X-Git-Url: http://git.maemo.org/git/?p=beifahrer;a=blobdiff_plain;f=src%2Flift-detail-window.vala;h=a61231cd9b5963e4ee2b3315e9c8f266529e924d;hp=346b1fc11720b7c571bfb7cc2b43770a4398d24d;hb=HEAD;hpb=d5531e7a10d8058db8850a5ebe6054bfcb0f6df3 diff --git a/src/lift-detail-window.vala b/src/lift-detail-window.vala index 346b1fc..a61231c 100644 --- a/src/lift-detail-window.vala +++ b/src/lift-detail-window.vala @@ -20,10 +20,6 @@ using Gtk; using Hildon; public class LiftDetailWindow : StackableWindow { - private const string BROWSER_SERVICE = "com.nokia.osso_browser"; - private const string BROWSER_PATH = "/com/nokia/osso_browser"; - private const string BROWSER_IF = "com.nokia.osso_browser"; - private const string CALENDAR_SERVICE = "com.nokia.calendar"; private const string CALENDAR_PATH = "/com/nokia/calendar"; private const string CALENDAR_IF = "com.nokia.calendar"; @@ -150,7 +146,7 @@ public class LiftDetailWindow : StackableWindow { button_email.hide (); add (alignment); - BeifahrerProgram.orientation.changed.connect (on_orientation_changed); + Gdk.Screen.get_default ().size_changed.connect (on_orientation_changed); add_contact.clicked.connect (on_add_contact_clicked); goto_website.clicked.connect (on_goto_website_clicked); image_eventbox.button_press_event.connect (on_image_eventbox_button_pressed); @@ -194,6 +190,11 @@ public class LiftDetailWindow : StackableWindow { string phone_number = E.normalize_phone_number (lift.phone); button_phone.value = phone_number; button_sms.value = phone_number; + } else if (lift.phone2 != null) { + button_phone.title = _("Phone"); + string phone_number = E.normalize_phone_number (lift.phone2); + button_phone.value = phone_number; + button_sms.value = phone_number; } if (lift.email_image_uri != null) { @@ -348,17 +349,7 @@ public class LiftDetailWindow : StackableWindow { } void on_goto_website_clicked () { - var url = "http://mitfahrclub.adac.de" + lift.href; - - try { - var conn = DBus.Bus.get (DBus.BusType.SESSION); - - dynamic DBus.Object browser = conn.get_object (BROWSER_SERVICE, BROWSER_PATH, BROWSER_IF); - browser.open_new_window (url, false); - } catch (Error e) { - stderr.printf ("Error: %s\n", e.message); - Banner.show_information (this, null, _("Failed to open browser.")); - } + BeifahrerProgram.open_browser (this, adac.get_lift_details_url (lift)); } bool on_image_eventbox_button_pressed (Gdk.EventButton event) { @@ -371,7 +362,7 @@ public class LiftDetailWindow : StackableWindow { return false; } - void on_orientation_changed () { + void on_orientation_changed (Gdk.Screen screen) { // Maybe this will be fixed directly in Maemo-GTK, see // http://lists.maemo.org/pipermail/maemo-developers/2010-May/026332.html vbox.queue_resize ();