Mercurial > minori
comparison src/gui/window.cpp @ 69:27a19dd6cba1
*: fix up some stuff
settings: due to my own incompetence OnOK caused the entire program to crash,
now that's fixed :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 03 Oct 2023 03:38:25 -0400 |
parents | 2417121d894e |
children | 6f7385bd334c |
comparison
equal
deleted
inserted
replaced
68:2417121d894e | 69:27a19dd6cba1 |
---|---|
18 #include "track/media.h" | 18 #include "track/media.h" |
19 #include <QActionGroup> | 19 #include <QActionGroup> |
20 #include <QApplication> | 20 #include <QApplication> |
21 #include <QDebug> | 21 #include <QDebug> |
22 #include <QFile> | 22 #include <QFile> |
23 #include <QHBoxLayout> | |
23 #include <QMainWindow> | 24 #include <QMainWindow> |
24 #include <QMenuBar> | 25 #include <QMenuBar> |
25 #include <QToolBar> | |
26 #include <QMessageBox> | 26 #include <QMessageBox> |
27 #include <QPlainTextEdit> | 27 #include <QPlainTextEdit> |
28 #include <QStackedWidget> | 28 #include <QStackedWidget> |
29 #include <QTextStream> | 29 #include <QTextStream> |
30 #include <QTimer> | 30 #include <QTimer> |
31 #include <QHBoxLayout> | 31 #include <QToolBar> |
32 #include <QToolButton> | |
32 #if MACOSX | 33 #if MACOSX |
33 # include "sys/osx/dark_theme.h" | 34 # include "sys/osx/dark_theme.h" |
34 #elif defined(WIN32) | 35 #elif defined(WIN32) |
35 # include "sys/win32/dark_theme.h" | 36 # include "sys/win32/dark_theme.h" |
36 #endif | 37 #endif |
201 toolbar->addAction(QIcon(":/icons/24x24/arrow-circle-double-135.png"), tr("&Synchronize"), [stack] { | 202 toolbar->addAction(QIcon(":/icons/24x24/arrow-circle-double-135.png"), tr("&Synchronize"), [stack] { |
202 Services::Synchronize(); | 203 Services::Synchronize(); |
203 reinterpret_cast<AnimeListPage*>(stack->widget(static_cast<int>(Pages::ANIME_LIST)))->Refresh(); | 204 reinterpret_cast<AnimeListPage*>(stack->widget(static_cast<int>(Pages::ANIME_LIST)))->Refresh(); |
204 }); | 205 }); |
205 toolbar->addSeparator(); | 206 toolbar->addSeparator(); |
206 toolbar->addAction(QIcon(":/icons/24x24/gear.png"), tr("S&ettings"), [this]{ | 207 |
208 QToolButton* button = new QToolButton(toolbar); | |
209 | |
210 menu = new QMenu(button); | |
211 action = menu->addAction(tr("Add new folder...")); | |
212 | |
213 button->setMenu(menu); | |
214 button->setIcon(QIcon(":/icons/24x24/folder-open.png")); | |
215 button->setPopupMode(QToolButton::InstantPopup); | |
216 toolbar->addWidget(button); | |
217 | |
218 button = new QToolButton(toolbar); | |
219 | |
220 menu = new QMenu(button); | |
221 action = menu->addAction(tr("Placeholder")); | |
222 | |
223 button->setMenu(menu); | |
224 button->setIcon(QIcon(":/icons/24x24/application-export.png")); | |
225 button->setPopupMode(QToolButton::InstantPopup); | |
226 toolbar->addWidget(button); | |
227 | |
228 toolbar->addSeparator(); | |
229 toolbar->addAction(QIcon(":/icons/24x24/gear.png"), tr("S&ettings"), [this] { | |
207 SettingsDialog dialog(this); | 230 SettingsDialog dialog(this); |
208 dialog.exec(); | 231 dialog.exec(); |
209 }); | 232 }); |
210 addToolBar(toolbar); | 233 addToolBar(toolbar); |
211 | 234 |
223 int id = Anime::db.GetAnimeFromTitle(title); | 246 int id = Anime::db.GetAnimeFromTitle(title); |
224 if (id == 0) { | 247 if (id == 0) { |
225 page->SetDefault(); | 248 page->SetDefault(); |
226 return; | 249 return; |
227 } | 250 } |
228 | 251 |
229 page->SetPlaying(id); | 252 page->SetPlaying(id); |
230 }); | 253 }); |
231 timer->start(5000); | 254 timer->start(5000); |
232 | 255 |
233 DarkTheme::SetTheme(session.config.theme); | 256 DarkTheme::SetTheme(session.config.theme); |