diff --git a/src/gui/peptide_detail_view/peptide_detail_view.ui b/src/gui/peptide_detail_view/peptide_detail_view.ui index f17ecdd4ebfae7509a67ec94406275fac139e9a0..e86a541a1da269e3390a76eace7d3da712afe16e 100644 --- a/src/gui/peptide_detail_view/peptide_detail_view.ui +++ b/src/gui/peptide_detail_view/peptide_detail_view.ui @@ -144,7 +144,7 @@ </widget> </item> </layout> - </widget> + </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> @@ -396,10 +396,27 @@ </hint> </hints> </connection> + <connection> + <sender>precision_unit_combobox</sender> + <signal>currentIndexChanged(QString)</signal> + <receiver>PeptideDetailView</receiver> + <slot>doMsmsPrecisionUnitChanged(QString)</slot> + <hints> + <hint type="sourcelabel"> + <x>680</x> + <y>355</y> + </hint> + <hint type="destinationlabel"> + <x>873</x> + <y>278</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>chooseDefaultMzDataDir()</slot> <slot>openInPeptideViewer()</slot> <slot>doMsmsPrecisionValueChanged(double)</slot> + <slot>doMsmsPrecisionUnitChanged(QString)</slot> </slots> </ui> diff --git a/src/gui/peptide_detail_view/peptidewindow.cpp b/src/gui/peptide_detail_view/peptidewindow.cpp index 776aa15769d0b4661db6fdde975ca1ef8f8731e8..27a208e53fa70882d92c89e460b3cdcb70e21097 100644 --- a/src/gui/peptide_detail_view/peptidewindow.cpp +++ b/src/gui/peptide_detail_view/peptidewindow.cpp @@ -227,6 +227,24 @@ void PeptideWindow::setPeptideMatch(PeptideMatch * p_peptide_match) { qDebug() << "PeptideWindow::setPeptideMatch end"; } +void PeptideWindow::doMsmsPrecisionUnitChanged(QString unit) { + + qDebug() << "PeptideWindow::doMsmsPrecisionUnitChanged begin " << unit; + QSettings settings; + pappso::mz precision = ui->precision_spinbox->value(); + + + if (unit == "dalton") { + _p_precision = Precision::getDaltonInstance(precision); + } else { + _p_precision = Precision::getPpmInstance(precision); + } + ui->spectrumWidget->setPrecision(_p_precision); + + settings.setValue("peptideview/precision_unit", unit); + + qDebug() << "PeptideWindow::doMsmsPrecisionUnitChanged end " << unit; +} void PeptideWindow::doMsmsPrecisionValueChanged(double precision_value) { @@ -242,6 +260,5 @@ void PeptideWindow::doMsmsPrecisionValueChanged(double precision_value) { } ui->spectrumWidget->setPrecision(_p_precision); - settings.setValue("peptideview/precision_unit", unit); settings.setValue("peptideview/precision_value", precision); } diff --git a/src/gui/peptide_detail_view/peptidewindow.h b/src/gui/peptide_detail_view/peptidewindow.h index 7811316cb35d20d1a3740192971ce9a48cbd52fc..33628df4ec6c847292149dc2527262095446ff0c 100644 --- a/src/gui/peptide_detail_view/peptidewindow.h +++ b/src/gui/peptide_detail_view/peptidewindow.h @@ -77,6 +77,7 @@ signals: protected slots: void doSpectrumSpReady(pappso::SpectrumSp spectrum_sp, QString error); void doMsmsPrecisionValueChanged(double precision_value); + void doMsmsPrecisionUnitChanged(QString unit); void chooseDefaultMzDataDir(); void openInPeptideViewer(); protected :