main.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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. game_list->LoadInterfaceLayout(settings);
  117. ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer);
  118. SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked());
  119. ui.action_Use_Shader_JIT->setChecked(Settings::values.use_shader_jit);
  120. SetShaderJITEnabled(ui.action_Use_Shader_JIT->isChecked());
  121. ui.action_Single_Window_Mode->setChecked(settings.value("singleWindowMode", true).toBool());
  122. ToggleWindowMode();
  123. ui.actionDisplay_widget_title_bars->setChecked(settings.value("displayTitleBars", true).toBool());
  124. OnDisplayTitleBars(ui.actionDisplay_widget_title_bars->isChecked());
  125. // Prepare actions for recent files
  126. for (int i = 0; i < max_recent_files_item; ++i) {
  127. actions_recent_files[i] = new QAction(this);
  128. actions_recent_files[i]->setVisible(false);
  129. connect(actions_recent_files[i], SIGNAL(triggered()), this, SLOT(OnMenuRecentFile()));
  130. ui.menu_recent_files->addAction(actions_recent_files[i]);
  131. }
  132. UpdateRecentFiles();
  133. // Setup connections
  134. connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
  135. connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
  136. connect(ui.action_Load_Symbol_Map, SIGNAL(triggered()), this, SLOT(OnMenuLoadSymbolMap()));
  137. connect(ui.action_Select_Game_List_Root, SIGNAL(triggered()), this, SLOT(OnMenuSelectGameListRoot()));
  138. connect(ui.action_Start, SIGNAL(triggered()), this, SLOT(OnStartGame()));
  139. connect(ui.action_Pause, SIGNAL(triggered()), this, SLOT(OnPauseGame()));
  140. connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame()));
  141. connect(ui.action_Use_Hardware_Renderer, SIGNAL(triggered(bool)), this, SLOT(SetHardwareRendererEnabled(bool)));
  142. connect(ui.action_Use_Shader_JIT, SIGNAL(triggered(bool)), this, SLOT(SetShaderJITEnabled(bool)));
  143. connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode()));
  144. connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog()));
  145. connect(this, SIGNAL(EmulationStarting(EmuThread*)), disasmWidget, SLOT(OnEmulationStarting(EmuThread*)));
  146. connect(this, SIGNAL(EmulationStopping()), disasmWidget, SLOT(OnEmulationStopping()));
  147. connect(this, SIGNAL(EmulationStarting(EmuThread*)), registersWidget, SLOT(OnEmulationStarting(EmuThread*)));
  148. connect(this, SIGNAL(EmulationStopping()), registersWidget, SLOT(OnEmulationStopping()));
  149. connect(this, SIGNAL(EmulationStarting(EmuThread*)), render_window, SLOT(OnEmulationStarting(EmuThread*)));
  150. connect(this, SIGNAL(EmulationStopping()), render_window, SLOT(OnEmulationStopping()));
  151. connect(this, SIGNAL(EmulationStarting(EmuThread*)), graphicsTracingWidget, SLOT(OnEmulationStarting(EmuThread*)));
  152. connect(this, SIGNAL(EmulationStopping()), graphicsTracingWidget, SLOT(OnEmulationStopping()));
  153. // Setup hotkeys
  154. RegisterHotkey("Main Window", "Load File", QKeySequence::Open);
  155. RegisterHotkey("Main Window", "Start Emulation");
  156. LoadHotkeys(settings);
  157. connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, SLOT(OnMenuLoadFile()));
  158. connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, SLOT(OnStartGame()));
  159. std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
  160. setWindowTitle(window_title.c_str());
  161. show();
  162. game_list->PopulateAsync(settings.value("gameListRootDir").toString(), settings.value("gameListDeepScan").toBool());
  163. QStringList args = QApplication::arguments();
  164. if (args.length() >= 2) {
  165. BootGame(args[1].toStdString());
  166. }
  167. }
  168. GMainWindow::~GMainWindow()
  169. {
  170. // will get automatically deleted otherwise
  171. if (render_window->parent() == nullptr)
  172. delete render_window;
  173. Pica::g_debug_context.reset();
  174. }
  175. void GMainWindow::OnDisplayTitleBars(bool show)
  176. {
  177. QList<QDockWidget*> widgets = findChildren<QDockWidget*>();
  178. if (show) {
  179. for (QDockWidget* widget: widgets) {
  180. QWidget* old = widget->titleBarWidget();
  181. widget->setTitleBarWidget(nullptr);
  182. if (old != nullptr)
  183. delete old;
  184. }
  185. } else {
  186. for (QDockWidget* widget: widgets) {
  187. QWidget* old = widget->titleBarWidget();
  188. widget->setTitleBarWidget(new QWidget());
  189. if (old != nullptr)
  190. delete old;
  191. }
  192. }
  193. }
  194. void GMainWindow::BootGame(const std::string& filename) {
  195. LOG_INFO(Frontend, "Citra starting...\n");
  196. // Shutdown previous session if the emu thread is still active...
  197. if (emu_thread != nullptr)
  198. ShutdownGame();
  199. // Initialize the core emulation
  200. System::Init(render_window);
  201. // Load the game
  202. if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) {
  203. LOG_CRITICAL(Frontend, "Failed to load ROM!");
  204. System::Shutdown();
  205. return;
  206. }
  207. // Create and start the emulation thread
  208. emu_thread = Common::make_unique<EmuThread>(render_window);
  209. emit EmulationStarting(emu_thread.get());
  210. render_window->moveContext();
  211. emu_thread->start();
  212. connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
  213. // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
  214. connect(emu_thread.get(), SIGNAL(DebugModeEntered()), disasmWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
  215. connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
  216. connect(emu_thread.get(), SIGNAL(DebugModeEntered()), callstackWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
  217. connect(emu_thread.get(), SIGNAL(DebugModeLeft()), disasmWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection);
  218. connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection);
  219. connect(emu_thread.get(), SIGNAL(DebugModeLeft()), callstackWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection);
  220. // Update the GUI
  221. registersWidget->OnDebugModeEntered();
  222. callstackWidget->OnDebugModeEntered();
  223. if (ui.action_Single_Window_Mode->isChecked()) {
  224. game_list->hide();
  225. }
  226. render_window->show();
  227. emulation_running = true;
  228. OnStartGame();
  229. }
  230. void GMainWindow::ShutdownGame() {
  231. emu_thread->RequestStop();
  232. // Release emu threads from any breakpoints
  233. // This belongs after RequestStop() and before wait() because if emulation stops on a GPU
  234. // breakpoint after (or before) RequestStop() is called, the emulation would never be able
  235. // to continue out to the main loop and terminate. Thus wait() would hang forever.
  236. // TODO(bunnei): This function is not thread safe, but it's being used as if it were
  237. Pica::g_debug_context->ClearBreakpoints();
  238. emit EmulationStopping();
  239. // Wait for emulation thread to complete and delete it
  240. emu_thread->wait();
  241. emu_thread = nullptr;
  242. // The emulation is stopped, so closing the window or not does not matter anymore
  243. disconnect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
  244. // Update the GUI
  245. ui.action_Start->setEnabled(false);
  246. ui.action_Start->setText(tr("Start"));
  247. ui.action_Pause->setEnabled(false);
  248. ui.action_Stop->setEnabled(false);
  249. render_window->hide();
  250. game_list->show();
  251. emulation_running = false;
  252. }
  253. void GMainWindow::StoreRecentFile(const QString& filename)
  254. {
  255. QSettings settings;
  256. QStringList recent_files = settings.value("recentFiles").toStringList();
  257. recent_files.prepend(filename);
  258. recent_files.removeDuplicates();
  259. while (recent_files.size() > max_recent_files_item) {
  260. recent_files.removeLast();
  261. }
  262. settings.setValue("recentFiles", recent_files);
  263. UpdateRecentFiles();
  264. }
  265. void GMainWindow::UpdateRecentFiles() {
  266. QSettings settings;
  267. QStringList recent_files = settings.value("recentFiles").toStringList();
  268. unsigned int num_recent_files = std::min(recent_files.size(), static_cast<int>(max_recent_files_item));
  269. for (unsigned int i = 0; i < num_recent_files; i++) {
  270. QString text = QString("&%1. %2").arg(i + 1).arg(QFileInfo(recent_files[i]).fileName());
  271. actions_recent_files[i]->setText(text);
  272. actions_recent_files[i]->setData(recent_files[i]);
  273. actions_recent_files[i]->setToolTip(recent_files[i]);
  274. actions_recent_files[i]->setVisible(true);
  275. }
  276. for (int j = num_recent_files; j < max_recent_files_item; ++j) {
  277. actions_recent_files[j]->setVisible(false);
  278. }
  279. // Grey out the recent files menu if the list is empty
  280. if (num_recent_files == 0) {
  281. ui.menu_recent_files->setEnabled(false);
  282. } else {
  283. ui.menu_recent_files->setEnabled(true);
  284. }
  285. }
  286. void GMainWindow::OnGameListLoadFile(QString game_path) {
  287. BootGame(game_path.toLatin1().data());
  288. }
  289. void GMainWindow::OnMenuLoadFile() {
  290. QSettings settings;
  291. QString rom_path = settings.value("romsPath", QString()).toString();
  292. QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), rom_path, tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)"));
  293. if (!filename.isEmpty()) {
  294. settings.setValue("romsPath", QFileInfo(filename).path());
  295. StoreRecentFile(filename);
  296. BootGame(filename.toLatin1().data());
  297. }
  298. }
  299. void GMainWindow::OnMenuLoadSymbolMap() {
  300. QSettings settings;
  301. QString symbol_path = settings.value("symbolsPath", QString()).toString();
  302. QString filename = QFileDialog::getOpenFileName(this, tr("Load Symbol Map"), symbol_path, tr("Symbol map (*)"));
  303. if (!filename.isEmpty()) {
  304. settings.setValue("symbolsPath", QFileInfo(filename).path());
  305. LoadSymbolMap(filename.toLatin1().data());
  306. }
  307. }
  308. void GMainWindow::OnMenuSelectGameListRoot() {
  309. QSettings settings;
  310. QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory"));
  311. if (!dir_path.isEmpty()) {
  312. settings.setValue("gameListRootDir", dir_path);
  313. game_list->PopulateAsync(dir_path, settings.value("gameListDeepScan").toBool());
  314. }
  315. }
  316. void GMainWindow::OnMenuRecentFile() {
  317. QAction* action = qobject_cast<QAction*>(sender());
  318. assert(action);
  319. QString filename = action->data().toString();
  320. QFileInfo file_info(filename);
  321. if (file_info.exists()) {
  322. BootGame(filename.toLatin1().data());
  323. StoreRecentFile(filename); // Put the filename on top of the list
  324. } else {
  325. // Display an error message and remove the file from the list.
  326. QMessageBox::information(this, tr("File not found"), tr("File \"%1\" not found").arg(filename));
  327. QSettings settings;
  328. QStringList recent_files = settings.value("recentFiles").toStringList();
  329. recent_files.removeOne(filename);
  330. settings.setValue("recentFiles", recent_files);
  331. UpdateRecentFiles();
  332. }
  333. }
  334. void GMainWindow::OnStartGame() {
  335. emu_thread->SetRunning(true);
  336. ui.action_Start->setEnabled(false);
  337. ui.action_Start->setText(tr("Continue"));
  338. ui.action_Pause->setEnabled(true);
  339. ui.action_Stop->setEnabled(true);
  340. }
  341. void GMainWindow::OnPauseGame() {
  342. emu_thread->SetRunning(false);
  343. ui.action_Start->setEnabled(true);
  344. ui.action_Pause->setEnabled(false);
  345. ui.action_Stop->setEnabled(true);
  346. }
  347. void GMainWindow::OnStopGame() {
  348. ShutdownGame();
  349. }
  350. void GMainWindow::OnOpenHotkeysDialog() {
  351. GHotkeysDialog dialog(this);
  352. dialog.exec();
  353. }
  354. void GMainWindow::SetHardwareRendererEnabled(bool enabled) {
  355. VideoCore::g_hw_renderer_enabled = enabled;
  356. }
  357. void GMainWindow::SetShaderJITEnabled(bool enabled) {
  358. VideoCore::g_shader_jit_enabled = enabled;
  359. }
  360. void GMainWindow::ToggleWindowMode() {
  361. if (ui.action_Single_Window_Mode->isChecked()) {
  362. // Render in the main window...
  363. render_window->BackupGeometry();
  364. ui.horizontalLayout->addWidget(render_window);
  365. render_window->setFocusPolicy(Qt::ClickFocus);
  366. if (emulation_running) {
  367. render_window->setVisible(true);
  368. render_window->setFocus();
  369. }
  370. } else {
  371. // Render in a separate window...
  372. ui.horizontalLayout->removeWidget(render_window);
  373. render_window->setParent(nullptr);
  374. render_window->setFocusPolicy(Qt::NoFocus);
  375. if (emulation_running) {
  376. render_window->setVisible(true);
  377. render_window->RestoreGeometry();
  378. game_list->show();
  379. }
  380. }
  381. }
  382. void GMainWindow::OnConfigure() {
  383. //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this);
  384. }
  385. void GMainWindow::closeEvent(QCloseEvent* event) {
  386. // Save window layout
  387. QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra");
  388. settings.beginGroup("UILayout");
  389. settings.setValue("geometry", saveGeometry());
  390. settings.setValue("state", saveState());
  391. settings.setValue("geometryRenderWindow", render_window->saveGeometry());
  392. settings.setValue("microProfileDialogGeometry", microProfileDialog->saveGeometry());
  393. settings.setValue("microProfileDialogVisible", microProfileDialog->isVisible());
  394. settings.endGroup();
  395. settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
  396. settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked());
  397. settings.setValue("firstStart", false);
  398. game_list->SaveInterfaceLayout(settings);
  399. SaveHotkeys(settings);
  400. // Shutdown session if the emu thread is active...
  401. if (emu_thread != nullptr)
  402. ShutdownGame();
  403. render_window->close();
  404. QWidget::closeEvent(event);
  405. }
  406. #ifdef main
  407. #undef main
  408. #endif
  409. int main(int argc, char* argv[]) {
  410. Log::Filter log_filter(Log::Level::Info);
  411. Log::SetFilter(&log_filter);
  412. MicroProfileOnThreadCreate("Frontend");
  413. SCOPE_EXIT({
  414. MicroProfileShutdown();
  415. });
  416. // Init settings params
  417. QSettings::setDefaultFormat(QSettings::IniFormat);
  418. QCoreApplication::setOrganizationName("Citra team");
  419. QCoreApplication::setApplicationName("Citra");
  420. QApplication::setAttribute(Qt::AA_X11InitThreads);
  421. QApplication app(argc, argv);
  422. GMainWindow main_window;
  423. // After settings have been loaded by GMainWindow, apply the filter
  424. log_filter.ParseFilterString(Settings::values.log_filter);
  425. main_window.show();
  426. return app.exec();
  427. }