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 eb6dde43..9294988b 100644 --- a/src/windows.py +++ b/src/windows.py @@ -534,7 +534,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 @@ -566,7 +566,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: @@ -592,7 +595,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 @@ -1322,7 +1328,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 @@ -1359,10 +1365,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: @@ -1512,6 +1514,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 @@ -1603,6 +1613,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: @@ -1622,10 +1635,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 |