mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-12 20:41:34 +00:00
By default set the background per-directory in spatial mode. Take out
004-04-09 Dave Camp <dave@ximian.com> * libnautilus-private/nautilus-directory-background.c: (nautilus_connect_desktop_background_to_file_metadata), (background_changed_callback), (nautilus_connect_background_to_file_metadata): * libnautilus-private/nautilus-directory-background.h: * libnautilus-private/nautilus-dnd.c: (nautilus_drag_drop_background_ask): * libnautilus-private/nautilus-dnd.h: * libnautilus-private/nautilus-icon-dnd.c: (get_background_drag_action): * src/file-manager/fm-icon-view.c: (fm_icon_view_begin_loading): By default set the background per-directory in spatial mode. * src/file-manager/fm-list-view.c: (fm_list_view_begin_loading): Take out background metadata stuff, we don't use an eelbackground here.
This commit is contained in:
parent
62236eb5ed
commit
a5805999a1
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2004-04-09 Dave Camp <dave@ximian.com>
|
||||||
|
|
||||||
|
* libnautilus-private/nautilus-directory-background.c:
|
||||||
|
(nautilus_connect_desktop_background_to_file_metadata),
|
||||||
|
(background_changed_callback),
|
||||||
|
(nautilus_connect_background_to_file_metadata):
|
||||||
|
* libnautilus-private/nautilus-directory-background.h:
|
||||||
|
* libnautilus-private/nautilus-dnd.c:
|
||||||
|
(nautilus_drag_drop_background_ask):
|
||||||
|
* libnautilus-private/nautilus-dnd.h:
|
||||||
|
* libnautilus-private/nautilus-icon-dnd.c:
|
||||||
|
(get_background_drag_action):
|
||||||
|
* src/file-manager/fm-icon-view.c: (fm_icon_view_begin_loading):
|
||||||
|
By default set the background per-directory in spatial mode.
|
||||||
|
* src/file-manager/fm-list-view.c: (fm_list_view_begin_loading):
|
||||||
|
Take out background metadata stuff, we don't use an eelbackground
|
||||||
|
here.
|
||||||
|
|
||||||
2004-04-09 Dave Camp <dave@ximian.com>
|
2004-04-09 Dave Camp <dave@ximian.com>
|
||||||
|
|
||||||
* src/nautilus-window-manage-views.c: (new_window_show_callback),
|
* src/nautilus-window-manage-views.c: (new_window_show_callback),
|
||||||
|
|
|
@ -127,7 +127,7 @@ nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *ico
|
||||||
* waste, but won't hurt, so I don't think it's worth refactoring the fn
|
* waste, but won't hurt, so I don't think it's worth refactoring the fn
|
||||||
* at this point.
|
* at this point.
|
||||||
*/
|
*/
|
||||||
nautilus_connect_background_to_file_metadata (GTK_WIDGET (icon_container), file);
|
nautilus_connect_background_to_file_metadata (GTK_WIDGET (icon_container), file, NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND);
|
||||||
|
|
||||||
if (GTK_WIDGET_REALIZED (icon_container)) {
|
if (GTK_WIDGET_REALIZED (icon_container)) {
|
||||||
desktop_background_realized (icon_container, GINT_TO_POINTER (FALSE));
|
desktop_background_realized (icon_container, GINT_TO_POINTER (FALSE));
|
||||||
|
@ -611,7 +611,17 @@ background_changed_callback (EelBackground *background,
|
||||||
g_signal_handlers_block_by_func (
|
g_signal_handlers_block_by_func (
|
||||||
file, G_CALLBACK (saved_settings_changed_callback), background);
|
file, G_CALLBACK (saved_settings_changed_callback), background);
|
||||||
|
|
||||||
if (action != NAUTILUS_DND_ACTION_SET_AS_BACKGROUND) {
|
if (action != NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND && action != NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND) {
|
||||||
|
GdkDragAction default_drag_action;
|
||||||
|
|
||||||
|
default_drag_action = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (background), "default_drag_action"));
|
||||||
|
|
||||||
|
|
||||||
|
action = default_drag_action;
|
||||||
|
g_print ("checking action, default_drag_action is %d\n", action);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND) {
|
||||||
nautilus_file_set_metadata (file,
|
nautilus_file_set_metadata (file,
|
||||||
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
|
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -839,7 +849,8 @@ background_destroyed_callback (EelBackground *background,
|
||||||
/* key routine that hooks up a background and location */
|
/* key routine that hooks up a background and location */
|
||||||
void
|
void
|
||||||
nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
||||||
NautilusFile *file)
|
NautilusFile *file,
|
||||||
|
GdkDragAction default_drag_action)
|
||||||
{
|
{
|
||||||
EelBackground *background;
|
EelBackground *background;
|
||||||
gpointer old_file;
|
gpointer old_file;
|
||||||
|
@ -880,6 +891,8 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
||||||
g_object_set_data_full (G_OBJECT (background), "eel_background_file",
|
g_object_set_data_full (G_OBJECT (background), "eel_background_file",
|
||||||
file, (GDestroyNotify) nautilus_file_unref);
|
file, (GDestroyNotify) nautilus_file_unref);
|
||||||
|
|
||||||
|
g_object_set_data (G_OBJECT (background), "default_drag_action", GINT_TO_POINTER (default_drag_action));
|
||||||
|
|
||||||
/* Connect new signal handlers. */
|
/* Connect new signal handlers. */
|
||||||
if (file != NULL) {
|
if (file != NULL) {
|
||||||
g_signal_connect_object (background, "settings_changed",
|
g_signal_connect_object (background, "settings_changed",
|
||||||
|
@ -910,13 +923,3 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
||||||
/* Update the background based on the file metadata. */
|
/* Update the background based on the file metadata. */
|
||||||
initialize_background_from_settings (file, background);
|
initialize_background_from_settings (file, background);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nautilus_connect_background_to_file_metadata_by_uri (GtkWidget *widget,
|
|
||||||
const char *uri)
|
|
||||||
{
|
|
||||||
NautilusFile *file;
|
|
||||||
file = nautilus_file_get (uri);
|
|
||||||
nautilus_connect_background_to_file_metadata (widget, file);
|
|
||||||
nautilus_file_unref (file);
|
|
||||||
}
|
|
||||||
|
|
|
@ -29,9 +29,8 @@
|
||||||
#include <libnautilus-private/nautilus-icon-container.h>
|
#include <libnautilus-private/nautilus-icon-container.h>
|
||||||
|
|
||||||
void nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
void nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
||||||
NautilusFile *file);
|
NautilusFile *file,
|
||||||
|
GdkDragAction default_drag_action);
|
||||||
void nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container,
|
void nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container,
|
||||||
NautilusFile *file);
|
NautilusFile *file);
|
||||||
void nautilus_connect_background_to_file_metadata_by_uri (GtkWidget *widget,
|
|
||||||
const char *uri);
|
|
||||||
gboolean nautilus_file_background_is_set (EelBackground *background);
|
gboolean nautilus_file_background_is_set (EelBackground *background);
|
||||||
|
|
|
@ -683,8 +683,8 @@ nautilus_drag_drop_background_ask (GtkWidget *widget,
|
||||||
&damd);
|
&damd);
|
||||||
|
|
||||||
append_drop_action_menu_item (menu, _("Set as background for _this folder"),
|
append_drop_action_menu_item (menu, _("Set as background for _this folder"),
|
||||||
NAUTILUS_DND_ACTION_SET_AS_BACKGROUND,
|
NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND,
|
||||||
(actions & NAUTILUS_DND_ACTION_SET_AS_BACKGROUND) != 0,
|
(actions & NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND) != 0,
|
||||||
&damd);
|
&damd);
|
||||||
|
|
||||||
menu_item = gtk_separator_menu_item_new ();
|
menu_item = gtk_separator_menu_item_new ();
|
||||||
|
|
|
@ -64,7 +64,8 @@ typedef enum {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NAUTILUS_DND_ACTION_FIRST = GDK_ACTION_ASK << 1,
|
NAUTILUS_DND_ACTION_FIRST = GDK_ACTION_ASK << 1,
|
||||||
NAUTILUS_DND_ACTION_SET_AS_BACKGROUND = NAUTILUS_DND_ACTION_FIRST << 0,
|
NAUTILUS_DND_ACTION_SET_AS_BACKGROUND = NAUTILUS_DND_ACTION_FIRST << 0,
|
||||||
NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND = NAUTILUS_DND_ACTION_FIRST << 1
|
NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND = NAUTILUS_DND_ACTION_FIRST << 1,
|
||||||
|
NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND = NAUTILUS_DND_ACTION_FIRST << 2
|
||||||
} NautilusDndAction;
|
} NautilusDndAction;
|
||||||
|
|
||||||
/* drag&drop-related information. */
|
/* drag&drop-related information. */
|
||||||
|
|
|
@ -533,7 +533,7 @@ get_background_drag_action (NautilusIconContainer *container,
|
||||||
GdkDragAction valid_actions;
|
GdkDragAction valid_actions;
|
||||||
|
|
||||||
if (action == GDK_ACTION_ASK) {
|
if (action == GDK_ACTION_ASK) {
|
||||||
valid_actions = NAUTILUS_DND_ACTION_SET_AS_BACKGROUND;
|
valid_actions = NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND;
|
||||||
if (g_object_get_data (G_OBJECT (eel_get_widget_background (GTK_WIDGET (container))), "is_desktop") == 0) {
|
if (g_object_get_data (G_OBJECT (eel_get_widget_background (GTK_WIDGET (container))), "is_desktop") == 0) {
|
||||||
valid_actions |= NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND;
|
valid_actions |= NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1088,7 +1088,18 @@ fm_icon_view_begin_loading (FMDirectoryView *view)
|
||||||
if (FM_IS_DESKTOP_ICON_VIEW (view)) {
|
if (FM_IS_DESKTOP_ICON_VIEW (view)) {
|
||||||
nautilus_connect_desktop_background_to_file_metadata (NAUTILUS_ICON_CONTAINER (icon_container), file);
|
nautilus_connect_desktop_background_to_file_metadata (NAUTILUS_ICON_CONTAINER (icon_container), file);
|
||||||
} else {
|
} else {
|
||||||
nautilus_connect_background_to_file_metadata (icon_container, file);
|
GdkDragAction default_action;
|
||||||
|
|
||||||
|
if (nautilus_view_get_window_type (fm_directory_view_get_nautilus_view (view)) == Nautilus_WINDOW_NAVIGATION) {
|
||||||
|
default_action = NAUTILUS_DND_ACTION_SET_AS_GLOBAL_BACKGROUND;
|
||||||
|
} else {
|
||||||
|
default_action = NAUTILUS_DND_ACTION_SET_AS_FOLDER_BACKGROUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
nautilus_connect_background_to_file_metadata
|
||||||
|
(icon_container,
|
||||||
|
file,
|
||||||
|
default_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1258,9 +1258,6 @@ fm_list_view_begin_loading (FMDirectoryView *view)
|
||||||
|
|
||||||
list_view = FM_LIST_VIEW (view);
|
list_view = FM_LIST_VIEW (view);
|
||||||
|
|
||||||
nautilus_connect_background_to_file_metadata (GTK_WIDGET (list_view->details->tree_view),
|
|
||||||
fm_directory_view_get_directory_as_file (view));
|
|
||||||
|
|
||||||
set_sort_order_from_metadata_and_preferences (list_view);
|
set_sort_order_from_metadata_and_preferences (list_view);
|
||||||
set_zoom_level_from_metadata_and_preferences (list_view);
|
set_zoom_level_from_metadata_and_preferences (list_view);
|
||||||
set_visible_columns_from_metadata_and_preferences (list_view);
|
set_visible_columns_from_metadata_and_preferences (list_view);
|
||||||
|
|
Loading…
Reference in a new issue