diff --git a/deluge/ui/gtkui/details_tab.py b/deluge/ui/gtkui/details_tab.py index 863902128..798fc6659 100644 --- a/deluge/ui/gtkui/details_tab.py +++ b/deluge/ui/gtkui/details_tab.py @@ -29,11 +29,6 @@ def fdate_or_dash(value): return "-" -def str_yes_no(value): - """Return Yes or No to bool value""" - return _("Yes") if value else _("No") - - class DetailsTab(Tab): def __init__(self): Tab.__init__(self) @@ -51,12 +46,9 @@ class DetailsTab(Tab): (builder.get_object("summary_num_files"), str, ("num_files",)), (builder.get_object("summary_completed"), fdate_or_dash, ("completed_time",)), (builder.get_object("summary_date_added"), fdate, ("time_added",)), - (builder.get_object("summary_private"), str_yes_no, ("private",)), (builder.get_object("summary_torrent_path"), None, ("download_location",)), (builder.get_object("summary_hash"), str, ("hash",)), (builder.get_object("summary_comments"), str, ("comment",)), - (builder.get_object("summary_owner"), str, ("owner",)), - (builder.get_object("summary_shared"), str_yes_no, ("shared",)), (builder.get_object("summary_pieces"), fpieces_num_size, ("num_pieces", "piece_length")), ] diff --git a/deluge/ui/gtkui/glade/main_window.tabs.ui b/deluge/ui/gtkui/glade/main_window.tabs.ui index b024f9fab..160de8202 100644 --- a/deluge/ui/gtkui/glade/main_window.tabs.ui +++ b/deluge/ui/gtkui/glade/main_window.tabs.ui @@ -60,7 +60,7 @@ True False - 5 + 10 2 10 10 @@ -69,54 +69,6 @@ True False 5 - - - True - False - - - True - False - 5 - - - True - False - 0 - 1 - Status: - - - - - - - - False - False - 0 - - - - - True - False - 0 - True - - - True - True - 1 - - - - - False - False - 0 - - True @@ -129,8 +81,8 @@ 0.10000000149 - False - False + True + True 0 @@ -141,7 +93,7 @@ False True - 1 + 0 @@ -330,21 +282,6 @@ GTK_FILL - - - True - False - 5 - - - - - - 4 - 5 - GTK_FILL - - True @@ -660,11 +597,14 @@ + + + False False - 2 + 1 @@ -704,7 +644,7 @@ False 0 0 - 5 + 10 2 10 15 @@ -712,7 +652,7 @@ True False - 7 + 6 5 10 5 @@ -733,42 +673,6 @@ GTK_EXPAND - - - True - False - 0 - Owner: - - - - - - 3 - 4 - 4 - 5 - GTK_FILL - - - - - - True - False - 0 - char - True - - - 4 - 5 - 4 - 5 - GTK_FILL - - - True @@ -780,8 +684,8 @@ - 6 - 7 + 5 + 6 GTK_FILL @@ -798,8 +702,8 @@ 1 5 - 6 - 7 + 5 + 6 @@ -811,8 +715,8 @@ 2 3 - 1 - 6 + 2 + 5 GTK_SHRINK @@ -842,8 +746,8 @@ - 1 - 2 + 2 + 3 GTK_FILL @@ -858,8 +762,9 @@ 1 2 - 1 - 2 + 2 + 3 + GTK_FILL @@ -874,8 +779,8 @@ - 2 - 3 + 3 + 4 GTK_FILL @@ -890,17 +795,18 @@ 1 2 - 2 - 3 + 3 + 4 + GTK_FILL - + True False 0 - Private: + Completed: @@ -915,12 +821,10 @@ - + True False 0 - char - True 4 @@ -932,28 +836,80 @@ - + True False 0 - Hash: + Added: - 5 - 6 + 3 + 4 + 2 + 3 GTK_FILL - + + 100 True False 0 - Download Folder: + + + 4 + 5 + 2 + 3 + GTK_SHRINK | GTK_FILL + + + + + + True + False + 0 + Pieces: + + + + + + 3 + 4 + 4 + 5 + GTK_FILL + + + + + + True + False + 0 + + + 4 + 5 + 4 + 5 + GTK_SHRINK | GTK_FILL + + + + + + True + False + 0 + Hash: @@ -973,13 +929,29 @@ True char True - end 1 2 - 5 - 6 + 4 + 5 + + + + + + True + False + 0 + Download Folder: + + + + + + 1 + 2 + GTK_FILL @@ -995,146 +967,9 @@ 1 - 2 - 4 - 5 - - - - - - True - False - 0 - Pieces: - - - - - - 3 - 4 - GTK_FILL - - - - - - True - False - 0 - - - 1 - 2 - 3 - 4 - GTK_SHRINK | GTK_FILL - - - - - - True - False - 0 - Completed: - - - - - - 3 - 4 - 2 - 3 - GTK_FILL - - - - - - True - False - 0 - - - 4 - 5 - 2 - 3 - GTK_FILL - - - - - - True - False - 0 - Added: - - - - - - 3 - 4 - 1 - 2 - GTK_FILL - - - - - - 100 - True - False - 0 - - - 4 5 1 2 - GTK_SHRINK | GTK_FILL - - - - - - True - False - 0 - Shared: - - - - - - 3 - 4 - 5 - 6 - GTK_FILL - - - - - - True - False - 0 - char - True - - - 4 - 5 - 5 - 6 - GTK_FILL @@ -1405,7 +1240,11 @@ True False - KiB/s + K/s + start + + + 2 @@ -1418,7 +1257,10 @@ True False - KiB/s + K/s + + + 2 @@ -1503,6 +1345,48 @@ True False + + + True + False + + + True + False + 0 + Owner: + + + + + + False + True + 0 + + + + + True + False + 0 + char + True + + + False + True + 10 + 1 + + + + + False + True + 0 + + Shared @@ -1516,7 +1400,7 @@ False True - 0 + 1 @@ -1532,7 +1416,7 @@ False True - 1 + 2 @@ -1548,7 +1432,7 @@ False True - 2 + 3 @@ -1564,7 +1448,7 @@ False False - 3 + 4 @@ -1578,7 +1462,7 @@ False True - 4 + 5 @@ -1776,7 +1660,7 @@ True False - 5 + 6 2 10 5 @@ -1908,8 +1792,8 @@ 2 - 4 - 5 + 5 + 6 GTK_FILL @@ -1942,6 +1826,40 @@ GTK_FILL + + + True + False + 0 + Private Torrent: + + + + + + 4 + 5 + GTK_FILL + + + + + + True + False + 0 + char + True + + + 1 + 2 + 4 + 5 + GTK_FILL + + + diff --git a/deluge/ui/gtkui/options_tab.py b/deluge/ui/gtkui/options_tab.py index 39a4228ae..8ac188dd8 100644 --- a/deluge/ui/gtkui/options_tab.py +++ b/deluge/ui/gtkui/options_tab.py @@ -38,6 +38,7 @@ class OptionsTab(Tab): self.entry_move_completed = builder.get_object("entry_move_completed") self.chk_shared = builder.get_object("chk_shared") self.button_apply = builder.get_object("button_apply") + self.summary_owner = builder.get_object("summary_owner") self.move_completed_hbox = builder.get_object("hbox_move_completed_path_chooser") self.move_completed_path_chooser = PathChooser("move_completed_paths_list") @@ -55,7 +56,8 @@ class OptionsTab(Tab): "on_chk_stop_at_ratio_toggled": self._on_chk_stop_at_ratio_toggled, "on_chk_toggled": self._on_chk_toggled, "on_spin_value_changed": self._on_spin_value_changed, - "on_move_completed_file_set": self._on_move_completed_file_set + "on_move_completed_file_set": self._on_move_completed_file_set, + "on_button_owner_clicked": self._on_button_owner_clicked, }) self.spin_max_download.connect("key-press-event", self._on_key_press_event) @@ -100,7 +102,8 @@ class OptionsTab(Tab): "sequential_download", "move_on_completed", "move_on_completed_path", - "shared" + "shared", + "owner" ]).addCallback(self._on_get_torrent_status) self.prev_torrent_id = torrent_id @@ -142,6 +145,8 @@ class OptionsTab(Tab): cursor_end=False, default_text=True) if status["shared"] != self.prev_status["shared"]: self.chk_shared.set_active(status["shared"]) + if status["owner"] != self.prev_status["owner"]: + self.summary_owner.set_text(status["owner"]) if status["storage_mode"] == "compact": self.chk_prioritize_first_last.set_sensitive(False) @@ -241,3 +246,7 @@ class OptionsTab(Tab): def _on_path_chooser_text_changed_event(self, widget, path): self.button_apply.set_sensitive(True) + + def _on_button_owner_clicked(self, button): + + pass diff --git a/deluge/ui/gtkui/piecesbar.py b/deluge/ui/gtkui/piecesbar.py index a9a01b7eb..a9399d6aa 100644 --- a/deluge/ui/gtkui/piecesbar.py +++ b/deluge/ui/gtkui/piecesbar.py @@ -17,6 +17,7 @@ import pango import pangocairo from cairo import FORMAT_ARGB32, Context, ImageSurface +import deluge.ui.gtkui.status_tab from deluge.configmanager import ConfigManager log = logging.getLogger(__name__) @@ -46,6 +47,7 @@ class PiecesBar(gtk.DrawingArea): self.__pieces = self.__old_pieces = () self.__num_pieces = self.__old_num_pieces = None self.__text = self.__old_text = "" + self.__message = self.__old_message = "" self.__fraction = self.__old_fraction = 0.0 self.__state = self.__old_state = None self.__progress_overlay = self.__text_overlay = self.__pieces_overlay = None @@ -165,17 +167,11 @@ class PiecesBar(gtk.DrawingArea): pl.set_font_description(self.__text_font) pl.set_width(-1) # No text wrapping - text = "" if self.__text: - text += self.__text + text = self.__text else: - if self.__state: - text += _(self.__state) + " " - if self.__fraction == 1.0: - fraction_format = "%d%%" - else: - fraction_format = "%.2f%%" - text += fraction_format % (self.__fraction * 100) + text = deluge.ui.gtkui.status_tab.fpcnt(self.__fraction, self.__state, self.__message) + log.trace("PiecesBar text %r", text) pl.set_text(text) plsize = pl.get_size() @@ -208,6 +204,13 @@ class PiecesBar(gtk.DrawingArea): self.__old_text = self.__text self.__text = text + def get_status_message(self): + return self.__text + + def set_status_message(self, message): + self.__old_message = self.__message + self.__message = message + def set_pieces(self, pieces, num_pieces): self.__old_pieces = self.__pieces self.__pieces = pieces @@ -234,6 +237,7 @@ class PiecesBar(gtk.DrawingArea): return self.set_pieces(status['pieces'], status['num_pieces']) + self.set_status_message(status['message']) self.update() def clear(self): diff --git a/deluge/ui/gtkui/status_tab.py b/deluge/ui/gtkui/status_tab.py index edd485dd3..f44b5fc00 100644 --- a/deluge/ui/gtkui/status_tab.py +++ b/deluge/ui/gtkui/status_tab.py @@ -28,10 +28,12 @@ def fratio(value): return ("%.3f" % value).rstrip('0').rstrip('.') if value > 0 else "∞" -def fpcnt(value, state): +def fpcnt(value, state, message): textstr = _(state) if state not in ("Error", "Seeding") and value < 100: textstr = ('%s %.2f' % (textstr, value)).rstrip('0').rstrip('.') + '%' + elif state == "Error": + textstr = _("%s: %s") % (textstr, message) return textstr @@ -100,11 +102,10 @@ class StatusTab(Tab): (builder.get_object("summary_active_time"), ftime_or_dash, ("active_time",)), (builder.get_object("summary_seed_time"), ftime_or_dash, ("seeding_time",)), (builder.get_object("summary_seed_rank"), fseed_rank_or_dash, ("seed_rank", "seeding_time")), - (builder.get_object("progressbar"), fpcnt, ("progress", "state")), + (builder.get_object("progressbar"), fpcnt, ("progress", "state", "message")), (builder.get_object("summary_last_seen_complete"), fdate_or_never, ("last_seen_complete",)), (builder.get_object("summary_last_active"), flast_active, ("time_since_download", "time_since_upload")), - (builder.get_object("summary_torrent_status"), str, ("message",)), ] self.status_keys = [status for widget in self.label_widgets for status in widget[2]] diff --git a/deluge/ui/gtkui/trackers_tab.py b/deluge/ui/gtkui/trackers_tab.py index e61a1639d..97875aa80 100644 --- a/deluge/ui/gtkui/trackers_tab.py +++ b/deluge/ui/gtkui/trackers_tab.py @@ -26,6 +26,11 @@ def ftranslate(text): return text +def str_yes_no(value): + """Return Yes or No to bool value""" + return _("Yes") if value else _("No") + + class TrackersTab(Tab): def __init__(self): Tab.__init__(self) @@ -42,6 +47,7 @@ class TrackersTab(Tab): (builder.get_object("summary_tracker"), None, ("tracker_host",)), (builder.get_object("summary_tracker_status"), ftranslate, ("tracker_status",)), (builder.get_object("summary_tracker_total"), fcount, ("trackers",)), + (builder.get_object("summary_private"), str_yes_no, ("private",)), ] self.status_keys = [status for widget in self.label_widgets for status in widget[2]]