diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-08-20 23:04:36 +0200 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-08-20 23:04:36 +0200 |
commit | 5f98bb5930eb24de0d087b6201d3f58f0df55178 (patch) | |
tree | 320d83a1f114f30f5018d30e196835d734b315f7 /qtmips_gui | |
parent | e7dbc15332dca8d3c2c233258f73694215e703b8 (diff) | |
download | qtmips-5f98bb5930eb24de0d087b6201d3f58f0df55178.tar.gz qtmips-5f98bb5930eb24de0d087b6201d3f58f0df55178.tar.bz2 qtmips-5f98bb5930eb24de0d087b6201d3f58f0df55178.zip |
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 <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/mainwindow.cpp | 7 | ||||
-rw-r--r-- | qtmips_gui/textsignalaction.h | 2 |
2 files changed, 7 insertions, 2 deletions
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 <QObject> #include <QAction> |