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" )
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() )
except :
hildon = False
-def global_start(button, scanner):
- scanner.start()
+def global_start(button, scanner, config):
+ scanner.start( config.scan_period )
if button._id :
button.disconnect( button._id )
- button._id = button.connect("clicked", global_stop, scanner)
+ button._id = button.connect("clicked", global_stop, scanner, config)
button.set_label("Switch GPS Off")
-def global_stop(button, scanner):
+def global_stop(button, scanner, config):
scanner.stop()
if button._id :
button.disconnect( button._id )
- button._id = button.connect("clicked", global_start, scanner)
+ button._id = button.connect("clicked", global_start, scanner, config)
button.set_label("Switch GPS On")
def enable_agps(button):
button.set_label("Start scanning")
-class scanner ( wifimap.Scanner ) :
+class scanner ( wifimap.ReplayScanner ) :
def scan ( self ) :
- wifimap.Scanner.scan( self )
+ wifimap.ReplayScanner.scan( self )
self.report()
def report ( self ) :
- self.status.set_label( wifimap.Scanner.report(self) )
+ self.status.set_label( wifimap.ReplayScanner.report(self) )
start, end = self.buffer.get_bounds()
self.buffer.delete( start , end )
for mac,rss in self.scanlist.iteritems() :
# Buttons creation
button = self.Button( "Switch GPS On")
- button._id = button.connect("clicked", global_start, _scanner)
+ button._id = button.connect("clicked", global_start, _scanner, self.map.config)
buttons.pack_start(button, expand=False)
button_scan = self.Button( "Start scanning")