X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=ui%2Fhildon_ui.py;h=c280dd70ef1835a024b01241e0b19c16f1c4ea99;hb=4b8b6fa7a5a2be7fd2ed64493b9a2cfca128878e;hp=c21b5a9e3a53a6f74d3b6a03bafbac7e82ea32d2;hpb=a4f70d1815c31b8acfa5572fc560b6f38d2040ab;p=meabook diff --git a/ui/hildon_ui.py b/ui/hildon_ui.py index c21b5a9..c280dd7 100644 --- a/ui/hildon_ui.py +++ b/ui/hildon_ui.py @@ -7,6 +7,7 @@ import hildon import gobject from gettext import gettext as _ from meabook.constants import * +from meabook.caller import PhoneCaller from meabook.ui.ui import MeabookUI @@ -50,6 +51,8 @@ def set_box_content(box, handler, items=[]): def on_button_click(widget): handler(widget.get_title(), widget.get_data('iname')) + #caller = PhoneCaller() + #caller.call(widget.get_value()) for child in box.get_children(): box.remove(child) @@ -197,6 +200,9 @@ class HildonMeabook(MeabookUI): if fname == 'image': continue button = self.renderer.render_button(_(fname) , fvalue, fname) + if fname in (FIELD_PHONE_HOME, FIELD_PHONE_GENERAL, \ + FIELD_PHONE_INTERNAL, FIELD_PHONE_MOBILE): + button.connect('clicked', self.call_cb) info_box.pack_start(button, expand=False) # pack widgets image_box.pack_start(image, expand=False) @@ -347,6 +353,11 @@ class HildonMeabook(MeabookUI): self.search_entry.set_text('') set_box_content(self.box, None) + def call_cb(self, widget): + """Nake a phone call.""" + + self.controller.call(widget.get_value()) + class AboutDialog(hildon.Dialog):