REFACTORING : completed separation of static and interactive maps
[wifihood] / wifimap / view.py
index 6353744..bcb4c51 100755 (executable)
@@ -137,7 +137,7 @@ class interactiveMapWidget :
     self.composeMap()
     self.show()
 
-class mapWidget ( AbstractmapWidget , gtk.Image ) :
+class simpleMapWidget ( AbstractmapWidget , gtk.Image ) :
 
     def __init__ ( self , config , map_size=(800,480) ) :
         AbstractmapWidget.__init__( self , config , map_size )
@@ -204,6 +204,7 @@ class mapWidget ( AbstractmapWidget , gtk.Image ) :
                 del(pixbuf)
 
         self.draw_paths()
+        self.plot_APs()
 
     def draw_paths( self ) :
 
@@ -230,14 +231,6 @@ class mapWidget ( AbstractmapWidget , gtk.Image ) :
                 pixmap.draw_rectangle(blue, True , dest_x , dest_y , 3 , 3 )
         fd.close()
 
-        db = wifimap.db.database( os.path.join( self.conf.homedir , self.conf.dbname ) )
-        db.open()
-        for ap in db.db.execute( "SELECT * FROM ap" ) :
-            if ap[3] > 1 :
-                dest_x , dest_y = self.gps2pix( ( ap[4]/ap[3] , ap[5]/ap[3] ) , ( center_x , center_y ) )
-                pixmap.draw_rectangle(red, True , dest_x , dest_y , 3 , 3 )
-        db.close()
-
         self.get_pixbuf().get_from_drawable( pixmap , pixmap.get_colormap() , 0, 0 , 0 , 0 , self.win_x, self.win_y )
 
     def plot_APs( self ) :
@@ -264,3 +257,7 @@ class mapWidget ( AbstractmapWidget , gtk.Image ) :
 
         self.get_pixbuf().get_from_drawable( pixmap , pixmap.get_colormap() , 0, 0 , 0 , 0 , self.win_x, self.win_y )
 
+class mapWidget ( simpleMapWidget , interactiveMapWidget ) :
+
+    pass
+