]> git.0d.be Git - empathy.git/commitdiff
Add a new preference in the UI
authorCosimo Cecchi <cosimoc@gnome.org>
Wed, 6 May 2009 13:04:12 +0000 (15:04 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 1 Jun 2009 15:49:55 +0000 (17:49 +0200)
libempathy-gtk/empathy-conf.h
libempathy-gtk/empathy-ui-utils.c
src/empathy-preferences.c
src/empathy-preferences.ui

index 07026df5c9b1ff0ee6698a78807caaa03a14e82a..d650f42244c4d209aa6c9071297ad21d1bfe081d 100644 (file)
@@ -82,6 +82,7 @@ struct _EmpathyConfClass {
 #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"
 #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"
+#define EMPATHY_PREFS_FILE_TRANSFER_USE_HASH       EMPATHY_PREFS_PATH "/file_transfer/use_hash"
 
 typedef void (*EmpathyConfNotifyFunc) (EmpathyConf  *conf,
                                      const gchar *key,
 
 typedef void (*EmpathyConfNotifyFunc) (EmpathyConf  *conf,
                                      const gchar *key,
index f7c8149eb8fa1e1b7ef1efdf5d1e17fef6921e28..3ea3e76aa43c56f2bbcf811678f06a5b22005ded 100644 (file)
@@ -1411,14 +1411,21 @@ file_manager_send_file_response_cb (GtkDialog      *widget,
        GFile *file;
        gchar *uri;
        GtkRecentManager *manager;
        GFile *file;
        gchar *uri;
        GtkRecentManager *manager;
+       gboolean use_hash;
 
        if (response_id == GTK_RESPONSE_OK) {
                file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (widget));
                uri = g_file_get_uri (file);
 
 
        if (response_id == GTK_RESPONSE_OK) {
                file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (widget));
                uri = g_file_get_uri (file);
 
+               use_hash = empathy_conf_get_bool
+                       (empathy_conf_get (),
+                        EMPATHY_PREFS_FILE_TRANSFER_USE_HASH,
+                        &use_hash);
+
                factory = empathy_ft_factory_dup_singleton ();
 
                factory = empathy_ft_factory_dup_singleton ();
 
-               empathy_ft_factory_new_transfer_outgoing (factory, contact, file);
+               empathy_ft_factory_new_transfer_outgoing (factory, contact,
+                                                         file, use_hash);
 
                manager = gtk_recent_manager_get_default ();
                gtk_recent_manager_add_item (manager, uri);
 
                manager = gtk_recent_manager_get_default ();
                gtk_recent_manager_add_item (manager, uri);
index 406db4c9f2ccd16a032fcc206031eb6eb4f314d5..d2ac53bb35dc82caae5104efb73978ad536f3327 100644 (file)
@@ -53,6 +53,7 @@ typedef struct {
        GtkWidget *checkbutton_autoconnect;
        GtkWidget *radiobutton_contact_list_sort_by_name;
        GtkWidget *radiobutton_contact_list_sort_by_state;
        GtkWidget *checkbutton_autoconnect;
        GtkWidget *radiobutton_contact_list_sort_by_name;
        GtkWidget *radiobutton_contact_list_sort_by_state;
+       GtkWidget *checkbutton_use_hash;
 
        GtkWidget *checkbutton_sounds_enabled;
        GtkWidget *checkbutton_sounds_disabled_away;
 
        GtkWidget *checkbutton_sounds_enabled;
        GtkWidget *checkbutton_sounds_disabled_away;
@@ -284,6 +285,9 @@ preferences_setup_widgets (EmpathyPreferences *preferences)
        preferences_hookup_sensitivity (preferences,
                                        EMPATHY_PREFS_LOCATION_PUBLISH,
                                        preferences->checkbutton_location_reduce_accuracy);
        preferences_hookup_sensitivity (preferences,
                                        EMPATHY_PREFS_LOCATION_PUBLISH,
                                        preferences->checkbutton_location_reduce_accuracy);
+       preferences_hookup_toggle_button (preferences,
+                                         EMPATHY_PREFS_FILE_TRANSFER_USE_HASH,
+                                         preferences->checkbutton_use_hash);
 
        id = empathy_conf_notify_add (empathy_conf_get (),
                                      EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST,
 
        id = empathy_conf_notify_add (empathy_conf_get (),
                                      EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST,
@@ -1128,6 +1132,7 @@ empathy_preferences_show (GtkWindow *parent)
                "checkbutton_autoconnect", &preferences->checkbutton_autoconnect,
                "radiobutton_contact_list_sort_by_name", &preferences->radiobutton_contact_list_sort_by_name,
                "radiobutton_contact_list_sort_by_state", &preferences->radiobutton_contact_list_sort_by_state,
                "checkbutton_autoconnect", &preferences->checkbutton_autoconnect,
                "radiobutton_contact_list_sort_by_name", &preferences->radiobutton_contact_list_sort_by_name,
                "radiobutton_contact_list_sort_by_state", &preferences->radiobutton_contact_list_sort_by_state,
+               "checkbutton_use_hash", &preferences->checkbutton_use_hash,
                "checkbutton_notifications_enabled", &preferences->checkbutton_notifications_enabled,
                "checkbutton_notifications_disabled_away", &preferences->checkbutton_notifications_disabled_away,
                "checkbutton_notifications_focus", &preferences->checkbutton_notifications_focus,
                "checkbutton_notifications_enabled", &preferences->checkbutton_notifications_enabled,
                "checkbutton_notifications_disabled_away", &preferences->checkbutton_notifications_disabled_away,
                "checkbutton_notifications_focus", &preferences->checkbutton_notifications_focus,
index d92fc8f88458e25bef00a2e7d6a4e1c807e68173..4185ef7dc158d3c81c7951397288afb96aff145a 100644 (file)
                     <property name="position">2</property>
                   </packing>
                 </child>
                     <property name="position">2</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="GtkCheckButton" id="checkbutton_use_hash">
+                            <property name="label" translatable="yes">Use chec_ksum to validate file transfers</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>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label2">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;File Transfer&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">3</property>
+                  </packing>
+                </child>
               </object>
             </child>
             <child type="tab">
               </object>
             </child>
             <child type="tab">