mailr14564 - /1.3/gui/relax_gui.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 01, 2011 - 13:11:
Author: bugman
Date: Thu Sep  1 13:11:42 2011
New Revision: 14564

URL: http://svn.gna.org/viewcvs/relax?rev=14564&view=rev
Log:
The results viewer window no longer shows 1 warning dialog per results file.

At the end of the analysis, one warning dialog per results file was being 
shown as the execution
lock was on.  Now a special method for the 'result_file' observer object has 
been added which
skips this dialog.


Modified:
    1.3/gui/relax_gui.py

Modified: 1.3/gui/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/relax_gui.py?rev=14564&r1=14563&r2=14564&view=diff
==============================================================================
--- 1.3/gui/relax_gui.py (original)
+++ 1.3/gui/relax_gui.py Thu Sep  1 13:11:42 2011
@@ -147,7 +147,7 @@
 
         # Register functions with the observer objects.
         status.observers.pipe_alteration.register('status bar', 
self.update_status_bar)
-        status.observers.result_file.register('gui', 
self.show_results_viewer)
+        status.observers.result_file.register('gui', 
self.show_results_viewer_no_warn)
 
 
     def about_gui(self, event):
@@ -447,14 +447,18 @@
         """
 
         # Show the results viewer in a thread safe way.
-        wx.CallAfter(self.show_results_viewer_safe)
-
-
-    def show_results_viewer_safe(self):
-        """Display the analysis results in a thread safe wx.CallAfter 
call."""
+        wx.CallAfter(self.show_results_viewer_safe, warn=True)
+
+
+    def show_results_viewer_safe(self, warn=False):
+        """Display the analysis results in a thread safe wx.CallAfter call.
+
+        @keyword warn:  A flag which if True will cause a message dialog to 
appear warning about keeping the window open with the execution lock.
+        @type warn:     bool
+        """
 
         # Throw a warning if the execution lock is on.
-        if status.exec_lock.locked():
+        if warn and status.exec_lock.locked():
             dlg = wx.MessageDialog(self, "Leaving the results viewer window 
open will slow down the calculations.", caption="Warning", 
style=wx.OK|wx.ICON_EXCLAMATION|wx.STAY_ON_TOP)
             wx.CallAfter(dlg.ShowModal)
 
@@ -465,6 +469,13 @@
         # Open the window.
         if status.show_gui and not self.results_viewer.IsShown():
             self.results_viewer.Show()
+
+
+    def show_results_viewer_no_warn(self):
+        """Display the analysis results."""
+
+        # Show the results viewer in a thread safe way with no warning 
dialog.
+        wx.CallAfter(self.show_results_viewer_safe, warn=False)
 
 
     def show_tree(self, event):




Related Messages


Powered by MHonArc, Updated Thu Sep 01 13:20:02 2011