From cc5de9de7b109c49e7e7e1f18f7d89bc4721c0a2 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 29 Jul 2010 07:55:34 -0400 Subject: [PATCH] Argument-less command execution in GUI working! --- hooke/ui/gui/__init__.py | 2 +- hooke/ui/gui/panel/commands.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hooke/ui/gui/__init__.py b/hooke/ui/gui/__init__.py index dc21ebf..d9706f2 100644 --- a/hooke/ui/gui/__init__.py +++ b/hooke/ui/gui/__init__.py @@ -155,7 +155,6 @@ class HookeFrame (wx.Frame): # size=wx.Size(150, 90), # style=wx.NO_BORDER|wx.TE_MULTILINE), 'right'), ('output', panel.PANELS['output']( - buffer_lines=5, parent=self, pos=wx.Point(0, 0), size=wx.Size(150, 90), @@ -655,6 +654,7 @@ class HookeFrame (wx.Frame): # Command panel interface def select_command(self, _class, method, command): + return self.select_plugin(plugin=command.plugin) plugin = self.GetItemText(selected_item) if plugin != 'core': diff --git a/hooke/ui/gui/panel/commands.py b/hooke/ui/gui/panel/commands.py index 8408409..b8bae8d 100644 --- a/hooke/ui/gui/panel/commands.py +++ b/hooke/ui/gui/panel/commands.py @@ -129,12 +129,12 @@ class Tree (wx.TreeCtrl): in_callback(self, command) def execute(self): - item = self.GetSelection() - if item.IsOk(): - if not self.ItemHasChildren(item): - item_text = self.GetItemText(item) - # TODO: generate args - in_callback(self, command, args) + _id = self.GetSelection() + name = self._name_for_id[self._canonical_id(_id)] + if self._is_command(name): + command = self._commands[name] + args = {} # TODO: generate args + in_callback(self, command, args) class CommandsPanel (Panel, wx.Panel): -- 2.26.2