Commit 086cc82e authored by louiz’'s avatar louiz’

/close command closes MucListTab

parent c2d1bf21
...@@ -1136,11 +1136,14 @@ class MucListTab(Tab): ...@@ -1136,11 +1136,14 @@ class MucListTab(Tab):
self.input = self.default_help_message self.input = self.default_help_message
self.key_func["KEY_DOWN"] = self.listview.move_cursor_down self.key_func["KEY_DOWN"] = self.listview.move_cursor_down
self.key_func["KEY_UP"] = self.listview.move_cursor_up self.key_func["KEY_UP"] = self.listview.move_cursor_up
self.key_func['^I'] = self.completion
self.key_func['M-i'] = self.completion
self.key_func["/"] = self.on_slash self.key_func["/"] = self.on_slash
self.key_func['j'] = self.join_selected self.key_func['j'] = self.join_selected
self.key_func['J'] = self.join_selected_no_focus self.key_func['J'] = self.join_selected_no_focus
self.key_func['^J'] = self.join_selected self.key_func['^J'] = self.join_selected
self.key_func['^M'] = self.join_selected self.key_func['^M'] = self.join_selected
self.commands['close'] = (self.close, _("Usage: /close\nClose: Just close this tab"), None)
self.resize() self.resize()
def refresh(self, tabs, informations, roster): def refresh(self, tabs, informations, roster):
...@@ -1176,6 +1179,9 @@ class MucListTab(Tab): ...@@ -1176,6 +1179,9 @@ class MucListTab(Tab):
self.input.resize(1, self.width, self.height-1, 0, self.core.stdscr) self.input.resize(1, self.width, self.height-1, 0, self.core.stdscr)
self.input.do_command("/") # we add the slash self.input.do_command("/") # we add the slash
def close(self, arg=None):
self.core.close_tab(self)
def join_selected_no_focus(self): def join_selected_no_focus(self):
return return
...@@ -1217,13 +1223,16 @@ class MucListTab(Tab): ...@@ -1217,13 +1223,16 @@ class MucListTab(Tab):
return True return True
def execute_slash_command(self, txt): def execute_slash_command(self, txt):
if txt.startswith('/'): self.execute_command(txt)
self.core.execute(txt)
return self.reset_help_message() return self.reset_help_message()
def get_name(self): def get_name(self):
return self.name return self.name
def completion(self):
if isinstance(self.input, windows.CommandInput):
self.complete_commands(self.input)
def on_input(self, key): def on_input(self, key):
res = self.input.do_command(key) res = self.input.do_command(key)
if res: if res:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment