Move scanning area as the position changes (fixes #6887)
[wifihood] / wifiscanner
index cb2a452..88a9e4c 100755 (executable)
@@ -57,6 +57,7 @@ class scanner ( wifimap.Scanner ) :
             self.buffer.insert_at_cursor( "%s %5d\n" % ( mac , rss ) )
         if self.info[0] == "FIX" :
             self.map.hide()
+            self.map.recenter( self.info[4:6] )
             pixmap,mask = self.map.get_pixbuf().render_pixmap_and_mask()
             self.map.plot( pixmap , ( float(self.info[4]) , float(self.info[5]) ) , "red" , 2 )
             self.map.get_pixbuf().get_from_drawable( pixmap , pixmap.get_colormap() , 0, 0 , 0 , 0 , self.map.win_x, self.map.win_y )
@@ -134,9 +135,7 @@ if hildon :
 
             self.config = wifimap.config.Configuration()
             self.config.zoom = 16
-            self.map = wifimap.simpleMapWidget( self.config )
-            self.map.plot_APs()
-            self.add( self.map )
+            self.add( wifimap.simpleMapWidget( self.config ) )
 
     class Wifiscanner ( AbstractWifiscanner , hildon.Window ) :