From 22ad96e7aa06e03d380f35d66212cea713dff0f2 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 12 Jan 2011 17:19:14 +0100 Subject: Clean up the on_enter methods. fixed #2101 --- src/tabs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 845b50a8..92b6f9c5 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -95,7 +95,7 @@ class Tab(object): return True return False - def on_enter(self, provided_text=None): + def execute_command(self, provided_text): """ Execute the command in the input and return False if the input didn't contain a command @@ -246,7 +246,7 @@ class ChatTab(Tab): def on_enter(self): txt = self.input.key_enter() - if not Tab.on_enter(self, txt): + if not self.execute_command(txt): self.command_say(txt) def command_say(self, line): @@ -306,6 +306,9 @@ class InfoTab(ChatTab): self.input.do_command(key) return False + def on_enter(self): + self.execute_command(self.input_enter_key()) + def on_lose_focus(self): self.color_state = theme.COLOR_TAB_NORMAL @@ -915,7 +918,7 @@ class RosterInfoTab(Tab): def execute_slash_command(self, txt): if txt.startswith('/'): - Tab.on_enter(self, txt) + self.execute_command(txt) return self.reset_help_message() def on_lose_focus(self): -- cgit v1.2.3