Skip to content

Commit

Permalink
Update connect statements in gui.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinffernandez committed Oct 26, 2022
1 parent a1f43ce commit 9bf90a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
28 changes: 14 additions & 14 deletions src/gui/mmomegui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void MmomeGui::on_action_Save_As_triggered()
void MmomeGui::on_actionSettings_triggered()
{
_settingsDlg = new SettingsDlg(this);
connect(_settingsDlg, SIGNAL(finished(int)), this, SLOT(settingsDlgClosed()));
connect(_settingsDlg, &SettingsDlg::finished, this, &MmomeGui::settingsDlgClosed);
enableActions(false);
_settingsDlg->show();
}
Expand All @@ -162,7 +162,7 @@ void MmomeGui::on_actionImport_triggered()
modelsDir.cd(sbmlfi.baseName());
_compiler_msg->setPlainText(_compiler_msg->toPlainText() + QString("\nImport SBML model: ") + fileName);
_proc = new QProcess(this);
connect(_proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(importFinished(int, QProcess::ExitStatus)));
connect(_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &MmomeGui::importFinished);
_sbmlFile = modelsDir.absolutePath() + SLASH + sbmlfi.baseName() + ".mo";
QStringList args;
args << "-o " + _sbmlFile;
Expand All @@ -187,8 +187,8 @@ void MmomeGui::editModel(QString name)
QMdiSubWindow *sw = new QMdiSubWindow(this, Qt::CustomizeWindowHint);
sw->setWidget(Editor::instance(this, name));
mdiArea->addSubWindow(sw);
connect(Editor::instance(), SIGNAL(done(QString, QString)), this, SLOT(done(QString, QString)));
connect(Editor::instance(), SIGNAL(clean(int)), this, SLOT(cleanBuildDir(int)));
connect(Editor::instance(), &ModelEditor::done, this, &MmomeGui::done);
connect(Editor::instance(), &ModelEditor::clean, this, &MmomeGui::cleanBuildDir);
connect(action_Save, &QAction::triggered, this, []() { Editor::instance()->save(); });
connect(actionSa_ve_All, &QAction::triggered, Editor::instance(), &ModelEditor::saveAll);
Editor::instance()->setWindowState(Qt::WindowMaximized);
Expand Down Expand Up @@ -275,7 +275,7 @@ void MmomeGui::run(QString name)
_compiler_msg->setPlainText(_compiler_msg->toPlainText() + QString("\nCreating/cleaning directory: ") + outputDir.absolutePath());
on_actionClear_Log_triggered();
_proc = new QProcess(this);
connect(_proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(run_finished(int, QProcess::ExitStatus)));
connect(_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &MmomeGui::run_finished);
QStringList args;
args << name;
if (Editor::instance()->isParallel()) {
Expand All @@ -290,7 +290,7 @@ void MmomeGui::run(QString name)
} else {
args << QString("false");
}
connect(_proc, SIGNAL(readyReadStandardError()), this, SLOT(simulation_message()));
connect(_proc, &QProcess::readyReadStandardError, this, &MmomeGui::simulation_message);
_timeInterval = Editor::instance()->stopTime().toDouble() - Editor::instance()->startTime().toDouble();
_sim_progress->setMaximum(100);
_sim_progress->reset();
Expand Down Expand Up @@ -396,8 +396,8 @@ void MmomeGui::on_actionRun_triggered()
}
_compiler_msg->clear();
_runDlg = new RunDlg(this);
connect(_runDlg, SIGNAL(accepted()), this, SLOT(runDlgClose()));
connect(_runDlg, SIGNAL(rejected()), this, SLOT(runDlgRejected()));
connect(_runDlg, &RunDlg::accepted, this, &MmomeGui::runDlgClose);
connect(_runDlg, &RunDlg::rejected, this, &MmomeGui::runDlgRejected);
_runDlg->setStartTime(Editor::instance()->startTime());
_runDlg->setStopTime(Editor::instance()->stopTime());
_runDlg->setTolerance(Editor::instance()->tolerance());
Expand Down Expand Up @@ -531,7 +531,7 @@ bool MmomeGui::compile(bool dbg)
}
QString flags = _utils->appFlag(FLG_FLAGS);
_proc = new QProcess(this);
connect(_proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(comp_finished(int, QProcess::ExitStatus)));
connect(_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &MmomeGui::comp_finished);
QStringList args;
QString set;
if (_settings_only) {
Expand Down Expand Up @@ -666,7 +666,7 @@ void MmomeGui::comp_finished(int exitCode, QProcess::ExitStatus exitStatus)
QString build = _utils->appCommand(CMD_BUILD);
delete _proc;
_proc = new QProcess(this);
connect(_proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(make_finished(int, QProcess::ExitStatus)));
connect(_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &MmomeGui::make_finished);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("MMOC_BUILD", QDir(_utils->appDir(MMOC_BUILD)).absolutePath());
env.insert("MMOC_BIN", QDir(_utils->appDir(MMOC_BIN)).absolutePath());
Expand Down Expand Up @@ -723,7 +723,7 @@ void MmomeGui::on_actionLog_triggered()
}
QString logCmd = _utils->appCommand(CMD_LOG);
_log = new QProcess(this);
connect(_log, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(log_finished(int, QProcess::ExitStatus)));
connect(_log, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &MmomeGui::log_finished);
QStringList args;
args << name;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
Expand Down Expand Up @@ -772,12 +772,12 @@ void MmomeGui::createActions()
for (int i = 0; i < MaxRecentFiles; ++i) {
recentFileActs[i] = new QAction(this);
recentFileActs[i]->setVisible(false);
connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFiles()));
connect(recentFileActs[i], &QAction::triggered, this, &MmomeGui::openRecentFiles);
}
exitAct = new QAction(tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
connect(exitAct, &QAction::triggered, qApp, &QApplication::closeAllWindows);
separatorAct = menu_File->addSeparator();
for (int i = 0; i < MaxRecentFiles; ++i) menu_File->addAction(recentFileActs[i]);
separatorAct->setVisible(false);
Expand Down Expand Up @@ -911,7 +911,7 @@ void MmomeGui::on_actionGraphics_triggered()
return;
}
_plot = new QProcess(this);
connect(_plot, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(plot_finished(int, QProcess::ExitStatus)));
connect(_plot, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &MmomeGui::plot_finished);
QStringList args;
if (plotOptions.isEmpty()) {
plotOptions = "-persist";
Expand Down
6 changes: 1 addition & 5 deletions src/gui/modeleditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
******************************************************************************/

#ifndef MODELEDITOR_H_
#define MODELEDITOR_H_
#pragma once

#include <QTabWidget>
#include <QTextCursor>
Expand Down Expand Up @@ -128,7 +127,6 @@ class ModelEditor : public QDialog, public Ui::ModelEditorForm {
void saveAll(void);
void saveAs(QString name = QString());


protected:
void reject(){};

Expand Down Expand Up @@ -199,5 +197,3 @@ class ModelEditor : public QDialog, public Ui::ModelEditorForm {
Utils *_utils;
MmoHighlighter *_hl;
};

#endif /* MODELEDITOR_H_ */

0 comments on commit 9bf90a2

Please sign in to comment.