diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-03-19 02:06:51 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-03-19 02:06:51 +0000 |
commit | d25f061a8bfc71317f045c6b78d98777cd871098 (patch) | |
tree | 5a6f0129715e0970105d1297521b757fbae95fdf /src/gui.py | |
parent | ef58ef0e462c99b47c6da0133cf14728aa0a4a42 (diff) | |
download | poezio-d25f061a8bfc71317f045c6b78d98777cd871098.tar.gz poezio-d25f061a8bfc71317f045c6b78d98777cd871098.tar.bz2 poezio-d25f061a8bfc71317f045c6b78d98777cd871098.tar.xz poezio-d25f061a8bfc71317f045c6b78d98777cd871098.zip |
back to a non-bugged version, PLEASE test and report ANY regression
Diffstat (limited to 'src/gui.py')
-rw-r--r-- | src/gui.py | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -103,6 +103,7 @@ class Gui(object): def main_loop(self, stdscr): while 1: stdscr.leaveok(1) + self.window.input.win.move(0, self.window.input.pos) curses.doupdate() try: key = stdscr.getkey() @@ -241,6 +242,7 @@ class Gui(object): self.add_info(room, nick_from + ' ' + body[4:], date) else: self.add_message(room, nick_from, body, date) + self.window.input.refresh() curses.doupdate() def room_presence(self, stanza): @@ -312,6 +314,8 @@ class Gui(object): self.add_info(room, _('%(nick)s changed his/her status : %(a)s, %(b)s, %(c)s, %(d)s') % {'nick':from_nick, 'a':affiliation, 'b':role, 'c':show, 'd':status}) if room == self.current_room(): self.window.user_win.refresh(room.users) + self.window.input.refresh() + curses.doupdate() def add_info(self, room, info, date=None): """ @@ -319,20 +323,24 @@ class Gui(object): (displays it immediately AND saves it for redisplay in futur refresh) """ + if not date: + date = datetime.now() msg = room.add_info(info, date) - self.window.text_win.add_line(room, (datetime.now(), msg)) + self.window.text_win.add_line(room, (date, msg)) if room.name == self.current_room().name: self.window.text_win.refresh(room.name) self.window.input.refresh() curses.doupdate() - else: - self.window.info_win.refresh(self.rooms, self.current_room()) - def add_message(self, room, nick_from, body, date): + def add_message(self, room, nick_from, body, date=None): + if not date: + date = datetime.now() color = room.add_message(nick_from, body, date) self.window.text_win.add_line(room, (date, nick_from.encode('utf-8'), body.encode('utf-8'), color)) if room == self.current_room(): self.window.text_win.refresh(room.name) + else: + self.window.info_win.refresh(self.rooms, self.current_room()) def execute(self): line = self.window.input.get_text() |