From e0fcaeac86f34f12dc86ebcf2310244f79361ea2 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 29 May 2011 02:15:52 +0200 Subject: fixes #2153 Remove the anon-specific tab --- src/core.py | 3 +-- src/tabs.py | 71 ------------------------------------------------------------- 2 files changed, 1 insertion(+), 73 deletions(-) (limited to 'src') diff --git a/src/core.py b/src/core.py index 1da52b21..4430d280 100644 --- a/src/core.py +++ b/src/core.py @@ -185,8 +185,7 @@ class Core(object): tabs.Tab.resize(self.stdscr) # resize the information_win to its initial size self.resize_global_information_win() - default_tab = tabs.InfoTab() if self.xmpp.anon\ - else tabs.RosterInfoTab() + default_tab = tabs.RosterInfoTab() default_tab.on_gain_focus() self.tabs.append(default_tab) self.information(_('Welcome to poezio!')) diff --git a/src/tabs.py b/src/tabs.py index 3c8bfdff..083dc193 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -356,77 +356,6 @@ class ChatTab(Tab): def command_say(self, line): raise NotImplementedError -class InfoTab(ChatTab): - """ - The information tab, used to display global informations - when using a anonymous account - """ - def __init__(self): - Tab.__init__(self) - self.tab_win = windows.GlobalInfoBar() - self.input = windows.Input() - self.name = "Info" - self.color_state = theme.COLOR_TAB_NORMAL - self.key_func['^M'] = self.on_enter - self.key_func['^I'] = self.completion - self.key_func['M-i'] = self.completion - self.resize() - - def resize(self): - if not self.visible: - return - self.tab_win.resize(1, self.width, self.height-2, 0) - self.info_win.resize(self.height-2, self.width, 0, 0) - self.input.resize(1, self.width, self.height-1, 0) - - def refresh(self): - if not self.visible: - return - if self.need_resize: - self.resize() - log.debug(' TAB Refresh: %s'%self.__class__.__name__) - self.info_win.refresh(self.core.informations) - self.tab_win.refresh() - self.input.refresh() - - def completion(self): - self.complete_commands(self.input) - - def get_name(self): - return self.name - - def get_color_state(self): - return self.color_state - - def set_color_state(self, color): - return - - def on_input(self, key): - if key in self.key_func: - self.key_func[key]() - return False - self.input.do_command(key) - return False - - def on_enter(self): - self.execute_command(self.input.key_enter()) - - def on_lose_focus(self): - self.color_state = theme.COLOR_TAB_NORMAL - - def on_gain_focus(self): - self.color_state = theme.COLOR_TAB_CURRENT - curses.curs_set(1) - - def on_scroll_up(self): - pass - - def on_scroll_down(self): - pass - - def on_info_win_size_changed(self): - return - class MucTab(ChatTab): """ The tab containing a multi-user-chat room. -- cgit v1.2.3