thomas - r7274 - in flumotion/trunk: . flumotion/component/base

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Sun Aug 24 17:51:33 CEST 2008


Author: thomas
Date: Sun Aug 24 17:51:33 2008
New Revision: 7274

Log:
	* flumotion/component/base/baseadminnode.py:
	  Make the id of render errors unique by using the title of the
	  Node.  This makes sure that render error messages from one node
	  do not get removed by the successful rendering of another node,
	  both deriving from the same base class.



Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/base/baseadminnode.py

Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Sun Aug 24 17:51:33 2008
@@ -1,5 +1,13 @@
 2008-08-24  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* flumotion/component/base/baseadminnode.py:
+	  Make the id of render errors unique by using the title of the
+	  Node.  This makes sure that render error messages from one node
+	  do not get removed by the successful rendering of another node,
+	  both deriving from the same base class.
+
+2008-08-24  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* flumotion/admin/gtk/adminwindow.py:
 	  Make docstrings adhere to style guide.
 	  Document the fact that _componentDo can also take a None state,

Modified: flumotion/trunk/flumotion/component/base/baseadminnode.py
==============================================================================
--- flumotion/trunk/flumotion/component/base/baseadminnode.py	(original)
+++ flumotion/trunk/flumotion/component/base/baseadminnode.py	Sun Aug 24 17:51:33 2008
@@ -218,10 +218,14 @@
 
         Returns: a deferred returning the main widget for embedding
         """
+        self.debug('BaseAdminGtkNode.render() for %s' % self.title)
+
         # clear up previous error messages
         allmessages = self.state.get('messages', [])
         for message in allmessages:
-            if message.id == 'render':
+            # since we can have multiple nodes, only remove the one from
+            # ours; this assumes each node's title is unique for a component
+            if message.id == 'render-%s' % self.title:
                 self.debug('Removing previous messages %r' % message)
                 self.state.observe_remove('messages', message)
 
@@ -232,7 +236,7 @@
             m = messages.Error(T_(N_(
                 "Internal error in component UI.  "
                 "Please file a bug against the component.")),
-                debug=debug, mid="render")
+                debug=debug, mid="render-%s" % self.title)
             self.addMessage(m)
 
             label = gtk.Label(_("Internal error.\nSee component error "


More information about the flumotion-commit mailing list