mailr14683 - /1.3/gui/controller.py


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

Header


Content

Posted by edward on September 19, 2011 - 10:41:
Author: bugman
Date: Mon Sep 19 10:41:47 2011
New Revision: 14683

URL: http://svn.gna.org/viewcvs/relax?rev=14683&view=rev
Log:
The relax controller is now shown on all errors and warning (or raised if 
below other windows).


Modified:
    1.3/gui/controller.py

Modified: 1.3/gui/controller.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/controller.py?rev=14683&r1=14682&r2=14683&view=diff
==============================================================================
--- 1.3/gui/controller.py (original)
+++ 1.3/gui/controller.py Mon Sep 19 10:41:47 2011
@@ -92,7 +92,7 @@
         self.log_queue = Queue()
 
         # Add the log panel.
-        self.log_panel = LogCtrl(self.main_panel, log_queue=self.log_queue, 
id=-1)
+        self.log_panel = LogCtrl(self.main_panel, self, 
log_queue=self.log_queue, id=-1)
         sizer.Add(self.log_panel, 1, wx.EXPAND|wx.ALL, 0)
 
         # IO redirection.
@@ -527,11 +527,13 @@
 class LogCtrl(wx.stc.StyledTextCtrl):
     """A special control designed to display relax output messages."""
 
-    def __init__(self, parent, log_queue=None, id=wx.ID_ANY, 
pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BORDER_SUNKEN, 
name=wx.stc.STCNameStr):
+    def __init__(self, parent, controller, log_queue=None, id=wx.ID_ANY, 
pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BORDER_SUNKEN, 
name=wx.stc.STCNameStr):
         """Set up the log control.
 
         @param parent:          The parent wx window object.
         @type parent:           Window
+        @param controller:      The controller window.
+        @type controller:       wx.Frame instance
         @keyword log_queue:     The queue of log messages.
         @type log_queue:        Queue.Queue instance
         @keyword id:            The wx ID.
@@ -547,7 +549,7 @@
         """
 
         # Store the args.
-        self.controller = parent
+        self.controller = controller
         self.log_queue = log_queue
 
         # Initialise the base class.
@@ -952,6 +954,17 @@
                 self.StartStyling(end - len_string, 31)
                 self.SetStyling(len_string, stream_list[i])
 
+            # Show the controller when there are errors or warnings.
+            if stream_list[i] in [1, 3] and status.show_gui:
+                # Bring the window to the front.
+                if self.controller.IsShown():
+                    self.controller.Show()
+                    self.controller.Raise()
+
+                # Open the window.
+                else:
+                    self.controller.Show()
+
         # Limit the scroll back.
         self.limit_scrollback()
 




Related Messages


Powered by MHonArc, Updated Mon Sep 19 11:00:02 2011