implemented showing details dialog for field
authorMax Usachev <maxusachev@gmail.com>
Wed, 23 Jun 2010 08:10:31 +0000 (11:10 +0300)
committerMax Usachev <maxusachev@gmail.com>
Wed, 23 Jun 2010 08:11:06 +0000 (11:11 +0300)
ui/hildon_ui/hildon_ui.py
ui/hildon_ui/info.py

index 10e046a..9e4746d 100644 (file)
@@ -185,7 +185,6 @@ class HildonMeabook(MeabookUI):
             info_box = gtk.VBox()
             image_box = gtk.VBox()
             pannable_area = hildon.PannableArea()
-            pannable_area.set_property('mov-mode', hildon.MOVEMENT_MODE_BOTH)
             image = self.renderer.render_image(dict(entry))
             for fname, fvalue in entry:
                 if fname == 'image':
@@ -194,6 +193,8 @@ class HildonMeabook(MeabookUI):
                 if fname in (FIELD_PHONE_HOME, FIELD_PHONE_GENERAL, \
                     FIELD_PHONE_INTERNAL, FIELD_PHONE_MOBILE):
                     button.connect('clicked', self.call_cb)
+                else:
+                    button.connect('clicked', self.show_details_cb)
                 info_box.pack_start(button, expand=False)
             # pack widgets
             image_box.pack_start(image, expand=False)
@@ -351,3 +352,8 @@ class HildonMeabook(MeabookUI):
         """Make a phone call."""
 
         self.controller.call(widget.get_value())
+
+    def show_details_cb(self, widget):
+        """Show widget text in dialog."""
+
+        InfoDialog(widget.get_title(), widget.get_value()).run()
index 1350405..f5b17d9 100644 (file)
@@ -2,6 +2,10 @@
 Information dialogs
 """
 
+import gtk
+import hildon
+
+
 class InfoDialog:
     def __init__(self, title, message):
         self.title = title
@@ -9,8 +13,10 @@ class InfoDialog:
 
     def run(self):
         dialog = hildon.Dialog()
-        dialog.set_title(title)
-        label = gtk.Label(message)
+        dialog.set_title(self.title)
+        label = gtk.Label('\n' + self.message + '\n')
+        label.set_justify(gtk.JUSTIFY_CENTER)
+        label.set_line_wrap(True)
         dialog.vbox.add(label)
         dialog.vbox.show_all()
         dialog.run()