Qt: Prompt for restart when changing display driver
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Jul 2015 14:51:09 -0700
2 files changed,
10 insertions(+),
0 deletions(-)
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -296,6 +296,7 @@ void Window::openSettingsWindow() {
SettingsView* settingsWindow = new SettingsView(m_config); connect(settingsWindow, SIGNAL(biosLoaded(const QString&)), m_controller, SLOT(loadBIOS(const QString&))); connect(settingsWindow, SIGNAL(audioDriverChanged()), m_controller, SLOT(reloadAudioDriver())); + connect(settingsWindow, SIGNAL(displayDriverChanged()), this, SLOT(mustRestart())); openView(settingsWindow); }@@ -568,6 +569,14 @@ QMessageBox::Yes | QMessageBox::Cancel, this, Qt::Sheet);
confirm->setAttribute(Qt::WA_DeleteOnClose); connect(confirm->button(QMessageBox::Yes), SIGNAL(clicked()), m_config, SLOT(makePortable())); confirm->show(); +} + +void Window::mustRestart() { + QMessageBox* dialog = new QMessageBox(QMessageBox::Warning, tr("Restart needed"), + tr("Some changes will not take effect until the emulator is restarted."), + QMessageBox::Ok, this, Qt::Sheet); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->show(); } void Window::recordFrame() {
M
src/platform/qt/Window.h
→
src/platform/qt/Window.h
@@ -116,6 +116,7 @@ void gameFailed();
void unimplementedBiosCall(int); void tryMakePortable(); + void mustRestart(); void recordFrame(); void showFPS();