From: javiplx Date: Wed, 4 May 2011 21:06:59 +0000 (+0000) Subject: Extend settings to GTK scanner X-Git-Tag: hildon-wrapped~35 X-Git-Url: http://vcs.maemo.org/git/?p=wifihood;a=commitdiff_plain;h=ea8aef1ea10f21f5e220b8bdd46ba9960a701ae4 Extend settings to GTK scanner git-svn-id: file:///svnroot/wifihood/trunk@117 c51dfc6a-5949-4919-9c8e-f207a149c383 --- diff --git a/wifiscanner/wifiscanner b/wifiscanner/wifiscanner index f50cc63..f6e9253 100755 --- a/wifiscanner/wifiscanner +++ b/wifiscanner/wifiscanner @@ -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()