mirror of
https://github.com/jorenchik/mdemory.git
synced 2026-03-22 00:26:21 +00:00
refactoring the source files
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <QSettings>
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
void update(bool isChanged = false);
|
||||
|
||||
void saveMdem();
|
||||
|
||||
struct MdemBuffer {
|
||||
std::vector<Question*> questions = std::vector<Question*>();
|
||||
time_t trainedAt = 0;
|
||||
bool error = false;
|
||||
bool isModified = false;
|
||||
};
|
||||
|
||||
void updateMdemInfo(std::string filename = "", bool isChanged = true);
|
||||
|
||||
extern QSettings *settings;
|
||||
|
||||
#define SETTING_TIMEZONE "timezone"
|
||||
#define SETTING_CHARACTER_WRAP "characterWrap"
|
||||
#define SETTING_NOT_REMEMBERED "notRemembered"
|
||||
#define SETTING_HARD "hard"
|
||||
#define SETTING_MEDIUM "medium"
|
||||
#define SETTING_EASY "easy"
|
||||
|
||||
58
src/include/mdemList.h
Normal file
58
src/include/mdemList.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qboxlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qwidget.h>
|
||||
#include <vector>
|
||||
#include <QSettings>
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
struct MdemBuffer {
|
||||
std::vector<Question*> questions = std::vector<Question*>();
|
||||
time_t trainedAt = 0;
|
||||
bool error = false;
|
||||
bool isModified = false;
|
||||
};
|
||||
|
||||
struct Mdem {
|
||||
QWidget wMdem;
|
||||
QVBoxLayout vMdem;
|
||||
QLabel wFrontText;
|
||||
QWidget wFront;
|
||||
QHBoxLayout hFront;
|
||||
QWidget wBack;
|
||||
QVBoxLayout hBack;
|
||||
QToolButton editButton;
|
||||
QToolButton deleteButton;
|
||||
QToolButton showButton;
|
||||
int labelCount;
|
||||
QVector<QLabel*> backLabels;
|
||||
Question *question;
|
||||
};
|
||||
|
||||
struct ErrorView {
|
||||
QWidget box;
|
||||
QVBoxLayout layout;
|
||||
QLabel label;
|
||||
};
|
||||
|
||||
struct Page {
|
||||
size_t start;
|
||||
size_t end;
|
||||
};
|
||||
|
||||
void update(bool isChanged = false);
|
||||
void saveMdem();
|
||||
void updateMdemInfo(std::string filename = "", bool isChanged = true);
|
||||
QMainWindow *initMdemListWindow();
|
||||
|
||||
#define SETTING_TIMEZONE "timezone"
|
||||
#define SETTING_CHARACTER_WRAP "characterWrap"
|
||||
#define SETTING_NOT_REMEMBERED "notRemembered"
|
||||
#define SETTING_HARD "hard"
|
||||
#define SETTING_MEDIUM "medium"
|
||||
#define SETTING_EASY "easy"
|
||||
7
src/include/settings.h
Normal file
7
src/include/settings.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <qsettings.h>
|
||||
#include <qwidget.h>
|
||||
|
||||
extern QSettings *settings;
|
||||
QWidget *initSettings();
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "main.h"
|
||||
#include "parser.h"
|
||||
#include "mdemList.h"
|
||||
|
||||
extern QMainWindow *trainWindow;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user