commands=self.commands,
selected=self.gui.config['selected command'],
callbacks={
- 'execute': self.execute_command,
+ 'execute': self.explicit_execute_command,
'select_plugin': self.select_plugin,
'select_command': self.select_command,
# 'selection_changed': self.panelProperties.select(self, method, command), #SelectedTreeItem = selected_item,
raise Exception('Multiple commands named "%s"' % name)
return cs[0]
+ def explicit_execute_command(self, _class=None, method=None,
+ command=None, args=None):
+ return self.execute_command(
+ _class=_class, method=method, command=command, args=args,
+ explicit_user_call=True)
+
def execute_command(self, _class=None, method=None,
- command=None, args=None):
+ command=None, args=None, explicit_user_call=False):
if args == None:
args = {}
if ('property editor' in self._c
if len(args[arg.name]) == 0:
args[arg.name] = arg.default
cm = CommandMessage(command.name, args)
- self.gui._submit_command(cm, self.inqueue)
+ self.gui._submit_command(
+ cm, self.inqueue, explicit_user_call=explicit_user_call)
+ # TODO: skip responses for commands that were captured by the
+ # command stack. We'd need to poll on each request, remember
+ # capture state, or add a flag to the response...
return self._handle_response(command_message=cm)
def _handle_response(self, command_message):