mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
reviewed by: John Sullivan <sullivan@eazel.com>
A cut at an ability to build without Medusa, starting with a patch that Eric Fischer wrote. This change is not fully tested. Fixed bug 5513 ("nautilus --help" displays "Help options" twice). * acconfig.h: Add HAVE_MEDUSA. * configure.in: Add code to detect HAVE_MEDUSA. * libnautilus-extensions/nautilus-customization-data.c: (nautilus_customization_data_destroy), (load_name_map_hash_table): Added a FIXME. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-file.h: * libnautilus-extensions/nautilus-trash-file.h: * libnautilus-extensions/nautilus-trash-file.c: (nautilus_trash_file_initialize), (trash_destroy), (nautilus_trash_file_initialize_class): * libnautilus-extensions/nautilus-vfs-file.h: * libnautilus-extensions/nautilus-vfs-file.c: (nautilus_vfs_file_initialize), (vfs_destroy), (nautilus_vfs_file_initialize_class): Initial cut at breaking out the special trash version of NautilusFile. Sadly we need this as well as NautilusTrashDirectory. * src/file-manager/fm-search-list-view.c: (load_location_callback): Add _() so things get localized and put the code to compose the indexing message inside ifdef HAVE_MEDUSA. * src/file-manager/nautilus-indexing-info.h: * src/file-manager/nautilus-indexing-info.c: Put HAVE_MEDUSA ifdefs around most of this file. (get_text_for_progress_label): Mark string for translation. (update_progress_display): Remove code to "handle" timeout left around after dialog is destroyed. (update_file_index_callback): Change error messages to be more easily localizable. Use nautilus_error_dialog instead of gnome_error_dialog. (timeout_remove_callback): Get rid of the timeout when the object is destroyed. (show_index_progress_bar): Connect handler to get rid of the timeout when the object is destroyed. (show_indexing_info_dialog): Move code that puts up dialog into a new function. Also use nautilus_gtk_window_present to put up a window. Change the NautilusLabel to use line wrapping. (show_search_service_not_available_dialog): Put this dialog in its own function so you can use it multiple times. (nautilus_indexing_info_request_reindex): Put HAVE_MEDUSA around the content of this function. (nautilus_indexing_info_get_last_index_time): Put HAVE_MEDUSA around the function, with a small simple implementation for the other case. (nautilus_indexing_info_show_dialog): Put HAVE_MEDUSA around the function, with a small invocation of the "not available" dialog. * src/nautilus-main.c: (main): Remove redundant AUTOHELP. * src/nautilus-search-bar-criterion.c: (make_emblem_value_menu): Fix emblem_name storage lifetime problem. * src/file-manager/fm-icon-view.c: Whitespace tweak.
This commit is contained in:
parent
50d32c9943
commit
b28b3cc18d
67
ChangeLog
67
ChangeLog
|
@ -1,3 +1,70 @@
|
|||
2001-01-08 Darin Adler <darin@eazel.com>
|
||||
|
||||
reviewed by: John Sullivan <sullivan@eazel.com>
|
||||
|
||||
A cut at an ability to build without Medusa, starting with a patch
|
||||
that Eric Fischer wrote. This change is not fully tested.
|
||||
|
||||
Fixed bug 5513 ("nautilus --help" displays "Help options" twice).
|
||||
|
||||
* acconfig.h: Add HAVE_MEDUSA.
|
||||
* configure.in: Add code to detect HAVE_MEDUSA.
|
||||
|
||||
* libnautilus-extensions/nautilus-customization-data.c:
|
||||
(nautilus_customization_data_destroy), (load_name_map_hash_table):
|
||||
Added a FIXME.
|
||||
|
||||
* libnautilus-extensions/Makefile.am:
|
||||
* libnautilus-extensions/nautilus-file.h:
|
||||
* libnautilus-extensions/nautilus-trash-file.h:
|
||||
* libnautilus-extensions/nautilus-trash-file.c:
|
||||
(nautilus_trash_file_initialize), (trash_destroy),
|
||||
(nautilus_trash_file_initialize_class):
|
||||
* libnautilus-extensions/nautilus-vfs-file.h:
|
||||
* libnautilus-extensions/nautilus-vfs-file.c:
|
||||
(nautilus_vfs_file_initialize), (vfs_destroy),
|
||||
(nautilus_vfs_file_initialize_class):
|
||||
Initial cut at breaking out the special trash version of
|
||||
NautilusFile. Sadly we need this as well as
|
||||
NautilusTrashDirectory.
|
||||
|
||||
* src/file-manager/fm-search-list-view.c:
|
||||
(load_location_callback): Add _() so things get localized and put
|
||||
the code to compose the indexing message inside ifdef HAVE_MEDUSA.
|
||||
|
||||
* src/file-manager/nautilus-indexing-info.h:
|
||||
* src/file-manager/nautilus-indexing-info.c:
|
||||
Put HAVE_MEDUSA ifdefs around most of this file.
|
||||
(get_text_for_progress_label): Mark string for translation.
|
||||
(update_progress_display): Remove code to "handle" timeout left
|
||||
around after dialog is destroyed.
|
||||
(update_file_index_callback): Change error messages to be more
|
||||
easily localizable. Use nautilus_error_dialog instead of
|
||||
gnome_error_dialog.
|
||||
(timeout_remove_callback): Get rid of the timeout when the object
|
||||
is destroyed.
|
||||
(show_index_progress_bar): Connect handler to get rid of the
|
||||
timeout when the object is destroyed.
|
||||
(show_indexing_info_dialog): Move code that puts up dialog into a
|
||||
new function. Also use nautilus_gtk_window_present to put up a
|
||||
window. Change the NautilusLabel to use line wrapping.
|
||||
(show_search_service_not_available_dialog): Put this dialog in its
|
||||
own function so you can use it multiple times.
|
||||
(nautilus_indexing_info_request_reindex): Put HAVE_MEDUSA around
|
||||
the content of this function.
|
||||
(nautilus_indexing_info_get_last_index_time): Put HAVE_MEDUSA
|
||||
around the function, with a small simple implementation for the
|
||||
other case.
|
||||
(nautilus_indexing_info_show_dialog): Put HAVE_MEDUSA around the
|
||||
function, with a small invocation of the "not available" dialog.
|
||||
|
||||
* src/nautilus-main.c: (main): Remove redundant AUTOHELP.
|
||||
|
||||
* src/nautilus-search-bar-criterion.c: (make_emblem_value_menu):
|
||||
Fix emblem_name storage lifetime problem.
|
||||
|
||||
* src/file-manager/fm-icon-view.c: Whitespace tweak.
|
||||
|
||||
2001-01-08 John Sullivan <sullivan@eazel.com>
|
||||
|
||||
reviewed by: Darin Adler <darin@eazel.com>
|
||||
|
|
28
acconfig.h
28
acconfig.h
|
@ -1,24 +1,24 @@
|
|||
#undef bzread
|
||||
#undef bzopen
|
||||
#undef bzdopen
|
||||
#undef bzwrite
|
||||
#undef bzerror
|
||||
#undef bzclose
|
||||
#undef bzflush
|
||||
#undef bzCompress
|
||||
#undef bzCompressInit
|
||||
#undef bzDecompress
|
||||
#undef bzDecompressInit
|
||||
#undef EAZEL_BUILD_TIMESTAMP
|
||||
#undef EAZEL_SERVICES
|
||||
#undef ENABLE_PROFILER
|
||||
#undef ENABLE_NLS
|
||||
#undef ENABLE_PROFILER
|
||||
#undef HAVE_CATGETS
|
||||
#undef HAVE_GETTEXT
|
||||
#undef HAVE_LC_MESSAGES
|
||||
#undef HAVE_MEDUSA
|
||||
#undef HAVE_PAM
|
||||
#undef HAVE_RPM
|
||||
#undef HAVE_RPM_30
|
||||
#undef HAVE_RPM_40
|
||||
#undef HAVE_STPCPY
|
||||
#undef USING_OAF
|
||||
#undef EAZEL_BUILD_TIMESTAMP
|
||||
#undef bzCompress
|
||||
#undef bzCompressInit
|
||||
#undef bzDecompress
|
||||
#undef bzDecompressInit
|
||||
#undef bzclose
|
||||
#undef bzdopen
|
||||
#undef bzerror
|
||||
#undef bzflush
|
||||
#undef bzopen
|
||||
#undef bzread
|
||||
#undef bzwrite
|
||||
|
|
29
configure.in
29
configure.in
|
@ -514,11 +514,6 @@ AC_SUBST(IDL_CFLAGS)
|
|||
|
||||
AM_PATH_OAF(0.6.1)
|
||||
|
||||
dnl GnomeVFS can compile without OAF support, Nautilus depends on OAF.
|
||||
dnl Make USING_OAF be defined
|
||||
|
||||
AC_DEFINE(USING_OAF)
|
||||
|
||||
AM_PATH_GCONF(0.11,,,gconf-gtk)
|
||||
|
||||
AC_PATH_PROG(XML_CONFIG,xml-config,no)
|
||||
|
@ -604,21 +599,23 @@ AC_SUBST(Z_LIBS)], AC_MSG_ERROR([*** zlib is required]))
|
|||
dnl ====================================
|
||||
dnl = Begin tests for medusa
|
||||
dnl ====================================
|
||||
MEDUSA_CFLAGS=""
|
||||
MEDUSA_LIBS=""
|
||||
AC_MSG_CHECKING(for Medusa)
|
||||
|
||||
if test -n `medusa-config --libs | cut -d ' ' -f1` ;
|
||||
then
|
||||
MEDUSA_CFLAGS=`medusa-config --cflags`
|
||||
MEDUSA_LIBS=`medusa-config --libs`
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
case "`medusa-config --libs 2>/dev/null | cut -d ' ' -f1`" in
|
||||
'')
|
||||
MEDUSA_CFLAGS=""
|
||||
MEDUSA_LIBS=""
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Could not find medusa library. Please, get it from GNOME's cvs.)
|
||||
fi
|
||||
AC_MSG_WARN(Could not find medusa library. Please get it from GNOME's cvs.)
|
||||
;;
|
||||
|
||||
*)
|
||||
MEDUSA_CFLAGS=`medusa-config --cflags`
|
||||
MEDUSA_LIBS=`medusa-config --libs`
|
||||
AC_DEFINE(HAVE_MEDUSA)
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(MEDUSA_CFLAGS)
|
||||
AC_SUBST(MEDUSA_LIBS)
|
||||
|
@ -641,7 +638,7 @@ then
|
|||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Ammonite is required for Eazel Services. Please obtain it from Eazel's FTP site)
|
||||
AC_MSG_ERROR(Ammonite is required for Eazel Services. Please obtain it from Eazel's FTP site)
|
||||
fi
|
||||
|
||||
AC_SUBST(AMMONITE_CFLAGS)
|
||||
|
|
|
@ -131,11 +131,13 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-thumbnails.c \
|
||||
nautilus-trash-directory.c \
|
||||
nautilus-trash-monitor.c \
|
||||
nautilus-trash-file.c \
|
||||
nautilus-undo-context.c \
|
||||
nautilus-undo-manager.c \
|
||||
nautilus-undo-signal-handlers.c \
|
||||
nautilus-user-level-manager.c \
|
||||
nautilus-vfs-directory.c \
|
||||
nautilus-vfs-file.c \
|
||||
nautilus-view-identifier.c \
|
||||
nautilus-volume-monitor.c \
|
||||
nautilus-xml-extensions.c \
|
||||
|
@ -236,11 +238,13 @@ noinst_HEADERS = \
|
|||
nautilus-thumbnails.h \
|
||||
nautilus-trash-directory.h \
|
||||
nautilus-trash-monitor.h \
|
||||
nautilus-trash-file.h \
|
||||
nautilus-undo-context.h \
|
||||
nautilus-undo-manager.h \
|
||||
nautilus-undo-signal-handlers.h \
|
||||
nautilus-user-level-manager.h \
|
||||
nautilus-vfs-directory.h \
|
||||
nautilus-vfs-file.h \
|
||||
nautilus-view-identifier.h \
|
||||
nautilus-volume-monitor.h \
|
||||
nautilus-xml-extensions.h \
|
||||
|
|
|
@ -266,6 +266,7 @@ nautilus_customization_data_destroy (NautilusCustomizationData *data)
|
|||
gnome_vfs_directory_list_destroy (data->private_file_list);
|
||||
}
|
||||
if (data->name_map_hash != NULL) {
|
||||
/* FIXME: This leaks all the strings in the hash table. */
|
||||
g_hash_table_destroy (data->name_map_hash);
|
||||
}
|
||||
|
||||
|
@ -433,12 +434,8 @@ load_name_map_hash_table (NautilusCustomizationData *data)
|
|||
if (display_name && filename) {
|
||||
g_hash_table_insert (data->name_map_hash, g_strdup (filename), g_strdup (display_name));
|
||||
}
|
||||
if (filename) {
|
||||
xmlFree (filename);
|
||||
}
|
||||
if (display_name) {
|
||||
xmlFree (display_name);
|
||||
}
|
||||
xmlFree (filename);
|
||||
xmlFree (display_name);
|
||||
current_node = current_node->next;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,213 +79,207 @@ typedef void (*NautilusFileOperationCallback) (NautilusFile *file,
|
|||
gpointer callback_data);
|
||||
|
||||
/* GtkObject requirements. */
|
||||
GtkType nautilus_file_get_type (void);
|
||||
GtkType nautilus_file_get_type (void);
|
||||
|
||||
/* Getting at a single file. */
|
||||
NautilusFile * nautilus_file_get (const char *uri);
|
||||
NautilusFile * nautilus_file_get (const char *uri);
|
||||
|
||||
/* Covers for gtk_object_ref and gtk_object_unref that provide two conveniences:
|
||||
* 1) You don't have to cast to GtkObject *, so using these is type safe.
|
||||
* 2) You are allowed to call these with NULL,
|
||||
*/
|
||||
NautilusFile * nautilus_file_ref (NautilusFile *file);
|
||||
void nautilus_file_unref (NautilusFile *file);
|
||||
NautilusFile * nautilus_file_ref (NautilusFile *file);
|
||||
void nautilus_file_unref (NautilusFile *file);
|
||||
|
||||
/* Monitor the file. */
|
||||
void nautilus_file_monitor_add (NautilusFile *file,
|
||||
gconstpointer client,
|
||||
GList *attributes);
|
||||
void nautilus_file_monitor_remove (NautilusFile *file,
|
||||
gconstpointer client);
|
||||
void nautilus_file_monitor_add (NautilusFile *file,
|
||||
gconstpointer client,
|
||||
GList *attributes);
|
||||
void nautilus_file_monitor_remove (NautilusFile *file,
|
||||
gconstpointer client);
|
||||
|
||||
/* Waiting for data that's read asynchronously.
|
||||
* This interface currently works only for metadata, but could be expanded
|
||||
* to other attributes as well.
|
||||
*/
|
||||
void nautilus_file_call_when_ready (NautilusFile *file,
|
||||
GList *attributes,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel_call_when_ready (NautilusFile *file,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
gboolean nautilus_file_check_if_ready (NautilusFile *file,
|
||||
GList *attributes);
|
||||
void nautilus_file_invalidate_attributes (NautilusFile *file,
|
||||
GList *file_attributes);
|
||||
void nautilus_file_invalidate_all_attributes (NautilusFile *file);
|
||||
|
||||
|
||||
|
||||
void nautilus_file_call_when_ready (NautilusFile *file,
|
||||
GList *attributes,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel_call_when_ready (NautilusFile *file,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
gboolean nautilus_file_check_if_ready (NautilusFile *file,
|
||||
GList *attributes);
|
||||
void nautilus_file_invalidate_attributes (NautilusFile *file,
|
||||
GList *attributes);
|
||||
void nautilus_file_invalidate_all_attributes (NautilusFile *file);
|
||||
|
||||
/* Basic attributes for file objects. */
|
||||
char * nautilus_file_get_name (NautilusFile *file);
|
||||
char * nautilus_file_get_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_uri_scheme (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri_for_display (NautilusFile *file);
|
||||
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
|
||||
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
|
||||
char * nautilus_file_get_mime_type (NautilusFile *file);
|
||||
gboolean nautilus_file_is_mime_type (NautilusFile *file,
|
||||
const char *mime_type);
|
||||
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
|
||||
char * nautilus_file_get_symbolic_link_target_path
|
||||
(NautilusFile *file);
|
||||
gboolean nautilus_file_is_broken_symbolic_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_nautilus_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_executable (NautilusFile *file);
|
||||
gboolean nautilus_file_is_directory (NautilusFile *file);
|
||||
gboolean nautilus_file_is_in_trash (NautilusFile *file);
|
||||
GnomeVFSResult nautilus_file_get_file_info_result (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
|
||||
guint *count,
|
||||
gboolean *count_unreadable);
|
||||
void nautilus_file_recompute_deep_counts (NautilusFile *file);
|
||||
NautilusRequestStatus nautilus_file_get_deep_counts (NautilusFile *file,
|
||||
guint *directory_count,
|
||||
guint *file_count,
|
||||
guint *unreadable_directory_count,
|
||||
GnomeVFSFileSize *total_size);
|
||||
GList * nautilus_file_get_keywords (NautilusFile *file);
|
||||
void nautilus_file_set_keywords (NautilusFile *file,
|
||||
GList *keywords);
|
||||
GList * nautilus_file_get_emblem_names (NautilusFile *file);
|
||||
char * nautilus_file_get_top_left_text (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_mime_types (NautilusFile *file,
|
||||
GList **mime_list);
|
||||
|
||||
char * nautilus_file_get_name (NautilusFile *file);
|
||||
char * nautilus_file_get_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_uri_scheme (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri_for_display (NautilusFile *file);
|
||||
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
|
||||
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
|
||||
char * nautilus_file_get_mime_type (NautilusFile *file);
|
||||
gboolean nautilus_file_is_mime_type (NautilusFile *file,
|
||||
const char *mime_type);
|
||||
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
|
||||
char * nautilus_file_get_symbolic_link_target_path (NautilusFile *file);
|
||||
gboolean nautilus_file_is_broken_symbolic_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_nautilus_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_executable (NautilusFile *file);
|
||||
gboolean nautilus_file_is_directory (NautilusFile *file);
|
||||
gboolean nautilus_file_is_in_trash (NautilusFile *file);
|
||||
GnomeVFSResult nautilus_file_get_file_info_result (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
|
||||
guint *count,
|
||||
gboolean *count_unreadable);
|
||||
void nautilus_file_recompute_deep_counts (NautilusFile *file);
|
||||
NautilusRequestStatus nautilus_file_get_deep_counts (NautilusFile *file,
|
||||
guint *directory_count,
|
||||
guint *file_count,
|
||||
guint *unreadable_directory_count,
|
||||
GnomeVFSFileSize *total_size);
|
||||
GList * nautilus_file_get_keywords (NautilusFile *file);
|
||||
void nautilus_file_set_keywords (NautilusFile *file,
|
||||
GList *keywords);
|
||||
GList * nautilus_file_get_emblem_names (NautilusFile *file);
|
||||
char * nautilus_file_get_top_left_text (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_mime_types (NautilusFile *file,
|
||||
GList **mime_list);
|
||||
|
||||
/* Permissions. */
|
||||
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
|
||||
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_group (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_group (NautilusFile *file);
|
||||
char * nautilus_file_get_owner_name (NautilusFile *file);
|
||||
char * nautilus_file_get_group_name (NautilusFile *file);
|
||||
GList * nautilus_get_user_names (void);
|
||||
GList * nautilus_get_group_names (void);
|
||||
GList * nautilus_file_get_settable_group_names (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
|
||||
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_group (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_group (NautilusFile *file);
|
||||
char * nautilus_file_get_owner_name (NautilusFile *file);
|
||||
char * nautilus_file_get_group_name (NautilusFile *file);
|
||||
GList * nautilus_get_user_names (void);
|
||||
GList * nautilus_get_group_names (void);
|
||||
GList * nautilus_file_get_settable_group_names (NautilusFile *file);
|
||||
|
||||
/* "Capabilities". */
|
||||
gboolean nautilus_file_can_read (NautilusFile *file);
|
||||
gboolean nautilus_file_can_write (NautilusFile *file);
|
||||
gboolean nautilus_file_can_execute (NautilusFile *file);
|
||||
gboolean nautilus_file_can_rename (NautilusFile *file);
|
||||
gboolean nautilus_file_can_read (NautilusFile *file);
|
||||
gboolean nautilus_file_can_write (NautilusFile *file);
|
||||
gboolean nautilus_file_can_execute (NautilusFile *file);
|
||||
gboolean nautilus_file_can_rename (NautilusFile *file);
|
||||
|
||||
/* Basic operations for file objects. */
|
||||
void nautilus_file_set_owner (NautilusFile *file,
|
||||
const char *user_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_group (NautilusFile *file,
|
||||
const char *group_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_permissions (NautilusFile *file,
|
||||
GnomeVFSFilePermissions permissions,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_rename (NautilusFile *file,
|
||||
const char *new_name,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel (NautilusFile *file,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_owner (NautilusFile *file,
|
||||
const char *user_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_group (NautilusFile *file,
|
||||
const char *group_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_permissions (NautilusFile *file,
|
||||
GnomeVFSFilePermissions permissions,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_rename (NautilusFile *file,
|
||||
const char *new_name,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel (NautilusFile *file,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
/* Return true if this file has already been deleted.
|
||||
* This object will be unref'd after sending the files_removed signal,
|
||||
* but it could hang around longer if someone ref'd it.
|
||||
*/
|
||||
gboolean nautilus_file_is_gone (NautilusFile *file);
|
||||
gboolean nautilus_file_is_gone (NautilusFile *file);
|
||||
|
||||
/* Simple getting and setting top-level metadata. */
|
||||
char * nautilus_file_get_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata);
|
||||
GList * nautilus_file_get_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey);
|
||||
void nautilus_file_set_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata,
|
||||
const char *metadata);
|
||||
void nautilus_file_set_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey,
|
||||
GList *list);
|
||||
char * nautilus_file_get_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata);
|
||||
GList * nautilus_file_get_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey);
|
||||
void nautilus_file_set_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata,
|
||||
const char *metadata);
|
||||
void nautilus_file_set_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey,
|
||||
GList *list);
|
||||
|
||||
/* Covers for common data types. */
|
||||
gboolean nautilus_file_get_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata);
|
||||
void nautilus_file_set_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata,
|
||||
gboolean metadata);
|
||||
int nautilus_file_get_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata);
|
||||
void nautilus_file_set_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata,
|
||||
int metadata);
|
||||
gboolean nautilus_file_get_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata);
|
||||
void nautilus_file_set_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata,
|
||||
gboolean metadata);
|
||||
int nautilus_file_get_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata);
|
||||
void nautilus_file_set_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata,
|
||||
int metadata);
|
||||
|
||||
|
||||
/* Attributes for file objects as user-displayable strings. */
|
||||
char * nautilus_file_get_string_attribute (NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
char * nautilus_file_get_string_attribute_with_default
|
||||
(NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
char * nautilus_file_get_string_attribute (NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
char * nautilus_file_get_string_attribute_with_default (NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
|
||||
/* Matching with another URI. */
|
||||
gboolean nautilus_file_matches_uri (NautilusFile *file,
|
||||
const char *uri);
|
||||
gboolean nautilus_file_matches_uri (NautilusFile *file,
|
||||
const char *uri);
|
||||
|
||||
/* Is the file local? */
|
||||
gboolean nautilus_file_is_local (NautilusFile *file);
|
||||
gboolean nautilus_file_is_local (NautilusFile *file);
|
||||
|
||||
/* Comparing two file objects for sorting */
|
||||
int nautilus_file_compare_for_sort (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_name (NautilusFile *file_1,
|
||||
const char *pattern);
|
||||
int nautilus_file_compare_for_sort (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_name (NautilusFile *file_1,
|
||||
const char *pattern);
|
||||
|
||||
/* filtering functions for use by various directory views */
|
||||
gboolean nautilus_file_is_hidden_file (NautilusFile *file);
|
||||
gboolean nautilus_file_is_backup_file (NautilusFile *file);
|
||||
gboolean nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
GList *nautilus_file_list_filter_hidden_and_backup (GList *files,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
gboolean nautilus_file_is_hidden_file (NautilusFile *file);
|
||||
gboolean nautilus_file_is_backup_file (NautilusFile *file);
|
||||
gboolean nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
GList *nautilus_file_list_filter_hidden_and_backup (GList *files,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
|
||||
|
||||
/* Get the URI that's used when activating the file.
|
||||
* Getting this can require reading the contents of the file.
|
||||
*/
|
||||
char * nautilus_file_get_activation_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_activation_uri (NautilusFile *file);
|
||||
|
||||
/* Convenience functions for dealing with a list of NautilusFile objects that each have a ref.
|
||||
* These are just convenient names for functions that work on lists of GtkObject *.
|
||||
*/
|
||||
GList * nautilus_file_list_ref (GList *file_list);
|
||||
void nautilus_file_list_unref (GList *file_list);
|
||||
void nautilus_file_list_free (GList *file_list);
|
||||
GList * nautilus_file_list_copy (GList *file_list);
|
||||
GList * nautilus_file_list_ref (GList *file_list);
|
||||
void nautilus_file_list_unref (GList *file_list);
|
||||
void nautilus_file_list_free (GList *file_list);
|
||||
GList * nautilus_file_list_copy (GList *file_list);
|
||||
|
||||
/* Debugging */
|
||||
void nautilus_file_dump (NautilusFile *file);
|
||||
void nautilus_file_dump (NautilusFile *file);
|
||||
|
||||
typedef struct NautilusFileDetails NautilusFileDetails;
|
||||
|
||||
|
@ -297,8 +291,32 @@ struct NautilusFile {
|
|||
typedef struct {
|
||||
GtkObjectClass parent_slot;
|
||||
|
||||
/* Called then the file notices any change. */
|
||||
void (* changed) (NautilusFile *file);
|
||||
/* Called when the file notices any change. */
|
||||
void (* changed) (NautilusFile *file);
|
||||
|
||||
/* Virtual functions (mainly used for trash directory). */
|
||||
void (* monitor_add) (NautilusFile *file,
|
||||
gconstpointer client,
|
||||
GList *attributes);
|
||||
void (* monitor_remove) (NautilusFile *file,
|
||||
gconstpointer client);
|
||||
gboolean (* get_item_count) (NautilusFile *file,
|
||||
guint *count,
|
||||
gboolean *count_unreadable);
|
||||
NautilusRequestStatus (* get_deep_counts) (NautilusFile *file,
|
||||
guint *directory_count,
|
||||
guint *file_count,
|
||||
guint *unreadable_directory_count,
|
||||
GnomeVFSFileSize *total_size);
|
||||
void (* call_when_ready) (NautilusFile *file,
|
||||
GList *attributes,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
void (* cancel_call_when_ready) (NautilusFile *file,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
gboolean (* check_if_ready) (NautilusFile *file,
|
||||
GList *attributes);
|
||||
} NautilusFileClass;
|
||||
|
||||
#endif /* NAUTILUS_FILE_H */
|
||||
|
|
70
libnautilus-extensions/nautilus-trash-file.c
Normal file
70
libnautilus-extensions/nautilus-trash-file.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-trash-file.c: Subclass of NautilusFile to help implement the
|
||||
virtual trash directory.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-trash-file.h"
|
||||
|
||||
#include "nautilus-gtk-macros.h"
|
||||
|
||||
struct NautilusTrashFileDetails {
|
||||
};
|
||||
|
||||
static void nautilus_trash_file_initialize (gpointer object,
|
||||
gpointer klass);
|
||||
static void nautilus_trash_file_initialize_class (gpointer klass);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusTrashFile,
|
||||
nautilus_trash_file,
|
||||
NAUTILUS_TYPE_FILE)
|
||||
|
||||
static void
|
||||
nautilus_trash_file_initialize (gpointer object, gpointer klass)
|
||||
{
|
||||
NautilusTrashFile *file;
|
||||
|
||||
file = NAUTILUS_TRASH_FILE (object);
|
||||
|
||||
file->details = g_new0 (NautilusTrashFileDetails, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
trash_destroy (GtkObject *object)
|
||||
{
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_trash_file_initialize_class (gpointer klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
NautilusFileClass *file_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
file_class = NAUTILUS_FILE_CLASS (klass);
|
||||
|
||||
object_class->destroy = trash_destroy;
|
||||
|
||||
/* file_class-> */
|
||||
}
|
55
libnautilus-extensions/nautilus-trash-file.h
Normal file
55
libnautilus-extensions/nautilus-trash-file.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-trash-file.h: Subclass of NautilusFile to implement the
|
||||
the case of a TRASH file.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_TRASH_FILE_H
|
||||
#define NAUTILUS_TRASH_FILE_H
|
||||
|
||||
#include "nautilus-file.h"
|
||||
|
||||
#define NAUTILUS_TYPE_TRASH_FILE \
|
||||
(nautilus_trash_file_get_type ())
|
||||
#define NAUTILUS_TRASH_FILE(obj) \
|
||||
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TRASH_FILE, NautilusTrashFile))
|
||||
#define NAUTILUS_TRASH_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TRASH_FILE, NautilusTrashFileClass))
|
||||
#define NAUTILUS_IS_TRASH_FILE(obj) \
|
||||
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TRASH_FILE))
|
||||
#define NAUTILUS_IS_TRASH_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TRASH_FILE))
|
||||
|
||||
typedef struct NautilusTrashFileDetails NautilusTrashFileDetails;
|
||||
|
||||
typedef struct {
|
||||
NautilusFile parent_slot;
|
||||
NautilusTrashFileDetails *details;
|
||||
} NautilusTrashFile;
|
||||
|
||||
typedef struct {
|
||||
NautilusFileClass parent_slot;
|
||||
} NautilusTrashFileClass;
|
||||
|
||||
GtkType nautilus_trash_file_get_type (void);
|
||||
|
||||
#endif /* NAUTILUS_TRASH_FILE_H */
|
70
libnautilus-extensions/nautilus-vfs-file.c
Normal file
70
libnautilus-extensions/nautilus-vfs-file.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-vfs-file.c: Subclass of NautilusFile to help implement the
|
||||
virtual trash directory.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-vfs-file.h"
|
||||
|
||||
#include "nautilus-gtk-macros.h"
|
||||
|
||||
struct NautilusVFSFileDetails {
|
||||
};
|
||||
|
||||
static void nautilus_vfs_file_initialize (gpointer object,
|
||||
gpointer klass);
|
||||
static void nautilus_vfs_file_initialize_class (gpointer klass);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusVFSFile,
|
||||
nautilus_vfs_file,
|
||||
NAUTILUS_TYPE_FILE)
|
||||
|
||||
static void
|
||||
nautilus_vfs_file_initialize (gpointer object, gpointer klass)
|
||||
{
|
||||
NautilusVFSFile *file;
|
||||
|
||||
file = NAUTILUS_VFS_FILE (object);
|
||||
|
||||
file->details = g_new0 (NautilusVFSFileDetails, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
vfs_destroy (GtkObject *object)
|
||||
{
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_vfs_file_initialize_class (gpointer klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
NautilusFileClass *file_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
file_class = NAUTILUS_FILE_CLASS (klass);
|
||||
|
||||
object_class->destroy = vfs_destroy;
|
||||
|
||||
/* file_class-> */
|
||||
}
|
55
libnautilus-extensions/nautilus-vfs-file.h
Normal file
55
libnautilus-extensions/nautilus-vfs-file.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-vfs-file.h: Subclass of NautilusFile to implement the
|
||||
the case of a VFS file.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_VFS_FILE_H
|
||||
#define NAUTILUS_VFS_FILE_H
|
||||
|
||||
#include "nautilus-file.h"
|
||||
|
||||
#define NAUTILUS_TYPE_VFS_FILE \
|
||||
(nautilus_vfs_file_get_type ())
|
||||
#define NAUTILUS_VFS_FILE(obj) \
|
||||
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VFS_FILE, NautilusVFSFile))
|
||||
#define NAUTILUS_VFS_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VFS_FILE, NautilusVFSFileClass))
|
||||
#define NAUTILUS_IS_VFS_FILE(obj) \
|
||||
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VFS_FILE))
|
||||
#define NAUTILUS_IS_VFS_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VFS_FILE))
|
||||
|
||||
typedef struct NautilusVFSFileDetails NautilusVFSFileDetails;
|
||||
|
||||
typedef struct {
|
||||
NautilusFile parent_slot;
|
||||
NautilusVFSFileDetails *details;
|
||||
} NautilusVFSFile;
|
||||
|
||||
typedef struct {
|
||||
NautilusFileClass parent_slot;
|
||||
} NautilusVFSFileClass;
|
||||
|
||||
GtkType nautilus_vfs_file_get_type (void);
|
||||
|
||||
#endif /* NAUTILUS_VFS_FILE_H */
|
|
@ -131,11 +131,13 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-thumbnails.c \
|
||||
nautilus-trash-directory.c \
|
||||
nautilus-trash-monitor.c \
|
||||
nautilus-trash-file.c \
|
||||
nautilus-undo-context.c \
|
||||
nautilus-undo-manager.c \
|
||||
nautilus-undo-signal-handlers.c \
|
||||
nautilus-user-level-manager.c \
|
||||
nautilus-vfs-directory.c \
|
||||
nautilus-vfs-file.c \
|
||||
nautilus-view-identifier.c \
|
||||
nautilus-volume-monitor.c \
|
||||
nautilus-xml-extensions.c \
|
||||
|
@ -236,11 +238,13 @@ noinst_HEADERS = \
|
|||
nautilus-thumbnails.h \
|
||||
nautilus-trash-directory.h \
|
||||
nautilus-trash-monitor.h \
|
||||
nautilus-trash-file.h \
|
||||
nautilus-undo-context.h \
|
||||
nautilus-undo-manager.h \
|
||||
nautilus-undo-signal-handlers.h \
|
||||
nautilus-user-level-manager.h \
|
||||
nautilus-vfs-directory.h \
|
||||
nautilus-vfs-file.h \
|
||||
nautilus-view-identifier.h \
|
||||
nautilus-volume-monitor.h \
|
||||
nautilus-xml-extensions.h \
|
||||
|
|
|
@ -266,6 +266,7 @@ nautilus_customization_data_destroy (NautilusCustomizationData *data)
|
|||
gnome_vfs_directory_list_destroy (data->private_file_list);
|
||||
}
|
||||
if (data->name_map_hash != NULL) {
|
||||
/* FIXME: This leaks all the strings in the hash table. */
|
||||
g_hash_table_destroy (data->name_map_hash);
|
||||
}
|
||||
|
||||
|
@ -433,12 +434,8 @@ load_name_map_hash_table (NautilusCustomizationData *data)
|
|||
if (display_name && filename) {
|
||||
g_hash_table_insert (data->name_map_hash, g_strdup (filename), g_strdup (display_name));
|
||||
}
|
||||
if (filename) {
|
||||
xmlFree (filename);
|
||||
}
|
||||
if (display_name) {
|
||||
xmlFree (display_name);
|
||||
}
|
||||
xmlFree (filename);
|
||||
xmlFree (display_name);
|
||||
current_node = current_node->next;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,213 +79,207 @@ typedef void (*NautilusFileOperationCallback) (NautilusFile *file,
|
|||
gpointer callback_data);
|
||||
|
||||
/* GtkObject requirements. */
|
||||
GtkType nautilus_file_get_type (void);
|
||||
GtkType nautilus_file_get_type (void);
|
||||
|
||||
/* Getting at a single file. */
|
||||
NautilusFile * nautilus_file_get (const char *uri);
|
||||
NautilusFile * nautilus_file_get (const char *uri);
|
||||
|
||||
/* Covers for gtk_object_ref and gtk_object_unref that provide two conveniences:
|
||||
* 1) You don't have to cast to GtkObject *, so using these is type safe.
|
||||
* 2) You are allowed to call these with NULL,
|
||||
*/
|
||||
NautilusFile * nautilus_file_ref (NautilusFile *file);
|
||||
void nautilus_file_unref (NautilusFile *file);
|
||||
NautilusFile * nautilus_file_ref (NautilusFile *file);
|
||||
void nautilus_file_unref (NautilusFile *file);
|
||||
|
||||
/* Monitor the file. */
|
||||
void nautilus_file_monitor_add (NautilusFile *file,
|
||||
gconstpointer client,
|
||||
GList *attributes);
|
||||
void nautilus_file_monitor_remove (NautilusFile *file,
|
||||
gconstpointer client);
|
||||
void nautilus_file_monitor_add (NautilusFile *file,
|
||||
gconstpointer client,
|
||||
GList *attributes);
|
||||
void nautilus_file_monitor_remove (NautilusFile *file,
|
||||
gconstpointer client);
|
||||
|
||||
/* Waiting for data that's read asynchronously.
|
||||
* This interface currently works only for metadata, but could be expanded
|
||||
* to other attributes as well.
|
||||
*/
|
||||
void nautilus_file_call_when_ready (NautilusFile *file,
|
||||
GList *attributes,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel_call_when_ready (NautilusFile *file,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
gboolean nautilus_file_check_if_ready (NautilusFile *file,
|
||||
GList *attributes);
|
||||
void nautilus_file_invalidate_attributes (NautilusFile *file,
|
||||
GList *file_attributes);
|
||||
void nautilus_file_invalidate_all_attributes (NautilusFile *file);
|
||||
|
||||
|
||||
|
||||
void nautilus_file_call_when_ready (NautilusFile *file,
|
||||
GList *attributes,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel_call_when_ready (NautilusFile *file,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
gboolean nautilus_file_check_if_ready (NautilusFile *file,
|
||||
GList *attributes);
|
||||
void nautilus_file_invalidate_attributes (NautilusFile *file,
|
||||
GList *attributes);
|
||||
void nautilus_file_invalidate_all_attributes (NautilusFile *file);
|
||||
|
||||
/* Basic attributes for file objects. */
|
||||
char * nautilus_file_get_name (NautilusFile *file);
|
||||
char * nautilus_file_get_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_uri_scheme (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri_for_display (NautilusFile *file);
|
||||
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
|
||||
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
|
||||
char * nautilus_file_get_mime_type (NautilusFile *file);
|
||||
gboolean nautilus_file_is_mime_type (NautilusFile *file,
|
||||
const char *mime_type);
|
||||
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
|
||||
char * nautilus_file_get_symbolic_link_target_path
|
||||
(NautilusFile *file);
|
||||
gboolean nautilus_file_is_broken_symbolic_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_nautilus_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_executable (NautilusFile *file);
|
||||
gboolean nautilus_file_is_directory (NautilusFile *file);
|
||||
gboolean nautilus_file_is_in_trash (NautilusFile *file);
|
||||
GnomeVFSResult nautilus_file_get_file_info_result (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
|
||||
guint *count,
|
||||
gboolean *count_unreadable);
|
||||
void nautilus_file_recompute_deep_counts (NautilusFile *file);
|
||||
NautilusRequestStatus nautilus_file_get_deep_counts (NautilusFile *file,
|
||||
guint *directory_count,
|
||||
guint *file_count,
|
||||
guint *unreadable_directory_count,
|
||||
GnomeVFSFileSize *total_size);
|
||||
GList * nautilus_file_get_keywords (NautilusFile *file);
|
||||
void nautilus_file_set_keywords (NautilusFile *file,
|
||||
GList *keywords);
|
||||
GList * nautilus_file_get_emblem_names (NautilusFile *file);
|
||||
char * nautilus_file_get_top_left_text (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_mime_types (NautilusFile *file,
|
||||
GList **mime_list);
|
||||
|
||||
char * nautilus_file_get_name (NautilusFile *file);
|
||||
char * nautilus_file_get_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_uri_scheme (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_parent_uri_for_display (NautilusFile *file);
|
||||
GnomeVFSFileSize nautilus_file_get_size (NautilusFile *file);
|
||||
GnomeVFSFileType nautilus_file_get_file_type (NautilusFile *file);
|
||||
char * nautilus_file_get_mime_type (NautilusFile *file);
|
||||
gboolean nautilus_file_is_mime_type (NautilusFile *file,
|
||||
const char *mime_type);
|
||||
gboolean nautilus_file_is_symbolic_link (NautilusFile *file);
|
||||
char * nautilus_file_get_symbolic_link_target_path (NautilusFile *file);
|
||||
gboolean nautilus_file_is_broken_symbolic_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_nautilus_link (NautilusFile *file);
|
||||
gboolean nautilus_file_is_executable (NautilusFile *file);
|
||||
gboolean nautilus_file_is_directory (NautilusFile *file);
|
||||
gboolean nautilus_file_is_in_trash (NautilusFile *file);
|
||||
GnomeVFSResult nautilus_file_get_file_info_result (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_count (NautilusFile *file,
|
||||
guint *count,
|
||||
gboolean *count_unreadable);
|
||||
void nautilus_file_recompute_deep_counts (NautilusFile *file);
|
||||
NautilusRequestStatus nautilus_file_get_deep_counts (NautilusFile *file,
|
||||
guint *directory_count,
|
||||
guint *file_count,
|
||||
guint *unreadable_directory_count,
|
||||
GnomeVFSFileSize *total_size);
|
||||
GList * nautilus_file_get_keywords (NautilusFile *file);
|
||||
void nautilus_file_set_keywords (NautilusFile *file,
|
||||
GList *keywords);
|
||||
GList * nautilus_file_get_emblem_names (NautilusFile *file);
|
||||
char * nautilus_file_get_top_left_text (NautilusFile *file);
|
||||
gboolean nautilus_file_get_directory_item_mime_types (NautilusFile *file,
|
||||
GList **mime_list);
|
||||
|
||||
/* Permissions. */
|
||||
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
|
||||
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_group (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_group (NautilusFile *file);
|
||||
char * nautilus_file_get_owner_name (NautilusFile *file);
|
||||
char * nautilus_file_get_group_name (NautilusFile *file);
|
||||
GList * nautilus_get_user_names (void);
|
||||
GList * nautilus_get_group_names (void);
|
||||
GList * nautilus_file_get_settable_group_names (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_permissions (NautilusFile *file);
|
||||
GnomeVFSFilePermissions nautilus_file_get_permissions (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_owner (NautilusFile *file);
|
||||
gboolean nautilus_file_can_get_group (NautilusFile *file);
|
||||
gboolean nautilus_file_can_set_group (NautilusFile *file);
|
||||
char * nautilus_file_get_owner_name (NautilusFile *file);
|
||||
char * nautilus_file_get_group_name (NautilusFile *file);
|
||||
GList * nautilus_get_user_names (void);
|
||||
GList * nautilus_get_group_names (void);
|
||||
GList * nautilus_file_get_settable_group_names (NautilusFile *file);
|
||||
|
||||
/* "Capabilities". */
|
||||
gboolean nautilus_file_can_read (NautilusFile *file);
|
||||
gboolean nautilus_file_can_write (NautilusFile *file);
|
||||
gboolean nautilus_file_can_execute (NautilusFile *file);
|
||||
gboolean nautilus_file_can_rename (NautilusFile *file);
|
||||
gboolean nautilus_file_can_read (NautilusFile *file);
|
||||
gboolean nautilus_file_can_write (NautilusFile *file);
|
||||
gboolean nautilus_file_can_execute (NautilusFile *file);
|
||||
gboolean nautilus_file_can_rename (NautilusFile *file);
|
||||
|
||||
/* Basic operations for file objects. */
|
||||
void nautilus_file_set_owner (NautilusFile *file,
|
||||
const char *user_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_group (NautilusFile *file,
|
||||
const char *group_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_permissions (NautilusFile *file,
|
||||
GnomeVFSFilePermissions permissions,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_rename (NautilusFile *file,
|
||||
const char *new_name,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel (NautilusFile *file,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_owner (NautilusFile *file,
|
||||
const char *user_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_group (NautilusFile *file,
|
||||
const char *group_name_or_id,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_set_permissions (NautilusFile *file,
|
||||
GnomeVFSFilePermissions permissions,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_rename (NautilusFile *file,
|
||||
const char *new_name,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
void nautilus_file_cancel (NautilusFile *file,
|
||||
NautilusFileOperationCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
/* Return true if this file has already been deleted.
|
||||
* This object will be unref'd after sending the files_removed signal,
|
||||
* but it could hang around longer if someone ref'd it.
|
||||
*/
|
||||
gboolean nautilus_file_is_gone (NautilusFile *file);
|
||||
gboolean nautilus_file_is_gone (NautilusFile *file);
|
||||
|
||||
/* Simple getting and setting top-level metadata. */
|
||||
char * nautilus_file_get_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata);
|
||||
GList * nautilus_file_get_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey);
|
||||
void nautilus_file_set_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata,
|
||||
const char *metadata);
|
||||
void nautilus_file_set_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey,
|
||||
GList *list);
|
||||
char * nautilus_file_get_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata);
|
||||
GList * nautilus_file_get_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey);
|
||||
void nautilus_file_set_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
const char *default_metadata,
|
||||
const char *metadata);
|
||||
void nautilus_file_set_metadata_list (NautilusFile *file,
|
||||
const char *list_key,
|
||||
const char *list_subkey,
|
||||
GList *list);
|
||||
|
||||
/* Covers for common data types. */
|
||||
gboolean nautilus_file_get_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata);
|
||||
void nautilus_file_set_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata,
|
||||
gboolean metadata);
|
||||
int nautilus_file_get_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata);
|
||||
void nautilus_file_set_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata,
|
||||
int metadata);
|
||||
gboolean nautilus_file_get_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata);
|
||||
void nautilus_file_set_boolean_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
gboolean default_metadata,
|
||||
gboolean metadata);
|
||||
int nautilus_file_get_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata);
|
||||
void nautilus_file_set_integer_metadata (NautilusFile *file,
|
||||
const char *key,
|
||||
int default_metadata,
|
||||
int metadata);
|
||||
|
||||
|
||||
/* Attributes for file objects as user-displayable strings. */
|
||||
char * nautilus_file_get_string_attribute (NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
char * nautilus_file_get_string_attribute_with_default
|
||||
(NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
char * nautilus_file_get_string_attribute (NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
char * nautilus_file_get_string_attribute_with_default (NautilusFile *file,
|
||||
const char *attribute_name);
|
||||
|
||||
/* Matching with another URI. */
|
||||
gboolean nautilus_file_matches_uri (NautilusFile *file,
|
||||
const char *uri);
|
||||
gboolean nautilus_file_matches_uri (NautilusFile *file,
|
||||
const char *uri);
|
||||
|
||||
/* Is the file local? */
|
||||
gboolean nautilus_file_is_local (NautilusFile *file);
|
||||
gboolean nautilus_file_is_local (NautilusFile *file);
|
||||
|
||||
/* Comparing two file objects for sorting */
|
||||
int nautilus_file_compare_for_sort (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_name (NautilusFile *file_1,
|
||||
const char *pattern);
|
||||
int nautilus_file_compare_for_sort (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
|
||||
NautilusFile *file_2,
|
||||
NautilusFileSortType sort_type);
|
||||
int nautilus_file_compare_name (NautilusFile *file_1,
|
||||
const char *pattern);
|
||||
|
||||
/* filtering functions for use by various directory views */
|
||||
gboolean nautilus_file_is_hidden_file (NautilusFile *file);
|
||||
gboolean nautilus_file_is_backup_file (NautilusFile *file);
|
||||
gboolean nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
GList *nautilus_file_list_filter_hidden_and_backup (GList *files,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
gboolean nautilus_file_is_hidden_file (NautilusFile *file);
|
||||
gboolean nautilus_file_is_backup_file (NautilusFile *file);
|
||||
gboolean nautilus_file_should_show (NautilusFile *file,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
GList *nautilus_file_list_filter_hidden_and_backup (GList *files,
|
||||
gboolean show_hidden,
|
||||
gboolean show_backup);
|
||||
|
||||
|
||||
/* Get the URI that's used when activating the file.
|
||||
* Getting this can require reading the contents of the file.
|
||||
*/
|
||||
char * nautilus_file_get_activation_uri (NautilusFile *file);
|
||||
char * nautilus_file_get_activation_uri (NautilusFile *file);
|
||||
|
||||
/* Convenience functions for dealing with a list of NautilusFile objects that each have a ref.
|
||||
* These are just convenient names for functions that work on lists of GtkObject *.
|
||||
*/
|
||||
GList * nautilus_file_list_ref (GList *file_list);
|
||||
void nautilus_file_list_unref (GList *file_list);
|
||||
void nautilus_file_list_free (GList *file_list);
|
||||
GList * nautilus_file_list_copy (GList *file_list);
|
||||
GList * nautilus_file_list_ref (GList *file_list);
|
||||
void nautilus_file_list_unref (GList *file_list);
|
||||
void nautilus_file_list_free (GList *file_list);
|
||||
GList * nautilus_file_list_copy (GList *file_list);
|
||||
|
||||
/* Debugging */
|
||||
void nautilus_file_dump (NautilusFile *file);
|
||||
void nautilus_file_dump (NautilusFile *file);
|
||||
|
||||
typedef struct NautilusFileDetails NautilusFileDetails;
|
||||
|
||||
|
@ -297,8 +291,32 @@ struct NautilusFile {
|
|||
typedef struct {
|
||||
GtkObjectClass parent_slot;
|
||||
|
||||
/* Called then the file notices any change. */
|
||||
void (* changed) (NautilusFile *file);
|
||||
/* Called when the file notices any change. */
|
||||
void (* changed) (NautilusFile *file);
|
||||
|
||||
/* Virtual functions (mainly used for trash directory). */
|
||||
void (* monitor_add) (NautilusFile *file,
|
||||
gconstpointer client,
|
||||
GList *attributes);
|
||||
void (* monitor_remove) (NautilusFile *file,
|
||||
gconstpointer client);
|
||||
gboolean (* get_item_count) (NautilusFile *file,
|
||||
guint *count,
|
||||
gboolean *count_unreadable);
|
||||
NautilusRequestStatus (* get_deep_counts) (NautilusFile *file,
|
||||
guint *directory_count,
|
||||
guint *file_count,
|
||||
guint *unreadable_directory_count,
|
||||
GnomeVFSFileSize *total_size);
|
||||
void (* call_when_ready) (NautilusFile *file,
|
||||
GList *attributes,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
void (* cancel_call_when_ready) (NautilusFile *file,
|
||||
NautilusFileCallback callback,
|
||||
gpointer callback_data);
|
||||
gboolean (* check_if_ready) (NautilusFile *file,
|
||||
GList *attributes);
|
||||
} NautilusFileClass;
|
||||
|
||||
#endif /* NAUTILUS_FILE_H */
|
||||
|
|
70
libnautilus-private/nautilus-trash-file.c
Normal file
70
libnautilus-private/nautilus-trash-file.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-trash-file.c: Subclass of NautilusFile to help implement the
|
||||
virtual trash directory.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-trash-file.h"
|
||||
|
||||
#include "nautilus-gtk-macros.h"
|
||||
|
||||
struct NautilusTrashFileDetails {
|
||||
};
|
||||
|
||||
static void nautilus_trash_file_initialize (gpointer object,
|
||||
gpointer klass);
|
||||
static void nautilus_trash_file_initialize_class (gpointer klass);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusTrashFile,
|
||||
nautilus_trash_file,
|
||||
NAUTILUS_TYPE_FILE)
|
||||
|
||||
static void
|
||||
nautilus_trash_file_initialize (gpointer object, gpointer klass)
|
||||
{
|
||||
NautilusTrashFile *file;
|
||||
|
||||
file = NAUTILUS_TRASH_FILE (object);
|
||||
|
||||
file->details = g_new0 (NautilusTrashFileDetails, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
trash_destroy (GtkObject *object)
|
||||
{
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_trash_file_initialize_class (gpointer klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
NautilusFileClass *file_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
file_class = NAUTILUS_FILE_CLASS (klass);
|
||||
|
||||
object_class->destroy = trash_destroy;
|
||||
|
||||
/* file_class-> */
|
||||
}
|
55
libnautilus-private/nautilus-trash-file.h
Normal file
55
libnautilus-private/nautilus-trash-file.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-trash-file.h: Subclass of NautilusFile to implement the
|
||||
the case of a TRASH file.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_TRASH_FILE_H
|
||||
#define NAUTILUS_TRASH_FILE_H
|
||||
|
||||
#include "nautilus-file.h"
|
||||
|
||||
#define NAUTILUS_TYPE_TRASH_FILE \
|
||||
(nautilus_trash_file_get_type ())
|
||||
#define NAUTILUS_TRASH_FILE(obj) \
|
||||
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TRASH_FILE, NautilusTrashFile))
|
||||
#define NAUTILUS_TRASH_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TRASH_FILE, NautilusTrashFileClass))
|
||||
#define NAUTILUS_IS_TRASH_FILE(obj) \
|
||||
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TRASH_FILE))
|
||||
#define NAUTILUS_IS_TRASH_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TRASH_FILE))
|
||||
|
||||
typedef struct NautilusTrashFileDetails NautilusTrashFileDetails;
|
||||
|
||||
typedef struct {
|
||||
NautilusFile parent_slot;
|
||||
NautilusTrashFileDetails *details;
|
||||
} NautilusTrashFile;
|
||||
|
||||
typedef struct {
|
||||
NautilusFileClass parent_slot;
|
||||
} NautilusTrashFileClass;
|
||||
|
||||
GtkType nautilus_trash_file_get_type (void);
|
||||
|
||||
#endif /* NAUTILUS_TRASH_FILE_H */
|
70
libnautilus-private/nautilus-vfs-file.c
Normal file
70
libnautilus-private/nautilus-vfs-file.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-vfs-file.c: Subclass of NautilusFile to help implement the
|
||||
virtual trash directory.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-vfs-file.h"
|
||||
|
||||
#include "nautilus-gtk-macros.h"
|
||||
|
||||
struct NautilusVFSFileDetails {
|
||||
};
|
||||
|
||||
static void nautilus_vfs_file_initialize (gpointer object,
|
||||
gpointer klass);
|
||||
static void nautilus_vfs_file_initialize_class (gpointer klass);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusVFSFile,
|
||||
nautilus_vfs_file,
|
||||
NAUTILUS_TYPE_FILE)
|
||||
|
||||
static void
|
||||
nautilus_vfs_file_initialize (gpointer object, gpointer klass)
|
||||
{
|
||||
NautilusVFSFile *file;
|
||||
|
||||
file = NAUTILUS_VFS_FILE (object);
|
||||
|
||||
file->details = g_new0 (NautilusVFSFileDetails, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
vfs_destroy (GtkObject *object)
|
||||
{
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_vfs_file_initialize_class (gpointer klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
NautilusFileClass *file_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
file_class = NAUTILUS_FILE_CLASS (klass);
|
||||
|
||||
object_class->destroy = vfs_destroy;
|
||||
|
||||
/* file_class-> */
|
||||
}
|
55
libnautilus-private/nautilus-vfs-file.h
Normal file
55
libnautilus-private/nautilus-vfs-file.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
||||
|
||||
nautilus-vfs-file.h: Subclass of NautilusFile to implement the
|
||||
the case of a VFS file.
|
||||
|
||||
Copyright (C) 1999, 2000 Eazel, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Darin Adler <darin@eazel.com>
|
||||
*/
|
||||
|
||||
#ifndef NAUTILUS_VFS_FILE_H
|
||||
#define NAUTILUS_VFS_FILE_H
|
||||
|
||||
#include "nautilus-file.h"
|
||||
|
||||
#define NAUTILUS_TYPE_VFS_FILE \
|
||||
(nautilus_vfs_file_get_type ())
|
||||
#define NAUTILUS_VFS_FILE(obj) \
|
||||
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VFS_FILE, NautilusVFSFile))
|
||||
#define NAUTILUS_VFS_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VFS_FILE, NautilusVFSFileClass))
|
||||
#define NAUTILUS_IS_VFS_FILE(obj) \
|
||||
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VFS_FILE))
|
||||
#define NAUTILUS_IS_VFS_FILE_CLASS(klass) \
|
||||
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_VFS_FILE))
|
||||
|
||||
typedef struct NautilusVFSFileDetails NautilusVFSFileDetails;
|
||||
|
||||
typedef struct {
|
||||
NautilusFile parent_slot;
|
||||
NautilusVFSFileDetails *details;
|
||||
} NautilusVFSFile;
|
||||
|
||||
typedef struct {
|
||||
NautilusFileClass parent_slot;
|
||||
} NautilusVFSFileClass;
|
||||
|
||||
GtkType nautilus_vfs_file_get_type (void);
|
||||
|
||||
#endif /* NAUTILUS_VFS_FILE_H */
|
|
@ -1645,7 +1645,6 @@ get_icon_uri_callback (NautilusIconContainer *container,
|
|||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
g_assert (FM_IS_ICON_VIEW (icon_view));
|
||||
|
||||
|
||||
return nautilus_file_get_uri (file);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,17 +102,19 @@ NAUTILUS_DEFINE_CLASS_BOILERPLATE (FMSearchListView,
|
|||
static void
|
||||
load_location_callback (NautilusView *nautilus_view, char *location)
|
||||
{
|
||||
#ifdef HAVE_MEDUSA
|
||||
char *last_indexing_time, *status_string;
|
||||
|
||||
nautilus_view_set_title (nautilus_view, "Search Results");
|
||||
|
||||
last_indexing_time = nautilus_indexing_info_get_last_index_time ();
|
||||
status_string = g_strdup_printf ("Search results may not include items modified after %s, when your drive was last indexed.",
|
||||
status_string = g_strdup_printf (_("Search results may not include items modified after %s, when your drive was last indexed."),
|
||||
last_indexing_time);
|
||||
g_free (last_indexing_time);
|
||||
|
||||
nautilus_view_report_status (nautilus_view, status_string);
|
||||
g_free (status_string);
|
||||
#endif
|
||||
|
||||
nautilus_view_set_title (nautilus_view, _("Search Results"));
|
||||
}
|
||||
|
||||
/* FIXME bugzilla.eazel.com 5057: GnomeVFSResults may not be the
|
||||
|
|
|
@ -23,60 +23,53 @@
|
|||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <gnome.h>
|
||||
#include "nautilus-indexing-info.h"
|
||||
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkprogressbar.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-stock.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-label.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
|
||||
/* FOR THE INCREDIBLE HACK */
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
|
||||
|
||||
#ifdef HAVE_MEDUSA
|
||||
|
||||
#include <libmedusa/medusa-index-service.h>
|
||||
#include <libmedusa/medusa-index-progress.h>
|
||||
#include <libmedusa/medusa-indexed-search.h>
|
||||
|
||||
#include "nautilus-indexing-info.h"
|
||||
#define PROGRESS_UPDATE_INTERVAL 5000
|
||||
|
||||
typedef struct {
|
||||
NautilusLabel *progress_label;
|
||||
GtkProgress *progress_bar;
|
||||
} ProgressChangeData;
|
||||
|
||||
static GtkWidget *dialog = NULL;
|
||||
static GtkWidget *indexing_info_dialog = NULL;
|
||||
|
||||
static char *
|
||||
get_text_for_progress_label (void)
|
||||
{
|
||||
return g_strdup_printf ("Indexing is %d%% complete.", medusa_index_progress_get_percentage_complete ());
|
||||
return g_strdup_printf (_("Indexing is %d%% complete."),
|
||||
medusa_index_progress_get_percentage_complete ());
|
||||
}
|
||||
|
||||
static gint
|
||||
update_progress_display (gpointer data)
|
||||
static gboolean
|
||||
update_progress_display (gpointer callback_data)
|
||||
{
|
||||
NautilusLabel *progress_label;
|
||||
ProgressChangeData *progress_change_data;
|
||||
char *progress_string;
|
||||
|
||||
g_return_val_if_fail (data != NULL, 0);
|
||||
progress_change_data = (ProgressChangeData *) data;
|
||||
if (dialog == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This shouldn't ever happen, but it is possible, so we'll
|
||||
* not whine if it does.
|
||||
*/
|
||||
if (!NAUTILUS_IS_LABEL (progress_change_data->progress_label)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (GTK_IS_PROGRESS (progress_change_data->progress_bar), 0);
|
||||
progress_change_data = (ProgressChangeData *) callback_data;
|
||||
|
||||
progress_label = NAUTILUS_LABEL (progress_change_data->progress_label);
|
||||
progress_string = get_text_for_progress_label ();
|
||||
nautilus_label_set_text (progress_label,
|
||||
|
@ -85,44 +78,35 @@ update_progress_display (gpointer data)
|
|||
gtk_progress_set_value (progress_change_data->progress_bar,
|
||||
medusa_index_progress_get_percentage_complete ());
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
update_file_index_callback (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
char *error = NULL;
|
||||
MedusaIndexingRequestResult result;
|
||||
const char *error;
|
||||
|
||||
result = medusa_index_service_request_reindex ();
|
||||
|
||||
|
||||
switch (result) {
|
||||
default:
|
||||
case MEDUSA_INDEXER_REQUEST_OK:
|
||||
error = NULL;
|
||||
break;
|
||||
case MEDUSA_INDEXER_ERROR_BUSY:
|
||||
error = _("Busy");
|
||||
error = _("Error while trying to reindex: Busy");
|
||||
break;
|
||||
case MEDUSA_INDEXER_ERROR_NO_RESPONSE:
|
||||
error = _("No response");
|
||||
error = _("Error while trying to reindex: No response");
|
||||
break;
|
||||
case MEDUSA_INDEXER_ERROR_NO_INDEXER_PRESENT:
|
||||
error = _("No indexer present");
|
||||
error = _("Error while trying to reindex: No indexer present");
|
||||
break;
|
||||
}
|
||||
|
||||
if (error != NULL) {
|
||||
char *string;
|
||||
GtkWidget *error_dialog;
|
||||
|
||||
string = g_strdup_printf (_("Error while trying "
|
||||
"to reindex: %s"),
|
||||
error);
|
||||
error_dialog = gnome_error_dialog (string);
|
||||
gnome_dialog_run (GNOME_DIALOG (error_dialog));
|
||||
g_free(string);
|
||||
nautilus_error_dialog (error, _("Error While Reindexing"), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,21 +133,6 @@ make_label_helvetica_medium (NautilusLabel *label)
|
|||
nautilus_label_set_font (NAUTILUS_LABEL (label),
|
||||
scalable_font);
|
||||
}
|
||||
char *
|
||||
nautilus_indexing_info_get_last_index_time (void)
|
||||
{
|
||||
struct tm *time_struct;
|
||||
time_t the_time;
|
||||
char *time_string;
|
||||
|
||||
the_time = medusa_index_service_get_last_index_update_time ();
|
||||
time_struct = localtime (&the_time);
|
||||
|
||||
|
||||
time_string = nautilus_strdup_strftime (_("%I:%M %p, %x"), time_struct);
|
||||
|
||||
return time_string;
|
||||
}
|
||||
|
||||
static void
|
||||
show_reindex_request_information (GnomeDialog *gnome_dialog)
|
||||
|
@ -173,13 +142,12 @@ show_reindex_request_information (GnomeDialog *gnome_dialog)
|
|||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
GtkWidget *hbox;
|
||||
|
||||
|
||||
|
||||
time_str = nautilus_indexing_info_get_last_index_time ();
|
||||
label_str = g_strdup_printf (_("Your files were last indexed at %s"),
|
||||
time_str);
|
||||
g_free (time_str);
|
||||
|
||||
|
||||
label = nautilus_label_new (label_str);
|
||||
nautilus_label_set_text_justification (NAUTILUS_LABEL (label), GTK_JUSTIFY_LEFT);
|
||||
make_label_helvetica_bold (NAUTILUS_LABEL (label));
|
||||
|
@ -189,14 +157,19 @@ show_reindex_request_information (GnomeDialog *gnome_dialog)
|
|||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
button = gtk_button_new_with_label (_("Update Now"));
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (update_file_index_callback),
|
||||
NULL);
|
||||
update_file_index_callback, NULL);
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (gnome_dialog->vbox), hbox,
|
||||
FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
timeout_remove_callback (gpointer callback_data)
|
||||
{
|
||||
gtk_timeout_remove (GPOINTER_TO_UINT (callback_data));
|
||||
}
|
||||
|
||||
static void
|
||||
show_index_progress_bar (GnomeDialog *gnome_dialog)
|
||||
{
|
||||
|
@ -206,6 +179,7 @@ show_index_progress_bar (GnomeDialog *gnome_dialog)
|
|||
char *progress_string;
|
||||
int percentage_complete;
|
||||
ProgressChangeData *progress_data;
|
||||
guint timeout_id;
|
||||
|
||||
indexing_notification_label = nautilus_label_new (_("Your files are currently being indexed:"));
|
||||
make_label_helvetica_bold (NAUTILUS_LABEL (indexing_notification_label));
|
||||
|
@ -223,7 +197,6 @@ show_index_progress_bar (GnomeDialog *gnome_dialog)
|
|||
/* Put the progress bar in an hbox to make it a more sane size */
|
||||
gtk_box_pack_start (GTK_BOX (embedded_vbox), indexing_progress_bar, FALSE, FALSE, 0);
|
||||
|
||||
|
||||
progress_string = get_text_for_progress_label ();
|
||||
progress_label = nautilus_label_new (progress_string);
|
||||
g_free (progress_string);
|
||||
|
@ -236,23 +209,100 @@ show_index_progress_bar (GnomeDialog *gnome_dialog)
|
|||
FALSE, FALSE, GNOME_PAD_SMALL);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (gnome_dialog->vbox), progress_bar_hbox,
|
||||
FALSE, FALSE, 0);
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
/* Keep the dialog current with actual indexing progress */
|
||||
progress_data = g_new0 (ProgressChangeData, 1);
|
||||
progress_data = g_new (ProgressChangeData, 1);
|
||||
progress_data->progress_label = NAUTILUS_LABEL (progress_label);
|
||||
progress_data->progress_bar = GTK_PROGRESS (indexing_progress_bar);
|
||||
gtk_timeout_add_full (5000,
|
||||
update_progress_display,
|
||||
NULL,
|
||||
progress_data,
|
||||
g_free);
|
||||
timeout_id = gtk_timeout_add_full (PROGRESS_UPDATE_INTERVAL,
|
||||
update_progress_display,
|
||||
NULL,
|
||||
progress_data,
|
||||
g_free);
|
||||
gtk_signal_connect (GTK_OBJECT (progress_bar_hbox),
|
||||
"destroy",
|
||||
timeout_remove_callback,
|
||||
GUINT_TO_POINTER (timeout_id));
|
||||
}
|
||||
|
||||
static void
|
||||
show_indexing_info_dialog (void)
|
||||
{
|
||||
GnomeDialog *gnome_dialog;
|
||||
GtkWidget *label;
|
||||
|
||||
/* A dialog is up already */
|
||||
if (indexing_info_dialog != NULL) {
|
||||
nautilus_gtk_window_present (GTK_WINDOW (indexing_info_dialog));
|
||||
return;
|
||||
}
|
||||
|
||||
/* FIXME: Should set title, maybe use nautilus stock dialogs. */
|
||||
indexing_info_dialog = gnome_dialog_new (_("Indexing Info"),
|
||||
GNOME_STOCK_BUTTON_OK,
|
||||
NULL);
|
||||
|
||||
gnome_dialog = GNOME_DIALOG (indexing_info_dialog);
|
||||
|
||||
gnome_dialog_set_close (gnome_dialog, TRUE /*click_closes*/);
|
||||
gnome_dialog_close_hides (gnome_dialog, FALSE /*just_hide*/);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (indexing_info_dialog), "destroy",
|
||||
gtk_widget_destroyed,
|
||||
&indexing_info_dialog);
|
||||
|
||||
label = nautilus_label_new (_("Once a day your files and text content are indexed so "
|
||||
"your searches are fast. If you need to update your index "
|
||||
"now, click on the \"Update Now\" button for the "
|
||||
"appropriate index."));
|
||||
nautilus_label_set_line_wrap (NAUTILUS_LABEL (label), TRUE);
|
||||
|
||||
make_label_helvetica_medium (NAUTILUS_LABEL (label));
|
||||
|
||||
nautilus_label_set_text_justification (NAUTILUS_LABEL (label), GTK_JUSTIFY_LEFT);
|
||||
gtk_box_pack_start (GTK_BOX (gnome_dialog->vbox), label, TRUE, TRUE, 0);
|
||||
|
||||
if (medusa_index_is_currently_running ()) {
|
||||
show_index_progress_bar (gnome_dialog);
|
||||
} else {
|
||||
show_reindex_request_information (gnome_dialog);
|
||||
}
|
||||
|
||||
gtk_widget_show_all (indexing_info_dialog);
|
||||
}
|
||||
|
||||
#endif /* HAVE_MEDUSA */
|
||||
|
||||
static void
|
||||
show_search_service_not_available_dialog (void)
|
||||
{
|
||||
nautilus_error_dialog (_("Sorry, but the medusa search service is not available."),
|
||||
_("Search Service Not Available"),
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_indexing_info_request_reindex (void)
|
||||
{
|
||||
#ifdef HAVE_MEDUSA
|
||||
medusa_index_service_request_reindex ();
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
nautilus_indexing_info_get_last_index_time (void)
|
||||
{
|
||||
#ifdef HAVE_MEDUSA
|
||||
time_t update_time;
|
||||
|
||||
update_time = medusa_index_service_get_last_index_update_time ();
|
||||
return nautilus_strdup_strftime (_("%I:%M %p, %x"),
|
||||
localtime (&update_time));
|
||||
#else
|
||||
g_warning ("called nautilus_indexing_info_get_last_index_time with HAVE_MEDUSA off");
|
||||
return g_strdup ("");
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -264,55 +314,17 @@ nautilus_indexing_info_request_reindex (void)
|
|||
void
|
||||
nautilus_indexing_info_show_dialog (void)
|
||||
{
|
||||
|
||||
GnomeDialog *gnome_dialog;
|
||||
GtkWidget *label;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 2534: is it ok to show the index dialog if
|
||||
we can't use the index right now?
|
||||
This assumes not */
|
||||
#ifdef HAVE_MEDUSA
|
||||
/* FIXME bugzilla.eazel.com 2534: Is it ok to show the index
|
||||
* dialog if we can't use the index right now? This assumes
|
||||
* not.
|
||||
*/
|
||||
if (medusa_indexed_search_is_available () != GNOME_VFS_OK) {
|
||||
GtkWidget *error =
|
||||
gnome_error_dialog (_("Search service not available"));
|
||||
gnome_dialog_run (GNOME_DIALOG (error));
|
||||
return;
|
||||
}
|
||||
|
||||
/* A dialog is up already */
|
||||
if (dialog != NULL) {
|
||||
gtk_widget_show_now (dialog);
|
||||
gdk_window_raise (dialog->window);
|
||||
return;
|
||||
}
|
||||
|
||||
dialog = gnome_dialog_new (_("Indexing Info..."),
|
||||
GNOME_STOCK_BUTTON_OK,
|
||||
NULL);
|
||||
|
||||
gnome_dialog = GNOME_DIALOG (dialog);
|
||||
|
||||
gnome_dialog_set_close (gnome_dialog, TRUE /*click_closes*/);
|
||||
gnome_dialog_close_hides (gnome_dialog, FALSE /*just_hide*/);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
|
||||
&dialog);
|
||||
|
||||
label = nautilus_label_new (_("Once a day your files and text content are indexed so\n"
|
||||
"your searches are fast. If you need to update your index\n"
|
||||
"now, click on the \"Update Now\" button for the\n"
|
||||
"appropriate index.\n"));
|
||||
make_label_helvetica_medium (NAUTILUS_LABEL (label));
|
||||
|
||||
nautilus_label_set_text_justification (NAUTILUS_LABEL (label), GTK_JUSTIFY_LEFT);
|
||||
gtk_box_pack_start (GTK_BOX (gnome_dialog->vbox), label, TRUE, TRUE, 0);
|
||||
|
||||
if (medusa_index_is_currently_running ()) {
|
||||
show_index_progress_bar (gnome_dialog);
|
||||
|
||||
} else {
|
||||
show_reindex_request_information (gnome_dialog);
|
||||
show_search_service_not_available_dialog ();
|
||||
} else {
|
||||
show_indexing_info_dialog ();
|
||||
}
|
||||
|
||||
gtk_widget_show_all (dialog);
|
||||
#else
|
||||
show_search_service_not_available_dialog ();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -26,14 +26,11 @@
|
|||
#ifndef NAUTILUS_INDEXING_INFO_H
|
||||
#define NAUTILUS_INDEXING_INFO_H
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
||||
/* Show the indexing info dialog, If one is already running
|
||||
* just raise that one */
|
||||
void nautilus_indexing_info_show_dialog (void);
|
||||
void nautilus_indexing_info_request_reindex (void);
|
||||
char * nautilus_indexing_info_get_last_index_time (void);
|
||||
|
||||
END_GNOME_DECLS
|
||||
* just raise that one.
|
||||
*/
|
||||
void nautilus_indexing_info_show_dialog (void);
|
||||
void nautilus_indexing_info_request_reindex (void);
|
||||
char *nautilus_indexing_info_get_last_index_time (void);
|
||||
|
||||
#endif /* NAUTILUS_INDEXING_INFO_H */
|
||||
|
|
|
@ -110,7 +110,8 @@ nautilus_main_event_loop_register (GtkObject* object)
|
|||
gboolean
|
||||
nautilus_main_is_event_loop_mainstay (GtkObject* object)
|
||||
{
|
||||
return g_slist_length (event_loop_registrants) == 1 && event_loop_registrants->data == object;
|
||||
return g_slist_length (event_loop_registrants) == 1
|
||||
&& event_loop_registrants->data == object;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -141,11 +142,11 @@ main (int argc, char *argv[])
|
|||
{ "check", 'c', POPT_ARG_NONE, &perform_self_check, 0, N_("Perform a quick set of self-check tests."), NULL },
|
||||
#endif
|
||||
{ "geometry", 'g', POPT_ARG_STRING, &geometry, 0, N_("Create the initial window with the given geometry."), N_("GEOMETRY") },
|
||||
{ "no-default-window", 'n', POPT_ARG_NONE, &no_default_window, 0, N_("Only create Nautilus windows for explicitly specified URIs."), NULL },
|
||||
{ "no-default-window", 'n', POPT_ARG_NONE, &no_default_window, 0, N_("Only create windows for explicitly specified URIs."), NULL },
|
||||
{ "quit", 'q', POPT_ARG_NONE, &kill_shell, 0, N_("Quit Nautilus."), NULL },
|
||||
{ "restart", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN, &restart_shell, 0, N_("Restart Nautilus."), NULL },
|
||||
/* FIXME bugzilla.eazel.com 5510: These OAF options don't get translated for some reason. */
|
||||
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
|
||||
POPT_AUTOHELP
|
||||
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -1027,7 +1027,7 @@ make_emblem_value_menu (NautilusSearchBarCriterion *criterion)
|
|||
&emblem_label) == GNOME_VFS_OK) {
|
||||
|
||||
/* remove the suffix, if any, to make the emblem name */
|
||||
dot_pos = strrchr(emblem_name, '.');
|
||||
dot_pos = strrchr (emblem_name, '.');
|
||||
if (dot_pos) {
|
||||
*dot_pos = '\0';
|
||||
}
|
||||
|
@ -1040,7 +1040,8 @@ make_emblem_value_menu (NautilusSearchBarCriterion *criterion)
|
|||
}
|
||||
menu_item = gtk_menu_item_new ();
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "emblem name", emblem_name);
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item), "emblem name",
|
||||
emblem_name, (GtkDestroyNotify) g_free);
|
||||
temp_hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
||||
gtk_box_pack_start (GTK_BOX (temp_hbox), emblem_pixmap_widget, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (temp_hbox), emblem_label, FALSE, FALSE, 0);
|
||||
|
@ -1053,7 +1054,6 @@ make_emblem_value_menu (NautilusSearchBarCriterion *criterion)
|
|||
gtk_option_menu_set_menu (criterion->details->value_menu,
|
||||
value_menu);
|
||||
criterion->details->use_value_menu = TRUE;
|
||||
g_free (emblem_name);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue