annotate src/gui/window.cpp @ 9:5c0397762b53

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