Skip to content
Snippets Groups Projects
Commit 19188f70 authored by Langella Olivier's avatar Langella Olivier
Browse files

build tandem run dialog only when it is required

parent 284269b1
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Main)
_p_load_results_dialog = new LoadResultsDialog(this);
_p_export_spreadsheet_dialog = new ExportSpreadsheetDialog(this);
_p_waiting_message_dialog = new WaitingMessageDialog(this);
_p_tandem_run_dialog = new TandemRunDialog(this);
_project_window = new ProjectWindow(this);
......@@ -73,10 +72,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Main)
#if QT_VERSION >= 0x050000
// Qt5 code
connect(_p_tandem_run_dialog,
&TandemRunDialog::accepted,
this,
&MainWindow::doAcceptedTandemRunDialog);
connect(_p_load_results_dialog,
&LoadResultsDialog::accepted,
this,
......@@ -90,21 +85,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Main)
this,
&MainWindow::doCheckNewVersion);
#else
// Qt4 code
connect(_p_tandem_run_dialog,
SIGNAL(accepted()),
this,
SLOT(doAcceptedTandemRunDialog()));
connect(_p_load_results_dialog,
SIGNAL(accepted()),
this,
SLOT(doAcceptedLoadResultDialog()));
connect(_p_export_spreadsheet_dialog,
SIGNAL(accepted()),
this,
SLOT(doAcceptedExportSpreadsheetDialog()));
#endif
}
......@@ -253,6 +233,7 @@ MainWindow::doAcceptedTandemRunDialog()
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
showWaitingMessage(tr("Running X!Tandem"));
emit operateRunningXtandem(_p_tandem_run_dialog->getTandemRunBatch());
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
}
......@@ -355,6 +336,14 @@ MainWindow::doProjectNotReady(QString error)
void
MainWindow::doActionTandemRun()
{
if(_p_tandem_run_dialog == nullptr)
{
_p_tandem_run_dialog = new TandemRunDialog(this);
connect(_p_tandem_run_dialog,
&TandemRunDialog::accepted,
this,
&MainWindow::doAcceptedTandemRunDialog);
}
_p_tandem_run_dialog->show();
_p_tandem_run_dialog->raise();
_p_tandem_run_dialog->activateWindow();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment