main.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <thread>
  5. #include <QDesktopWidget>
  6. #include <QtGui>
  7. #include <QFileDialog>
  8. #include <QMessageBox>
  9. #include "qhexedit.h"
  10. #include "citra_qt/bootmanager.h"
  11. #include "citra_qt/config.h"
  12. #include "citra_qt/game_list.h"
  13. #include "citra_qt/hotkeys.h"
  14. #include "citra_qt/main.h"
  15. // Debugger
  16. #include "citra_qt/debugger/callstack.h"
  17. #include "citra_qt/debugger/disassembler.h"
  18. #include "citra_qt/debugger/graphics.h"
  19. #include "citra_qt/debugger/graphics_breakpoints.h"
  20. #include "citra_qt/debugger/graphics_cmdlists.h"
  21. #include "citra_qt/debugger/graphics_framebuffer.h"
  22. #include "citra_qt/debugger/graphics_tracing.h"
  23. #include "citra_qt/debugger/graphics_vertex_shader.h"
  24. #include "citra_qt/debugger/profiler.h"
  25. #include "citra_qt/debugger/ramview.h"
  26. #include "citra_qt/debugger/registers.h"
  27. #include "common/make_unique.h"
  28. #include "common/microprofile.h"
  29. #include "common/platform.h"
  30. #include "common/scm_rev.h"
  31. #include "common/scope_exit.h"
  32. #include "common/string_util.h"
  33. #include "common/logging/backend.h"
  34. #include "common/logging/filter.h"
  35. #include "common/logging/log.h"
  36. #include "common/logging/text_formatter.h"
  37. #include "core/core.h"
  38. #include "core/settings.h"
  39. #include "core/system.h"
  40. #include "core/arm/disassembler/load_symbol_map.h"
  41. #include "core/loader/loader.h"
  42. #include "video_core/video_core.h"
  43. GMainWindow::GMainWindow() : emu_thread(nullptr)
  44. {
  45. Pica::g_debug_context = Pica::DebugContext::Construct();
  46. Config config;
  47. ui.setupUi(this);
  48. statusBar()->hide();
  49. render_window = new GRenderWindow(this, emu_thread.get());
  50. render_window->hide();
  51. game_list = new GameList();
  52. ui.horizontalLayout->addWidget(game_list);
  53. profilerWidget = new ProfilerWidget(this);
  54. addDockWidget(Qt::BottomDockWidgetArea, profilerWidget);
  55. profilerWidget->hide();
  56. microProfileDialog = new MicroProfileDialog(this);
  57. microProfileDialog->hide();
  58. disasmWidget = new DisassemblerWidget(this, emu_thread.get());
  59. addDockWidget(Qt::BottomDockWidgetArea, disasmWidget);
  60. disasmWidget->hide();
  61. registersWidget = new RegistersWidget(this);
  62. addDockWidget(Qt::RightDockWidgetArea, registersWidget);
  63. registersWidget->hide();
  64. callstackWidget = new CallstackWidget(this);
  65. addDockWidget(Qt::RightDockWidgetArea, callstackWidget);
  66. callstackWidget->hide();
  67. graphicsWidget = new GPUCommandStreamWidget(this);
  68. addDockWidget(Qt::RightDockWidgetArea, graphicsWidget);
  69. graphicsWidget ->hide();
  70. graphicsCommandsWidget = new GPUCommandListWidget(this);
  71. addDockWidget(Qt::RightDockWidgetArea, graphicsCommandsWidget);
  72. graphicsCommandsWidget->hide();
  73. auto graphicsBreakpointsWidget = new GraphicsBreakPointsWidget(Pica::g_debug_context, this);
  74. addDockWidget(Qt::RightDockWidgetArea, graphicsBreakpointsWidget);
  75. graphicsBreakpointsWidget->hide();
  76. auto graphicsFramebufferWidget = new GraphicsFramebufferWidget(Pica::g_debug_context, this);
  77. addDockWidget(Qt::RightDockWidgetArea, graphicsFramebufferWidget);
  78. graphicsFramebufferWidget->hide();
  79. auto graphicsVertexShaderWidget = new GraphicsVertexShaderWidget(Pica::g_debug_context, this);
  80. addDockWidget(Qt::RightDockWidgetArea, graphicsVertexShaderWidget);
  81. graphicsVertexShaderWidget->hide();
  82. auto graphicsTracingWidget = new GraphicsTracingWidget(Pica::g_debug_context, this);
  83. addDockWidget(Qt::RightDockWidgetArea, graphicsTracingWidget);
  84. graphicsTracingWidget->hide();
  85. QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging"));
  86. debug_menu->addAction(profilerWidget->toggleViewAction());
  87. debug_menu->addAction(microProfileDialog->toggleViewAction());
  88. debug_menu->addAction(disasmWidget->toggleViewAction());
  89. debug_menu->addAction(registersWidget->toggleViewAction());
  90. debug_menu->addAction(callstackWidget->toggleViewAction());
  91. debug_menu->addAction(graphicsWidget->toggleViewAction());
  92. debug_menu->addAction(graphicsCommandsWidget->toggleViewAction());
  93. debug_menu->addAction(graphicsBreakpointsWidget->toggleViewAction());
  94. debug_menu->addAction(graphicsFramebufferWidget->toggleViewAction());
  95. debug_menu->addAction(graphicsVertexShaderWidget->toggleViewAction());
  96. debug_menu->addAction(graphicsTracingWidget->toggleViewAction());
  97. // Set default UI state
  98. // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half
  99. QDesktopWidget* desktop = ((QApplication*)QApplication::instance())->desktop();
  100. QRect screenRect = desktop->screenGeometry(this);
  101. int x, y, w, h;
  102. w = screenRect.width() * 2 / 3;
  103. h = screenRect.height() / 2;
  104. x = (screenRect.x() + screenRect.width()) / 2 - w / 2;
  105. y = (screenRect.y() + screenRect.height()) / 2 - h * 55 / 100;
  106. setGeometry(x, y, w, h);
  107. // Restore UI state
  108. QSettings settings;
  109. settings.beginGroup("UILayout");
  110. restoreGeometry(settings.value("geometry").toByteArray());
  111. restoreState(settings.value("state").toByteArray());
  112. render_window->restoreGeometry(settings.value("geometryRenderWindow").toByteArray());
  113. microProfileDialog->restoreGeometry(settings.value("microProfileDialogGeometry").toByteArray());
  114. microProfileDialog->setVisible(settings.value("microProfileDialogVisible").toBool());
  115. settings.endGroup();
  116. ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer);
  117. SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked());
  118. ui.action_Use_Shader_JIT->setChecked(Settings::values.use_shader_jit);
  119. SetShaderJITEnabled(ui.action_Use_Shader_JIT->isChecked());
  120. ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool());
  121. ToggleWindowMode();
  122. ui.actionDisplay_widget_title_bars->setChecked(settings.value("displayTitleBars", true).toBool());
  123. OnDisplayTitleBars(ui.actionDisplay_widget_title_bars->isChecked());
  124. // Prepare actions for recent files
  125. for (int i = 0; i < max_recent_files_item; ++i) {
  126. actions_recent_files[i] = new QAction(this);
  127. actions_recent_files[i]->setVisible(false);
  128. connect(actions_recent_files[i], SIGNAL(triggered()), this, SLOT(OnMenuRecentFile()));
  129. ui.menu_recent_files->addAction(actions_recent_files[i]);
  130. }
  131. UpdateRecentFiles();
  132. // Setup connections
  133. connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
  134. connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
  135. connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));
  136. connect(ui.action_Select_Game_List_Root, SIGNAL(triggered()), this, SLOT(OnMenuSelectGameListRoot()));
  137. connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame()));
  138. connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame()));
  139. connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame()));
  140. connect(ui.action_Use_Hardware_Renderer, SIGNAL(triggered(bool)), this, SLOT(SetHardwareRendererEnabled(bool)));
  141. connect(ui.action_Use_Shader_JIT, SIGNAL(triggered(bool)), this, SLOT(SetShaderJITEnabled(bool)));
  142. connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode()));
  143. connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog()));
  144. connect(this, SIGNAL(EmulationStarting(EmuThread*)), disasmWidget, SLOT(OnEmulationStarting(EmuThread*)));
  145. connect(this, SIGNAL(EmulationStopping()), disasmWidget, SLOT(OnEmulationStopping()));
  146. connect(this, SIGNAL(EmulationStarting(EmuThread*)), registersWidget, SLOT(OnEmulationStarting(EmuThread*)));
  147. connect(this, SIGNAL(EmulationStopping()), registersWidget, SLOT(OnEmulationStopping()));
  148. connect(this, SIGNAL(EmulationStarting(EmuThread*)), render_window, SLOT(OnEmulationStarting(EmuThread*)));
  149. connect(this, SIGNAL(EmulationStopping()), render_window, SLOT(OnEmulationStopping()));
  150. connect(this, SIGNAL(EmulationStarting(EmuThread*)), graphicsTracingWidget, SLOT(OnEmulationStarting(EmuThread*)));
  151. connect(this, SIGNAL(EmulationStopping()), graphicsTracingWidget, SLOT(OnEmulationStopping()));
  152. // Setup hotkeys
  153. RegisterHotkey("Main Window", "Load File", QKeySequence::Open);
  154. RegisterHotkey("Main Window", "Start Emulation");
  155. LoadHotkeys(settings);
  156. connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, SLOT(OnMenuLoadFile()));
  157. connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, SLOT(OnStartGame()));
  158. std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
  159. setWindowTitle(window_title.c_str());
  160. show();
  161. game_list->PopulateAsync(settings.value("gameListRootDir").toString(), settings.value("gameListDeepScan").toBool());
  162. QStringList args = QApplication::arguments();
  163. if (args.length() >= 2) {
  164. BootGame(args[1].toStdString());
  165. }
  166. }
  167. GMainWindow::~GMainWindow()
  168. {
  169. // will get automatically deleted otherwise
  170. if (render_window->parent() == nullptr)
  171. delete render_window;
  172. Pica::g_debug_context.reset();
  173. }
  174. void GMainWindow::OnDisplayTitleBars(bool show)
  175. {
  176. QList<QDockWidget*> widgets = findChildren<QDockWidget*>();
  177. if (show) {
  178. for (QDockWidget* widget: widgets) {
  179. QWidget* old = widget->titleBarWidget();
  180. widget->setTitleBarWidget(nullptr);
  181. if (old != nullptr)
  182. delete old;
  183. }
  184. } else {
  185. for (QDockWidget* widget: widgets) {
  186. QWidget* old = widget->titleBarWidget();
  187. widget->setTitleBarWidget(new QWidget());
  188. if (old != nullptr)
  189. delete old;
  190. }
  191. }
  192. }
  193. void GMainWindow::BootGame(const std::string& filename) {
  194. LOG_INFO(Frontend, "Citra starting...\n");
  195. // Shutdown previous session if the emu thread is still active...
  196. if (emu_thread != nullptr)
  197. ShutdownGame();
  198. // Initialize the core emulation
  199. System::Init(render_window);
  200. // Load the game
  201. if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) {
  202. LOG_CRITICAL(Frontend, "Failed to load ROM!");
  203. System::Shutdown();
  204. return;
  205. }
  206. // Create and start the emulation thread
  207. emu_thread = Common::make_unique<EmuThread>(render_window);
  208. emit EmulationStarting(emu_thread.get());
  209. render_window->moveContext();
  210. emu_thread->start();
  211. connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
  212. // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
  213. connect(emu_thread.get(), SIGNAL(DebugModeEntered()), disasmWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
  214. connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
  215. connect(emu_thread.get(), SIGNAL(DebugModeEntered()), callstackWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
  216. connect(emu_thread.get(), SIGNAL(DebugModeLeft()), disasmWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection);
  217. connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection);
  218. connect(emu_thread.get(), SIGNAL(DebugModeLeft()), callstackWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection);
  219. // Update the GUI
  220. registersWidget->OnDebugModeEntered();
  221. callstackWidget->OnDebugModeEntered();
  222. if (ui.action_Single_Window_Mode->isChecked()) {
  223. game_list->hide();
  224. }
  225. render_window->show();
  226. emulation_running = true;
  227. OnStartGame();
  228. }
  229. void GMainWindow::ShutdownGame() {
  230. emu_thread->RequestStop();
  231. // Release emu threads from any breakpoints
  232. // This belongs after RequestStop() and before wait() because if emulation stops on a GPU
  233. // breakpoint after (or before) RequestStop() is called, the emulation would never be able
  234. // to continue out to the main loop and terminate. Thus wait() would hang forever.
  235. // TODO(bunnei): This function is not thread safe, but it's being used as if it were
  236. Pica::g_debug_context->ClearBreakpoints();
  237. emit EmulationStopping();
  238. // Wait for emulation thread to complete and delete it
  239. emu_thread->wait();
  240. emu_thread = nullptr;
  241. // The emulation is stopped, so closing the window or not does not matter anymore
  242. disconnect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
  243. // Update the GUI
  244. ui.action_Start->setEnabled(false);
  245. ui.action_Start->setText(tr("Start"));
  246. ui.action_Pause->setEnabled(false);
  247. ui.action_Stop->setEnabled(false);
  248. render_window->hide();
  249. game_list->show();
  250. emulation_running = false;
  251. }
  252. void GMainWindow::StoreRecentFile(const QString& filename)
  253. {
  254. QSettings settings;
  255. QStringList recent_files = settings.value("recentFiles").toStringList();
  256. recent_files.prepend(filename);
  257. recent_files.removeDuplicates();
  258. while (recent_files.size() > max_recent_files_item) {
  259. recent_files.removeLast();
  260. }
  261. settings.setValue("recentFiles", recent_files);
  262. UpdateRecentFiles();
  263. }
  264. void GMainWindow::UpdateRecentFiles() {
  265. QSettings settings;
  266. QStringList recent_files = settings.value("recentFiles").toStringList();
  267. unsigned int num_recent_files = std::min(recent_files.size(), static_cast<int>(max_recent_files_item));
  268. for (unsigned int i = 0; i < num_recent_files; i++) {
  269. QString text = QString("&%1. %2").arg(i + 1).arg(QFileInfo(recent_files[i]).fileName());
  270. actions_recent_files[i]->setText(text);
  271. actions_recent_files[i]->setData(recent_files[i]);
  272. actions_recent_files[i]->setToolTip(recent_files[i]);
  273. actions_recent_files[i]->setVisible(true);
  274. }
  275. for (int j = num_recent_files; j < max_recent_files_item; ++j) {
  276. actions_recent_files[j]->setVisible(false);
  277. }
  278. // Grey out the recent files menu if the list is empty
  279. if (num_recent_files == 0) {
  280. ui.menu_recent_files->setEnabled(false);
  281. } else {
  282. ui.menu_recent_files->setEnabled(true);
  283. }
  284. }
  285. void GMainWindow::OnGameListLoadFile(QString game_path) {
  286. BootGame(game_path.toLatin1().data());
  287. }
  288. void GMainWindow::OnMenuLoadFile() {
  289. QSettings settings;
  290. QString rom_path = settings.value("romsPath", QString()).toString();
  291. QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)"));
  292. if (!filename.isEmpty()) {
  293. settings.setValue("romsPath", QFileInfo(filename).path());
  294. StoreRecentFile(filename);
  295. BootGame(filename.toLatin1().data());
  296. }
  297. }
  298. void GMainWindow::OnMenuLoadSymbolMap() {
  299. QSettings settings;
  300. QString symbol_path = settings.value("symbolsPath", QString()).toString();
  301. QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), symbol_path, tr("Symbol map (*)"));
  302. if (!filename.isEmpty()) {
  303. settings.setValue("symbolsPath", QFileInfo(filename).path());
  304. LoadSymbolMap(filename.toLatin1().data());
  305. }
  306. }
  307. void GMainWindow::OnMenuSelectGameListRoot() {
  308. QSettings settings;
  309. QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory"));
  310. if (!dir_path.isEmpty()) {
  311. settings.setValue("gameListRootDir", dir_path);
  312. game_list->PopulateAsync(dir_path, settings.value("gameListDeepScan").toBool());
  313. }
  314. }
  315. void GMainWindow::OnMenuRecentFile() {
  316. QAction* action = qobject_cast<QAction*>(sender());
  317. assert(action);
  318. QString filename = action->data().toString();
  319. QFileInfo file_info(filename);
  320. if (file_info.exists()) {
  321. BootGame(filename.toLatin1().data());
  322. StoreRecentFile(filename); // Put the filename on top of the list
  323. } else {
  324. // Display an error message and remove the file from the list.
  325. QMessageBox::information(this, tr("File not found"), tr("File \"%1\" not found").arg(filename));
  326. QSettings settings;
  327. QStringList recent_files = settings.value("recentFiles").toStringList();
  328. recent_files.removeOne(filename);
  329. settings.setValue("recentFiles", recent_files);
  330. UpdateRecentFiles();
  331. }
  332. }
  333. void GMainWindow::OnStartGame() {
  334. emu_thread->SetRunning(true);
  335. ui.action_Start->setEnabled(false);
  336. ui.action_Start->setText(tr("Continue"));
  337. ui.action_Pause->setEnabled(true);
  338. ui.action_Stop->setEnabled(true);
  339. }
  340. void GMainWindow::OnPauseGame() {
  341. emu_thread->SetRunning(false);
  342. ui.action_Start->setEnabled(true);
  343. ui.action_Pause->setEnabled(false);
  344. ui.action_Stop->setEnabled(true);
  345. }
  346. void GMainWindow::OnStopGame() {
  347. ShutdownGame();
  348. }
  349. void GMainWindow::OnOpenHotkeysDialog() {
  350. GHotkeysDialog dialog(this);
  351. dialog.exec();
  352. }
  353. void GMainWindow::SetHardwareRendererEnabled(bool enabled) {
  354. VideoCore::g_hw_renderer_enabled = enabled;
  355. }
  356. void GMainWindow::SetShaderJITEnabled(bool enabled) {
  357. VideoCore::g_shader_jit_enabled = enabled;
  358. }
  359. void GMainWindow::ToggleWindowMode() {
  360. if (ui.action_Single_Window_Mode->isChecked()) {
  361. // Render in the main window...
  362. render_window->BackupGeometry();
  363. ui.horizontalLayout->addWidget(render_window);
  364. render_window->setFocusPolicy(Qt::ClickFocus);
  365. if (emulation_running) {
  366. render_window->setVisible(true);
  367. render_window->setFocus();
  368. }
  369. } else {
  370. // Render in a separate window...
  371. ui.horizontalLayout->removeWidget(render_window);
  372. render_window->setParent(nullptr);
  373. render_window->setFocusPolicy(Qt::NoFocus);
  374. if (emulation_running) {
  375. render_window->setVisible(true);
  376. render_window->RestoreGeometry();
  377. game_list->show();
  378. }
  379. }
  380. }
  381. void GMainWindow::OnConfigure() {
  382. //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this);
  383. }
  384. void GMainWindow::closeEvent(QCloseEvent* event) {
  385. // Save window layout
  386. QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra");
  387. settings.beginGroup("UILayout");
  388. settings.setValue("geometry", saveGeometry());
  389. settings.setValue("state", saveState());
  390. settings.setValue("geometryRenderWindow", render_window->saveGeometry());
  391. settings.setValue("microProfileDialogGeometry", microProfileDialog->saveGeometry());
  392. settings.setValue("microProfileDialogVisible", microProfileDialog->isVisible());
  393. settings.endGroup();
  394. settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
  395. settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked());
  396. settings.setValue("firstStart", false);
  397. SaveHotkeys(settings);
  398. // Shutdown session if the emu thread is active...
  399. if (emu_thread != nullptr)
  400. ShutdownGame();
  401. render_window->close();
  402. QWidget::closeEvent(event);
  403. }
  404. #ifdef main
  405. #undef main
  406. #endif
  407. int main(int argc, char* argv[]) {
  408. Log::Filter log_filter(Log::Level::Info);
  409. Log::SetFilter(&log_filter);
  410. MicroProfileOnThreadCreate("Frontend");
  411. SCOPE_EXIT({
  412. MicroProfileShutdown();
  413. });
  414. // Init settings params
  415. QSettings::setDefaultFormat(QSettings::IniFormat);
  416. QCoreApplication::setOrganizationName("Citra team");
  417. QCoreApplication::setApplicationName("Citra");
  418. QApplication::setAttribute(Qt::AA_X11InitThreads);
  419. QApplication app(argc, argv);
  420. GMainWindow main_window;
  421. // After settings have been loaded by GMainWindow, apply the filter
  422. log_filter.ParseFilterString(Settings::values.log_filter);
  423. main_window.show();
  424. return app.exec();
  425. }