emit setActiveSingleRunKey(m_activeSequence->selectedRunKey());
}
+void DataManager::onSingleRunClose(const QString& key)
+{
+ std::string stdKey = key.toStdString();
+ QString newKey;
+
+ if (m_activeSequence == nullptr)
+ return;
+
+ stdKey = key.toStdString();
+
+ SingleRunsMap::const_iterator cit = m_activeSequence->cbegin();
+ while (cit != m_activeSequence->cend()) {
+ if (cit->first.compare(stdKey) == 0)
+ break;
+ cit++;
+ }
+ if (cit == m_activeSequence->cend()) {
+ Logger::log(Logger::Level::ERROR, ME_SENDER_STR, "[" + key + "]: No such single run.");
+ return;
+ }
+
+ if (m_activeSequence->count() > 1) {
+ /* Closed single run was the last in the sequence */
+ if (std::next(cit) == m_activeSequence->cend())
+ newKey = QString::fromStdString(std::prev(cit)->first);
+ else
+ newKey = QString::fromStdString(std::next(cit)->first);
+
+ onSingleRunSelected(newKey);
+ } else {
+ emit cleanDashboard();
+ emit setSingleRunInfo("", "", "", "");
+ }
+
+ m_activeSequence->remove(stdKey);
+ m_singleSelModel.setSingleRuns(m_activeSequence->allRunKeys());
+ if (!newKey.isEmpty())
+ emit setActiveSingleRunKey(newKey.toStdString());
+}
+
void DataManager::onSingleRunSelected(const QString& key)
{
if (m_activeSequence == nullptr)
void onSaveChanges();
void onSaveAllChanges();
void onSequenceSelected(const QString& key);
+ void onSingleRunClose(const QString& key);
void onSingleRunSelected(const QString& key);
/* DATA menu */
connect(ui->actionLoad_single_run, SIGNAL(triggered()), this, SLOT(onLoadSingleRun()));
connect(ui->actionLoad_sequence, SIGNAL(triggered()), this, SLOT(onLoadSequence()));
+ connect(ui->actionClose_single_run, SIGNAL(triggered()), this, SLOT(onCloseSingleRun()));
connect(ui->actionSave_changes, SIGNAL(triggered()), this, SLOT(onSaveChanges()));
connect(ui->actionSave_all_changes, SIGNAL(triggered()), this, SLOT(onSaveAllChanges()));
/* EXPORT menu */
delete m_dashboard->widget(0);
}
+void MainWindow::onCloseSingleRun()
+{
+ emit singleRunClose(ui->qcbox_singleRun->currentText());
+}
+
void MainWindow::onSetActiveSequenceIndex(const int idx)
{
if (ui->qcbox_sequence->currentIndex() == idx)
private slots:
void onAboutAnyanka();
+ void onCloseSingleRun();
void onExportGraphToImage() { emit exportGraphToImage(); }
void onExportPeaks() { emit exportPeaks(); }
void onExportRawData() { emit exportRawData(); }
void saveChanges();
void saveAllChanges();
void sequenceSelected(const QString& str);
+ void singleRunClose(const QString& key);
void singleRunSelected(const QString& str);
void zoomMode();
};
<addaction name="actionLoad_single_run"/>
<addaction name="actionLoad_sequence"/>
<addaction name="separator"/>
+ <addaction name="actionClose_single_run"/>
+ <addaction name="separator"/>
<addaction name="actionSave_changes"/>
<addaction name="actionSave_all_changes"/>
</widget>
<string>Ctrl+Shift+S</string>
</property>
</action>
+ <action name="actionClose_single_run">
+ <property name="text">
+ <string>Close single run</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
QObject::connect(mWin.get(), SIGNAL(loadSingleRun(QString)), dMgr.get(), SLOT(onLoadSingleRun(QString)));
QObject::connect(mWin.get(), SIGNAL(loadSequence(QString)), dMgr.get(), SLOT(onLoadSequence(QString)));
QObject::connect(mWin.get(), SIGNAL(sequenceSelected(QString)), dMgr.get(), SLOT(onSequenceSelected(QString)));
+ QObject::connect(mWin.get(), SIGNAL(singleRunClose(QString)), dMgr.get(), SLOT(onSingleRunClose(QString)));
QObject::connect(mWin.get(), SIGNAL(singleRunSelected(QString)), dMgr.get(), SLOT(onSingleRunSelected(QString)));
mWin->show();