diff options
author | Stefano Karapetsas <[email protected]> | 2012-09-05 19:50:04 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-09-05 19:50:04 +0200 |
commit | 4ce75a73f8a69f906a784a7704be7891e7519d81 (patch) | |
tree | 8e4694283757046632b763131b18047a8005740c /libcaja-private | |
parent | 1a64f79e50328465453567515ddd62c3ea394662 (diff) | |
download | caja-4ce75a73f8a69f906a784a7704be7891e7519d81.tar.bz2 caja-4ce75a73f8a69f906a784a7704be7891e7519d81.tar.xz |
convert desktop preferences to gsettings
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-desktop-link-monitor.c | 41 | ||||
-rw-r--r-- | libcaja-private/caja-desktop-link.c | 86 | ||||
-rw-r--r-- | libcaja-private/caja-global-preferences.c | 116 | ||||
-rw-r--r-- | libcaja-private/caja-global-preferences.h | 21 | ||||
-rw-r--r-- | libcaja-private/caja-icon-container.c | 19 | ||||
-rw-r--r-- | libcaja-private/org.mate.caja.gschema.xml.in | 6 |
6 files changed, 105 insertions, 184 deletions
diff --git a/libcaja-private/caja-desktop-link-monitor.c b/libcaja-private/caja-desktop-link-monitor.c index c8720307..e6016f2f 100644 --- a/libcaja-private/caja-desktop-link-monitor.c +++ b/libcaja-private/caja-desktop-link-monitor.c @@ -228,7 +228,7 @@ create_mount_link (CajaDesktopLinkMonitor *monitor, return; if ((!g_mount_is_shadowed (mount)) && - eel_preferences_get_boolean (CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) + g_settings_get_boolean (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) { link = caja_desktop_link_new_from_mount (mount); monitor->details->mount_links = g_list_prepend (monitor->details->mount_links, link); @@ -302,7 +302,7 @@ update_link_visibility (CajaDesktopLinkMonitor *monitor, CajaDesktopLinkType link_type, const char *preference_key) { - if (eel_preferences_get_boolean (preference_key)) + if (g_settings_get_boolean (caja_desktop_preferences, preference_key)) { if (*link_ref == NULL) { @@ -379,7 +379,7 @@ desktop_volumes_visible_changed (gpointer callback_data) monitor = CAJA_DESKTOP_LINK_MONITOR (callback_data); - if (eel_preferences_get_boolean (CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) + if (g_settings_get_boolean (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) { if (monitor->details->mount_links == NULL) { @@ -404,15 +404,20 @@ static void create_link_and_add_preference (CajaDesktopLink **link_ref, CajaDesktopLinkType link_type, const char *preference_key, - EelPreferencesCallback callback, + GCallback callback, gpointer callback_data) { - if (eel_preferences_get_boolean (preference_key)) + char *detailed_signal; + + if (g_settings_get_boolean (caja_desktop_preferences, preference_key)) { { *link_ref = caja_desktop_link_new (link_type); } - eel_preferences_add_callback (preference_key, callback, callback_data); + detailed_signal = g_strconcat ("changed::", preference_key, NULL); + g_signal_connect_swapped (caja_desktop_preferences, + detailed_signal, + callback, callback_data); } static void @@ -438,25 +443,25 @@ caja_desktop_link_monitor_init (gpointer object, gpointer klass) create_link_and_add_preference (&monitor->details->home_link, CAJA_DESKTOP_LINK_HOME, CAJA_PREFERENCES_DESKTOP_HOME_VISIBLE, - desktop_home_visible_changed, + G_CALLBACK (desktop_home_visible_changed), monitor); create_link_and_add_preference (&monitor->details->computer_link, CAJA_DESKTOP_LINK_COMPUTER, CAJA_PREFERENCES_DESKTOP_COMPUTER_VISIBLE, - desktop_computer_visible_changed, + G_CALLBACK (desktop_computer_visible_changed), monitor); create_link_and_add_preference (&monitor->details->trash_link, CAJA_DESKTOP_LINK_TRASH, CAJA_PREFERENCES_DESKTOP_TRASH_VISIBLE, - desktop_trash_visible_changed, + G_CALLBACK (desktop_trash_visible_changed), monitor); create_link_and_add_preference (&monitor->details->network_link, CAJA_DESKTOP_LINK_NETWORK, CAJA_PREFERENCES_DESKTOP_NETWORK_VISIBLE, - desktop_network_visible_changed, + G_CALLBACK (desktop_network_visible_changed), monitor); /* Mount links */ @@ -470,9 +475,10 @@ caja_desktop_link_monitor_init (gpointer object, gpointer klass) } g_list_free (mounts); - eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE, - desktop_volumes_visible_changed, - monitor); + g_signal_connect_swapped (caja_desktop_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE, + G_CALLBACK (desktop_volumes_visible_changed), + monitor); monitor->details->mount_id = g_signal_connect_object (monitor->details->volume_monitor, "mount_added", @@ -498,7 +504,8 @@ remove_link_and_preference (CajaDesktopLink **link_ref, *link_ref = NULL; } - eel_preferences_remove_callback (preference_key, callback, callback_data); + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, + callback, callback_data); } static void @@ -541,9 +548,9 @@ desktop_link_monitor_finalize (GObject *object) caja_directory_unref (monitor->details->desktop_dir); monitor->details->desktop_dir = NULL; - eel_preferences_remove_callback (CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE, - desktop_volumes_visible_changed, - monitor); + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, + desktop_volumes_visible_changed, + monitor); if (monitor->details->mount_id != 0) { diff --git a/libcaja-private/caja-desktop-link.c b/libcaja-private/caja-desktop-link.c index 502d6ef0..7ac505a3 100644 --- a/libcaja-private/caja-desktop-link.c +++ b/libcaja-private/caja-desktop-link.c @@ -118,7 +118,21 @@ home_name_changed (gpointer callback_data) g_assert (link->details->type == CAJA_DESKTOP_LINK_HOME); g_free (link->details->display_name); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_HOME_NAME); + + link->details->display_name = g_settings_get_string (caja_desktop_preferences, + CAJA_PREFERENCES_DESKTOP_HOME_NAME); + if (link->details->display_name[0] == 0) { + g_free (link->details->display_name); + /* Note to translators: If it's hard to compose a good home + * icon name from the user name, you can use a string without + * an "%s" here, in which case the home icon name will not + * include the user's name, which should be fine. To avoid a + * warning, put "%.0s" somewhere in the string, which will + * match the user name string passed by the C code, but not + * put the user name in the final string. + */ + link->details->display_name = g_strdup_printf (_("%s's Home"), g_get_user_name ()); + } caja_desktop_link_changed (link); } @@ -132,7 +146,7 @@ computer_name_changed (gpointer callback_data) g_assert (link->details->type == CAJA_DESKTOP_LINK_COMPUTER); g_free (link->details->display_name); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME); caja_desktop_link_changed (link); } @@ -146,7 +160,7 @@ trash_name_changed (gpointer callback_data) g_assert (link->details->type == CAJA_DESKTOP_LINK_TRASH); g_free (link->details->display_name); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_TRASH_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_TRASH_NAME); caja_desktop_link_changed (link); } @@ -159,7 +173,7 @@ network_name_changed (gpointer callback_data) g_assert (link->details->type == CAJA_DESKTOP_LINK_NETWORK); g_free (link->details->display_name); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_NETWORK_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_NETWORK_NAME); caja_desktop_link_changed (link); } @@ -175,38 +189,41 @@ caja_desktop_link_new (CajaDesktopLinkType type) { case CAJA_DESKTOP_LINK_HOME: link->details->filename = g_strdup ("home"); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_HOME_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_HOME_NAME); link->details->activation_location = g_file_new_for_path (g_get_home_dir ()); link->details->icon = g_themed_icon_new (CAJA_ICON_HOME); - eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_HOME_NAME, - home_name_changed, - link); + g_signal_connect_swapped (caja_desktop_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_HOME_NAME, + G_CALLBACK (home_name_changed), + link); break; case CAJA_DESKTOP_LINK_COMPUTER: link->details->filename = g_strdup ("computer"); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME); link->details->activation_location = g_file_new_for_uri ("computer:///"); /* TODO: This might need a different icon: */ link->details->icon = g_themed_icon_new (CAJA_ICON_COMPUTER); - eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME, - computer_name_changed, - link); + g_signal_connect_swapped (caja_desktop_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME, + G_CALLBACK (computer_name_changed), + link); break; case CAJA_DESKTOP_LINK_TRASH: link->details->filename = g_strdup ("trash"); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_TRASH_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_TRASH_NAME); link->details->activation_location = g_file_new_for_uri (EEL_TRASH_URI); link->details->icon = caja_trash_monitor_get_icon (); - eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_TRASH_NAME, - trash_name_changed, - link); + g_signal_connect_swapped (caja_desktop_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_TRASH_NAME, + G_CALLBACK (trash_name_changed), + link); link->details->signal_handler_obj = G_OBJECT (caja_trash_monitor_get ()); link->details->signal_handler = g_signal_connect_object (caja_trash_monitor_get (), "trash_state_changed", @@ -215,13 +232,14 @@ caja_desktop_link_new (CajaDesktopLinkType type) case CAJA_DESKTOP_LINK_NETWORK: link->details->filename = g_strdup ("network"); - link->details->display_name = eel_preferences_get (CAJA_PREFERENCES_DESKTOP_NETWORK_NAME); + link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_NETWORK_NAME); link->details->activation_location = g_file_new_for_uri ("network:///"); link->details->icon = g_themed_icon_new (CAJA_ICON_NETWORK); - eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_NETWORK_NAME, - network_name_changed, - link); + g_signal_connect_swapped (caja_desktop_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_NETWORK_NAME, + G_CALLBACK (network_name_changed), + link); break; default: @@ -366,20 +384,24 @@ caja_desktop_link_rename (CajaDesktopLink *link, switch (link->details->type) { case CAJA_DESKTOP_LINK_HOME: - eel_preferences_set (CAJA_PREFERENCES_DESKTOP_HOME_NAME, - name); + g_settings_set_string (caja_desktop_preferences, + CAJA_PREFERENCES_DESKTOP_HOME_NAME, + name); break; case CAJA_DESKTOP_LINK_COMPUTER: - eel_preferences_set (CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME, - name); + g_settings_set_string (caja_desktop_preferences, + CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME, + name); break; case CAJA_DESKTOP_LINK_TRASH: - eel_preferences_set (CAJA_PREFERENCES_DESKTOP_TRASH_NAME, - name); + g_settings_set_string (caja_desktop_preferences, + CAJA_PREFERENCES_DESKTOP_TRASH_NAME, + name); break; case CAJA_DESKTOP_LINK_NETWORK: - eel_preferences_set (CAJA_PREFERENCES_DESKTOP_NETWORK_NAME, - name); + g_settings_set_string (caja_desktop_preferences, + CAJA_PREFERENCES_DESKTOP_NETWORK_NAME, + name); break; default: g_assert_not_reached (); @@ -421,28 +443,28 @@ desktop_link_finalize (GObject *object) if (link->details->type == CAJA_DESKTOP_LINK_HOME) { - eel_preferences_remove_callback (CAJA_PREFERENCES_DESKTOP_HOME_NAME, + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, home_name_changed, link); } if (link->details->type == CAJA_DESKTOP_LINK_COMPUTER) { - eel_preferences_remove_callback (CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME, + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, computer_name_changed, link); } if (link->details->type == CAJA_DESKTOP_LINK_TRASH) { - eel_preferences_remove_callback (CAJA_PREFERENCES_DESKTOP_TRASH_NAME, + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, trash_name_changed, link); } if (link->details->type == CAJA_DESKTOP_LINK_NETWORK) { - eel_preferences_remove_callback (CAJA_PREFERENCES_DESKTOP_NETWORK_NAME, + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, network_name_changed, link); } diff --git a/libcaja-private/caja-global-preferences.c b/libcaja-private/caja-global-preferences.c index 1111e9d3..94da8a82 100644 --- a/libcaja-private/caja-global-preferences.c +++ b/libcaja-private/caja-global-preferences.c @@ -49,10 +49,6 @@ static const char *EXTRA_MONITOR_PATHS[] = { "/desktop/mate/file_views", /* Forward declarations */ static void global_preferences_install_defaults (void); static void global_preferences_register_enumerations (void); -static gpointer default_home_link_name (void); -static gpointer default_computer_link_name (void); -static gpointer default_trash_link_name (void); -static gpointer default_network_link_name (void); /* An enumeration used for installing type specific preferences defaults. */ @@ -96,17 +92,6 @@ static EelEnumerationEntry file_size_enum_entries[] = { "4294967295", N_("4 GB"), 4294967295U } }; -static EelEnumerationEntry default_icon_view_sort_order_enum_entries[] = -{ - { "manually", N_("Manually"), PREFERENCES_SORT_ORDER_MANUALLY }, - { "--------", "--------" }, - { "name", N_("By Name"), CAJA_FILE_SORT_BY_DISPLAY_NAME }, - { "size", N_("By Size"), CAJA_FILE_SORT_BY_SIZE }, - { "type", N_("By Type"), CAJA_FILE_SORT_BY_TYPE }, - { "modification_date", N_("By Modification Date"), CAJA_FILE_SORT_BY_MTIME }, - { "emblems", N_("By Emblems"), CAJA_FILE_SORT_BY_EMBLEMS } -}; - static EelEnumerationEntry standard_font_size_entries[] = { { "8", N_("8"), 8 }, @@ -215,70 +200,6 @@ static const PreferenceDefault preference_defaults[] = "default_zoom_level" }, - /* Desktop Preferences */ - { - CAJA_PREFERENCES_DESKTOP_HOME_VISIBLE, - PREFERENCE_BOOLEAN, - GINT_TO_POINTER (FALSE) - }, - - { - CAJA_PREFERENCES_DESKTOP_HOME_NAME, - PREFERENCE_STRING, - NULL, - default_home_link_name, g_free, - }, - - { - CAJA_PREFERENCES_DESKTOP_COMPUTER_VISIBLE, - PREFERENCE_BOOLEAN, - GINT_TO_POINTER (TRUE) - }, - - { - CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME, - PREFERENCE_STRING, - NULL, - default_computer_link_name, g_free, - }, - - { - CAJA_PREFERENCES_DESKTOP_TRASH_VISIBLE, - PREFERENCE_BOOLEAN, - GINT_TO_POINTER (TRUE) - }, - - { - CAJA_PREFERENCES_DESKTOP_TRASH_NAME, - PREFERENCE_STRING, - NULL, - default_trash_link_name, g_free, - }, - - { - CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE, - PREFERENCE_BOOLEAN, - GINT_TO_POINTER (TRUE) - }, - - { - CAJA_PREFERENCES_DESKTOP_NETWORK_VISIBLE, - PREFERENCE_BOOLEAN, - GINT_TO_POINTER (FALSE) - }, - - { - CAJA_PREFERENCES_DESKTOP_NETWORK_NAME, - PREFERENCE_STRING, - NULL, - default_network_link_name, g_free, - }, - - { - CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT, - PREFERENCE_INTEGER, - GINT_TO_POINTER (3) - }, { CAJA_PREFERENCES_LOCKDOWN_COMMAND_LINE, PREFERENCE_BOOLEAN, @@ -287,39 +208,6 @@ static const PreferenceDefault preference_defaults[] = { NULL } }; -static gpointer -default_home_link_name (void) -{ - /* Note to translators: If it's hard to compose a good home - * icon name from the user name, you can use a string without - * an "%s" here, in which case the home icon name will not - * include the user's name, which should be fine. To avoid a - * warning, put "%.0s" somewhere in the string, which will - * match the user name string passed by the C code, but not - * put the user name in the final string. - */ - return g_strdup_printf (_("%s's Home"), g_get_user_name ()); -} - -static gpointer -default_computer_link_name (void) -{ - return g_strdup (_("Computer")); -} - -static gpointer -default_trash_link_name (void) -{ - return g_strdup (_("Trash")); -} - -static gpointer -default_network_link_name (void) -{ - return g_strdup (_("Network Servers")); -} - - /** * global_preferences_register_enumerations @@ -340,9 +228,6 @@ global_preferences_register_enumerations (void) * populate widgets and route preferences changes between the * storage (MateConf) and the displayed values. */ - eel_enumeration_register ("default_icon_view_sort_order", - default_icon_view_sort_order_enum_entries, - G_N_ELEMENTS (default_icon_view_sort_order_enum_entries)); eel_enumeration_register ("default_zoom_level", default_zoom_level_enum_entries, G_N_ELEMENTS (default_zoom_level_enum_entries)); @@ -543,6 +428,7 @@ caja_global_preferences_init (void) caja_media_preferences = g_settings_new("org.mate.media-handling"); caja_window_state = g_settings_new("org.mate.caja.window-state"); caja_icon_view_preferences = g_settings_new("org.mate.caja.icon-view"); + caja_desktop_preferences = g_settings_new("org.mate.caja.desktop"); /* Set up storage for values accessed in this file */ g_signal_connect_swapped (caja_icon_view_preferences, diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h index 6ad73d18..73c67552 100644 --- a/libcaja-private/caja-global-preferences.h +++ b/libcaja-private/caja-global-preferences.h @@ -161,7 +161,7 @@ G_BEGIN_DECLS /* ellipsization preferences */ #define CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT "text-ellipsis-limit" -#define CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT "desktop/text_ellipsis_limit" +#define CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT "text-ellipsis-limit" /* Compact View */ #define CAJA_PREFERENCES_COMPACT_VIEW_DEFAULT_ZOOM_LEVEL "compact_view/default_zoom_level" @@ -210,15 +210,15 @@ G_BEGIN_DECLS CAJA_SIMPLE_SEARCH_BAR } CajaSearchBarMode; -#define CAJA_PREFERENCES_DESKTOP_HOME_VISIBLE "desktop/home_icon_visible" -#define CAJA_PREFERENCES_DESKTOP_HOME_NAME "desktop/home_icon_name" -#define CAJA_PREFERENCES_DESKTOP_COMPUTER_VISIBLE "desktop/computer_icon_visible" -#define CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME "desktop/computer_icon_name" -#define CAJA_PREFERENCES_DESKTOP_TRASH_VISIBLE "desktop/trash_icon_visible" -#define CAJA_PREFERENCES_DESKTOP_TRASH_NAME "desktop/trash_icon_name" -#define CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE "desktop/volumes_visible" -#define CAJA_PREFERENCES_DESKTOP_NETWORK_VISIBLE "desktop/network_icon_visible" -#define CAJA_PREFERENCES_DESKTOP_NETWORK_NAME "desktop/network_icon_name" +#define CAJA_PREFERENCES_DESKTOP_HOME_VISIBLE "home-icon-visible" +#define CAJA_PREFERENCES_DESKTOP_HOME_NAME "home-icon-name" +#define CAJA_PREFERENCES_DESKTOP_COMPUTER_VISIBLE "computer-icon-visible" +#define CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME "computer-icon-name" +#define CAJA_PREFERENCES_DESKTOP_TRASH_VISIBLE "trash-icon-visible" +#define CAJA_PREFERENCES_DESKTOP_TRASH_NAME "trash-icon-name" +#define CAJA_PREFERENCES_DESKTOP_VOLUMES_VISIBLE "volumes-visible" +#define CAJA_PREFERENCES_DESKTOP_NETWORK_VISIBLE "network-icon-visible" +#define CAJA_PREFERENCES_DESKTOP_NETWORK_NAME "network-icon-name" /* Lockdown */ #define CAJA_PREFERENCES_LOCKDOWN_COMMAND_LINE "/desktop/mate/lockdown/disable_command_line" @@ -230,6 +230,7 @@ GSettings *caja_preferences; GSettings *caja_media_preferences; GSettings *caja_window_state; GSettings *caja_icon_view_preferences; +GSettings *caja_desktop_preferences; G_END_DECLS diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index fa9651b7..787c1785 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4456,6 +4456,9 @@ finalize (GObject *object) g_signal_handlers_disconnect_by_func (caja_icon_view_preferences, text_ellipsis_limit_changed_container_callback, object); + g_signal_handlers_disconnect_by_func (caja_desktop_preferences, + text_ellipsis_limit_changed_container_callback, + object); g_hash_table_destroy (details->icon_set); details->icon_set = NULL; @@ -6202,9 +6205,10 @@ caja_icon_container_constructor (GType type, container = CAJA_ICON_CONTAINER (object); if (caja_icon_container_get_is_desktop (container)) { - eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT, - text_ellipsis_limit_changed_container_callback, - container, G_OBJECT (container)); + g_signal_connect_swapped (caja_desktop_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT, + G_CALLBACK (text_ellipsis_limit_changed_container_callback), + container); } else { @@ -6850,7 +6854,7 @@ desktop_text_ellipsis_limit_changed_callback (gpointer callback_data) { int pref; - pref = eel_preferences_get_integer (CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT); + pref = g_settings_get_int (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT); desktop_text_ellipsis_limit = pref; } @@ -6902,9 +6906,10 @@ caja_icon_container_init (CajaIconContainer *container) NULL); text_ellipsis_limit_changed_callback (NULL); - eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT, - desktop_text_ellipsis_limit_changed_callback, - NULL); + g_signal_connect_swapped (caja_icon_view_preferences, + "changed::" CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT, + G_CALLBACK (desktop_text_ellipsis_limit_changed_callback), + NULL); desktop_text_ellipsis_limit_changed_callback (NULL); setup_prefs = TRUE; diff --git a/libcaja-private/org.mate.caja.gschema.xml.in b/libcaja-private/org.mate.caja.gschema.xml.in index 35df20ec..a7f608e5 100644 --- a/libcaja-private/org.mate.caja.gschema.xml.in +++ b/libcaja-private/org.mate.caja.gschema.xml.in @@ -391,7 +391,7 @@ <_description>If this is set to true, an icon linking to the Network Servers view will be put on the desktop.</_description> </key> <key name="computer-icon-name" type="s"> - <default>''</default> + <default l10n="messages" context="computer-icon-name">'Computer'</default> <_summary>Desktop computer icon name</_summary> <_description>This name can be set if you want a custom name for the computer icon on the desktop.</_description> </key> @@ -401,12 +401,12 @@ <_description>This name can be set if you want a custom name for the home icon on the desktop.</_description> </key> <key name="trash-icon-name" type="s"> - <default>''</default> + <default l10n="messages" context="trash-icon-name">'Trash'</default> <_summary>Desktop trash icon name</_summary> <_description>This name can be set if you want a custom name for the trash icon on the desktop.</_description> </key> <key name="network-icon-name" type="s"> - <default>''</default> + <default l10n="messages" context="network-icon-name">'Network Servers'</default> <_summary>Network servers icon name</_summary> <_description>This name can be set if you want a custom name for the network servers icon on the desktop.</_description> </key> |