diff --git a/pixmaps/downloading24.png b/pixmaps/downloading24.png new file mode 100644 index 000000000..285b0b914 Binary files /dev/null and b/pixmaps/downloading24.png differ diff --git a/pixmaps/inactive24.png b/pixmaps/inactive24.png new file mode 100644 index 000000000..a2b5a023b Binary files /dev/null and b/pixmaps/inactive24.png differ diff --git a/pixmaps/seeding24.png b/pixmaps/seeding24.png new file mode 100644 index 000000000..31a41957d Binary files /dev/null and b/pixmaps/seeding24.png differ diff --git a/src/dgtk.py b/src/dgtk.py index 1e43e88e6..0772d4205 100644 --- a/src/dgtk.py +++ b/src/dgtk.py @@ -102,3 +102,14 @@ def add_toggle_column(view, header, cid, toggled_signal=None): if toggled_signal is not None: render.connect("toggled", toggled_signal) return column + +def add_texticon_column(view, header, icon_col, text_col): + column = gtk.TreeViewColumn(header) + render = gtk.CellRendererPixbuf() + column.pack_start(render, expand=False) + column.add_attribute(render, 'pixbuf', icon_col) + render = gtk.CellRendererText() + column.pack_start(render, expand=True) + column.add_attribute(render, 'text', text_col) + view.append_column(column) + return column diff --git a/src/interface.py b/src/interface.py index 33650da2e..a55b59cc5 100644 --- a/src/interface.py +++ b/src/interface.py @@ -317,7 +317,7 @@ class DelugeGTK: TORRENT_VIEW_COL_UPLOAD, TORRENT_VIEW_COL_ETA, TORRENT_VIEW_COL_RATIO) = range(15) self.queue_column = dgtk.add_text_column(self.torrent_view, "#", TORRENT_VIEW_COL_QUEUE) - self.name_column = dgtk.add_text_column(self.torrent_view, _("Name"), TORRENT_VIEW_COL_NAME) + self.name_column = dgtk.add_texticon_column(self.torrent_view, _("Name"), TORRENT_VIEW_COL_STATUSICON, TORRENT_VIEW_COL_NAME) self.size_column = dgtk.add_func_column(self.torrent_view, _("Size"), size, TORRENT_VIEW_COL_SIZE) self.status_column = dgtk.add_progress_column(self.torrent_view, _("Status"), TORRENT_VIEW_COL_PROGRESS, TORRENT_VIEW_COL_STATUS) self.seed_column = dgtk.add_func_column(self.torrent_view, _("Seeders"), peer, (TORRENT_VIEW_COL_CONNECTED_SEEDS, TORRENT_VIEW_COL_SEEDS)) @@ -328,6 +328,7 @@ class DelugeGTK: self.share_column = dgtk.add_func_column(self.torrent_view, _("Ratio"), ratio, TORRENT_VIEW_COL_RATIO) self.status_column.set_expand(True) + self.name_column.set_sort_column_id(TORRENT_VIEW_COL_NAME) self.seed_column.set_sort_column_id(TORRENT_VIEW_COL_CONNECTED_SEEDS) self.peer_column.set_sort_column_id(TORRENT_VIEW_COL_CONNECTED_PEERS) @@ -655,8 +656,16 @@ class DelugeGTK: except ZeroDivisionError: eta = 0 share = float(self.calc_share_ratio(unique_id, state)) - # The None is for the status icon - rlist = [int(unique_id), int(queue), None,str(name), long(size), float(progress), str(message), + + # Set the appropriate status icon + if state["is_paused"]: + status_icon = gtk.gdk.pixbuf_new_from_file(common.get_pixmap("inactive24.png")) + elif state["is_seed"]: + status_icon = gtk.gdk.pixbuf_new_from_file(common.get_pixmap("seeding24.png")) + else: + status_icon = gtk.gdk.pixbuf_new_from_file(common.get_pixmap("downloading24.png")) + + rlist = [int(unique_id), int(queue), status_icon, str(name), long(size), float(progress), str(message), int(seeds), int(seeds_t), int(peers), int(peers_t), int(dlrate), int(ulrate), int(eta), float(share)] return rlist