diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-02-02 23:35:01 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-02-02 23:35:01 +0000 |
commit | 4b47768eced03ce4e2689e690780c89d5a176af8 (patch) | |
tree | 6384dcdb8a4466bf6f7d88ba081fa3df4b16b514 | |
parent | bd4a258fe7b89bba948f9f5e6163b0f55ea62b76 (diff) | |
download | poezio-4b47768eced03ce4e2689e690780c89d5a176af8.tar.gz poezio-4b47768eced03ce4e2689e690780c89d5a176af8.tar.bz2 poezio-4b47768eced03ce4e2689e690780c89d5a176af8.tar.xz poezio-4b47768eced03ce4e2689e690780c89d5a176af8.zip |
fixed #1147
-rw-r--r-- | src/gui.py | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -175,6 +175,7 @@ class Gui(object): 'avail': (self.command_avail, _('Usage: /avail [message]\nAvail: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), 'available': (self.command_avail, _('Usage: /available [message]\nAvailable: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), 'bookmark': (self.command_bookmark, _('Usage: /bookmark [roomname][/nick]\nBookmark: Bookmark the specified room (you will then auto-join it on each poezio start). This commands uses the same syntaxe as /nick. Type /help nick for syntaxe examples. Note that when typing "/bookmark" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)')), + 'set': (self.command_set, _('Usage: /set <option> <value>\nSet: Sets the value to the option in your configuration file. You can, for example, change your default nickname by doing `/set default_nick toto` or your resource with `/set resource`')), 'nick': (self.command_nick, _('Usage: /nick <nickname>\nNick: Change your nickname in the current room')) } @@ -323,10 +324,7 @@ class Gui(object): else: msg = room.on_presence(stanza, from_nick) if room == self.current_room(): - try: - self.window.text_win.add_line(room, (datetime.now(), msg)) - except: - pass + self.window.text_win.add_line(room, (datetime.now(), msg)) self.window.text_win.refresh(room.name) self.window.user_win.refresh(room.users) self.window.text_win.refresh() @@ -420,6 +418,20 @@ class Gui(object): res = roomname config.setAndSave('rooms', bookmarked+':'+res) + def command_set(self, args): + if len(args) != 2: + self.command_help(['set']) + return + option = args[0] + value = args[1] + config.setAndSave(option, value) + msg = "%s=%s" % (option, value) + room = self.current_room() + room.add_info(msg) + self.window.text_win.add_line(room, (datetime.now(), msg)) + self.window.text_win.refresh(room.name) + self.window.input.refresh() + def command_show(self, args): possible_show = {'avail':'None', 'available':'None', |