diff --git a/src/history_manager.glade b/src/history_manager.glade index 30159e6ec6eb0cf00f9908368d2a55beaeb34214..49225bf27ae00d5160e73683e81037c2c2c0f5d0 100644 --- a/src/history_manager.glade +++ b/src/history_manager.glade @@ -73,13 +73,12 @@ <child> <widget class="GtkLabel" id="welcome_label"> <property name="visible">True</property> - <property name="label" translatable="yes"><big>Welcome to Gajim History Logs Manager</big> + <property name="label" translatable="yes"><big><b>Welcome to Gajim History Logs Manager</b></big> You can select logs from the left and/or search database from below. -<span background="lightyellow"><b>WARNING:</b> -If you plan to do massive deletions, please make sure Gajim is not running. -Generally avoid deletions with contacts you currently chat with.</span></property> +<b>WARNING:</b> +If you plan to do massive deletions, please make sure Gajim is not running. Generally avoid deletions with contacts you currently chat with.</property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -96,8 +95,8 @@ Generally avoid deletions with contacts you currently chat with.</span></p </widget> <packing> <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> diff --git a/src/history_manager.py b/src/history_manager.py index 6deb5c4287a80a6779e7c79d7edc4112749368c7..90145c4c8b5a5a813bf3f0eba138c37deca2bd57 100755 --- a/src/history_manager.py +++ b/src/history_manager.py @@ -115,7 +115,7 @@ class HistoryManager: self.logs_listview.append_column(col) renderer_text = gtk.CellRendererText() # holds message - col = gtk.TreeViewColumn('Message', renderer_text, text = C_MESSAGE) + col = gtk.TreeViewColumn('Message', renderer_text, markup = C_MESSAGE) col.set_sort_column_id(C_MESSAGE) # user can click this header and sort col.set_resizable(True) self.logs_listview.append_column(col) @@ -265,17 +265,24 @@ class HistoryManager: # exposed in UI (TreeViewColumns) are only time, message and subject # but store in liststore log_line_id, jid_id, time, message and subject time_ = row[2] + kind = row[3] try: time_ = time.strftime('%x', time.localtime(float(time_))).decode( locale.getpreferredencoding()) except ValueError: pass else: - self.logs_liststore.append((row[0], row[1], time_, row[4], row[5])) + if kind in (constants.KIND_SINGLE_MSG_RECV, + constants.KIND_CHAT_MSG_RECV): # it is the other side + color = gajim.config.get('inmsgcolor') # so incoming color + elif kind in (constants.KIND_SINGLE_MSG_SENT, + constants.KIND_CHAT_MSG_SENT): # it is us + color = gajim.config.get('outmsgcolor') # so outgoing color + message = '<span foreground="%s">%s</span>' % (color, row[4]) + self.logs_liststore.append((row[0], row[1], time_, message, row[5])) def _fill_search_results_listview(self, text): '''ask db and fill listview with results that match text''' - # FIXME: check kind and set color accordingly # exposed in UI (TreeViewColumns) are only JID, time, message and subject # but store in liststore jid, time, message and subject self.search_results_liststore.clear() @@ -384,7 +391,6 @@ class HistoryManager: results = self.cur.fetchall() file_ = open(path_to_file, 'w') for row in results: - # FIXME: check kind and say You or JID # in store: time, kind, message FROM logs # in text: JID or You, time, message time_ = row[0]