Debian packaging: 0.0.4-1
[beifahrer] / src / lift-detail-window.vala
index 346b1fc..a61231c 100644 (file)
@@ -20,10 +20,6 @@ using Gtk;
 using Hildon;
 
 public class LiftDetailWindow : StackableWindow {
 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";
        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);
 
                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);
                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;
                        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) {
                }
 
                if (lift.email_image_uri != null) {
@@ -348,17 +349,7 @@ public class LiftDetailWindow : StackableWindow {
        }
 
        void on_goto_website_clicked () {
        }
 
        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) {
        }
 
        bool on_image_eventbox_button_pressed (Gdk.EventButton event) {
@@ -371,7 +362,7 @@ public class LiftDetailWindow : StackableWindow {
                return false;
        }
 
                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 ();
                // Maybe this will be fixed directly in Maemo-GTK, see
                // http://lists.maemo.org/pipermail/maemo-developers/2010-May/026332.html
                vbox.queue_resize ();