aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-03 20:46:22 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-03 20:46:22 +0200
commit2fea133bc9d23a75ac765ca5fdc00b50a65086f1 (patch)
tree495200dec4f22a0bbdf5651b075bfa4b1ce4e134 /qtmips_gui
parente28573e96800e0f316a8404b8c02c60c4597159b (diff)
downloadqtmips-2fea133bc9d23a75ac765ca5fdc00b50a65086f1.tar.gz
qtmips-2fea133bc9d23a75ac765ca5fdc00b50a65086f1.tar.bz2
qtmips-2fea133bc9d23a75ac765ca5fdc00b50a65086f1.zip
Minor correction of emscripten save as to offer original file name if known.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/mainwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index 7a76dc2..775d926 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -579,10 +579,13 @@ void MainWindow::save_source_as() {
central_window->setTabText(idx, current_srceditor->title());
update_open_file_list();
#else
+ QString filename = current_srceditor->filename();
+ if (filename.isEmpty())
+ filename = "unknown.s";
QInputDialog *dialog = new QInputDialog(this);
dialog->setWindowTitle("Select file name");
dialog->setLabelText("File name:");
- dialog->setTextValue("unknow.s");
+ dialog->setTextValue(filename);
dialog->setMinimumSize(QSize(200, 100));
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, SIGNAL(textValueSelected(QString)),