From: Cosimo Cecchi Date: Wed, 6 May 2009 13:04:12 +0000 (+0200) Subject: Add a new preference in the UI X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=d3fc1349507da7d0bb6538a8e66fa3116bb6eec9 Add a new preference in the UI --- diff --git a/libempathy-gtk/empathy-conf.h b/libempathy-gtk/empathy-conf.h index 07026df5..d650f422 100644 --- a/libempathy-gtk/empathy-conf.h +++ b/libempathy-gtk/empathy-conf.h @@ -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_FILE_TRANSFER_USE_HASH EMPATHY_PREFS_PATH "/file_transfer/use_hash" typedef void (*EmpathyConfNotifyFunc) (EmpathyConf *conf, const gchar *key, diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index f7c8149e..3ea3e76a 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1411,14 +1411,21 @@ file_manager_send_file_response_cb (GtkDialog *widget, 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); + use_hash = empathy_conf_get_bool + (empathy_conf_get (), + EMPATHY_PREFS_FILE_TRANSFER_USE_HASH, + &use_hash); + 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); diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index 406db4c9..d2ac53bb 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -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_use_hash; 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_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, @@ -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_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, diff --git a/src/empathy-preferences.ui b/src/empathy-preferences.ui index d92fc8f8..4185ef7d 100644 --- a/src/empathy-preferences.ui +++ b/src/empathy-preferences.ui @@ -224,6 +224,42 @@ 2 + + + True + 0 + none + + + True + 6 + 12 + + + Use chec_ksum to validate file transfers + True + True + False + True + True + + + + + + + True + <b>File Transfer</b> + True + + + + + False + False + 3 + +