Ticket #1903: deluge_[1903]_superseeding_ui_devel_20140907.patch

File deluge_[1903]_superseeding_ui_devel_20140907.patch, 12.2 KB (added by funkylove20, 10 years ago)
  • deluge/ui/console/commands/manage.py

    diff --git a/deluge/ui/console/commands/manage.py b/deluge/ui/console/commands/manage.py
    index a026c76..803a157 100644
    a b  
    5353    "max_upload_slots": int,
    5454    "private": bool,
    5555    "prioritize_first_last": bool,
     56    "super_seeding": bool,
    5657    "is_auto_managed": bool,
    5758    "stop_at_ratio": bool,
    5859    "stop_ratio": float,
  • deluge/ui/console/modes/torrent_actions.py

    diff --git a/deluge/ui/console/modes/torrent_actions.py b/deluge/ui/console/modes/torrent_actions.py
    index 96416b9..2ae34fc 100644
    a b  
    5050    ("max_connections", int),
    5151    ("max_upload_slots", int),
    5252    ("prioritize_first_last", bool),
     53    ("super_seeding", bool),
    5354    ("sequential_download", bool),
    5455    ("is_auto_managed", bool),
    5556    ("stop_at_ratio", bool),
     
    6566    "max_connections": "Max connections",
    6667    "max_upload_slots": "Max upload slots",
    6768    "prioritize_first_last": "Prioritize first/last pieces",
     69    "super_seeding": "Super Seeding",
    6870    "sequential_download": "Sequential download",
    6971    "is_auto_managed": "Is auto managed?",
    7072    "stop_at_ratio": "Stop at ratio",
  • deluge/ui/gtkui/glade/main_window.tabs.ui

    diff --git a/deluge/ui/gtkui/glade/main_window.tabs.ui b/deluge/ui/gtkui/glade/main_window.tabs.ui
    index 5451340..2d75bff 100644
    a b  
    15161516                                  </packing>
    15171517                                </child>
    15181518                                <child>
     1519                                  <object class="GtkCheckButton" id="chk_super_seeding">
     1520                                    <property name="label" translatable="yes">Super Seeding</property>
     1521                                    <property name="use_action_appearance">False</property>
     1522                                    <property name="visible">True</property>
     1523                                    <property name="can_focus">True</property>
     1524                                    <property name="receives_default">False</property>
     1525                                    <property name="draw_indicator">True</property>
     1526                                    <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
     1527                                  </object>
     1528                                  <packing>
     1529                                     <property name="expand">False</property>
     1530                                     <property name="fill">True</property>
     1531                                     <property name="position">3</property>
     1532                                     </packing>
     1533                                </child>
     1534                                <child>
    15191535                                  <object class="GtkCheckButton" id="chk_move_completed">
    15201536                                    <property name="label" translatable="yes">Move completed:</property>
    15211537                                    <property name="use_action_appearance">False</property>
     
    15281544                                  <packing>
    15291545                                    <property name="expand">False</property>
    15301546                                    <property name="fill">False</property>
    1531                                     <property name="position">3</property>
     1547                                    <property name="position">4</property>
    15321548                                  </packing>
    15331549                                </child>
    15341550                                <child>
     
    15421558                                  <packing>
    15431559                                    <property name="expand">False</property>
    15441560                                    <property name="fill">True</property>
    1545                                     <property name="position">4</property>
     1561                                    <property name="position">5</property>
    15461562                                  </packing>
    15471563                                </child>
    15481564                              </object>
  • deluge/ui/gtkui/glade/torrent_menu.options.ui

    diff --git a/deluge/ui/gtkui/glade/torrent_menu.options.ui b/deluge/ui/gtkui/glade/torrent_menu.options.ui
    index 2044679..4cefb8c 100644
    a b  
    7979      </object>
    8080    </child>
    8181    <child>
     82      <object class="GtkMenuItem" id="menuitem_super_seeding">
     83        <property name="visible">True</property>
     84        <property name="can_focus">False</property>
     85        <property name="use_action_appearance">False</property>
     86        <property name="label" translatable="yes">_Super Seeding</property>
     87        <property name="use_underline">True</property>
     88      </object>
     89    </child>
     90    <child>
    8291      <object class="GtkMenuItem" id="menuitem_change_owner">
    8392        <property name="visible">True</property>
    8493        <property name="can_focus">False</property>
  • deluge/ui/gtkui/menubar.py

    diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py
    index 0c40ee6..fddf5de 100644
    a b def __init__(self):  
    8585        submenu.append(item)
    8686        submenu.show_all()
    8787        self.builder.get_object("menuitem_auto_managed").set_submenu(submenu)
     88       
     89        submenu = gtk.Menu()
     90        item = gtk.MenuItem(_("On"))
     91        item.connect("activate", self.on_menuitem_set_super_seeding_on)
     92        submenu.append(item)
     93        item = gtk.MenuItem(_("Off"))
     94        item.set_name("menuitem_super_seeding")
     95        item.connect("activate", self.on_menuitem_set_super_seeding_off)
     96        submenu.append(item)
     97        submenu.show_all()
     98        self.builder.get_object("menuitem_super_seeding").set_submenu(submenu)
    8899
    89100        submenu = gtk.Menu()
    90101        item = gtk.MenuItem(_("Disable"))
    def on_menuitem_set_stop_seed_at_ratio_disable(self, widget):  
    471482        client.core.set_torrent_options(component.get("TorrentView").get_selected_torrents(),
    472483                                        {"stop_at_ratio": False})
    473484
     485    def on_menuitem_set_super_seeding_off(self, widget):
     486        client.core.set_torrent_options(component.get("TorrentView").get_selected_torrents(),
     487                                        {"super_seeding": False})
     488
     489    def on_menuitem_set_super_seeding_on(self, widget):
     490        client.core.set_torrent_options(component.get("TorrentView").get_selected_torrents(),
     491                                        {"super_seeding": True})
     492
    474493    def on_menuitem_sidebar_zero_toggled(self, widget):
    475494        self.config["sidebar_show_zero"] = widget.get_active()
    476495        component.get("FilterTreeView").update()
  • deluge/ui/gtkui/options_tab.py

    diff --git a/deluge/ui/gtkui/options_tab.py b/deluge/ui/gtkui/options_tab.py
    index 806d5f0..c05167a 100644
    a b def __init__(self):  
    3434        self.chk_stop_at_ratio = builder.get_object("chk_stop_at_ratio")
    3535        self.chk_remove_at_ratio = builder.get_object("chk_remove_at_ratio")
    3636        self.spin_stop_ratio = builder.get_object("spin_stop_ratio")
     37        self.chk_super_seeding = builder.get_object("chk_super_seeding")
    3738        self.chk_move_completed = builder.get_object("chk_move_completed")
    3839        self.entry_move_completed = builder.get_object("entry_move_completed")
    3940        self.chk_shared = builder.get_object("chk_shared")
    def __init__(self):  
    5354            "on_button_apply_clicked": self._on_button_apply_clicked,
    5455            "on_chk_move_completed_toggled": self._on_chk_move_completed_toggled,
    5556            "on_chk_stop_at_ratio_toggled": self._on_chk_stop_at_ratio_toggled,
     57            "on_chk_super_seeding_toggled" : self._on_chk_super_seeding_toggled,
    5658            "on_chk_toggled": self._on_chk_toggled,
    5759            "on_spin_value_changed": self._on_spin_value_changed,
    5860            "on_move_completed_file_set": self._on_move_completed_file_set
    def update(self):  
    9698            "stop_at_ratio",
    9799            "stop_ratio",
    98100            "remove_at_ratio",
     101            "super_seeding",
    99102            "storage_mode",
    100103            "sequential_download",
    101104            "move_on_completed",
    def _on_get_torrent_status(self, status):  
    135138                self.spin_stop_ratio.set_value(status["stop_ratio"])
    136139            if status["remove_at_ratio"] != self.prev_status["remove_at_ratio"]:
    137140                self.chk_remove_at_ratio.set_active(status["remove_at_ratio"])
     141            if status["super_seeding"] != self.prev_status["super_seeding"]:
     142                self.chk_super_seeding.set_active(status["super_seeding"])
    138143            if status["move_on_completed"] != self.prev_status["move_on_completed"]:
    139144                self.chk_move_completed.set_active(status["move_on_completed"])
    140145            if status["move_on_completed_path"] != self.prev_status["move_on_completed_path"]:
    def _on_button_apply_clicked(self, button):  
    210215            client.core.set_torrent_remove_at_ratio(
    211216                self.prev_torrent_id, self.chk_remove_at_ratio.get_active()
    212217            )
     218        if self.chk_super_seeding.get_active () != self.prev_status["super_seeding"]:
     219            client.core.set_super_seeding(
     220                self.prev_torrent_id, self.chk_super_seeding.get_active()
     221            )
    213222        if self.chk_move_completed.get_active() != self.prev_status["move_on_completed"]:
    214223            client.core.set_torrent_move_completed(
    215224                self.prev_torrent_id, self.chk_move_completed.get_active()
    def _on_chk_stop_at_ratio_toggled(self, widget):  
    238247        if not self.button_apply.is_sensitive():
    239248            self.button_apply.set_sensitive(True)
    240249
     250    def _on_chk_super_seeding_toggled(self, widget):
     251        value = widget.get_active()
     252       
     253        self.chk_super_seeding.set_sensitive(value)
     254       
     255        if not self.button_apply.is_sensitive():
     256            self.button_apply.set_sensitive(True)
     257
    241258    def _on_chk_toggled(self, widget):
    242259        if not self.button_apply.is_sensitive():
    243260            self.button_apply.set_sensitive(True)
  • deluge/ui/web/js/deluge-all/Keys.js

    diff --git a/deluge/ui/web/js/deluge-all/Keys.js b/deluge/ui/web/js/deluge-all/Keys.js
    index 2653295..d58f866 100644
    a b Deluge.Keys = {  
    104104        'max_download_speed', 'max_upload_speed', 'max_connections',
    105105        'max_upload_slots','is_auto_managed', 'stop_at_ratio', 'stop_ratio',
    106106        'remove_at_ratio', 'private', 'prioritize_first_last',
    107         'move_completed', 'move_completed_path'
     107        'move_completed', 'move_completed_path', 'super_seeding'
    108108    ]
    109109};
    110110
  • deluge/ui/web/js/deluge-all/details/OptionsTab.js

    diff --git a/deluge/ui/web/js/deluge-all/details/OptionsTab.js b/deluge/ui/web/js/deluge-all/details/OptionsTab.js
    index 4a6294f..b0a9886 100644
    a b Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {  
    6868                'move_completed': false,
    6969                'move_completed_path': '',
    7070                'private': false,
    71                 'prioritize_first_last': false
     71                'prioritize_first_last': false,
     72                'super_seeding': false
    7273            }
    7374        });
    7475
    Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {  
    309310            id: 'prioritize_first_last'
    310311        });
    311312
     313        this.fields.super_seeding = this.fieldsets.general.add({
     314            fieldLabel: '',
     315            labelSeparator: '',
     316            boxLabel: _('Super Seeding'),
     317            id: 'super_seeding'
     318        });
     319
    312320        // Bind the fields so the options manager can manage them.
    313321        for (var id in this.fields) {
    314322            this.optionsManager.bind(id, this.fields[id]);
  • deluge/ui/web/js/gettext.js

    diff --git a/deluge/ui/web/js/gettext.js b/deluge/ui/web/js/gettext.js
    index 04547a3..f16d6b7 100644
    a b GetText.add('Stop seed at ratio', '${escape(_("Stop seed at ratio"))}')  
    746746// QueuePage.js:175
    747747GetText.add('Stop seeding when share ratio reaches:', '${escape(_("Stop seeding when share ratio reaches:"))}')
    748748
     749// OptionsTab.js:316
     750GetText.add('Super Seeding', '${escape(_("Super Seeding"))}')
     751
    749752// OtherPage.js:72
    750753GetText.add('System Information', '${escape(_("System Information"))}')
    751754