Extend settings to GTK scanner
authorjaviplx <javiplx@gmail.com>
Wed, 4 May 2011 21:06:59 +0000 (21:06 +0000)
committerjaviplx <javiplx@gmail.com>
Wed, 4 May 2011 21:06:59 +0000 (21:06 +0000)
git-svn-id: file:///svnroot/wifihood/trunk@117 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiscanner/wifiscanner

index f50cc63..f6e9253 100755 (executable)
@@ -76,7 +76,6 @@ class AbstractWifiscanner :
 
         # Top frame creation
         top_frame = gtk.Frame()
-        self.vbox.pack_start(top_frame)
 
         hbox = gtk.HBox(homogeneous=False, spacing=0)
         top_frame.add(hbox)
@@ -85,6 +84,8 @@ class AbstractWifiscanner :
         bottom_frame = gtk.Frame()
         self.vbox.pack_end(bottom_frame, expand=False)
 
+        self.vbox.pack_end(top_frame)
+
         bottom_box = gtk.HBox(homogeneous=False, spacing=0)
         bottom_frame.add( bottom_box )
 
@@ -127,6 +128,10 @@ class AbstractWifiscanner :
     def run ( self ) :
         gtk.main()
 
+def settings_cb ( widget , config ) :
+    wifimap.config.SettingsWindow( config )
+
+
 if hildon :
 
     class MapWindow ( gtk.Frame ) :
@@ -186,10 +191,6 @@ if hildon :
 
             menubar.show_all()
 
-    def settings_cb ( widget , config ) :
-        wifimap.config.SettingsWindow( config )
-
-
 else :
 
     class MapWindow ( gtk.Frame ) :
@@ -210,6 +211,8 @@ else :
             AbstractWifiscanner.__init__( self )
             self.add(self.vbox)
 
+            self.create_menu()
+
             self.show_all()
 
         def TextView ( self , placeholder=None ) :
@@ -231,6 +234,17 @@ else :
                 toggle_button.set_label( label )
             return toggle_button
 
+        def create_menu ( self ) :
+
+            menubar = gtk.MenuBar()
+            self.vbox.pack_start( menubar )
+
+            settings = gtk.MenuItem( "Settings" )
+            settings.connect( "activate", settings_cb , self.map.config )
+            menubar.append( settings )
+
+            menubar.show_all()
+
 window = Wifiscanner()
 window.run()