From 5f98bb5930eb24de0d087b6201d3f58f0df55178 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 20 Aug 2019 23:04:36 +0200 Subject: Workaround to emscripten problem with source close when save requiring rename. Allow user to select only discard and cancel close. Signed-off-by: Pavel Pisa --- qtmips_gui/mainwindow.cpp | 7 ++++++- qtmips_gui/textsignalaction.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'qtmips_gui') diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index 084b063..b56fa85 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -782,10 +782,15 @@ void MainWindow::close_source_check() { QMessageBox *msgbox = new QMessageBox(this); msgbox->setWindowTitle("Close unsaved source"); msgbox->setText("Close unsaved source."); +#ifndef __EMSCRIPTEN__ msgbox->setInformativeText("Do you want to save your changes?"); msgbox->setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); +#else + msgbox->setInformativeText("Discard your changes or cancel close?"); + msgbox->setStandardButtons(QMessageBox::Discard | QMessageBox::Cancel); +#endif msgbox->setDefaultButton(QMessageBox::Save); - msgbox->setMinimumSize(QSize(200, 100)); + msgbox->setMinimumSize(QSize(200, 150)); msgbox->setAttribute(Qt::WA_DeleteOnClose); connect(msgbox, SIGNAL(finished(int)), this, SLOT(close_source_decided(int))); diff --git a/qtmips_gui/textsignalaction.h b/qtmips_gui/textsignalaction.h index 2373cdb..b3c0644 100644 --- a/qtmips_gui/textsignalaction.h +++ b/qtmips_gui/textsignalaction.h @@ -34,7 +34,7 @@ ******************************************************************************/ #ifndef TEXTSIGNALACTION_H -#define TEXTACTION_H +#define TEXTSIGNALACTION_H #include #include -- cgit v1.2.3