diff --git a/gui/main.cpp b/gui/main.cpp index 31111bb1d2..4ed488f724 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) if (vm.count("input-files")) inputFiles = vm["input-files"].as>(); if (vm.count("project")) { - w.setConfig(vm["project"].as(), inputFiles); + w.setProjectFile(vm["project"].as(), inputFiles); } else { w.addInputFiles(inputFiles); } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 138c814c74..c4c0b55a69 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -281,17 +281,17 @@ void displayError(const scram::Error &err, const QString &title, } // namespace -bool MainWindow::setConfig(const std::string &configPath, - std::vector inputFiles) +bool MainWindow::setProjectFile(const std::string &projectFilePath, + std::vector inputFiles) { try { - Project config(configPath); - inputFiles.insert(inputFiles.begin(), config.input_files().begin(), - config.input_files().end()); - mef::Initializer(inputFiles, config.settings()); + Project project(projectFilePath); + inputFiles.insert(inputFiles.begin(), project.input_files().begin(), + project.input_files().end()); + mef::Initializer(inputFiles, project.settings()); if (!addInputFiles(inputFiles)) return false; - m_settings = config.settings(); + m_settings = project.settings(); } catch (const scram::IOError &err) { displayError(err, _("Configuration file error"), this); return false; @@ -304,7 +304,7 @@ bool MainWindow::setConfig(const std::string &configPath, this); return false; } catch (const scram::VersionError &err) { - displayError(err, tr("Version Error"), tr("Version incompatibility"), + displayError(err, _("Version Error"), _("Version incompatibility"), this); return false; } @@ -357,7 +357,7 @@ bool MainWindow::addInputFiles(const std::vector &inputFiles) return false; } - emit configChanged(); + emit projectChanged(); return true; } @@ -548,7 +548,7 @@ void MainWindow::setupConnections() }); connect(ui->actionRun, &QAction::triggered, this, &MainWindow::runAnalysis); - connect(this, &MainWindow::configChanged, [this] { + connect(this, &MainWindow::projectChanged, [this] { m_undoStack->clear(); setWindowTitle(QStringLiteral("%1[*]").arg(getModelNameForTitle())); ui->actionSaveAs->setEnabled(true); @@ -658,7 +658,7 @@ void MainWindow::createNewModel() m_inputFiles.clear(); m_model = std::make_unique(); - emit configChanged(); + emit projectChanged(); } void MainWindow::openFiles(QString directory) diff --git a/gui/mainwindow.h b/gui/mainwindow.h index cd54e10ffb..b54bed604d 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -61,17 +61,17 @@ class MainWindow : public QMainWindow explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); - /// Loads a model and analysis configuration from a file. + /// Loads a model and analysis from a project file. /// - /// @param[in] configPath The path to the configuration file. + /// @param[in] projectFilePath The path to the project configuration file. /// @param[in] inputFiles Additional input files for model initialization. /// /// @returns true if the initialization is successful. /// /// @post No side effects are left-over /// if the initialization is not successful. - bool setConfig(const std::string &configPath, - std::vector inputFiles = {}); + bool setProjectFile(const std::string &projectFilePath, + std::vector inputFiles = {}); /// Adds a new set of model elements from input files. /// @@ -85,8 +85,8 @@ class MainWindow : public QMainWindow bool addInputFiles(const std::vector &inputFiles); signals: - /// Indicates addition of new input or configuration files. - void configChanged(); + /// Indicates addition of new input or project files. + void projectChanged(); private slots: /// Opens a new project configuration.