From 7b7516e2417da3aadd8b4343ce047b2393100289 Mon Sep 17 00:00:00 2001 From: javiplx Date: Sun, 15 May 2011 19:56:07 +0000 Subject: [PATCH] Adjust settings windows for device git-svn-id: file:///svnroot/wifihood/trunk@194 c51dfc6a-5949-4919-9c8e-f207a149c383 --- wifiscanner/wifimap/config.py | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/wifiscanner/wifimap/config.py b/wifiscanner/wifimap/config.py index dfff47f..d380eaf 100644 --- a/wifiscanner/wifimap/config.py +++ b/wifiscanner/wifimap/config.py @@ -88,7 +88,6 @@ class SettingsWindow ( hildon.StackableWindow ) : self.add_dataframe( vbox , config ) self.add_mapsframe( vbox , config , handler ) - self.add_coordsframe( vbox , config ) self.add_dbframe( vbox , config ) self.show() @@ -110,7 +109,7 @@ class SettingsWindow ( hildon.StackableWindow ) : dbframe.show() vbox.pack_start(dbframe, True, True, 0) - database = gtk.Table(2, 2, False) + database = gtk.Table(4, 1, False) database.show() dbframe.add(database) @@ -119,6 +118,7 @@ class SettingsWindow ( hildon.StackableWindow ) : database.attach(dblabel, 0, 1, 0, 1, gtk.EXPAND|gtk.FILL, 0, 0, 5) dbvalue = hildon.Entry( gtk.HILDON_SIZE_FINGER_HEIGHT ) + dbvalue.set_width_chars(15) dbvalue.connect( "changed" , self.entry_cb , config , "basedir" ) dbvalue.set_text( config.homedir ) dbvalue.show() @@ -126,18 +126,19 @@ class SettingsWindow ( hildon.StackableWindow ) : dblabel = gtk.Label( "Database name" ) dblabel.show() - database.attach(dblabel, 0, 1, 1, 2, gtk.EXPAND|gtk.FILL, 0, 0, 5) + database.attach(dblabel, 2, 3, 0, 1, gtk.EXPAND|gtk.FILL, 0, 0, 5) dbvalue = hildon.Entry( gtk.HILDON_SIZE_FINGER_HEIGHT ) + dbvalue.set_width_chars(12) dbvalue.connect( "changed" , self.entry_cb , config , "dbname" ) dbvalue.set_text( config.dbname ) dbvalue.show() - database.attach(dbvalue, 1, 2, 1, 2, gtk.EXPAND|gtk.FILL, 0, 0, 5) + database.attach(dbvalue, 3, 4, 0, 1, gtk.EXPAND|gtk.FILL, 0, 0, 5) def add_mapsframe ( self , vbox , config , handler ) : - mapsframe = gtk.Frame( label="Maps" ) + mapsframe = gtk.Frame( label="Maps & Coordinates" ) mapsframe.set_label_align(0 , 0.1) mapsframe.show() vbox.pack_start(mapsframe, True, True, 0) @@ -149,6 +150,7 @@ class SettingsWindow ( hildon.StackableWindow ) : button = hildon.CheckButton( gtk.HILDON_SIZE_FINGER_HEIGHT ) button.set_label( "Use OpenStreet maps" ) button.set_active( 1 ) + button.set_sensitive(0) button.show() maps.attach(button, 0, 1, 0, 1, gtk.EXPAND|gtk.FILL, 0, 0, 5) @@ -156,31 +158,19 @@ class SettingsWindow ( hildon.StackableWindow ) : zoomlevel.show() maps.attach(zoomlevel, 1, 2, 0, 1, gtk.EXPAND|gtk.FILL, 0, 0, 5) - - def add_coordsframe ( self , vbox , config ) : - - gpsframe = gtk.Frame( label="Coordinates" ) - gpsframe.set_label_align(0 , 0.1) - gpsframe.show() - vbox.pack_start(gpsframe, True, True, 0) - - gps = gtk.Table(2, 2, False) - gps.show() - gpsframe.add(gps) - button = hildon.CheckButton( gtk.HILDON_SIZE_FINGER_HEIGHT ) - button.set_label( "Take initial coordinates from maemo-mapper" ) + button.set_label( "Use maemo-mapper coordinates" ) button.connect( "toggled" , self.checkbutton_cb , config , "use_mapper" ) button.set_active( config.use_mapper ) button.show() - gps.attach(button, 0, 2, 0, 1, gtk.EXPAND|gtk.FILL) #, 0, 0, 5) + maps.attach(button, 0, 1, 1, 2, gtk.EXPAND|gtk.FILL, 0, 0, 5) button = hildon.CheckButton( gtk.HILDON_SIZE_FINGER_HEIGHT ) - button.set_label( "Store changes in coordinates" ) + button.set_label( "Store coordinates changes" ) button.connect( "toggled" , self.checkbutton_cb , config , "store_gps" ) button.set_active( config.store_gps ) button.show() - gps.attach(button, 0, 2, 1, 2, gtk.EXPAND|gtk.FILL) #, 0, 0, 5) + maps.attach(button, 1, 2, 1, 2, gtk.EXPAND|gtk.FILL, 0, 0, 5) def add_dataframe ( self , vbox , config ) : @@ -190,26 +180,27 @@ class SettingsWindow ( hildon.StackableWindow ) : dataframe.show() vbox.pack_start(dataframe, True, True, 0) - datatable = gtk.Table(2, 2, False) + datatable = gtk.Table(3, 1, False) datatable.show() dataframe.add(datatable) scanlabel = gtk.Label( "Scanning interval" ) scanlabel.show() - datatable.attach(scanlabel, 0, 1, 0, 1, gtk.EXPAND|gtk.FILL) + datatable.attach(scanlabel, 1, 2, 0, 1, gtk.EXPAND|gtk.FILL) scanvalue = hildon.Entry( gtk.HILDON_SIZE_FINGER_HEIGHT ) + scanvalue.set_width_chars(5) scanvalue.connect( "changed" , self.float_cb , config , "scan-period" ) scanvalue.set_text( "%s" % config.scan_period ) scanvalue.show() - datatable.attach(scanvalue, 1, 2, 0, 1, gtk.EXPAND|gtk.FILL) + datatable.attach(scanvalue, 2, 3, 0, 1, gtk.FILL) button = hildon.CheckButton( gtk.HILDON_SIZE_FINGER_HEIGHT ) button.set_label( "Write full logfile" ) button.connect( "toggled" , self.checkbutton_cb , config , "store_log" ) button.set_active( config.store_log ) button.show() - datatable.attach(button, 0, 2, 1, 2, gtk.EXPAND|gtk.FILL) + datatable.attach(button, 0, 1, 0, 1, gtk.EXPAND|gtk.FILL) def entry_cb ( self , entry , config , keyword ) : config.__dict__[ keyword ] = entry.get_text() -- 1.7.9.5