Author: reinhard Date: 2010-10-28 15:59:53 -0500 (Thu, 28 Oct 2010) New Revision: 10229
Modified: trunk/gnue-forms/ trunk/gnue-forms/src/GFObjects/commanders.py Log: Fix for cases where actions are enabled or disabled before the UI is created. Property changes on: trunk/gnue-forms ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2010-10-28 21:46:06.186000109 +0200 committer: Reinhard Müller <[email protected]> properties: branch-nick: forms + timestamp: 2010-10-28 22:58:55.194000006 +0200 committer: Reinhard Müller <[email protected]> properties: branch-nick: forms Name: bzr:file-ids - src/GFObjects/GFField.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFField.py + src/GFObjects/commanders.py 8...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2Fcommanders.py Name: bzr:revision-id:v4 - 3116 [email protected] 3117 [email protected] 3118 [email protected] 3119 [email protected] 3120 [email protected] 3121 [email protected] 3122 [email protected] 3123 [email protected] 3124 [email protected] 3125 [email protected] 3126 [email protected] 3127 [email protected] 3128 [email protected] 3129 [email protected] 3130 [email protected] 3131 [email protected] 3132 [email protected] 3133 [email protected] 3134 [email protected] 3135 [email protected] 3136 [email protected] 3137 [email protected] 3138 [email protected] 3139 [email protected] 3140 [email protected] 3141 [email protected] 3142 [email protected] 3143 [email protected] 3144 [email protected] 3145 [email protected] 3146 [email protected] + 3116 [email protected] 3117 [email protected] 3118 [email protected] 3119 [email protected] 3120 [email protected] 3121 [email protected] 3122 [email protected] 3123 [email protected] 3124 [email protected] 3125 [email protected] 3126 [email protected] 3127 [email protected] 3128 [email protected] 3129 [email protected] 3130 [email protected] 3131 [email protected] 3132 [email protected] 3133 [email protected] 3134 [email protected] 3135 [email protected] 3136 [email protected] 3137 [email protected] 3138 [email protected] 3139 [email protected] 3140 [email protected] 3141 [email protected] 3142 [email protected] 3143 [email protected] 3144 [email protected] 3145 [email protected] 3146 [email protected] 3147 [email protected] Name: bzr:text-parents - src/GFObjects/GFField.py [email protected] + src/GFObjects/commanders.py svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10149 Modified: trunk/gnue-forms/src/GFObjects/commanders.py =================================================================== --- trunk/gnue-forms/src/GFObjects/commanders.py 2010-10-28 19:46:32 UTC (rev 10228) +++ trunk/gnue-forms/src/GFObjects/commanders.py 2010-10-28 20:59:53 UTC (rev 10229) @@ -83,11 +83,8 @@ #: operation of the commander. self.__action_off = None - #: Whether the UI widget is enabled or not. The UIxxx implementations - #: read this variable on initialisation; if at some point the UI - #: widgets are initialized with parameters, this variable can be made - #: private. - self._ui_enabled = False + #: Whether the UI widget is enabled or not. + self.__ui_enabled = False self._inits.append(self._phase_2_init_) @@ -131,7 +128,7 @@ # Set a variable to determine whether the UI widget should be # enabled or not. if self.action_off is None or not self.state: - self._ui_enabled = self.enabled and self.__action.enabled + self.__ui_enabled = self.enabled and self.__action.enabled # Link to action_off object if self.action_off is not None: @@ -144,7 +141,7 @@ # Set a variable to determine whether the UI widget should be # enabled or not. if self.state: - self._ui_enabled = self.enabled and self.__action_off.enabled + self.__ui_enabled = self.enabled and self.__action_off.enabled # ------------------------------------------------------------------------- @@ -278,10 +275,11 @@ else: new_ui_enabled = False - if new_ui_enabled != self._ui_enabled: + if new_ui_enabled != self.__ui_enabled: if self.uiWidget is not None: self.uiWidget._ui_set_enabled_(new_ui_enabled) - self._ui_enabled = new_ui_enabled + # Store this only if the uiWidget already exists. + self.__ui_enabled = new_ui_enabled # ------------------------------------------------------------------------- _______________________________________________ commit-gnue mailing list [email protected] http://lists.gnu.org/mailman/listinfo/commit-gnue
