Implement ap list window
[wifihood] / wifiscanner
index 3f11db7..2a74a65 100755 (executable)
@@ -2,7 +2,7 @@
 
 import wifimap
 
-import gtk
+import gtk , pango
 import hildon
 
 import gobject
@@ -59,32 +59,46 @@ def main():
     window.connect("delete_event", gtk.main_quit, None)
 
     vbox = gtk.VBox(homogeneous=False, spacing=0)
-    top_frame = gtk.Frame(label="top")
-    bottom_frame = gtk.Frame(label="bottom")
-
-    # FIXME : Temporary holder !!!
-    table = gtk.Table (2, 1, False)
-
-    # set the spacing to 10 on x and 10 on y 
-    table.set_row_spacings(10)
-    table.set_col_spacings(10)
+    top_frame = gtk.Frame()
+    bottom_frame = gtk.Frame()
+    bottom_box = gtk.HBox(homogeneous=False, spacing=0)
+
+    hbox = gtk.HBox(homogeneous=False, spacing=0)
+    top_frame.add(hbox)
+
+    textview = gtk.TextView()
+    textview.set_editable( False )
+    textview.set_cursor_visible( False )
+    textview.modify_font( pango.FontDescription("Courier 12") )
+    scrollview = gtk.ScrolledWindow()
+    scrollview.set_policy( gtk.POLICY_NEVER , gtk.POLICY_AUTOMATIC )
+    scrollview.add( textview )
+    hbox.pack_start( scrollview )
+
+    buttons = gtk.VBox(homogeneous=False, spacing=0)
+    hbox.pack_end(buttons, expand=False)
 
     button = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH, hildon.BUTTON_ARRANGEMENT_VERTICAL, "Switch On!")
     button.handler_id = button.connect("clicked", hello, gpsdev)
-    table.attach(button, 0, 1, 0, 1)
+    buttons.pack_start(button, expand=False)
 
     button_scan = hildon.Button(gtk.HILDON_SIZE_AUTO_WIDTH, hildon.BUTTON_ARRANGEMENT_VERTICAL, "Start scanning now !!")
     button_scan.handler_id = button_scan.connect("clicked", scana, gpsdev)
-    table.attach(button_scan, 0, 1, 1, 2)
-
-    bottom_frame.add(table)
+    buttons.pack_start(button_scan, expand=False)
 
     toggle_button = gtk.CheckButton(label="Use Assisted GPS")
     toggle_button.connect("toggled", enable_agps)
-    top_frame.add(toggle_button)
+    buttons.pack_start(toggle_button, expand=False)
+
+    status = gtk.Label( "status bar ..." )
+    gpsdev.set_infowin( status , textview.get_buffer() )
+    bottom_box.pack_start( status , expand=False , padding=20 )
+
+    bottom_frame.add( bottom_box )
 
     vbox.pack_start(top_frame)
-    vbox.pack_end(bottom_frame)
+    vbox.pack_end(bottom_frame, expand=False)
     window.add(vbox)
 
     window.show_all()