-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmaincontroller.h
87 lines (76 loc) · 2.44 KB
/
maincontroller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/** \file maincontroller.h
* \brief Contains the main controller class.
*/
#ifndef MAINCONTROLLER_H
#define MAINCONTROLLER_H
#include <QObject>
#include <QJsonDocument>
#include "maindialog.h"
#include "aboutdialog.h"
#include "resultswindow.h"
#include "settingsdialog.h"
#include "standingscontroller.h"
namespace DJ {
namespace Controller {
/** Controls all the other controllers, the views and the model.
*/
class MainController : public QObject {
Q_OBJECT
public:
/** Constructs a new main controller.
* \param parent The parent of this object.
*/
explicit MainController(QObject *parent = 0);
/** Destructs the main controller.
*/
~MainController();
/** Shows the main windows.
*/
void showMainWindow();
signals:
private:
View::MainDialog *mainDialog;
View::AboutDialog *aboutDialog;
View::ResultsWindow *resultsWindow;
View::SettingsDialog *settingsDialog;
StandingsController *standingsController;
Model::Contest *contest;
QHash<QString, Model::Contest *> contests;
QHash<QString, Model::Group *> groups;
QHash<QString, Model::Team *> teams;
QHash<QString, Model::Problem *> problems;
QHash<QString, Model::Submission *> submissions;
QList<Model::Judging *> judgings;
private slots:
void connectToServer();
void processUser(QJsonDocument userData);
void processContestsData(QJsonDocument contestsData);
void processGroupData(QJsonDocument groupData);
void processTeamData(QJsonDocument teamData);
void processProblemData(QJsonDocument problemData);
void processSubmissionData(QJsonDocument submissionData);
void processJudgingData(QJsonDocument judgingData);
void processUserLoadError(QString error);
void processContestsLoadError(QString error);
void processGroupsLoadError(QString error);
void processTeamsLoadError(QString error);
void processProblemsLoadError(QString error);
void processEventLoadError(QString error);
// void updateURL(QString url);
// void updateUsername(QString username);
// void updatePassword(QString password);
// void updateDir(QDir dir);
// void switchToDir();
// void switchToURL();
// void loadData();
// void enableSave();
// void enableActions();
// void saveXML(QString dir);
// void showStats();
void showResults();
void updateStanding();
void loadContest();
};
} // namespace Controller
} // namespace DJ
#endif // MAINCONTROLLER_H