Added about dialog.
[drlaunch] / src / win_config.py
index 43db90d..77526ee 100755 (executable)
@@ -35,6 +35,7 @@ from hildon import StackableWindow
 import apps
 from icon import Icon, getIcon
 from icongrid import IconGridWidget
+from about import DlgAbout
 
 class WinConfig(StackableWindow):
     def __init__(self, config, *args):
@@ -45,9 +46,7 @@ class WinConfig(StackableWindow):
        self.setupUi()
 
     def setupUi(self):
-       self.igw=IconGridWidget(True, self.config)
-#      self.igw.do_realize()
-#      self.igw.setSize(config.getSize())
+       self.set_title("DrLaunch Configuration")
 
        self.pa=hildon.PannableArea()
        self.add(self.pa)
@@ -56,12 +55,11 @@ class WinConfig(StackableWindow):
        hbox=gtk.HBox()
        self.pa.add_with_viewport(hbox)
 
-       # Now go for the right side
+       # Add the first column of options
        al=gtk.Alignment(yscale=0)
        hbox.add(al)
 
        vbox=gtk.VBox()
-#      hbox.add(vbox)
        al.add(vbox)
 
        maxsz=self.config.getMaxSize()
@@ -119,7 +117,25 @@ class WinConfig(StackableWindow):
        self.buttonAnimateRotation=but
        vbox.add(but)
 
+       # -----------------------------------------------
+       # Second column of options
+       vbox=gtk.VBox()
+       al=gtk.Alignment(xalign=0, yalign=1, xscale=1)
+       al.add(vbox)
+       hbox.add(al)
+       but=hildon.Button(
+               gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT,
+               hildon.BUTTON_ARRANGEMENT_VERTICAL)
+       but.set_title("About")
+       but.connect("clicked", self.slotButtonAbout)
+       vbox.add(but)
+       self.buttonAbout=but
+
+       # -----------------------------------------------
        # Add the icongrid
+       self.igw=IconGridWidget(True, self.config)
+#      self.igw.do_realize()
+#      self.igw.setSize(config.getSize())
        al=gtk.Alignment(xalign=0, xscale=0)
        al.add(self.igw)
        al.set_padding(0, 0, 20, 0)
@@ -156,6 +172,12 @@ class WinConfig(StackableWindow):
        but=self.buttonRotateIndividually
        self.setIndiv(but.get_active())
 
+    def slotButtonAbout(self, sender):
+       print "about"
+       #dlg=DlgAbout()
+       #dlg.run()
+       DlgAbout.present2()
+
 #    def slotButtonLongpress(self, sender):
 #      but=self.buttonRequireLongpress
 #      self.set