diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/study/SpacedRepetitionWindow.h |
Diffstat (limited to 'src/study/SpacedRepetitionWindow.h')
-rw-r--r-- | src/study/SpacedRepetitionWindow.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/src/study/SpacedRepetitionWindow.h b/src/study/SpacedRepetitionWindow.h new file mode 100644 index 0000000..942b7f2 --- /dev/null +++ b/src/study/SpacedRepetitionWindow.h @@ -0,0 +1,89 @@ +#ifndef SPACED_REPETITION_WINDOW_H +#define SPACED_REPETITION_WINDOW_H + +#include <QtCore> +#include <QtWidgets> + +#include "IStudyWindow.h" +#include "StudyRecord.h" +#include "StudySettings.h" +#include "SpacedRepetitionModel.h" +#include "CardSideView.h" + +class CardsStatusBar; +class NumberFrame; +class WarningPanel; + +class SpacedRepetitionWindow: public IStudyWindow +{ + Q_OBJECT + +public: + SpacedRepetitionWindow( SpacedRepetitionModel* aModel, QWidget* aParent ); + ~SpacedRepetitionWindow(); + +protected: + QVBoxLayout* createLowerPanel(); + void processState(); + void ReadSettings(); + void WriteSettings(); + QWidget* getAnswerEdit(); + QWidget* getUserAnswerLabel(); + +private: + static QString getProgressBarTooltip(); + +private: + QBoxLayout* createProgressLayout(); + QBoxLayout* createStatsLayout(); + QBoxLayout* createProgressBarLayout(); + void createGradeButtons(); + QPushButton* createGradeButton(int i, const QString& iconName, + const QString& label, const QString& toolTip); + void setEnabledGradeButtons(); + void layoutGradeButtons(); + void putGradeButtonsIntoLayouts(QBoxLayout* higherLt); + void replaceGradesLayout(QBoxLayout* higherLt); + void setGoodButtonText(); + void updateCardsProgress(); + void displayAnswer(); + void displayNoRemainedCards(); + void showLimitWarnings(); + bool dayLimitReached(int todayReviewed); + void createExactAnswerWidget(); + void showExactAnswer(const QStringList& correctAnswers); + void focusAnswerWidget(); + void processIsNewCard(); + +private slots: + void displayQuestion(); + +private: + static const int PosX = 200; + static const int PosY = 200; + static const int Width = 600; + static const int Height = 430; + static const int GradeButtonMinWidth = 100; + +private: + bool dayCardsLimitShown; + + WarningPanel* warningPanel; + QLabel* progressLabel; + NumberFrame* todayNewLabel; + NumberFrame* learningCardsLabel; + QLabel* timeToNextLearningLabel; + NumberFrame* scheduledCardsLabel; + NumberFrame* scheduledNewLabel; + QVBoxLayout* controlLt; + CardsStatusBar* coloredProgressBar; + QPushButton* gradeBtns[StudyRecord::GradesNum]; + QPushButton* goodBtn; + QSignalMapper* cardGradedSM; + bool usesExactAnswer; + CardSideView* exactAnswerLabel; + QLineEdit* exactAnswerEdit; + QTime m_answerTime; +}; + +#endif |