Ticket #1384: deluge_announce_ip.patch

File deluge_announce_ip.patch, 10.7 KB (added by OmegaPhil, 15 years ago)
  • deluge/core/preferencesmanager.py

    diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
    index bdc7f1c..6c7c41e 100644
    a b  
    5757    "download_location": deluge.common.get_default_download_dir(),
    5858    "listen_ports": [6881, 6891],
    5959    "listen_interface": "",
     60    "announce_ip": "",
    6061    "copy_torrent_file": False,
    6162    "del_copy_torrent_file": False,
    6263    "torrentfiles_location": deluge.common.get_default_download_dir(),
    def _on_set_listen_interface(self, key, value):  
    204205        # Call the random_port callback since it'll do what we need
    205206        self._on_set_random_port("random_port", self.config["random_port"])
    206207
     208    def _on_set_announce_ip(self, key, value):
     209        if value != "":
     210            log.debug("tracker announce IP address set to %s", value)
     211            self.session_set_setting("announce_ip", str(value))
     212
    207213    def _on_set_random_port(self, key, value):
    208214        log.debug("random port value set to %s", value)
    209215        # We need to check if the value has been changed to true and false
  • deluge/ui/gtkui/glade/preferences_dialog.ui

    diff --git a/deluge/ui/gtkui/glade/preferences_dialog.ui b/deluge/ui/gtkui/glade/preferences_dialog.ui
    index 2364629..6732d41 100644
    a b used sparingly.</property>  
    13721372                              </packing>
    13731373                            </child>
    13741374                            <child>
     1375                              <object class="GtkFrame" id="frame24">
     1376                                <property name="visible">True</property>
     1377                                <property name="can_focus">False</property>
     1378                                <property name="label_xalign">0</property>
     1379                                <property name="shadow_type">none</property>
     1380                                <child>
     1381                                  <object class="GtkAlignment" id="alignment59">
     1382                                    <property name="visible">True</property>
     1383                                    <property name="can_focus">False</property>
     1384                                    <property name="top_padding">2</property>
     1385                                    <property name="bottom_padding">2</property>
     1386                                    <property name="left_padding">12</property>
     1387                                    <child>
     1388                                      <object class="GtkHBox" id="hbox23">
     1389                                        <property name="visible">True</property>
     1390                                        <property name="can_focus">False</property>
     1391                                        <child>
     1392                                          <object class="GtkEntry" id="entry_announce_ip">
     1393                                            <property name="visible">True</property>
     1394                                            <property name="can_focus">True</property>
     1395                                            <property name="tooltip_text" translatable="yes">Enter the IP address to announce to trackers. Use this if you do not directly connect to the internet and NAT-PMP fails to retrieve your correct public IP address. Leave this empty to be automatically determined.</property>
     1396                                            <property name="max_length">60</property>
     1397                                            <property name="invisible_char">●</property>
     1398                                            <property name="width_chars">30</property>
     1399                                            <property name="primary_icon_activatable">False</property>
     1400                                            <property name="secondary_icon_activatable">False</property>
     1401                                            <property name="primary_icon_sensitive">True</property>
     1402                                            <property name="secondary_icon_sensitive">True</property>
     1403                                          </object>
     1404                                          <packing>
     1405                                            <property name="expand">False</property>
     1406                                            <property name="fill">False</property>
     1407                                            <property name="position">0</property>
     1408                                          </packing>
     1409                                        </child>
     1410                                        <child>
     1411                                          <placeholder/>
     1412                                        </child>
     1413                                      </object>
     1414                                    </child>
     1415                                  </object>
     1416                                </child>
     1417                                <child type="label">
     1418                                  <object class="GtkLabel" id="label68">
     1419                                    <property name="visible">True</property>
     1420                                    <property name="can_focus">False</property>
     1421                                    <property name="label" translatable="yes">&lt;b&gt;Tracker Announce IP Address&lt;/b&gt;</property>
     1422                                    <property name="use_markup">True</property>
     1423                                  </object>
     1424                                </child>
     1425                              </object>
     1426                              <packing>
     1427                                <property name="expand">False</property>
     1428                                <property name="fill">False</property>
     1429                                <property name="position">5</property>
     1430                              </packing>
     1431                            </child>
     1432                            <child>
    13751433                              <object class="GtkFrame" id="frame2">
    13761434                                <property name="visible">True</property>
    13771435                                <property name="can_focus">False</property>
    used sparingly.</property>  
    14471505                                <property name="expand">False</property>
    14481506                                <property name="fill">True</property>
    14491507                                <property name="padding">5</property>
    1450                                 <property name="position">5</property>
     1508                                <property name="position">6</property>
    14511509                              </packing>
    14521510                            </child>
    14531511                            <child>
    used sparingly.</property>  
    15771635                                <property name="expand">False</property>
    15781636                                <property name="fill">True</property>
    15791637                                <property name="padding">5</property>
    1580                                 <property name="position">6</property>
     1638                                <property name="position">7</property>
    15811639                              </packing>
    15821640                            </child>
    15831641                            <child>
    used sparingly.</property>  
    17691827                                <property name="expand">False</property>
    17701828                                <property name="fill">False</property>
    17711829                                <property name="padding">5</property>
    1772                                 <property name="position">7</property>
     1830                                <property name="position">8</property>
    17731831                              </packing>
    17741832                            </child>
    17751833                          </object>
  • deluge/ui/gtkui/preferences.py

    diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
    index 7ba931a..e481fa5 100644
    a b def _show(self):  
    316316                "spin_outgoing_port_max": ("value", self.core_config["outgoing_ports"][1]),
    317317                "chk_random_outgoing_ports": ("active", self.core_config["random_outgoing_ports"]),
    318318                "entry_interface": ("text", self.core_config["listen_interface"]),
     319                "entry_announce_ip": ("text", self.core_config["announce_ip"]),
    319320                "entry_peer_tos": ("text", self.core_config["peer_tos"]),
    320321                "chk_dht": ("active", self.core_config["dht"]),
    321322                "chk_upnp": ("active", self.core_config["upnp"]),
    def _show(self):  
    471472                "spin_outgoing_port_max",
    472473                "chk_random_outgoing_ports",
    473474                "entry_interface",
     475                "entry_announce_ip",
    474476                "entry_peer_tos",
    475477                "chk_dht",
    476478                "chk_upnp",
    def set_config(self, hide=False):  
    666668        new_core_config["random_outgoing_ports"] = \
    667669            self.builder.get_object("chk_random_outgoing_ports").get_active()
    668670        new_core_config["listen_interface"] = self.builder.get_object("entry_interface").get_text()
     671        new_core_config["announce_ip"] = self.builder.get_object("entry_announce_ip").get_text()
    669672        new_core_config["peer_tos"] = self.builder.get_object("entry_peer_tos").get_text()
    670673        new_core_config["dht"] = self.builder.get_object("chk_dht").get_active()
    671674        new_core_config["upnp"] = self.builder.get_object("chk_upnp").get_active()
  • deluge/ui/web/js/deluge-all/preferences/NetworkPage.js

    diff --git a/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js b/deluge/ui/web/js/deluge-all/preferences/NetworkPage.js
    index 13b1448..6f61d25 100644
    a b Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {  
    170170        fieldset = this.add({
    171171            xtype: 'fieldset',
    172172            border: false,
     173            title: _('Tracker Announce IP Address'),
     174            style: 'margin-bottom: 5px; padding-bottom: 0px;',
     175            autoHeight: true,
     176            labelWidth: 1,
     177            defaultType: 'textfield'
     178        });
     179        optMan.bind('announce_ip', fieldset.add({
     180            name: 'announce_ip',
     181            fieldLabel: '',
     182            labelSeparator: '',
     183            width: 200
     184        }));
     185       
     186        fieldset = this.add({
     187            xtype: 'fieldset',
     188            border: false,
    173189            title: _('TOS'),
    174190            style: 'margin-bottom: 5px; padding-bottom: 0px;',
    175191            bodyStyle: 'margin: 0px; padding: 0px',
  • deluge/ui/web/js/deluge-all/preferences/PreferencesWindow.js

    diff --git a/deluge/ui/web/js/deluge-all/preferences/PreferencesWindow.js b/deluge/ui/web/js/deluge-all/preferences/PreferencesWindow.js
    index 67f11fe..7f28263 100644
    a b Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {  
    4747    title: _('Preferences'),
    4848    layout: 'border',
    4949    width: 485,
    50     height: 500,
     50    height: 510,
    5151
    5252    buttonAlign: 'right',
    5353    closeAction: 'hide',