summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-03-19 02:06:51 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-03-19 02:06:51 +0000
commitd25f061a8bfc71317f045c6b78d98777cd871098 (patch)
tree5a6f0129715e0970105d1297521b757fbae95fdf
parentef58ef0e462c99b47c6da0133cf14728aa0a4a42 (diff)
downloadpoezio-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
-rw-r--r--src/gui.py16
-rw-r--r--src/window.py7
2 files changed, 12 insertions, 11 deletions
diff --git a/src/gui.py b/src/gui.py
index b4a5546a..6d342114 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -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()
diff --git a/src/window.py b/src/window.py
index 81902f4e..0df6c7e7 100644
--- a/src/window.py
+++ b/src/window.py
@@ -152,12 +152,6 @@ class TextWin(object):
self.parent_win = parent_win
self.wins = {}
- def rebuild(self, lines):
- """
- deprecated
- """
- pass # TODO
-
def redraw(self, room):
"""
called when the buffer changes or is
@@ -446,7 +440,6 @@ class Input(Win):
self.win.addstr(nick)
self.refresh()
-
def do_command(self, key):
self.reset_completion()
(y, x) = self.win.getyx()