Author: bugman Date: Mon Sep 19 13:04:08 2011 New Revision: 14693 URL: http://svn.gna.org/viewcvs/relax?rev=14693&view=rev Log: Fix for the updating of analysis tabs with the deletion of data pipes. The delete_analysis() method now decreases the _num_analyses and _current values at the very start. Modified: 1.3/gui/analyses/__init__.py Modified: 1.3/gui/analyses/__init__.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/analyses/__init__.py?rev=14693&r1=14692&r2=14693&view=diff ============================================================================== --- 1.3/gui/analyses/__init__.py (original) +++ 1.3/gui/analyses/__init__.py Mon Sep 19 13:04:08 2011 @@ -177,6 +177,13 @@ @type index: int """ + # Decrement the number of analyses. + self._num_analyses -= 1 + + # Shift the current page back one if necessary. + if self._current > index: + self._current -= 1 + # Execute the analysis delete method, if it exists. if hasattr(self._analyses[index], 'delete'): self._analyses[index].delete() @@ -194,16 +201,9 @@ # Delete the tab object. self._analyses.pop(index) - # Decrement the number of analyses. - self._num_analyses -= 1 - # The current page has been deleted, so switch one back (if possible). if index == self._current and self._current != 0: self.switch_page(self._current-1) - - # Shift the current page back one if necessary. - if self._current > index: - self._current -= 1 # No more analyses, so in the initial state. if self._num_analyses == 0: