From: Joel Holdsworth Date: Thu, 22 Jan 2015 02:48:19 +0000 (-0500) Subject: MainWindow: Added import options dialog X-Git-Tag: pulseview-0.3.0~199 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=53d45c5577e17f39dbd5b4e61e00122f6c4f689c;p=pulseview.git MainWindow: Added import options dialog --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index e48df546..3480d8cc 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -274,12 +274,25 @@ void MainWindow::import_file(shared_ptr format) "%1 files (*.*);;All Files (*.*)").arg( QString::fromStdString(format->description()))); - if (!file_name.isEmpty()) { - load_file(file_name, format); + if (file_name.isEmpty()) + return; - const QString abs_path = QFileInfo(file_name).absolutePath(); - settings.setValue(SettingOpenDirectory, abs_path); + // Show the options dialog + map options; + if (!format->options().empty()) { + dialogs::InputOutputOptions dlg( + tr("Import %1").arg(QString::fromStdString( + format->description())), + format->options(), this); + if (!dlg.exec()) + return; + options = dlg.options(); } + + load_file(file_name, format, options); + + const QString abs_path = QFileInfo(file_name).absolutePath(); + settings.setValue(SettingOpenDirectory, abs_path); } void MainWindow::setup_ui()