2000-11-17 Mathieu Lacage <mathieu@eazel.com> reviewed by: Sullivan fix Bug 4768. Reported 3 bugs about separate issues: 4796, 4797, 4798. * data/mime/gnome-vfs.keys: change icon filenames to relative paths. * libgnomevfs/Makefile.am: add GNOME_VFS_PREFIX * libgnomevfs/gnome-vfs-mime-info.c: (gnome_vfs_mime_info_reload): add initialition code if the mime stuff is not initalized when doing a reload. This avoids a segfault. * libgnomevfs/gnome-vfs-utils.c: (hack_file_exists): new function copied from gnome-libs: prviously named g_file_exists. (gnome_vfs_icon_path_from_filename): new API function. It looks in GNOME_PATH to find the icons and defaults to the gnome-vfs prefix one. It accepts only relative paths and returns an absolute path. * libgnomevfs/gnome-vfs-utils.h: add prototype. * mime-type-capplet/nautilus-mime-type-capplet.c: (really_change_icon), changes the icon used by a mime type. (gil_icon_selected_cb): changes the icon when you double-click. (change_icon_clicked_cb_real): changes the icon when you click on ok. (change_icon_clicked): connect to the clicked and select_icon signals to know when the user has made up his mind about hte new icon. (nautilus_mime_type_capplet_update_info), spaces. (add_mime_clicked): spaces. (nautilus_mime_type_capplet_update_mime_list_icon): spaces. (capplet_get_icon_pixbuf): spaces. (populate_mime_list): spaces. * mime-type-capplet/nautilus-mime-type-icon-entry.c: (icon_selected_cb): spaces. (nautilus_mime_type_show_icon_selection): spaces. (nautilus_mime_type_icon_entry_get_relative_filename): new function. returns a relative filename instead of an abosulte one. * mime-type-capplet/nautilus-mime-type-icon-entry.h: add relative function prototype
72 lines
2.8 KiB
C
72 lines
2.8 KiB
C
/* NautilusMimeIconEntry widget - Combo box with "Browse" button for files and
|
|
* A pick button which can display a list of icons
|
|
* in a current directory, the browse button displays
|
|
* same dialog as pixmap-entry
|
|
*
|
|
* Copyright (C) 1998 The Free Software Foundation
|
|
*
|
|
* Author: George Lebl <jirka@5z.com>
|
|
* icon selection based on original dentry-edit code which was:
|
|
* Written by: Havoc Pennington, based on code by John Ellis.
|
|
*/
|
|
|
|
#ifndef NAUTILUS_MIME_TYPE_ICON_ENTRY_H
|
|
#define NAUTILUS_MIME_TYPE_ICON_ENTRY_H
|
|
|
|
#include <gtk/gtkframe.h>
|
|
#include <gtk/gtkvbox.h>
|
|
#include <libgnome/gnome-defs.h>
|
|
#include <libgnomeui/gnome-file-entry.h>
|
|
|
|
|
|
BEGIN_GNOME_DECLS
|
|
|
|
|
|
#define NAUTILUS_TYPE_MIME_ICON_ENTRY (nautilus_mime_type_icon_entry_get_type ())
|
|
#define NAUTILUS_MIME_ICON_ENTRY(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_MIME_ICON_ENTRY, NautilusMimeIconEntry))
|
|
#define NAUTILUS_MIME_ICON_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_MIME_ICON_ENTRY, NautilusMimeIconEntryClass))
|
|
#define NAUTILUS_MIME_IS_ICON_ENTRY(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_MIME_ICON_ENTRY))
|
|
#define NAUTILUS_MIME_IS_ICON_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_MIME_ICON_ENTRY))
|
|
|
|
|
|
typedef struct _NautilusMimeIconEntry NautilusMimeIconEntry;
|
|
typedef struct _NautilusMimeIconEntryClass NautilusMimeIconEntryClass;
|
|
|
|
struct _NautilusMimeIconEntry {
|
|
GtkVBox vbox;
|
|
|
|
GtkWidget *fentry;
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *pick_dialog;
|
|
gchar *pick_dialog_dir;
|
|
};
|
|
|
|
struct _NautilusMimeIconEntryClass {
|
|
GtkVBoxClass parent_class;
|
|
};
|
|
|
|
|
|
guint nautilus_mime_type_icon_entry_get_type (void);
|
|
GtkWidget *nautilus_mime_type_icon_entry_new (const gchar *history_id,
|
|
const gchar *browse_dialog_title);
|
|
|
|
/*by default gnome_pixmap entry sets the default directory to the
|
|
gnome pixmap directory, this will set it to a subdirectory of that,
|
|
or one would use the file_entry functions for any other path*/
|
|
void nautilus_mime_type_icon_entry_set_pixmap_subdir(NautilusMimeIconEntry *ientry,
|
|
const gchar *subdir);
|
|
void nautilus_mime_type_icon_entry_set_icon(NautilusMimeIconEntry *ientry,
|
|
const gchar *filename);
|
|
GtkWidget *nautilus_mime_type_icon_entry_gnome_file_entry(NautilusMimeIconEntry *ientry);
|
|
GtkWidget *nautilus_mime_type_icon_entry_gnome_entry (NautilusMimeIconEntry *ientry);
|
|
GtkWidget *nautilus_mime_type_icon_entry_gtk_entry (NautilusMimeIconEntry *ientry);
|
|
|
|
/*only return a file if it was possible to load it with imlib*/
|
|
gchar *nautilus_mime_type_icon_entry_get_filename (NautilusMimeIconEntry *ientry);
|
|
gchar *nautilus_mime_type_icon_entry_get_relative_filename (NautilusMimeIconEntry *ientry);
|
|
void nautilus_mime_type_show_icon_selection (NautilusMimeIconEntry * ientry);
|
|
|
|
END_GNOME_DECLS
|
|
|
|
#endif
|