forked from awthwathje/SteaScree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
143 lines (96 loc) · 4.98 KB
/
main.cpp
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#include "controller.h"
#include "interfaceadjuster.h"
#include <QApplication>
Q_DECLARE_METATYPE(Screenshot)
// TODO: design inconsitencies across platforms
// TODO: UI in separate thread
// TODO: multi-threading
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QCoreApplication::setOrganizationName("Foyl");
QCoreApplication::setOrganizationDomain("foyl.io");
QCoreApplication::setApplicationName("SteaScree");
QCoreApplication::setApplicationVersion(QString(APP_VERSION));
MainWindow w;
Controller c;
InterfaceAdjuster i;
QObject::connect(&w, &MainWindow::sendButtonList,
&c, &Controller::getButtonList);
QObject::connect(&c, &Controller::adjustButtons,
&i, &InterfaceAdjuster::setButtonsPadding);
QObject::connect(&c, &Controller::addWidgetItemToScreenshotList,
&w, &MainWindow::addWidgetItemToScreenshotList);
QObject::connect(&c, &Controller::resizeScreenshotListColumns,
&w, &MainWindow::resizeScreenshotListColumns);
QObject::connect(&w, &MainWindow::getSteamDir,
&c, &Controller::returnSteamDir);
QObject::connect(&c, &Controller::sendSteamDir,
&w, &MainWindow::locateSteamDir);
QObject::connect(&w, &MainWindow::sendUserDataPaths,
&c, &Controller::setUserDataPaths);
QObject::connect(&w, &MainWindow::pushButton_addScreenshots_clicked,
&c, &Controller::returnLastSelectedScreenshotDir);
QObject::connect(&c, &Controller::sendLastSelectedScreenshotDir,
&w, &MainWindow::returnScreenshotsSelected);
QObject::connect(&w, &MainWindow::sendScreenshotsSelected,
&c, &Controller::addScreenshotsToPool);
QObject::connect(&w, &MainWindow::pushButton_prepare_clicked,
&c, &Controller::returnLinesState);
QObject::connect(&c, &Controller::sendLinesState,
&w, &MainWindow::prepareScreenshots);
QObject::connect(&c, &Controller::sendWidgetsDisabled,
&w, &MainWindow::setWidgetsDisabled);
QObject::connect(&c, &Controller::sendLabelsVisible,
&w, &MainWindow::setLabelsVisible);
QObject::connect(&c, &Controller::sendStatusLabelText,
&w, &MainWindow::setStatusLabelText);
QObject::connect(&c, &Controller::sendDirStatusLabelsVisible,
&w, &MainWindow::setDirStatusLabelsVisible);
QObject::connect(&w, &MainWindow::clearScreenshotPathsPool,
&c, &Controller::clearScreenshotPathsPool);
QObject::connect(&w, &MainWindow::clearState,
&c, &Controller::clearState);
QObject::connect(&w, &MainWindow::clearCopyingStatusLabels,
&c, &Controller::clearCopyingStatusLabels);
QObject::connect(&w, &MainWindow::getScreenshotPathsPoolLength,
&c, &Controller::returnScreenshotPathPoolLength);
QObject::connect(&c, &Controller::sendProgressBarLength,
&w, &MainWindow::setProgressBarLength);
QObject::connect(&w, &MainWindow::writeVDF,
&c, &Controller::writeVDF);
QObject::connect(&w, &MainWindow::sendSelectedIDs,
&c, &Controller::prepareScreenshots);
QObject::connect(&c, &Controller::moveWindow,
&w, &MainWindow::moveWindow);
QObject::connect(&w, &MainWindow::sendSettings,
&c, &Controller::writeSettings);
QObject::connect(&c, &Controller::sendComboBoxesCleared,
&w, &MainWindow::setComboBoxesCleared);
QObject::connect(&c, &Controller::sendLabelsCleared,
&w, &MainWindow::setLabelsCleared);
QObject::connect(&c, &Controller::sendToComboBox,
&w, &MainWindow::insertIntoComboBox);
QObject::connect(&c, &Controller::sendIndexOfComboBox,
&w, &MainWindow::setIndexOfComboBox);
QObject::connect(&c, &Controller::sendLabelsOnMissingStuff,
&w, &MainWindow::setLabelsOnMissingStuff);
QObject::connect(&c, &Controller::sendLabelsText,
&w, &MainWindow::setLabelsText);
QObject::connect(&c, &Controller::sendProgressBarValue,
&w, &MainWindow::setProgressBarValue);
QObject::connect(&c, &Controller::deleteCopiedWidgetItem,
&w, &MainWindow::deleteCopiedWidgetItem);
QObject::connect(&c, &Controller::sendUpdateInfo,
&w, &MainWindow::offerUpdate);
QObject::connect(&w, &MainWindow::sendNeverOfferUpdate,
&c, &Controller::writeSettingNeverOfferUpdate);
QObject::connect(&w, &MainWindow::sendNewlySelectedUserID,
&c, &Controller::fillGameIDs);
QObject::connect(&w, &MainWindow::sendTreeWidgetPointer,
&c, &Controller::receiveTreeWidgetPointer);
w.bootStrap();
c.bootStrap();
w.show();
return a.exec();
}