Qt: Add confirmation for making portable
Jeffrey Pfau jeffrey@endrift.com
Tue, 07 Jul 2015 22:51:13 -0700
2 files changed,
12 insertions(+),
1 deletions(-)
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -561,6 +561,15 @@ fail->setAttribute(Qt::WA_DeleteOnClose);
fail->show(); } +void Window::tryMakePortable() { + QMessageBox* confirm = new QMessageBox(QMessageBox::Question, tr("Really make portable?"), + tr("This will make the emulator load its configuration from the same directory as the executable. Do you want to continue?"), + 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::recordFrame() { m_frameList.append(QDateTime::currentDateTime()); while (m_frameList.count() > FRAME_LIST_SIZE) {@@ -642,7 +651,7 @@ m_mruMenu = fileMenu->addMenu(tr("Recent"));
fileMenu->addSeparator(); - addControlledAction(fileMenu, fileMenu->addAction(tr("Make portable"), m_config, SLOT(makePortable())), "makePortable"); + addControlledAction(fileMenu, fileMenu->addAction(tr("Make portable"), this, SLOT(tryMakePortable())), "makePortable"); fileMenu->addSeparator();
M
src/platform/qt/Window.h
→
src/platform/qt/Window.h
@@ -115,6 +115,8 @@ void gameCrashed(const QString&);
void gameFailed(); void unimplementedBiosCall(int); + void tryMakePortable(); + void recordFrame(); void showFPS();