Commit 72aa6695 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Require gtk/glib 2.3.0

2003-12-18  Alexander Larsson  <alexl@redhat.com>

	* configure.in:
	Require gtk/glib 2.3.0

	* libnautilus-private/nautilus-directory.c:
	Use gobject private data for details

	* libnautilus-private/nautilus-file-private.h:
	* libnautilus-private/nautilus-file.[ch]:
	Use gobject private data for details
	Add has_open_window flag and setter/getter

	* libnautilus-private/nautilus-icon-container.[ch]:
	* src/file-manager/fm-icon-container.c:
	Support visiting modifier for icons with open windows

	* src/file-manager/fm-directory-view.c:
	Don't use filename extension in templates name

	* src/file-manager/fm-list-model.c:
	Support accept and visiting icon modifiers

	* src/file-manager/fm-list-view.c:
	Always set the drag_view on the model so that the accept
	modifier works

	* src/nautilus-window.c: (nautilus_window_set_viewed_file):
	Set has_open_window on file
parent 934d4968
2003-12-18 Alexander Larsson <alexl@redhat.com>
* configure.in:
Require gtk/glib 2.3.0
* libnautilus-private/nautilus-directory.c:
Use gobject private data for details
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.[ch]:
Use gobject private data for details
Add has_open_window flag and setter/getter
* libnautilus-private/nautilus-icon-container.[ch]:
* src/file-manager/fm-icon-container.c:
Support visiting modifier for icons with open windows
* src/file-manager/fm-directory-view.c:
Don't use filename extension in templates name
* src/file-manager/fm-list-model.c:
Support accept and visiting icon modifiers
* src/file-manager/fm-list-view.c:
Always set the drag_view on the model so that the accept
modifier works
* src/nautilus-window.c: (nautilus_window_set_viewed_file):
Set has_open_window on file
2003-12-17 Alexander Larsson <alexl@redhat.com>
* src/nautilus-window.h:
......
......@@ -8,14 +8,14 @@ BONOBO_REQUIRED=2.1.0
BONOBO_UI_REQUIRED=2.2.0
EEL_REQUIRED=2.5.3
ESOUND_REQUIRED=0.2.27
GLIB_REQUIRED=2
GLIB_REQUIRED=2.3.0
GNOME_DESKTOP_REQUIRED=2.1.0
GNOME_REQUIRED=2.1.1
GNOME_UI_REQUIRED=2.3.3
GNOME_VFS_REQUIRED=2.5.1
ORBIT_REQUIRED=2.4.0
PANGO_REQUIRED=1.1.2
GTK_REQUIRED=2.1.1
GTK_REQUIRED=2.3.0
MEDUSA_REQUIRED=0.5.1
RSVG_REQUIRED=2.0.1
XML_REQUIRED=2.4.7
......
......@@ -120,6 +120,8 @@ nautilus_directory_class_init (NautilusDirectoryClass *klass)
G_TYPE_NONE, 1, G_TYPE_INT);
klass->get_name_for_self_as_new_file = real_get_name_for_self_as_new_file;
g_type_class_add_private (klass, sizeof (NautilusDirectoryDetails));
}
static void
......@@ -129,7 +131,7 @@ nautilus_directory_init (gpointer object, gpointer klass)
directory = NAUTILUS_DIRECTORY(object);
directory->details = g_new0 (NautilusDirectoryDetails, 1);
directory->details = G_TYPE_INSTANCE_GET_PRIVATE ((directory), NAUTILUS_TYPE_DIRECTORY, NautilusDirectoryDetails);
directory->details->file_hash = g_hash_table_new (g_str_hash, g_str_equal);
directory->details->high_priority_queue = nautilus_file_queue_new ();
directory->details->low_priority_queue = nautilus_file_queue_new ();
......@@ -213,8 +215,6 @@ nautilus_directory_finalize (GObject *object)
g_assert (directory->details->dequeue_pending_idle_id == 0);
gnome_vfs_file_info_list_unref (directory->details->pending_file_info);
g_free (directory->details);
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
......
......@@ -131,6 +131,8 @@ struct NautilusFileDetails
eel_boolean_bit has_volume : 1;
eel_boolean_bit has_drive : 1;
/* TRUE if the file is open in a spatial window */
eel_boolean_bit has_open_window : 1;
};
NautilusFile *nautilus_file_new_from_info (NautilusDirectory *directory,
......
......@@ -127,7 +127,7 @@ GNOME_CLASS_BOILERPLATE (NautilusFile, nautilus_file,
static void
nautilus_file_instance_init (NautilusFile *file)
{
file->details = g_new0 (NautilusFileDetails, 1);
file->details = G_TYPE_INSTANCE_GET_PRIVATE ((file), NAUTILUS_TYPE_FILE, NautilusFileDetails);
}
static NautilusFile *
......@@ -459,8 +459,6 @@ finalize (GObject *object)
eel_g_list_free_deep (file->details->mime_list);
g_free (file->details);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......@@ -5352,6 +5350,25 @@ nautilus_file_invalidate_attributes_internal (NautilusFile *file,
/* FIXME bugzilla.gnome.org 45075: implement invalidating metadata */
}
gboolean
nautilus_file_has_open_window (NautilusFile *file)
{
return file->details->has_open_window;
}
void
nautilus_file_set_has_open_window (NautilusFile *file,
gboolean has_open_window)
{
has_open_window = (has_open_window != FALSE);
if (file->details->has_open_window != has_open_window) {
file->details->has_open_window = has_open_window;
nautilus_file_changed (file);
}
}
gboolean
nautilus_file_is_thumbnailing (NautilusFile *file)
{
......@@ -5638,6 +5655,8 @@ nautilus_file_class_init (NautilusFileClass *class)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_type_class_add_private (class, sizeof (NautilusFileDetails));
}
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
......
......@@ -311,6 +311,10 @@ char * nautilus_file_get_drop_target_uri (Nautilu
char * nautilus_file_get_custom_icon (NautilusFile *file);
gboolean nautilus_file_has_open_window (NautilusFile *file);
void nautilus_file_set_has_open_window (NautilusFile *file,
gboolean has_open_window);
/* Thumbnailing handling */
gboolean nautilus_file_is_thumbnailing (NautilusFile *file);
......
......@@ -4732,14 +4732,15 @@ nautilus_icon_container_get_icon_images (NautilusIconContainer *container,
NautilusIconData *data,
GList **emblem_icons,
char **embedded_text,
gboolean *embedded_text_needs_loading)
gboolean *embedded_text_needs_loading,
gboolean *has_open_window)
{
NautilusIconContainerClass *klass;
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
g_return_val_if_fail (klass->get_icon_images != NULL, NULL);
return klass->get_icon_images (container, data, emblem_icons, embedded_text, embedded_text_needs_loading);
return klass->get_icon_images (container, data, emblem_icons, embedded_text, embedded_text_needs_loading, has_open_window);
}
......@@ -4865,6 +4866,8 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
char *embedded_text;
GdkRectangle embedded_text_rect;
gboolean embedded_text_needs_loading;
gboolean has_open_window;
char *modifier;
if (icon == NULL) {
return;
......@@ -4878,7 +4881,8 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
icon_name = nautilus_icon_container_get_icon_images (
container, icon->data,
&emblem_icon_names,
&embedded_text, &embedded_text_needs_loading);
&embedded_text, &embedded_text_needs_loading,
&has_open_window);
/* compute the maximum size based on the scale factor */
min_image_size = MINIMUM_IMAGE_SIZE * EEL_CANVAS (container)->pixels_per_unit;
......@@ -4889,10 +4893,18 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
icon_size = MAX (icon_size, min_image_size);
icon_size = MIN (icon_size, max_image_size);
modifier = NULL;
if (has_open_window) {
modifier = "visiting";
}
if (icon == details->drop_target) {
modifier = "accept";
}
pixbuf = nautilus_icon_factory_get_pixbuf_for_icon
(icon_name,
(icon == details->drop_target) ? "accept" : NULL,
modifier,
icon_size,
&attach_points,
&embedded_text_rect,
......
......@@ -116,7 +116,8 @@ typedef struct {
NautilusIconData *data,
GList **emblem_icons,
char **embedded_text,
gboolean *embedded_text_needs_loading);
gboolean *embedded_text_needs_loading,
gboolean *has_window_open);
void (* get_icon_text) (NautilusIconContainer *container,
NautilusIconData *data,
char **editable_text,
......
......@@ -4635,12 +4635,20 @@ add_template_to_templates_menus (FMDirectoryView *directory_view,
{
char *tip;
char *name;
char *dot;
GdkPixbuf *pixbuf;
CreateTemplateParameters *parameters;
name = nautilus_file_get_display_name (file);
tip = g_strdup_printf (_("Create Document from template \"%s\""), name);
/* Remove extension */
dot = strrchr (name, '.');
if (dot != NULL) {
*dot = 0;
}
pixbuf = nautilus_icon_factory_get_pixbuf_for_file
(file, NULL, NAUTILUS_ICON_SIZE_FOR_MENUS);
......
......@@ -56,7 +56,8 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
NautilusIconData *data,
GList **emblem_icons,
char **embedded_text,
gboolean *embedded_text_needs_loading)
gboolean *embedded_text_needs_loading,
gboolean *has_window_open)
{
FMIconView *icon_view;
EelStringList *emblems_to_ignore;
......@@ -80,6 +81,8 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
eel_string_list_free (emblems_to_ignore);
}
*has_window_open = nautilus_file_has_open_window (file);
return nautilus_icon_factory_get_icon_for_file (file, TRUE);
}
......
......@@ -189,6 +189,7 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column
int icon_size;
NautilusZoomLevel zoom_level;
int width, height;
char *modifier;
model = (FMListModel *)tree_model;
......@@ -220,7 +221,31 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column
zoom_level = fm_list_model_get_zoom_level_from_column_id (column);
icon_size = nautilus_get_icon_size_for_zoom_level (zoom_level);
icon = nautilus_icon_factory_get_pixbuf_for_file (file, NULL, icon_size);
modifier = NULL;
if (model->details->drag_view != NULL) {
GtkTreePath *path_a, *path_b;
gtk_tree_view_get_drag_dest_row (model->details->drag_view,
&path_a,
NULL);
if (path_a != NULL) {
path_b = gtk_tree_model_get_path (tree_model, iter);
if (gtk_tree_path_compare (path_a, path_b) == 0) {
modifier = "visiting";
}
gtk_tree_path_free (path_a);
gtk_tree_path_free (path_b);
}
}
if (nautilus_file_has_open_window (file)) {
modifier = "accept";
}
icon = nautilus_icon_factory_get_pixbuf_for_file (file, modifier, icon_size);
height = gdk_pixbuf_get_height (icon);
if (height > icon_size) {
......
......@@ -785,6 +785,9 @@ create_and_set_up_tree_view (FMListView *view)
view->details->model = g_object_new (FM_TYPE_LIST_MODEL, NULL);
gtk_tree_view_set_model (view->details->tree_view, GTK_TREE_MODEL (view->details->model));
/* Need the model for the dnd drop icon "accept" change */
fm_list_model_set_drag_view (FM_LIST_MODEL (view->details->model),
view->details->tree_view, 0, 0);
g_signal_connect_object (view->details->model, "sort_column_changed",
G_CALLBACK (sort_column_changed_callback), view, 0);
......
......@@ -1427,11 +1427,18 @@ nautilus_window_set_viewed_file (NautilusWindow *window,
cancel_chose_component_callback (window);
if (window->details->viewed_file != NULL) {
if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
nautilus_file_set_has_open_window (window->details->viewed_file,
FALSE);
}
nautilus_file_monitor_remove (window->details->viewed_file,
window);
}
if (file != NULL) {
if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
nautilus_file_set_has_open_window (file, TRUE);
}
attributes = NAUTILUS_FILE_ATTRIBUTE_DISPLAY_NAME;
nautilus_file_monitor_add (file, window, attributes);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment