annotate src/main.cpp @ 7:07a9095eaeed

Update Refactored some code, moved some around
author Paper <mrpapersonic@gmail.com>
date Thu, 24 Aug 2023 23:11:38 -0400
parents 1d82f6e04d7d
children b1f73678ef61
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
1 #include <QApplication>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
2 #include <QMainWindow>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
3 #include <QMenuBar>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
4 #include <QPlainTextEdit>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
5 #include <QStackedWidget>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
6 #include <QFile>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
7 #include <QTextStream>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
8 #include <QMessageBox>
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
9 #include "window.h"
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
10 #include "config.h"
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
11 #include "anime_list.h"
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
12 #include "now_playing.h"
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
13 #include "statistics.h"
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
14 #include "sidebar.h"
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
15 #include "ui_utils.h"
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
16 #include "settings.h"
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
17 #include "session.h"
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
18 #if MACOSX
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
19 #include "sys/osx/dark_theme.h"
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
20 #elif WIN32
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
21 #include "sys/win32/dark_theme.h"
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
22 #endif
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
23
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
24 Session session;
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
25
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
26 /* note that this code was originally created for use in
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
27 wxWidgets, but I thought the API was a little meh, so
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
28 I switched to Qt. */
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
29
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
30 MainWindow::MainWindow(QWidget* parent) :
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
31 QMainWindow(parent) {
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
32 main_widget = new QWidget(parent);
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
33 /* Menu Bar */
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
34 QAction* action;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
35 QMenuBar* menubar = new QMenuBar(parent);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
36 QMenu* menu = menubar->addMenu("&File");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
37 QMenu* submenu = menu->addMenu("&Library folders");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
38 action = new QAction("&Add new folder...");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
39 submenu->addAction(action);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
40 action = new QAction("&Scan available episodes");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
41 menu->addAction(action);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
42
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
43 menu->addSeparator();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
44
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
45 action = menu->addAction("Play &next episode");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
46 action = menu->addAction("Play &random episode");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
47 menu->addSeparator();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
48 action = menu->addAction("E&xit", qApp, &QApplication::quit);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
49
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
50 menu = menubar->addMenu("&Services");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
51 action = new QAction("Synchronize &list");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
52
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
53 menu->addSeparator();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
54
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
55 submenu = menu->addMenu("&AniList");
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
56 action = submenu->addAction("Go to my &profile");
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
57 action = submenu->addAction("Go to my &stats");
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
58
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
59 submenu = menu->addMenu("&Kitsu");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
60 action = submenu->addAction("Go to my &feed");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
61 action = submenu->addAction("Go to my &library");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
62 action = submenu->addAction("Go to my &profile");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
63
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
64 submenu = menu->addMenu("&MyAnimeList");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
65 action = submenu->addAction("Go to my p&anel");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
66 action = submenu->addAction("Go to my &profile");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
67 action = submenu->addAction("Go to my &history");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
68
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
69 menu = menubar->addMenu("&Tools");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
70 submenu = menu->addMenu("&Export anime list");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
71 action = submenu->addAction("Export as &Markdown...");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
72 action = submenu->addAction("Export as MyAnimeList &XML...");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
73
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
74 menu->addSeparator();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
75
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
76 action = menu->addAction("Enable anime &recognition");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
77 action->setCheckable(true);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
78 action = menu->addAction("Enable auto &sharing");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
79 action->setCheckable(true);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
80 action = menu->addAction("Enable &auto synchronization");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
81 action->setCheckable(true);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
82
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
83 menu->addSeparator();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
84
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
85 action = menu->addAction("&Settings", [this]{
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
86 SettingsDialog dialog(this);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
87 dialog.exec();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
88 });
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
89
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
90 setMenuBar(menubar);
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
91
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
92 SideBar* sidebar = new SideBar(main_widget);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
93 sidebar->AddItem("Now Playing", UiUtils::CreateSideBarIcon(":/icons/16x16/film.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
94 sidebar->AddSeparator();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
95 sidebar->AddItem("Anime List", UiUtils::CreateSideBarIcon(":/icons/16x16/document-list.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
96 sidebar->AddItem("History", UiUtils::CreateSideBarIcon(":/icons/16x16/clock-history-frame.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
97 sidebar->AddItem("Statistics", UiUtils::CreateSideBarIcon(":/icons/16x16/chart.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
98 sidebar->AddSeparator();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
99 sidebar->AddItem("Search", UiUtils::CreateSideBarIcon(":/icons/16x16/magnifier.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
100 sidebar->AddItem("Seasons", UiUtils::CreateSideBarIcon(":/icons/16x16/calendar.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
101 sidebar->AddItem("Torrents", UiUtils::CreateSideBarIcon(":/icons/16x16/feed.png"));
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
102 sidebar->setFixedWidth(128);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
103 sidebar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
104
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
105 QStackedWidget* stack = new QStackedWidget(main_widget);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
106 stack->addWidget(new NowPlayingWidget(parent));
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
107 AnimeListWidget* list_widget = new AnimeListWidget(parent);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
108 list_widget->SyncAnimeList();
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
109 stack->addWidget(list_widget);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
110 stack->addWidget(new StatisticsWidget(list_widget, parent));
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
111
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
112 connect(sidebar, &SideBar::CurrentItemChanged, stack, [stack](int index){
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
113 switch (index) {
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
114 case 0:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
115 case 1:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
116 case 2:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
117 stack->setCurrentIndex(index);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
118 break;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
119 default:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
120 break;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
121 }
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
122 });
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
123 sidebar->setCurrentRow(2);
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
124
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
125 QHBoxLayout* layout = new QHBoxLayout(main_widget);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
126 layout->addWidget(sidebar, 0, Qt::AlignLeft | Qt::AlignTop);
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
127 layout->addWidget(stack);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
128 setCentralWidget(main_widget);
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
129
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
130 ThemeChanged();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
131 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
132
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
133 void MainWindow::SetStyleSheet(enum Themes theme) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
134 switch (theme) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
135 case DARK: {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
136 QFile f(":qdarkstyle/dark/darkstyle.qss");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
137 if (!f.exists())
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
138 return; // fail
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
139 f.open(QFile::ReadOnly | QFile::Text);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
140 QTextStream ts(&f);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
141 setStyleSheet(ts.readAll());
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
142 break;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
143 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
144 default:
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
145 setStyleSheet("");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
146 break;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
147 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
148 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
149
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
150 void MainWindow::ThemeChanged() {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
151 switch (session.config.theme) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
152 case LIGHT: {
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
153 #if MACOSX
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
154 if (osx::DarkThemeAvailable())
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
155 osx::SetToLightTheme();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
156 else
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
157 SetStyleSheet(LIGHT);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
158 #else
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
159 SetStyleSheet(LIGHT);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
160 #endif
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
161 break;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
162 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
163 case DARK: {
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
164 #if MACOSX
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
165 if (osx::DarkThemeAvailable())
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
166 osx::SetToDarkTheme();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
167 else
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
168 SetStyleSheet(DARK);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
169 #else
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
170 SetStyleSheet(DARK);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
171 #endif
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
172 break;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
173 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
174 case OS: {
5
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
175 #if MACOSX
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
176 if (osx::DarkThemeAvailable())
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
177 osx::SetToAutoTheme();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
178 else
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
179 SetStyleSheet(LIGHT);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
180 #elif defined(WIN32)
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
181 if (win32::DarkThemeAvailable()) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
182 if (win32::IsInDarkTheme()) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
183 SetStyleSheet(DARK);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
184 } else {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
185 SetStyleSheet(LIGHT);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
186 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
187 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
188 #else
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
189 /* Currently OS detection only supports Windows and macOS.
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
190 Please don't be shy if you're willing to port it to other OSes
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents: 5
diff changeset
191 (or desktop environments, or window managers) */
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
192 SetStyleSheet(LIGHT);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
193 #endif
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
194 break;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
195 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
196 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
197 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
198
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
199 void MainWindow::SetActivePage(QWidget* page) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
200 this->setCentralWidget(page);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
201 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
202
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
203 void MainWindow::closeEvent(QCloseEvent* event) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
204 session.config.Save();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
205 event->accept();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
206 }
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
207
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
208 int main(int argc, char** argv) {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
209 QApplication app(argc, argv);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
210
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
211 session.config.Load();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
212
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
213 MainWindow window;
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
214
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
215 window.resize(941, 750);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
216 window.setWindowTitle("Weeaboo");
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
217 window.show();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
218
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
219 return app.exec();
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
220 }