Qt: Add confirmation for making portable

This commit is contained in:
Jeffrey Pfau 2015-07-07 22:51:13 -07:00
parent f0c8c246cc
commit 9911484aee
2 changed files with 12 additions and 1 deletions

View File

@ -561,6 +561,15 @@ void Window::unimplementedBiosCall(int call) {
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 @@ void Window::setupMenu(QMenuBar* menubar) {
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();

View File

@ -115,6 +115,8 @@ private slots:
void gameFailed();
void unimplementedBiosCall(int);
void tryMakePortable();
void recordFrame();
void showFPS();