From 2fea133bc9d23a75ac765ca5fdc00b50a65086f1 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 3 Jul 2019 20:46:22 +0200 Subject: Minor correction of emscripten save as to offer original file name if known. Signed-off-by: Pavel Pisa --- qtmips_gui/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qtmips_gui') 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)), -- cgit v1.2.3