X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=wifiscanner%2Fwifimap%2Fconfig.py;h=45afae47d56628b8299f18707e023eef884c8973;hb=4afda6641d41a1f02cc5d707e140d410106e4750;hp=5b60f1438535047c6724af0797fa56ee5d1a261b;hpb=5e8ffa7c68bc4162250d5fa28beba6a576b29568;p=wifihood diff --git a/wifiscanner/wifimap/config.py b/wifiscanner/wifimap/config.py index 5b60f14..45afae4 100644 --- a/wifiscanner/wifimap/config.py +++ b/wifiscanner/wifimap/config.py @@ -18,6 +18,8 @@ class Configuration : self.mapsdir = self._client.get_string( "/apps/wifihood/maps" ) or "/home/user/MyDocs/.maps" self.mapclass = self._client.get_string( "/apps/wifihood/maptype" ) or "OpenStreetMap I" + self.scan_period = self._client.get_int( "/apps/wifihood/scan-period" ) or 5000 + self.store_log = self._client.get_bool( "/apps/wifihood/store-logfile" ) self.use_mapper = self._client.get_bool( "/apps/wifihood/use-mapper" ) @@ -150,18 +152,35 @@ class AbstractSettingsWindow : dataframe.show() vbox.pack_start(dataframe, True, True, 0) + datatable = gtk.Table(2, 2, False) + datatable.show() + dataframe.add(datatable) + + scanlabel = gtk.Label( "Scanning interval" ) + scanlabel.show() + datatable.attach(scanlabel, 0, 1, 0, 1, gtk.EXPAND|gtk.FILL) + + scanvalue = self.Entry() + scanvalue.connect( "changed" , self.int_cb , config , "scan-period" , 1000 ) + scanvalue.set_text( "%s" % ( float(config.scan_period) / 1000 ) ) + scanvalue.show() + datatable.attach(scanvalue, 1, 2, 0, 1, gtk.EXPAND|gtk.FILL) + button = self.CheckButton() button.set_label( "Write full logfile" ) button.connect( "toggled" , self.checkbutton_cb , config , "store-logfile" ) button.set_active( config.store_log ) button.show() - dataframe.add(button) + datatable.attach(button, 0, 2, 1, 2, gtk.EXPAND|gtk.FILL) self.show() def entry_cb ( self , entry , config , keyword ) : config._client.set_string( "%s/%s" % ( "/apps/wifihood" , keyword ) , entry.get_text() ) + def int_cb ( self , entry , config , keyword , scale=1 ) : + config._client.set_int( "%s/%s" % ( "/apps/wifihood" , keyword ) , int( scale * float( entry.get_text() ) ) ) + def checkbutton_cb ( self , button , config , keyword ) : config._client.set_bool( "%s/%s" % ( "/apps/wifihood" , keyword ) , button.get_active() )