diff options
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/windows.py b/src/windows.py index 1d54f7ed..d4d9b2a7 100644 --- a/src/windows.py +++ b/src/windows.py @@ -538,7 +538,7 @@ class TextWin(Win): if None not in self.built_lines: self.built_lines.append(None) - def build_new_message(self, message): + def build_new_message(self, message, history=None): """ Take one message, build it and add it to the list Return the number of lines that are built for the given @@ -570,7 +570,10 @@ class TextWin(Win): else: txt = txt.replace('\t', ' ') # length of the time - offset = 9 + if history: + offset = 20 + else: + offset = 9 if theme.CHAR_TIME_RIGHT: offset += 1 if theme.CHAR_TIME_RIGHT: @@ -596,7 +599,10 @@ class TextWin(Win): else: color = None if first: - time = message.time.strftime("%H:%M:%S") + if history: + time = message.time.strftime("%Y-%m-%d %H:%M:%S") + else: + time = message.time.strftime("%H:%M:%S") nickname = nick else: time = None @@ -1326,7 +1332,7 @@ class RosterWin(Win): self.roster_len = len(roster) while self.roster_len and self.pos >= self.roster_len: self.move_cursor_up() - # self._win.erase() + self._win.erase() self._win.move(0, 0) self.draw_roster_information(roster) y = 1 @@ -1363,10 +1369,6 @@ class RosterWin(Win): y += 1 if y-self.start_pos+1 == self.height: break - line = ' '*self.width - while y < self.height: - self.addstr(y, 0, line) - y += 1 if self.start_pos > 1: self.draw_plus(1) if self.start_pos + self.height-2 < self.roster_len: @@ -1516,6 +1518,14 @@ class ListWin(Win): self._selected_row = 0 self._starting_pos = 0 # The column number from which we start the refresh + def empty(self): + """ + emtpy the list and reset some important values as well + """ + self.lines = [] + self._selected_row = 0 + self._starting_pos = 0 + def resize_columns(self, dic): """ Resize the width of the columns @@ -1607,6 +1617,9 @@ class ColumnHeaderWin(Win): def resize_columns(self, dic): self._columns_sizes = dic + def get_columns(self): + return self._columns + def refresh(self): log.debug('Refresh: %s'%self.__class__.__name__) with g_lock: @@ -1626,10 +1639,6 @@ class SimpleTextWin(Win): self._text = text self.built_lines = [] - def resize(self, height, width, y, x, stdscr): - self._resize(height, width, y, x, stdscr) - self.rebuild_text() - def rebuild_text(self): """ Transform the text in lines than can then be |