Skip to content
Snippets Groups Projects
Commit 949ccce2 authored by Renne Thomas's avatar Renne Thomas
Browse files

Add enable align menu

parent bb4143e9
No related branches found
No related tags found
1 merge request!14Align groups column
......@@ -74,7 +74,7 @@
</property>
<widget class="QMenu" name="menuAlign">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="title">
<string>&amp;Align</string>
......@@ -152,6 +152,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionAlignement</sender>
<signal>triggered()</signal>
<receiver>MsIdentificationView</receiver>
<slot>doAlignmentGroup()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>541</x>
<y>201</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>doNotValidHide(bool)</slot>
......@@ -164,5 +180,6 @@
<slot>doModificationSearch(QString)</slot>
<slot>doExportAsOdsFile()</slot>
<slot>onMsIdentificationSearchEdit(QString)</slot>
<slot>doAlignmentGroup()</slot>
</slots>
</ui>
......@@ -347,6 +347,7 @@ MsIdentificationListWindow::setAlignmentGroup(
m_proxy_model->setData(index, QVariant(), Qt::EditRole);
}
}
checkMsRunAlignmentGroupContent();
}
QModelIndexList
......@@ -354,3 +355,44 @@ MsIdentificationListWindow::getSelectedIndexes()
{
return ui->tableView->selectionModel()->selectedIndexes();
}
void
MsIdentificationListWindow::doAlignmentGroup()
{
QString text;
foreach(MsRunAlignmentGroupSp temp,
m_project_window->getProjectP()->getMsRunAlignmentGroupList())
{
text += temp->getMsRunAlignmentGroupName() + ": size = ";
text += QString::number(temp->getMsRunsInAlignmentGroup().size()) + "\n";
}
QMessageBox msg_box;
msg_box.setWindowTitle(tr("Work in progress"));
msg_box.setText(text);
msg_box.exec();
}
void
MsIdentificationListWindow::checkMsRunAlignmentGroupContent()
{
bool align_menu_enable = false;
foreach(MsRunAlignmentGroupSp align_group,
m_project_window->getProjectP()->getMsRunAlignmentGroupList())
{
if(align_group->getMsRunsInAlignmentGroup().size() >= 2)
{
align_menu_enable = true;
}
}
if(align_menu_enable)
{
ui->menuAlign->setEnabled(true);
}
else
{
ui->menuAlign->setEnabled(false);
}
}
......@@ -77,6 +77,7 @@ class MsIdentificationListWindow : public QMainWindow
void setAlignmentGroup(MsRunAlignmentGroupSp msrun_alignment_group);
void resizeColumnsToContents();
QModelIndexList getSelectedIndexes();
void checkMsRunAlignmentGroupContent();
void virtual closeEvent(QCloseEvent *event) override;
public slots:
......@@ -88,6 +89,7 @@ class MsIdentificationListWindow : public QMainWindow
void MsIdentificationDataChanged();
protected slots:
void doAlignmentGroup();
void doSearchOn(QString search_on);
void updateStatusBar();
void onMsIdentificationSearchEdit(QString protein_search_string);
......
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