diff options
author | Jasmine Hassan <[email protected]> | 2012-11-29 19:39:28 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-12-03 21:15:16 +0200 |
commit | 01c34579453893b76849400c9375dcc67c44622f (patch) | |
tree | 38ec0ab84f3effe6017c2b3989905b9f127bc1fe | |
parent | 532fbb1ce6bf446c8c5e40f8a49abc3e450a65d0 (diff) | |
download | caja-01c34579453893b76849400c9375dcc67c44622f.tar.bz2 caja-01c34579453893b76849400c9375dcc67c44622f.tar.xz |
[global-prefs|application] use MATE global 'show-desktop-icons' setting
instead of a local-to-caja setting 'show-desktop'
This key would indicate that file managers (by default Caja, but applies to
others like Thunar or ROX) should handle desktop, i.e. draw a background and
place icons there. Otherwise (when false), mate-settings-daemon will take
over drawing desktop background.
This is different from 'draw-background', which is a separate option used
only for drawing background without icons (by mate-settings-daemon).
To Caja, 'show-desktop-icons' implies 'draw-background', and so if set to
false, Caja won't (needlessly) draw the desktop.
However, if the user uses the "Background & Emblems dialog" to drop an
image-pattern/color/reset on the desktop, Caja will again draw the desktop.
For reference:
https://bugzilla.gnome.org/show_bug.cgi?id=632225
-rw-r--r-- | libcaja-private/caja-global-preferences.h | 106 | ||||
-rw-r--r-- | libcaja-private/org.mate.caja.gschema.xml.in | 5 | ||||
-rw-r--r-- | src/caja-application.c | 9 |
3 files changed, 58 insertions, 62 deletions
diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h index 0430a016..85fbe75f 100644 --- a/libcaja-private/caja-global-preferences.h +++ b/libcaja-private/caja-global-preferences.h @@ -30,79 +30,77 @@ G_BEGIN_DECLS - /* Whether exit when last window destroyed */ -#define CAJA_PREFERENCES_EXIT_WITH_LAST_WINDOW "exit-with-last-window" - - /* Desktop Background options */ -#define CAJA_PREFERENCES_BACKGROUND_SET "background-set" -#define CAJA_PREFERENCES_BACKGROUND_COLOR "background-color" -#define CAJA_PREFERENCES_BACKGROUND_URI "background-uri" - - /* Side Pane Background options */ -#define CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET "side-pane-background-set" -#define CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR "side-pane-background-color" -#define CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_URI "side-pane-background-uri" - - /* Automount options */ -#define CAJA_PREFERENCES_MEDIA_AUTOMOUNT "automount" -#define CAJA_PREFERENCES_MEDIA_AUTOMOUNT_OPEN "automount-open" - - /* Autorun options */ -#define CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER "autorun-never" -#define CAJA_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_START_APP "autorun-x-content-start-app" -#define CAJA_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_IGNORE "autorun-x-content-ignore" -#define CAJA_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER "autorun-x-content-open-folder" - - /* Trash options */ +/* Whether exit when last window destroyed */ +#define CAJA_PREFERENCES_EXIT_WITH_LAST_WINDOW "exit-with-last-window" + +/* Desktop Background options */ +#define CAJA_PREFERENCES_BACKGROUND_SET "background-set" +#define CAJA_PREFERENCES_BACKGROUND_COLOR "background-color" +#define CAJA_PREFERENCES_BACKGROUND_URI "background-uri" + +/* Side Pane Background options */ +#define CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET "side-pane-background-set" +#define CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR "side-pane-background-color" +#define CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_URI "side-pane-background-uri" + +/* Automount options */ +#define CAJA_PREFERENCES_MEDIA_AUTOMOUNT "automount" +#define CAJA_PREFERENCES_MEDIA_AUTOMOUNT_OPEN "automount-open" + +/* Autorun options */ +#define CAJA_PREFERENCES_MEDIA_AUTORUN_NEVER "autorun-never" +#define CAJA_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_START_APP "autorun-x-content-start-app" +#define CAJA_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_IGNORE "autorun-x-content-ignore" +#define CAJA_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER "autorun-x-content-open-folder" + +/* Trash options */ #define CAJA_PREFERENCES_CONFIRM_TRASH "confirm-trash" #define CAJA_PREFERENCES_ENABLE_DELETE "enable-delete" - /* Desktop options */ -#define CAJA_PREFERENCES_SHOW_DESKTOP "show-desktop" -#define CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR "desktop-is-home-dir" +/* Desktop options */ +#define CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR "desktop-is-home-dir" - /* Display */ +/* Display */ #define CAJA_PREFERENCES_SHOW_HIDDEN_FILES "show-hidden-files" #define CAJA_PREFERENCES_SHOW_ADVANCED_PERMISSIONS "show-advanced-permissions" -#define CAJA_PREFERENCES_DATE_FORMAT "date-format" +#define CAJA_PREFERENCES_DATE_FORMAT "date-format" - /* Mouse */ +/* Mouse */ #define CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "mouse-use-extra-buttons" #define CAJA_PREFERENCES_MOUSE_FORWARD_BUTTON "mouse-forward-button" -#define CAJA_PREFERENCES_MOUSE_BACK_BUTTON "mouse-back-button" - - typedef enum - { - CAJA_DATE_FORMAT_LOCALE, - CAJA_DATE_FORMAT_ISO, - CAJA_DATE_FORMAT_INFORMAL - } - CajaDateFormat; - - typedef enum - { - CAJA_NEW_TAB_POSITION_AFTER_CURRENT_TAB, - CAJA_NEW_TAB_POSITION_END, - } CajaNewTabPosition; - - /* Sidebar panels */ +#define CAJA_PREFERENCES_MOUSE_BACK_BUTTON "mouse-back-button" + +typedef enum +{ + CAJA_DATE_FORMAT_LOCALE, + CAJA_DATE_FORMAT_ISO, + CAJA_DATE_FORMAT_INFORMAL +} CajaDateFormat; + +typedef enum +{ + CAJA_NEW_TAB_POSITION_AFTER_CURRENT_TAB, + CAJA_NEW_TAB_POSITION_END, +} CajaNewTabPosition; + +/* Sidebar panels */ #define CAJA_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES "show-only-directories" - /* Single/Double click preference */ +/* Single/Double click preference */ #define CAJA_PREFERENCES_CLICK_POLICY "click-policy" - /* Activating executable text files */ +/* Activating executable text files */ #define CAJA_PREFERENCES_EXECUTABLE_TEXT_ACTIVATION "executable-text-activation" - /* Installing new packages when unknown mime type activated */ +/* Installing new packages when unknown mime type activated */ #define CAJA_PREFERENCES_INSTALL_MIME_ACTIVATION "install-mime-activation" - /* Spatial or browser mode */ +/* Spatial or browser mode */ #define CAJA_PREFERENCES_ALWAYS_USE_BROWSER "always-use-browser" #define CAJA_PREFERENCES_NEW_TAB_POSITION "tabs-open-position" #define CAJA_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY "always-use-location-entry" - /* Which views should be displayed for new windows */ +/* Which views should be displayed for new windows */ #define CAJA_WINDOW_STATE_START_WITH_LOCATION_BAR "start-with-location-bar" #define CAJA_WINDOW_STATE_START_WITH_STATUS_BAR "start-with-status-bar" #define CAJA_WINDOW_STATE_START_WITH_SIDEBAR "start-with-sidebar" @@ -112,12 +110,12 @@ G_BEGIN_DECLS #define CAJA_WINDOW_STATE_MAXIMIZED "maximized" #define CAJA_WINDOW_STATE_SIDEBAR_WIDTH "sidebar-width" - /* Sorting order */ +/* Sorting order */ #define CAJA_PREFERENCES_SORT_DIRECTORIES_FIRST "sort-directories-first" #define CAJA_PREFERENCES_DEFAULT_SORT_ORDER "default-sort-order" #define CAJA_PREFERENCES_DEFAULT_SORT_IN_REVERSE_ORDER "default-sort-in-reverse-order" - /* The default folder viewer - one of the two enums below */ +/* The default folder viewer - one of the two enums below */ #define CAJA_PREFERENCES_DEFAULT_FOLDER_VIEWER "default-folder-viewer" enum diff --git a/libcaja-private/org.mate.caja.gschema.xml.in b/libcaja-private/org.mate.caja.gschema.xml.in index 6e9ad411..5ae3e1a1 100644 --- a/libcaja-private/org.mate.caja.gschema.xml.in +++ b/libcaja-private/org.mate.caja.gschema.xml.in @@ -181,11 +181,6 @@ <_summary>Reverse sort order in new windows</_summary> <_description>If true, files in new windows will be sorted in reverse order. ie, if sorted by name, then instead of sorting the files from "a" to "z", they will be sorted from "z" to "a"; if sorted by size, instead of being incrementally they will be sorted decrementally.</_description> </key> - <key name="show-desktop" type="b"> - <default>true</default> - <_summary>Caja handles drawing the desktop</_summary> - <_description>If set to true, then Caja will draw the icons on the desktop.</_description> - </key> <key name="desktop-is-home-dir" type="b"> <default>false</default> <_summary>Caja uses the users home folder as the desktop</_summary> diff --git a/src/caja-application.c b/src/caja-application.c index 47a956c4..f09e2720 100644 --- a/src/caja-application.c +++ b/src/caja-application.c @@ -74,6 +74,8 @@ #include <libcaja-private/caja-signaller.h> #include <libcaja-extension/caja-menu-provider.h> #include <libcaja-private/caja-autorun.h> +#define MATE_DESKTOP_USE_UNSTABLE_API +#include <libmateui/mate-bg.h> #include "glibcompat.h" /* for g_list_free_full */ @@ -964,7 +966,7 @@ caja_application_startup (CajaApplication *application, char *accel_map_filename; if (!no_desktop && - !g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_DESKTOP)) + !g_settings_get_boolean (mate_background_preferences, MATE_BG_KEY_SHOW_DESKTOP)) { no_desktop = TRUE; } @@ -989,7 +991,8 @@ caja_application_startup (CajaApplication *application, } /* Monitor the preference to show or hide the desktop */ - g_signal_connect_swapped (caja_preferences, "changed::" CAJA_PREFERENCES_SHOW_DESKTOP, + g_signal_connect_swapped (mate_background_preferences, + "changed::" MATE_BG_KEY_SHOW_DESKTOP, G_CALLBACK(desktop_changed_callback), G_OBJECT (application)); @@ -1567,7 +1570,7 @@ desktop_changed_callback (gpointer user_data) CajaApplication *application; application = CAJA_APPLICATION (user_data); - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_DESKTOP)) + if (g_settings_get_boolean (mate_background_preferences, MATE_BG_KEY_SHOW_DESKTOP)) { caja_application_open_desktop (application); } |