From 436f1133dd3ce67bb3d51b0639c73739c57e3dc0 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 11:24:00 -0400 Subject: [PATCH 01/10] DolphinQt: Simplify action setup. We don't need two sets of actions (one with icons, one without icons) for Play/Stop, we can just tell Qt not to display the icons in the menus. --- Source/Core/DolphinQt/MainWindow.cpp | 4 --- Source/Core/DolphinQt/MainWindow.ui | 43 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 5ca60c22b2..3881dcd0c4 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -70,10 +70,8 @@ DMainWindow::DMainWindow(QWidget* parent_widget) connect(m_ui->actionIconView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged); connect(m_ui->actionPlay, &QAction::triggered, this, &DMainWindow::OnPlay); - connect(m_ui->actionPlay_mnu, &QAction::triggered, this, &DMainWindow::OnPlay); connect(m_game_tracker, &DGameTracker::StartGame, this, &DMainWindow::OnPlay); connect(m_ui->actionStop, &QAction::triggered, this, &DMainWindow::OnStop); - connect(m_ui->actionStop_mnu, &QAction::triggered, this, &DMainWindow::OnStop); connect(m_ui->actionReset, &QAction::triggered, this, &DMainWindow::OnReset); connect(m_ui->actionWebsite, &QAction::triggered, this, [&]() { @@ -339,13 +337,11 @@ void DMainWindow::OnCoreStateChanged(Core::EState state) { m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PAUSE)); m_ui->actionPlay->setText(tr("Pause")); - m_ui->actionPlay_mnu->setText(tr("Pause")); } else if (is_paused || is_not_initialized) { m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PLAY)); m_ui->actionPlay->setText(tr("Play")); - m_ui->actionPlay_mnu->setText(tr("Play")); } m_ui->actionStop->setEnabled(!is_not_initialized); diff --git a/Source/Core/DolphinQt/MainWindow.ui b/Source/Core/DolphinQt/MainWindow.ui index 966486f29f..26db42cd1f 100644 --- a/Source/Core/DolphinQt/MainWindow.ui +++ b/Source/Core/DolphinQt/MainWindow.ui @@ -19,9 +19,6 @@ 32 - - Qt::ToolButtonTextUnderIcon - true @@ -32,9 +29,12 @@ 0 0 990 - 19 + 21 + + true + Fi&le @@ -49,8 +49,8 @@ E&mulation - - + + @@ -108,6 +108,9 @@ Toolbar + + Qt::ToolButtonTextUnderIcon + TopToolBarArea @@ -160,11 +163,23 @@ Play + + F10 + + + false + Stop + + Esc + + + false + @@ -216,22 +231,6 @@ Exit - - - &Play - - - F10 - - - - - &Stop - - - Esc - - &Reset From 831d8ef13fd9a6ae263be2ddb5acab8114eeb387 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:10:38 -0400 Subject: [PATCH 02/10] DolphinQt: Properly handle quit events. * Confirm stopping emulation when the window is closing, not just the "Stop" button * Don't resume if we were already paused when we got the quit event * Shutdown the core at the end of main() so we don't crash on exit * Miscellaneous other logic cleanups related to this --- Source/Core/DolphinQt/Main.cpp | 1 + Source/Core/DolphinQt/MainWindow.cpp | 35 +++++++++++-------- Source/Core/DolphinQt/MainWindow.h | 1 - .../DolphinQt/VideoInterface/RenderWidget.h | 5 +-- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 289fbeedc0..4719de7051 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -60,6 +60,7 @@ int main(int argc, char* argv[]) int retcode = app.exec(); delete g_main_window; + Core::Shutdown(); UICommon::Shutdown(); return retcode; } diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 3881dcd0c4..d597d17151 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -62,7 +63,9 @@ DMainWindow::DMainWindow(QWidget* parent_widget) StartGame(filename); }); connect(m_ui->actionBrowse, &QAction::triggered, this, &DMainWindow::OnBrowse); - connect(m_ui->actionExit, &QAction::triggered, this, &DMainWindow::OnExit); + connect(m_ui->actionExit, &QAction::triggered, this, [&]() { + close(); + }); connect(m_ui->actionListView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged); connect(m_ui->actionTreeView, &QAction::triggered, this, &DMainWindow::OnGameListStyleChanged); @@ -110,7 +113,10 @@ DMainWindow::~DMainWindow() void DMainWindow::closeEvent(QCloseEvent* ce) { - Stop(); + if (!OnStop()) + ce->ignore(); + else + QMainWindow::closeEvent(ce); } // Emulation @@ -231,14 +237,6 @@ void DMainWindow::OnBrowse() m_game_tracker->ScanForGames(); } -void DMainWindow::OnExit() -{ - close(); - if (Core::GetState() == Core::CORE_UNINITIALIZED || m_isStopping) - return; - Stop(); -} - void DMainWindow::OnPlay() { if (Core::GetState() != Core::CORE_UNINITIALIZED) @@ -262,9 +260,17 @@ bool DMainWindow::OnStop() // Ask for confirmation in case the user accidentally clicked Stop / Escape if (SConfig::GetInstance().bConfirmStop) { - // Pause emulation - Core::SetState(Core::CORE_PAUSE); - emit CoreStateChanged(Core::CORE_PAUSE); + // Pause emulation if it isn't already + bool wasPaused = false; + if (Core::GetState() == Core::CORE_PAUSE) + { + wasPaused = true; + } + else + { + Core::SetState(Core::CORE_PAUSE); + emit CoreStateChanged(Core::CORE_PAUSE); + } QMessageBox::StandardButton ret = QMessageBox::question(m_render_widget.get(), tr("Please confirm..."), tr("Do you want to stop the current emulation?"), @@ -272,7 +278,8 @@ bool DMainWindow::OnStop() if (ret == QMessageBox::No) { - DoStartPause(); + if (!wasPaused) + DoStartPause(); return false; } } diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 0644d57d84..82492897b8 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -44,7 +44,6 @@ private slots: // Main toolbar void OnBrowse(); - void OnExit(); void OnPlay(); void OnReset(); diff --git a/Source/Core/DolphinQt/VideoInterface/RenderWidget.h b/Source/Core/DolphinQt/VideoInterface/RenderWidget.h index 3f6be38ff2..0afbf76f74 100644 --- a/Source/Core/DolphinQt/VideoInterface/RenderWidget.h +++ b/Source/Core/DolphinQt/VideoInterface/RenderWidget.h @@ -19,10 +19,7 @@ protected: void mousePressEvent(QMouseEvent*) override {} void paintEvent(QPaintEvent*) override {} -private slots: +private: void closeEvent(QCloseEvent* e) override; - -signals: - void Closed(); }; From db8b50cf7e3d0ad3481d38bb62f24d07fd297487 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:20:16 -0400 Subject: [PATCH 03/10] DolphinQt: Indentation fixes. --- Source/Core/DolphinQt/MainWindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index d597d17151..91eef1f0a5 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -185,7 +185,7 @@ QString DMainWindow::RequestBootFilename() { // If a game is already selected, just return the filename if (m_game_tracker->SelectedGame() != nullptr) - return m_game_tracker->SelectedGame()->GetFileName(); + return m_game_tracker->SelectedGame()->GetFileName(); return ShowFileDialog(); } @@ -200,8 +200,7 @@ QString DMainWindow::ShowFileDialog() QString DMainWindow::ShowFolderDialog() { return QFileDialog::getExistingDirectory(this, tr("Browse for a directory to add"), - QDir::homePath(), - QFileDialog::ShowDirsOnly); + QDir::homePath(), QFileDialog::ShowDirsOnly); } void DMainWindow::DoStartPause() From 7c130216275c1387e177ed0bb4ea84ba81a07080 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:20:45 -0400 Subject: [PATCH 04/10] DolphinQt: Add 'Screenshot' button. --- Source/Core/DolphinQt/MainWindow.cpp | 4 ++++ Source/Core/DolphinQt/MainWindow.ui | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 91eef1f0a5..391022971d 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -76,6 +76,9 @@ DMainWindow::DMainWindow(QWidget* parent_widget) connect(m_game_tracker, &DGameTracker::StartGame, this, &DMainWindow::OnPlay); connect(m_ui->actionStop, &QAction::triggered, this, &DMainWindow::OnStop); connect(m_ui->actionReset, &QAction::triggered, this, &DMainWindow::OnReset); + connect(m_ui->actionScreenshot, &QAction::triggered, this, [&]() { + Core::SaveScreenShot(); + }); connect(m_ui->actionWebsite, &QAction::triggered, this, [&]() { QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/"))); @@ -361,4 +364,5 @@ void DMainWindow::UpdateIcons() { // Play/Pause is handled in OnCoreStateChanged(). m_ui->actionStop->setIcon(Resources::GetIcon(Resources::TOOLBAR_STOP)); + m_ui->actionScreenshot->setIcon(Resources::GetIcon(Resources::TOOLBAR_SCREENSHOT)); } diff --git a/Source/Core/DolphinQt/MainWindow.ui b/Source/Core/DolphinQt/MainWindow.ui index 26db42cd1f..4f1a209d09 100644 --- a/Source/Core/DolphinQt/MainWindow.ui +++ b/Source/Core/DolphinQt/MainWindow.ui @@ -52,6 +52,8 @@ + + @@ -119,6 +121,7 @@ + @@ -236,6 +239,14 @@ &Reset + + + Screenshot + + + false + + From 0e2ea1ba6467d1e66afec72b9aac9524d4d5799f Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:22:47 -0400 Subject: [PATCH 05/10] DolphinQt: Remove '&' on closures where it isn't needed. --- Source/Core/DolphinQt/MainWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 391022971d..a4806d0e46 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -76,17 +76,17 @@ DMainWindow::DMainWindow(QWidget* parent_widget) connect(m_game_tracker, &DGameTracker::StartGame, this, &DMainWindow::OnPlay); connect(m_ui->actionStop, &QAction::triggered, this, &DMainWindow::OnStop); connect(m_ui->actionReset, &QAction::triggered, this, &DMainWindow::OnReset); - connect(m_ui->actionScreenshot, &QAction::triggered, this, [&]() { + connect(m_ui->actionScreenshot, &QAction::triggered, this, []() { Core::SaveScreenShot(); }); - connect(m_ui->actionWebsite, &QAction::triggered, this, [&]() { + connect(m_ui->actionWebsite, &QAction::triggered, this, []() { QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/"))); }); - connect(m_ui->actionOnlineDocs, &QAction::triggered, this, [&]() { + connect(m_ui->actionOnlineDocs, &QAction::triggered, this, []() { QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/docs/guides/"))); }); - connect(m_ui->actionGitHub, &QAction::triggered, this, [&]() { + connect(m_ui->actionGitHub, &QAction::triggered, this, []() { QDesktopServices::openUrl(QUrl(SL("https://github.com/dolphin-emu/dolphin"))); }); connect(m_ui->actionSystemInfo, &QAction::triggered, this, [&]() { From 11c641ed902e5c0c4eccd1e437a7a806189bc793 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:25:53 -0400 Subject: [PATCH 06/10] DolphinQt: Set the SUBSYSTEM in Release mode to 'Windows' to hide the console. --- Source/Core/DolphinQt/DolphinQt.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 718cdee343..c620893958 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -47,6 +47,7 @@ true $(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories) iphlpapi.lib;winmm.lib;setupapi.lib;vfw32.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;%(AdditionalDependencies) + Windows $(ProjectDir)\VideoInterface;$(ProjectDir)\GameList;%(AdditionalIncludeDirectories) From 7c2f22fd0c6a5eaa4a0631d4e4339c746d1b0c57 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:33:03 -0400 Subject: [PATCH 07/10] DolphinQt: Use C++11 'final' keyword where applicable. --- Source/Core/DolphinQt/AboutDialog.h | 2 +- Source/Core/DolphinQt/GameList/GameGrid.h | 2 +- Source/Core/DolphinQt/GameList/GameTracker.h | 2 +- Source/Core/DolphinQt/GameList/GameTree.h | 2 +- Source/Core/DolphinQt/MainWindow.h | 2 +- Source/Core/DolphinQt/SystemInfo.h | 2 +- Source/Core/DolphinQt/VideoInterface/RenderWidget.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinQt/AboutDialog.h b/Source/Core/DolphinQt/AboutDialog.h index 40f128ae7f..fa476a1024 100644 --- a/Source/Core/DolphinQt/AboutDialog.h +++ b/Source/Core/DolphinQt/AboutDialog.h @@ -13,7 +13,7 @@ namespace Ui class DAboutDialog; } -class DAboutDialog : public QDialog +class DAboutDialog final : public QDialog { Q_OBJECT diff --git a/Source/Core/DolphinQt/GameList/GameGrid.h b/Source/Core/DolphinQt/GameList/GameGrid.h index 50a70dc2fb..63e665e8a4 100644 --- a/Source/Core/DolphinQt/GameList/GameGrid.h +++ b/Source/Core/DolphinQt/GameList/GameGrid.h @@ -16,7 +16,7 @@ namespace Ui class DGameGrid; } -class DGameGrid : public QListWidget, public AbstractGameList +class DGameGrid final : public QListWidget, public AbstractGameList { Q_OBJECT diff --git a/Source/Core/DolphinQt/GameList/GameTracker.h b/Source/Core/DolphinQt/GameList/GameTracker.h index 7501874613..7f92ac2c00 100644 --- a/Source/Core/DolphinQt/GameList/GameTracker.h +++ b/Source/Core/DolphinQt/GameList/GameTracker.h @@ -38,7 +38,7 @@ public: void RemoveGames(QList items); }; -class DGameTracker : public QStackedWidget +class DGameTracker final : public QStackedWidget { Q_OBJECT diff --git a/Source/Core/DolphinQt/GameList/GameTree.h b/Source/Core/DolphinQt/GameList/GameTree.h index 2e379f99e7..37a1d0dfc7 100644 --- a/Source/Core/DolphinQt/GameList/GameTree.h +++ b/Source/Core/DolphinQt/GameList/GameTree.h @@ -16,7 +16,7 @@ namespace Ui class DGameTree; } -class DGameTree : public QTreeWidget, public AbstractGameList +class DGameTree final : public QTreeWidget, public AbstractGameList { Q_OBJECT diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 82492897b8..c36284fa09 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -18,7 +18,7 @@ namespace Ui class DMainWindow; } -class DMainWindow : public QMainWindow +class DMainWindow final : public QMainWindow { Q_OBJECT diff --git a/Source/Core/DolphinQt/SystemInfo.h b/Source/Core/DolphinQt/SystemInfo.h index b7906d2b47..3e010b0259 100644 --- a/Source/Core/DolphinQt/SystemInfo.h +++ b/Source/Core/DolphinQt/SystemInfo.h @@ -12,7 +12,7 @@ namespace Ui class DSystemInfo; } -class DSystemInfo : public QDialog +class DSystemInfo final : public QDialog { Q_OBJECT diff --git a/Source/Core/DolphinQt/VideoInterface/RenderWidget.h b/Source/Core/DolphinQt/VideoInterface/RenderWidget.h index 0afbf76f74..67639e7322 100644 --- a/Source/Core/DolphinQt/VideoInterface/RenderWidget.h +++ b/Source/Core/DolphinQt/VideoInterface/RenderWidget.h @@ -6,7 +6,7 @@ #include -class DRenderWidget : public QWidget +class DRenderWidget final : public QWidget { Q_OBJECT From 7c91669ced90144f1216e799164cf6de545e8474 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 13:37:33 -0400 Subject: [PATCH 08/10] DolphinQt: Updates to the SystemInfo dialog. * Windows 8.1/10 & OS X .10/.11 constants now in Qt * idealThreadCount() includes hyperthreads, so say 'logical processors' --- Source/Core/DolphinQt/SystemInfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/SystemInfo.cpp b/Source/Core/DolphinQt/SystemInfo.cpp index e8c6a04859..e6f54009be 100644 --- a/Source/Core/DolphinQt/SystemInfo.cpp +++ b/Source/Core/DolphinQt/SystemInfo.cpp @@ -46,7 +46,7 @@ void DSystemInfo::UpdateSystemInfo() sysinfo += SL("System\n===========================\n"); sysinfo += SL("OS: %1\n").arg(GetOS()); - sysinfo += SL("CPU: %1, %2 cores\n").arg(QString::fromStdString(cpu_info.Summarize())) + sysinfo += SL("CPU: %1, %2 logical processors\n").arg(QString::fromStdString(cpu_info.Summarize())) .arg(QThread::idealThreadCount()); sysinfo += SL("\nDolphin\n===========================\n"); @@ -70,12 +70,16 @@ QString DSystemInfo::GetOS() const case QSysInfo::WV_VISTA: ret += SL("Vista"); break; case QSysInfo::WV_WINDOWS7: ret += SL("7"); break; case QSysInfo::WV_WINDOWS8: ret += SL("8"); break; + case QSysInfo::WV_WINDOWS8_1: ret += SL("8.1"); break; + case QSysInfo::WV_WINDOWS10: ret += SL("10"); break; default: ret += SL("(unknown)"); break; } #elif defined(Q_OS_MAC) ret += SL("Mac OS X "); switch (QSysInfo::MacintoshVersion) { case QSysInfo::MV_10_9: ret += SL("10.9"); break; + case QSysInfo::MV_10_10: ret += SL("10.10"); break; + case QSysInfo::MV_10_11: ret += SL("10.11"); break; default: ret += SL("(unknown)"); break; } #elif defined(Q_OS_LINUX) From f5743f5ee91586525046b4bb3e116fb7fe7f8d99 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Sat, 12 Sep 2015 14:00:08 -0400 Subject: [PATCH 09/10] DolphinQt: Handle the Host_UpdateTitle callback. --- Source/Core/DolphinQt/DolphinQt.vcxproj | 1 + .../Core/DolphinQt/DolphinQt.vcxproj.filters | 1 + Source/Core/DolphinQt/Host.cpp | 9 ++++++++- Source/Core/DolphinQt/Host.h | 19 +++++++++++++++++++ Source/Core/DolphinQt/MainWindow.cpp | 12 ++++++++++++ Source/Core/DolphinQt/MainWindow.h | 3 ++- 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Source/Core/DolphinQt/Host.h diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index c620893958..abb186303c 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -172,6 +172,7 @@ + diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj.filters b/Source/Core/DolphinQt/DolphinQt.vcxproj.filters index 6eb3c010bc..2c58321344 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj.filters +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj.filters @@ -83,6 +83,7 @@ + Utils diff --git a/Source/Core/DolphinQt/Host.cpp b/Source/Core/DolphinQt/Host.cpp index 150c0ba88b..e07796a18b 100644 --- a/Source/Core/DolphinQt/Host.cpp +++ b/Source/Core/DolphinQt/Host.cpp @@ -10,8 +10,15 @@ #include "Common/MsgHandler.h" #include "Core/Host.h" +#include "DolphinQt/Host.h" #include "DolphinQt/MainWindow.h" +HostTitleEvent::HostTitleEvent(const std::string& title) + : QEvent((QEvent::Type)HostEvent::TitleEvent), + m_title(title) +{ +} + void Host_Message(int id) { // TODO @@ -24,7 +31,7 @@ void Host_UpdateMainFrame() void Host_UpdateTitle(const std::string& title) { - // TODO + qApp->postEvent(g_main_window, new HostTitleEvent(title)); } void* Host_GetRenderHandle() diff --git a/Source/Core/DolphinQt/Host.h b/Source/Core/DolphinQt/Host.h new file mode 100644 index 0000000000..40c4b6c54a --- /dev/null +++ b/Source/Core/DolphinQt/Host.h @@ -0,0 +1,19 @@ +// Copyright 2015 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +enum HostEvent { + TitleEvent = QEvent::User + 1, +}; + +class HostTitleEvent final : public QEvent +{ +public: + HostTitleEvent(const std::string& title); + const std::string m_title; +}; diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index a4806d0e46..4437147cf9 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -17,6 +17,7 @@ #include "Core/HW/ProcessorInterface.h" #include "DolphinQt/AboutDialog.h" +#include "DolphinQt/Host.h" #include "DolphinQt/MainWindow.h" #include "DolphinQt/SystemInfo.h" #include "DolphinQt/Utils/Resources.h" @@ -114,6 +115,17 @@ DMainWindow::~DMainWindow() { } +bool DMainWindow::event(QEvent* e) +{ + if (e->type() == HostEvent::TitleEvent) + { + HostTitleEvent* htev = (HostTitleEvent*)e; + m_ui->statusbar->showMessage(QString::fromStdString(htev->m_title), 1500); + return true; + } + return QMainWindow::event(e); +} + void DMainWindow::closeEvent(QCloseEvent* ce) { if (!OnStop()) diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index c36284fa09..0b2eb74b91 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -54,7 +54,8 @@ private slots: void UpdateIcons(); private: - void closeEvent(QCloseEvent* ce); + bool event(QEvent* e) override; + void closeEvent(QCloseEvent* ce) override; std::unique_ptr m_ui; DGameTracker* m_game_tracker; From 2d9c5ce6b33e466d364e929080d512b6bd525430 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Fri, 6 Nov 2015 18:39:30 -0500 Subject: [PATCH 10/10] Externals/Qt: Update to Qt 5.5.0. --- Externals/Qt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals/Qt b/Externals/Qt index e800367547..9dca8d6c71 160000 --- a/Externals/Qt +++ b/Externals/Qt @@ -1 +1 @@ -Subproject commit e800367547f23b981d1de8e6c13c1d6a88d56746 +Subproject commit 9dca8d6c716ad304d9382116ee29b5e2e4cde8d8