[Debichem-commits] [SCM] massXpert mass spectrometry suite: debian packaging branch, upstream, updated. debian/2.0.6

Filippo Rusconi (Debian Maintainer) rusconi-debian at laposte.net
Mon Oct 5 20:37:54 UTC 2009


The following commit has been merged in the upstream branch:
commit 1667f3d80df1649f8b6d5dc345fc898342f4dd5a
Author: Filippo Rusconi (Debian Maintainer) <rusconi-debian at laposte.net>
Date:   Mon Sep 21 17:42:07 2009 +0200

    Fixed behaviour of whole/selected sequence feature in mass search dialog.

diff --git a/TODO b/TODO
index e6ded44..9f10670 100644
--- a/TODO
+++ b/TODO
@@ -3,14 +3,12 @@ regression tests
 Pass-by-value should be avoided for objects.
 Chemical treatment as base class for fragmentation and cleavage ?
 Maybe introduce factoring with parentheses.
-when clicking on Update in mass search dialog, set the radio widget to current selection.
 XpertCalc should be able to store formulas or masses.
 
 Should be able to open sequence files not .mxp, and if bad chars found, open the purification dialog.
 
 /tmp/buildd/massxpert-2.0.4/lib/polymer.cpp 1373 Failed to open file "/usr/share/massxpert/pol-seqs/protein-1-letter.mxp" for writing.
 Implement the feature that was in polyxmass: handling of multiple char code editing with TAB key.
-Whole radio button in mass search window has no effect if some region is selected.
 C:\devel\massxpert\gui\mzLabInputOligomerTreeView.cpp debug messages to be removed.
 Multi-character disambiguation with Ctrl+Enter does not work properly
 Update usermanual with Catalogue 1 in the xpm module.
diff --git a/gui/massSearchDlg.cpp b/gui/massSearchDlg.cpp
index 41e750b..f0c6ffa 100644
--- a/gui/massSearchDlg.cpp
+++ b/gui/massSearchDlg.cpp
@@ -63,11 +63,11 @@ namespace massXpert
   
     mp_editorWnd = static_cast<SequenceEditorWnd *>(parent);
   
-    updateSelectionData();
-    if (m_calcOptions.coordinateList().size() > 1)
-      m_ui.currentSelectionRadioButton->setChecked(true);
-
-
+    // Set the current whole/selected sequence data in the
+    // m_calcOptions instance and in the corresponding widgets (true =
+    // read from sequence editor window).
+    updateSelectionData(true);
+    
     m_monoTolerance = 0;
     m_avgTolerance = 0;
   
@@ -210,7 +210,7 @@ namespace massXpert
     connect(m_ui.updateCurrentSelectionDataPushButton,
 	     SIGNAL(clicked()),
 	     this,
-	     SLOT(updateSelectionData()));
+	     SLOT(updateWholeSelectedSequenceData()));
 
 
     // MONO set of filtering widgets
@@ -330,12 +330,58 @@ namespace massXpert
     return true;
   }
 
+  void
+  MassSearchDlg::updateWholeSelectedSequenceData()
+  {
+    updateSelectionData(true);
+  }
+  
 
   bool 
-  MassSearchDlg::updateSelectionData()
+  MassSearchDlg::updateSelectionData(bool fromSequenceEditor)
   {
-    // There might be more than one region selections. So get all
-    // these coordinates !
+    // There are two situations: 
+
+    // 1. This function is called from the constructor to setup data
+    // in the whole/selected sequence groupBox widget. It gets the
+    // info directly from the sequence editor window
+    // (fromSequenceEditor = true). By default the param is true,
+    // because this is expected for when this slot is called upon
+    // clicking on the Update button.
+
+    // 2. This function is called only to set the whole/selected
+    // sequence data in the calculation options instance. The data are
+    // read directly from the widgets and the sequence editor window
+    // is not probed. 
+
+    if (!fromSequenceEditor)
+      {
+	// Only update that whole/selected sequence data in the
+	// m_calcOptions from the widgettry and not from the
+	// sequence. Because the user cannot modify the selection text
+	// in the line edit widget, all we need to know is: whole or
+	// selected sequence.
+
+	if (m_ui.wholeSequenceRadioButton->isChecked())
+	  {
+	    // Set the "selection" to be the whole sequence.
+	    
+	    Coordinates coordinates(0, mp_polymer->size() - 1);
+	    m_calcOptions.setCoordinateList(coordinates);
+	    
+	    m_ui.wholeSequenceRadioButton->setChecked(true);
+
+	    return true;
+	  }
+	// Else, we do not need to do anything. The selection is
+	// updated by clicking onto the Update button.
+
+	return true;
+      }
+
+    // At this point, we are asked to update the whole/selected
+    // sequence data directly from the sequence editor window. So get
+    // all these coordinates !
 	
     CoordinateList coordList;
 
@@ -384,6 +430,8 @@ namespace massXpert
 	    
 	    m_calcOptions.setCoordinateList(*coordinates);
 	  }
+
+	m_ui.currentSelectionRadioButton->setChecked(true);
       }
     else
       {
@@ -739,9 +787,10 @@ namespace massXpert
     // Update the options from the parent window.
     m_calcOptions = mp_editorWnd->calcOptions();
     
-    // Update the currently selected region(s) if any in the sequence
-    // editor.
-    updateSelectionData();
+    // Set the current whole/selected sequence data in the
+    // m_calcOptions instance (false = no read from sequence editor
+    // window).
+    updateSelectionData(false);
     
     updateIonizationData();
   
diff --git a/gui/massSearchDlg.hpp b/gui/massSearchDlg.hpp
index f6267de..3c2f372 100644
--- a/gui/massSearchDlg.hpp
+++ b/gui/massSearchDlg.hpp
@@ -137,6 +137,8 @@ namespace massXpert
     void freeAllOligomerLists();
     void emptyAllMassLists();
 
+    bool updateSelectionData(bool = true);
+
     // The results-exporting functions. ////////////////////////////////
     void prepareResultsTxtString();
     bool exportResultsClipboard();
@@ -145,8 +147,9 @@ namespace massXpert
     //////////////////////////////////// The results-exporting functions.
 
   public slots:
-    bool updateSelectionData();
 
+    void updateWholeSelectedSequenceData();
+    
     void search();
     void abort();
 

-- 
massXpert mass spectrometry suite: debian packaging



More information about the Debichem-commits mailing list