diff options
author | Ninad Sathaye <ninad@nanorex.com> | 2008-09-29 17:55:16 +0000 |
---|---|---|
committer | Ninad Sathaye <ninad@nanorex.com> | 2008-09-29 17:55:16 +0000 |
commit | 1b16edd05956c1c53f6402dcc16904c2a3c4d0b9 (patch) | |
tree | ccbf4e6afb41ddd155c3b2de40d6c0bc8b1ef73f | |
parent | dc0665880730659ce28757d9b0b5eaae1a96848e (diff) | |
download | nanoengineer-1b16edd05956c1c53f6402dcc16904c2a3c4d0b9.tar.gz nanoengineer-1b16edd05956c1c53f6402dcc16904c2a3c4d0b9.zip |
misc changes to remove old command API methods/calls/ comments
-rw-r--r-- | cad/src/command_support/EditCommand.py | 3 | ||||
-rw-r--r-- | cad/src/command_support/EditCommand_PM.py | 1 | ||||
-rw-r--r-- | cad/src/command_support/Motor_EditCommand.py | 40 | ||||
-rwxr-xr-x | cad/src/commands/BuildCrystal/BuildCrystal_Command.py | 4 | ||||
-rwxr-xr-x | cad/src/commands/Extrude/extrudeMode.py | 4 | ||||
-rwxr-xr-x | cad/src/commands/PlayMovie/movieMode.py | 4 | ||||
-rwxr-xr-x | cad/src/ne1_ui/MWsemantics.py | 9 | ||||
-rwxr-xr-x | cad/src/operations/ops_view.py | 1 | ||||
-rwxr-xr-x | cad/src/prototype/test_commands.py | 23 | ||||
-rwxr-xr-x | cad/src/prototype/test_commands_init.py | 1 |
10 files changed, 11 insertions, 79 deletions
diff --git a/cad/src/command_support/EditCommand.py b/cad/src/command_support/EditCommand.py index 63bb96db4..981c58a59 100644 --- a/cad/src/command_support/EditCommand.py +++ b/cad/src/command_support/EditCommand.py @@ -126,8 +126,7 @@ class EditCommand(Select_Command): def create_and_or_show_PM_if_wanted(self, showPropMgr = True): """ Create the property manager object if one doesn't already exist - and then (if not USE_COMMAND_STACK) show the propMgr if wanted - by the user + and then show the propMgr if wanted by the user @param showPropMgr: If True, show the property manager @type showPropMgr: boolean diff --git a/cad/src/command_support/EditCommand_PM.py b/cad/src/command_support/EditCommand_PM.py index 35d0ac095..686c087c3 100644 --- a/cad/src/command_support/EditCommand_PM.py +++ b/cad/src/command_support/EditCommand_PM.py @@ -21,7 +21,6 @@ from ne1_ui.NE1_QWidgetAction import NE1_QWidgetAction #debug flag to keep signals always connected from utilities.GlobalPreferences import KEEP_SIGNALS_ALWAYS_CONNECTED -from utilities.GlobalPreferences import USE_COMMAND_STACK class EditCommand_PM(PM_Dialog): """ diff --git a/cad/src/command_support/Motor_EditCommand.py b/cad/src/command_support/Motor_EditCommand.py index 9b123a65a..06362d481 100644 --- a/cad/src/command_support/Motor_EditCommand.py +++ b/cad/src/command_support/Motor_EditCommand.py @@ -14,8 +14,6 @@ TODO: from command_support.EditCommand import EditCommand from commands.SelectAtoms.SelectAtoms_GraphicsMode import SelectAtoms_GraphicsMode -from utilities.GlobalPreferences import USE_COMMAND_STACK - _superclass = EditCommand class Motor_EditCommand(EditCommand): """ @@ -53,40 +51,4 @@ class Motor_EditCommand(EditCommand): self.struct = None _superclass.command_entered(self) self.o.assy.permit_pick_atoms() - - #Old command API methods (in if not USE_COMMAND_STACK condition block) - if not USE_COMMAND_STACK: - def Enter(self): - """ - Enter this command. - @see: EditCommand.Enter - """ - #See EditCommand.Enter for a detailed comment on why self.struct is - #set to None while entering this command. - #May not be needed for RotaryMotor and Linear motor edit commands, - # but safe to do it for now -- Ninad 2008-01-14 - if self.struct: - self.struct = None - EditCommand.Enter(self) - self.o.assy.permit_pick_atoms() - - def init_gui(self): - """ - NOT IMPLEMENTED YET. - TODO: Move calls that create/ show PM in EditCommand.createStructure - out of that method. (That code was written before converting the - editCommands into 'Commands'. After this conversion, a better - implementation is necessary, in which PM creation and - display will be handled in init_gui method. - """ - #Note: This method overrides EditCommand.init_gui. This is just to - #prevent the call of self.create_and_or_show_PM_if_wanted. , As that - # method is called in self.createStructure. (to be cleaned up) - pass - - def restore_gui(self): - """ - """ - if self.propMgr: - self.propMgr.close() - +
\ No newline at end of file diff --git a/cad/src/commands/BuildCrystal/BuildCrystal_Command.py b/cad/src/commands/BuildCrystal/BuildCrystal_Command.py index 80ef7ca9a..e21c7f31e 100755 --- a/cad/src/commands/BuildCrystal/BuildCrystal_Command.py +++ b/cad/src/commands/BuildCrystal/BuildCrystal_Command.py @@ -1080,10 +1080,10 @@ class BuildCrystal_Command(basicMode): def makeMenus(self): self.Menu_spec = [ - ('Cancel', self.Cancel), + ('Cancel', self.command_Cancel), ('Start Over', self.StartOver), ('Backup', self._Backup), - ('Done', self.Done), # bruce 041217 + ('Done', self.command_Done), # bruce 041217 #None, #('Add New Layer', self.addLayer), # bruce 041103 removed Copy, per Ninad email; diff --git a/cad/src/commands/Extrude/extrudeMode.py b/cad/src/commands/Extrude/extrudeMode.py index 078022305..d87c60959 100755 --- a/cad/src/commands/Extrude/extrudeMode.py +++ b/cad/src/commands/Extrude/extrudeMode.py @@ -1713,9 +1713,9 @@ class extrudeMode(basicMode): def makeMenus(self): #e not yet reviewed for being good choices of what needs including in extrude cmenu self.Menu_spec = [ - ('Cancel', self.Cancel), + ('Cancel', self.command_Cancel), ('Start Over', self.StartOver), - ('Done', self.Done), #bruce 041217 + ('Done', self.command_Done), #bruce 041217 ] self.debug_Menu_spec = [ diff --git a/cad/src/commands/PlayMovie/movieMode.py b/cad/src/commands/PlayMovie/movieMode.py index afcc20d08..4b06f0bb2 100755 --- a/cad/src/commands/PlayMovie/movieMode.py +++ b/cad/src/commands/PlayMovie/movieMode.py @@ -286,9 +286,9 @@ class movieMode(basicMode): def makeMenus(self): self.Menu_spec = [ - ('Cancel', self.Cancel), + ('Cancel', self.command_Cancel), ('Reset Movie', self.ResetMovie), - ('Done', self.Done), + ('Done', self.command_Done), None, ('Edit Color Scheme...', self.w.colorSchemeCommand), ] diff --git a/cad/src/ne1_ui/MWsemantics.py b/cad/src/ne1_ui/MWsemantics.py index f49cebaba..149fe2ce8 100755 --- a/cad/src/ne1_ui/MWsemantics.py +++ b/cad/src/ne1_ui/MWsemantics.py @@ -1860,13 +1860,10 @@ class MWsemantics(QMainWindow, """ @note: called from several places, including ok_btn_clicked (and in some cases, cancel_btn_clicked) of PM_Dialog and its - subclasses, and (when not USE_COMMAND_STACK) the "Exit xxx" - toolbuttons (e.g. Exit DNA) via a signal set up in - Ui_AbstractFlyout.py. + subclasses - When USE_COMMAND_STACK is true, the calls from - ok_btn_clicked and cancel_btn_clicked methods are probably - correct, but are deprecated, and should be replaced by calls of + The calls from ok_btn_clicked and cancel_btn_clicked methods are + probablycorrect, but are deprecated, and should be replaced by calls of self.command.command_Done (where self is the calling PM). """ #bruce 080815/080827 docstring diff --git a/cad/src/operations/ops_view.py b/cad/src/operations/ops_view.py index 4a0828654..c80cc973b 100755 --- a/cad/src/operations/ops_view.py +++ b/cad/src/operations/ops_view.py @@ -24,7 +24,6 @@ from utilities.prefs_constants import ORTHOGRAPHIC from utilities.prefs_constants import PERSPECTIVE from model.NamedView import NamedView from model.PovrayScene import PovrayScene -from utilities.GlobalPreferences import USE_COMMAND_STACK class viewSlotsMixin: """ diff --git a/cad/src/prototype/test_commands.py b/cad/src/prototype/test_commands.py index f24ab7ffa..c6e33afac 100755 --- a/cad/src/prototype/test_commands.py +++ b/cad/src/prototype/test_commands.py @@ -48,7 +48,6 @@ from PM.PM_WidgetsDemoPropertyManager import PM_WidgetsDemoPropertyManager from command_support.GraphicsMode import GraphicsMode from command_support.Command import Command -from utilities.GlobalPreferences import USE_COMMAND_STACK # == @@ -89,28 +88,6 @@ class ExampleCommand(_superclass): command_level = CL_EDIT_GENERIC __abstract_command_class = True - if not USE_COMMAND_STACK: - def init_gui(self): - print "init_gui in", self ### - # note: propMgr is initialized to None in our superclass anyMode - if self.PM_class and not self.propMgr: - self.propMgr = self.PM_class(self) - _superclass.init_gui(self) # this fixed the "disconnect without connect" bug - #[when _superclass was SelectAtoms_Command anyway] - #k will we need to do this first not last? or not do all of it? seems ok so far. - if self.propMgr: - self.propMgr.show() - return - - def restore_gui(self): - print "restore_gui in", self ### - if self.propMgr: - self.propMgr.close() # removes PM tab -- better than the prior .hide() call [bruce 070829] - _superclass.restore_gui(self) # this apparently worked even when it called init_gui by mistake!! - return - - pass - # == ##class _Example_TemporaryCommand_useParentPM(ExampleCommand): diff --git a/cad/src/prototype/test_commands_init.py b/cad/src/prototype/test_commands_init.py index e8b45e579..1434c6719 100755 --- a/cad/src/prototype/test_commands_init.py +++ b/cad/src/prototype/test_commands_init.py @@ -15,7 +15,6 @@ from utilities.debug import register_debug_menu_command import utilities.EndUser as EndUser, utilities.Initialize as Initialize -from utilities.GlobalPreferences import USE_COMMAND_STACK # == |