0,0 → 1,44 |
Author: Magnus Holmgren <holmgren@debian.org> |
Description: Improve the code for adding new entries to the Additional Hosts list |
- Fix C&P bug that caused the Game port to be validated twice but the Web port not at all. |
- Pre-fill the default ports. |
- Don't destroy the dialog until the entered values have been extracted. |
|
--- a/pyscrabble/gui/options.py |
+++ b/pyscrabble/gui/options.py |
@@ -830,10 +830,12 @@ class OptionWindow(gtk.Window): |
|
s = _("Game port") |
gport = gtkutil.EntryWithLabel(label="%s: " % s, visibility=True) |
+ gport.set_text("9999") |
dialog.vbox.pack_start( gport ) |
|
s = _("Web port") |
wport = gtkutil.EntryWithLabel(label="%s: " % s, visibility=True) |
+ wport.set_text("8888") |
dialog.vbox.pack_start( wport ) |
|
s = _("Location") |
@@ -866,13 +868,11 @@ class OptionWindow(gtk.Window): |
|
try: |
int(gport.get_text()) |
- int(gport.get_text()) |
+ int(wport.get_text()) |
except: |
self.error(util.ErrorMessage(_('Port must be a number'))) |
return |
|
- dialog.destroy() |
- |
o = manager.OptionManager(section=HOSTS_SECTION) |
data = o.get_default_option(OPTION_HOSTS, '') |
data = '%s%s:%s:%s:%s/' % (data, host.get_text(), gport.get_text(), wport.get_text(), location.get_text()) |
@@ -882,4 +882,5 @@ class OptionWindow(gtk.Window): |
model.clear() |
for host,gport,wport,location in util.getAdditionalHosts(): |
model.append( (host,location) ) |
- |
\ No newline at end of file |
+ |
+ dialog.destroy() |