Add option in Preferences to change the listen interface

This commit is contained in:
Andrew Resch 2009-06-12 16:12:00 +00:00
parent ca7f33db1f
commit 3458b238d8
2 changed files with 59 additions and 10 deletions

View file

@ -838,6 +838,59 @@
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame31">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment51">
<property name="visible">True</property>
<property name="top_padding">2</property>
<property name="bottom_padding">2</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkHBox" id="hbox21">
<property name="visible">True</property>
<child>
<widget class="GtkEntry" id="entry_interface">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">Enter the IP address of the interface to listen for incoming bittorrent connections on. Leave this empty if you want to use the default.</property>
<property name="max_length">60</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">30</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label110">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Interface&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame2">
<property name="visible">True</property>
@ -904,7 +957,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">5</property>
<property name="position">4</property>
<property name="position">5</property>
</packing>
</child>
<child>
@ -1028,7 +1081,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">5</property>
<property name="position">5</property>
<property name="position">6</property>
</packing>
</child>
<child>
@ -1187,15 +1240,9 @@ Disabled</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">6</property>
<property name="position">7</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>

View file

@ -227,6 +227,7 @@ class Preferences(component.Component):
"spin_outgoing_port_min": ("value", self.core_config["outgoing_ports"][0]),
"spin_outgoing_port_max": ("value", self.core_config["outgoing_ports"][1]),
"chk_random_outgoing_ports": ("active", self.core_config["random_outgoing_ports"]),
"entry_interface": ("text", self.core_config["listen_interface"]),
"entry_peer_tos": ("text", self.core_config["peer_tos"]),
"chk_dht": ("active", self.core_config["dht"]),
"chk_upnp": ("active", self.core_config["upnp"]),
@ -369,6 +370,7 @@ class Preferences(component.Component):
"spin_outgoing_port_min",
"spin_outgoing_port_max",
"chk_random_outgoing_ports",
"entry_interface",
"entry_peer_tos",
"chk_dht",
"chk_upnp",
@ -568,7 +570,7 @@ class Preferences(component.Component):
new_core_config["outgoing_ports"] = outgoing_ports
new_core_config["random_outgoing_ports"] = \
self.glade.get_widget("chk_random_outgoing_ports").get_active()
new_core_config["listen_interface"] = self.glade.get_widget("entry_interface").get_text()
new_core_config["peer_tos"] = self.glade.get_widget("entry_peer_tos").get_text()
new_core_config["dht"] = self.glade.get_widget("chk_dht").get_active()
new_core_config["upnp"] = self.glade.get_widget("chk_upnp").get_active()