summaryrefslogtreecommitdiff
path: root/src/statistics/StatisticsView.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/statistics/StatisticsView.h')
-rw-r--r--src/statistics/StatisticsView.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/statistics/StatisticsView.h b/src/statistics/StatisticsView.h
new file mode 100644
index 0000000..560f8b8
--- /dev/null
+++ b/src/statistics/StatisticsView.h
@@ -0,0 +1,53 @@
+#ifndef STATISTICS_VIEW_H
+#define STATISTICS_VIEW_H
+
+#include <QtCore>
+#include <QtWidgets>
+
+#include "StatisticsParams.h"
+
+class Dictionary;
+class CardPack;
+
+class StatisticsView: public QDialog, public StatisticsParams
+{
+ Q_OBJECT
+public:
+ StatisticsView(const Dictionary* dict);
+
+private:
+ static QList<QPair<QString, int>> getPeriodsList();
+
+private:
+ void init();
+ void closeEvent(QCloseEvent *event);
+ void createPages();
+ void createContentsList();
+ void createListItems();
+ void createUi();
+ void loadSettings();
+ void saveSettings();
+ QBoxLayout* createControlLayout();
+ QComboBox* createPacksBox();
+ QComboBox* createPeriodBox();
+ void updateChart();
+ void updatePeriodBox();
+
+private slots:
+ void changePage(QListWidgetItem* curPage, QListWidgetItem* prevPage);
+ void setPack(int packIndex);
+ void setPeriod(int index);
+
+private:
+ static const QSize GridSize;
+ static const int IconSize = 75;
+
+private:
+ const Dictionary* dict;
+ QListWidget* contentsWidget;
+ QLabel* periodLabel;
+ QComboBox* periodBox;
+ QStackedWidget* pagesWidget;
+};
+
+#endif