add port mention to add peer glade and fix poort oops in ip validation

This commit is contained in:
Marcos Pinto 2008-10-18 03:53:54 +00:00
parent fd1dfedfba
commit 251b1733ce
2 changed files with 8 additions and 4 deletions

View File

@ -154,7 +154,11 @@ def add_peer_dialog():
response = peer_dialog.run() response = peer_dialog.run()
if response: if response:
value = txt_ip.get_text() value = txt_ip.get_text()
if deluge.common.is_ip(value): ip = value.split(":")[0]
client.connect_peer(component.get("TorrentView").get_selected_torrent(), value) port = value.split(":")[1]
if deluge.common.is_ip(ip):
id = component.get("TorrentView").get_selected_torrent()
log.debug("adding peer %s to %s", value, id)
client.connect_peer(id, value)
peer_dialog.destroy() peer_dialog.destroy()
return True return True

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.5 on Fri Oct 17 20:13:27 2008 --> <!--Generated with glade3 3.4.5 on Fri Oct 17 22:54:20 2008 -->
<glade-interface> <glade-interface>
<widget class="GtkDialog" id="speed_dialog"> <widget class="GtkDialog" id="speed_dialog">
<property name="app_paintable">True</property> <property name="app_paintable">True</property>
@ -117,7 +117,7 @@
<child> <child>
<widget class="GtkLabel" id="label1"> <widget class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Enter Peer IP to Add</property> <property name="label" translatable="yes">Enter Peer IP:Port to Add</property>
</widget> </widget>
</child> </child>
<child> <child>