all repos — mgba @ 0496691c9b0a767cf92dd50dbfec38f38e67439b

mGBA Game Boy Advance Emulator

Qt: Prompt for restart when changing display driver
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Jul 2015 14:51:09 -0700
commit

0496691c9b0a767cf92dd50dbfec38f38e67439b

parent

5749649b9c5d90c4090ee4e771f1d4f1ffef85c4

2 files changed, 10 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/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.hsrc/platform/qt/Window.h

@@ -116,6 +116,7 @@ void gameFailed();

void unimplementedBiosCall(int); void tryMakePortable(); + void mustRestart(); void recordFrame(); void showFPS();