From c6d064ad5952f233d583ccd420c502b581d57a8c Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Fri, 29 May 2009 13:53:38 -0400 Subject: Add a Location tab in preferences --- src/empathy-preferences.c | 52 ++++++++++++ src/empathy-preferences.ui | 206 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 253 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index 628db52da..ff74a8cdc 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -64,6 +64,12 @@ typedef struct { GtkWidget *treeview_spell_checker; + GtkWidget *checkbutton_location_publish; + GtkWidget *checkbutton_location_reduce_accuracy; + GtkWidget *checkbutton_location_resource_network; + GtkWidget *checkbutton_location_resource_cell; + GtkWidget *checkbutton_location_resource_gps; + GList *notify_ids; } EmpathyPreferences; @@ -247,6 +253,38 @@ preferences_setup_widgets (EmpathyPreferences *preferences) EMPATHY_PREFS_AUTOCONNECT, preferences->checkbutton_autoconnect); + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_LOCATION_PUBLISH, + preferences->checkbutton_location_publish); + + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_LOCATION_RESOURCE_NETWORK, + preferences->checkbutton_location_resource_network); + preferences_hookup_sensitivity (preferences, + EMPATHY_PREFS_LOCATION_PUBLISH, + preferences->checkbutton_location_resource_network); + + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_LOCATION_RESOURCE_CELL, + preferences->checkbutton_location_resource_cell); + preferences_hookup_sensitivity (preferences, + EMPATHY_PREFS_LOCATION_PUBLISH, + preferences->checkbutton_location_resource_cell); + + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_LOCATION_RESOURCE_GPS, + preferences->checkbutton_location_resource_gps); + preferences_hookup_sensitivity (preferences, + EMPATHY_PREFS_LOCATION_PUBLISH, + preferences->checkbutton_location_resource_gps); + + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_LOCATION_REDUCE_ACCURACY, + preferences->checkbutton_location_reduce_accuracy); + preferences_hookup_sensitivity (preferences, + EMPATHY_PREFS_LOCATION_PUBLISH, + preferences->checkbutton_location_reduce_accuracy); + id = empathy_conf_notify_add (empathy_conf_get (), EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST, preferences_compact_contact_list_changed_cb, @@ -1009,6 +1047,8 @@ preferences_radio_button_toggled_cb (GtkWidget *button, } value = enum_value->value_nick; + } else if (key && strcmp (key, EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM) == 0) { + return; } empathy_conf_set_string (empathy_conf_get (), key, value); @@ -1094,6 +1134,11 @@ empathy_preferences_show (GtkWindow *parent) "checkbutton_sounds_disabled_away", &preferences->checkbutton_sounds_disabled_away, "treeview_sounds", &preferences->treeview_sounds, "treeview_spell_checker", &preferences->treeview_spell_checker, + "checkbutton_location_publish", &preferences->checkbutton_location_publish, + "checkbutton_location_reduce_accuracy", &preferences->checkbutton_location_reduce_accuracy, + "checkbutton_location_resource_network", &preferences->checkbutton_location_resource_network, + "checkbutton_location_resource_cell", &preferences->checkbutton_location_resource_cell, + "checkbutton_location_resource_gps", &preferences->checkbutton_location_resource_gps, NULL); g_free (filename); @@ -1124,6 +1169,13 @@ empathy_preferences_show (GtkWindow *parent) gtk_widget_show (page); } + if (TRUE) { /* FIXME */ + GtkWidget *page; + + page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (preferences->notebook), 4); + gtk_widget_show (page); + } + if (parent) { gtk_window_set_transient_for (GTK_WINDOW (preferences->dialog), GTK_WINDOW (parent)); diff --git a/src/empathy-preferences.ui b/src/empathy-preferences.ui index c20d271e2..b95354720 100644 --- a/src/empathy-preferences.ui +++ b/src/empathy-preferences.ui @@ -308,7 +308,7 @@ Notifications - 4 + 1 False @@ -423,6 +423,202 @@ False + + + True + 12 + vertical + 18 + + + _Publish location to my contacts + True + True + False + True + True + + + False + False + 0 + + + + + True + 0 + none + + + True + 6 + 12 + + + True + vertical + 6 + + + True + 6 + + + True + 0 + gtk-dialog-info + + + False + 0 + + + + + True + 0 + <small>Reduced location accuracy means that nothing more precise than your city, state and country will be published. GPS coordinates will have a random value added (±0.5°).</small> + True + True + + + 1 + + + + + False + 0 + + + + + _Reduce location accuracy + True + True + False + True + True + True + + + False + False + 1 + + + + + + + + + True + <b>Privacy</b> + True + + + + + False + False + 1 + + + + + True + 0 + none + + + True + 6 + 12 + + + True + vertical + + + Allow _GPS usage + True + True + False + True + True + + + False + False + 0 + + + + + Allow _cellphone usage + True + True + False + True + True + True + + + False + False + 1 + + + + + Allow _network usage + True + True + False + True + True + True + + + False + False + 2 + + + + + + + + + True + <b>Geoclue Settings</b> + True + + + + + False + 2 + + + + + 3 + + + + + True + Location + + + 3 + False + + True @@ -532,7 +728,7 @@ - 3 + 4 @@ -541,7 +737,7 @@ Spell Checking - 3 + 4 False @@ -616,7 +812,7 @@ - 4 + 5 @@ -625,7 +821,7 @@ Themes - 4 + 5 False -- cgit v1.2.3