]> git.0d.be Git - empathy.git/commitdiff
Add a Location tab in preferences
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>
Fri, 29 May 2009 17:53:38 +0000 (13:53 -0400)
committerPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>
Mon, 1 Jun 2009 15:35:28 +0000 (11:35 -0400)
data/empathy.schemas.in
libempathy-gtk/empathy-conf.h
src/empathy-preferences.c
src/empathy-preferences.ui

index 62b462fb2aac3756c947be416d1f5c1145d04332..80a1457c7d2b24fc2d771761210cf4aed483b9ad 100644 (file)
       </locale>
     </schema>
 
-  </schemalist>  
+    <schema>
+      <key>/schemas/apps/empathy/location/publish</key>
+      <applyto>/apps/empathy/location/publish</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Empathy can publish the user's location</short>
+        <long>
+        Whether or not Empathy can publish the user's location to his contacts.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/empathy/location/resource_network</key>
+      <applyto>/apps/empathy/location/resource_network</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Empathy can use the network to guess the location</short>
+        <long>
+        Whether or not Empathy can use the network to guess the location.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/empathy/location/resource_cell</key>
+      <applyto>/apps/empathy/location/resource_cell</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Empathy can use the cellular network to guess the location</short>
+        <long>
+        Whether or not Empathy can use the cellular network to guess the location.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/empathy/location/resource_gps</key>
+      <applyto>/apps/empathy/location/resource_gps</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Empathy can use the GPS to guess the location</short>
+        <long>
+        Whether or not Empathy can use the GPS to guess the location.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/empathy/location/reduce_accuracy</key>
+      <applyto>/apps/empathy/location/reduce_accuracy</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Empathy should reduce the location's accuracy</short>
+        <long>
+        Whether or not Empathy should reduce the location's accuracy for privacy reasons.
+        </long>
+      </locale>
+    </schema>
+
+  </schemalist>
 </gconfschemafile>
index 4a6fdc4f885e3e9d09b7c152d9f9d39f485bf6bb..07026df5c9b1ff0ee6698a78807caaa03a14e82a 100644 (file)
@@ -77,6 +77,11 @@ struct _EmpathyConfClass {
 #define EMPATHY_PREFS_AUTOCONNECT                  EMPATHY_PREFS_PATH "/autoconnect"
 #define EMPATHY_PREFS_IMPORT_ASKED                 EMPATHY_PREFS_PATH "/import_asked"
 #define EMPATHY_PREFS_FILE_TRANSFER_DEFAULT_FOLDER EMPATHY_PREFS_PATH "/file_transfer/default_folder"
+#define EMPATHY_PREFS_LOCATION_PUBLISH             EMPATHY_PREFS_PATH "/location/publish"
+#define EMPATHY_PREFS_LOCATION_RESOURCE_NETWORK    EMPATHY_PREFS_PATH "/location/resource_network"
+#define EMPATHY_PREFS_LOCATION_RESOURCE_CELL       EMPATHY_PREFS_PATH "/location/resource_cell"
+#define EMPATHY_PREFS_LOCATION_RESOURCE_GPS        EMPATHY_PREFS_PATH "/location/resource_gps"
+#define EMPATHY_PREFS_LOCATION_REDUCE_ACCURACY     EMPATHY_PREFS_PATH "/location/reduce_accuracy"
 
 typedef void (*EmpathyConfNotifyFunc) (EmpathyConf  *conf,
                                      const gchar *key,
index 628db52da2035ed8ec95a9c708b0bbd608d5cdc3..ff74a8cdc751ca057fba06c1a28bee42764caf0e 100644 (file)
@@ -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));
index c20d271e2670878d4dbaaf900147042297081385..b95354720e1e2f04615239b6a06b375f83a855ca 100644 (file)
                 <property name="label" translatable="yes">Notifications</property>
               </object>
               <packing>
-                <property name="position">4</property>
+                <property name="position">1</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">18</property>
+                <child>
+                  <object class="GtkCheckButton" id="checkbutton_location_publish">
+                    <property name="label" translatable="yes">_Publish location to my contacts</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame1">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment2">
+                        <property name="visible">True</property>
+                        <property name="top_padding">6</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkVBox" id="vbox4">
+                            <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkHBox" id="hbox1">
+                                <property name="visible">True</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <object class="GtkImage" id="image1">
+                                    <property name="visible">True</property>
+                                    <property name="yalign">0</property>
+                                    <property name="stock">gtk-dialog-info</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label6">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">&lt;small&gt;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 (&#xB1;0.5&#xB0;).&lt;/small&gt;</property>
+                                    <property name="use_markup">True</property>
+                                    <property name="wrap">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="checkbutton_location_reduce_accuracy">
+                                <property name="label" translatable="yes">_Reduce location accuracy</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label3">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Privacy&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame5">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment4">
+                        <property name="visible">True</property>
+                        <property name="top_padding">6</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkVBox" id="vbox5">
+                            <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
+                            <child>
+                              <object class="GtkCheckButton" id="checkbutton_location_resource_gps">
+                                <property name="label" translatable="yes">Allow _GPS usage</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="checkbutton_location_resource_cell">
+                                <property name="label" translatable="yes">Allow _cellphone usage</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="checkbutton_location_resource_network">
+                                <property name="label" translatable="yes">Allow _network usage</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label5">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Geoclue Settings&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Location</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
             <child>
               <object class="GtkVBox" id="vbox168">
                 <property name="visible">True</property>
                 </child>
               </object>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
               </packing>
             </child>
             <child type="tab">
                 <property name="label" translatable="yes">Spell Checking</property>
               </object>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
                 </child>
               </object>
               <packing>
-                <property name="position">4</property>
+                <property name="position">5</property>
               </packing>
             </child>
             <child type="tab">
                 <property name="label" translatable="yes">Themes</property>
               </object>
               <packing>
-                <property name="position">4</property>
+                <property name="position">5</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>