Allow variable size on map window
authorjaviplx <javiplx@gmail.com>
Tue, 7 Dec 2010 14:24:26 +0000 (14:24 +0000)
committerjaviplx <javiplx@gmail.com>
Tue, 7 Dec 2010 14:24:26 +0000 (14:24 +0000)
git-svn-id: file:///svnroot/wifihood/trunk@79 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiscanner/wifimap/view.py
wifiscanner/wifiview.py

index 4a7e591..f98f582 100755 (executable)
@@ -10,12 +10,12 @@ import wifimap
 
 class AbstractmapWidget :
 
-  def __init__ ( self , config ) :
+  def __init__ ( self , config , map_size=(800,480) ) :
 
     self.conf = config
 
     # Maximum width should be 800, but actually gets reduced
-    self.win_x , self.win_y = 800 , 480
+    self.win_x , self.win_y = map_size
     self.tile_size = 256
 
     self.reftile_x , self.refpix_x = self.lon2tilex( self.conf.lon , self.conf.zoom )
index fa15bf9..850deee 100755 (executable)
@@ -16,8 +16,8 @@ import wifimap.view
 
 class mapWidget ( wifimap.view.AbstractmapWidget , gtk.Image ) :
 
-  def __init__ ( self , config ) :
-    wifimap.view.AbstractmapWidget.__init__( self , config )
+  def __init__ ( self , config , map_size=(800,480) ) :
+    wifimap.view.AbstractmapWidget.__init__( self , config , map_size )
 
     gtk.Image.__init__(self)
 
@@ -229,7 +229,7 @@ class AbstractMapWindow:
       else :
           print "UNKNOWN",event.keyval
 
-    def __init__(self):
+    def __init__( self , map_size=(800,480) ) :
 
         self.connect("destroy", self.destroy)
 
@@ -248,10 +248,10 @@ class AbstractMapWindow:
         self.connect('button_release_event', self.release_event)
         #
         self.config = wifimap.config.Configuration()
-        self.map = mapWidget( self.config )
+        self.map = mapWidget( self.config , map_size )
         self.vbox.pack_end( self.map , True , True , 5)
 
-        self.size_x , self.size_y = 800 , 480
+        self.size_x , self.size_y = map_size
         self.click_x , self.click_y = None , None
 
     def zoomdialog ( self , widget ) :