diff options
34 files changed, 395 insertions, 887 deletions
diff --git a/cut-n-paste-code/Makefile.am b/cut-n-paste-code/Makefile.am index 40ef00039..dd85ee073 100644 --- a/cut-n-paste-code/Makefile.am +++ b/cut-n-paste-code/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = widgets +SUBDIRS = widgets libegg diff --git a/cut-n-paste-code/libegg/Makefile.am b/cut-n-paste-code/libegg/Makefile.am new file mode 100644 index 000000000..5a357c363 --- /dev/null +++ b/cut-n-paste-code/libegg/Makefile.am @@ -0,0 +1,47 @@ +NULL= + +noinst_LTLIBRARIES = libegg.la + +INCLUDES = $(LIBEGG_CFLAGS) + +EGG_SCREEN_FILES = \ + egg-screen-exec.h \ + egg-screen-exec.c \ + egg-screen-url.h \ + egg-screen-url.c \ + egg-screen-help.h \ + egg-screen-help.c \ + $(NULL) + +EGG_RECENT_FILES = \ + egg-recent-model.c \ + egg-recent-model.h \ + egg-recent-item.c \ + egg-recent-item.h \ + egg-recent-vfs-utils.c \ + egg-recent-vfs-utils.h \ + $(NULL) + +EGG_TREE_DND_FILES = \ + eggtreemultidnd.c \ + eggtreemultidnd.h \ + $(NULL) + +libegg_la_SOURCES = \ + $(EGG_SCREEN_FILES) \ + $(EGG_RECENT_FILES) \ + $(EGG_TREE_DND_FILES) \ + $(NULL) + +EXTRA_DIST = \ + update-from-egg.sh \ + $(NULL) + +EGG_SCREEN_DIR = $(srcdir)/../../../libegg/libegg/screen-exec +EGG_RECENT_DIR = $(srcdir)/../../../libegg/libegg/recent-files +EGG_TREE_DND_DIR = $(srcdir)/../../../libegg/libegg/treeviewutils + +regenerate-built-sources: + EGGFILES="$(EGG_SCREEN_FILES)" EGGDIR="$(EGG_SCREEN_DIR)" $(srcdir)/update-from-egg.sh + EGGFILES="$(EGG_RECENT_FILES)" EGGDIR="$(EGG_RECENT_DIR)" $(srcdir)/update-from-egg.sh + EGGFILES="$(EGG_TREE_DND_FILES)" EGGDIR="$(EGG_TREE_DND_DIR)" $(srcdir)/update-from-egg.sh diff --git a/libnautilus-private/egg-recent-item.c b/cut-n-paste-code/libegg/egg-recent-item.c index 4b42aca75..4b42aca75 100644 --- a/libnautilus-private/egg-recent-item.c +++ b/cut-n-paste-code/libegg/egg-recent-item.c diff --git a/libnautilus-private/egg-recent-item.h b/cut-n-paste-code/libegg/egg-recent-item.h index 74cb097a3..74cb097a3 100644 --- a/libnautilus-private/egg-recent-item.h +++ b/cut-n-paste-code/libegg/egg-recent-item.h diff --git a/libnautilus-private/egg-recent-model.c b/cut-n-paste-code/libegg/egg-recent-model.c index a5637a8dc..2f6ee5498 100644 --- a/libnautilus-private/egg-recent-model.c +++ b/cut-n-paste-code/libegg/egg-recent-model.c @@ -151,19 +151,6 @@ static GMarkupParser parser = {start_element_handler, end_element_handler, NULL, error_handler}; -#if 0 -static void -print_elapsed (struct timeval before, struct timeval after, const gchar *label) -{ - gdouble elapsed; - - elapsed = after.tv_sec - before.tv_sec - + (after.tv_usec - before.tv_usec) / 1000000.0; - - g_print ("%s: %f elapsed.\n", label, elapsed); -} -#endif - static gboolean egg_recent_model_string_match (const GSList *list, const gchar *str) { @@ -689,20 +676,18 @@ egg_recent_model_monitor_cb (GnomeVFSMonitorHandle *handle, static void egg_recent_model_monitor (EggRecentModel *model, gboolean should_monitor) { - GnomeVFSResult res; - if (should_monitor && model->priv->monitor == NULL) { - res = gnome_vfs_monitor_add (&model->priv->monitor, + gnome_vfs_monitor_add (&model->priv->monitor, model->priv->path, GNOME_VFS_MONITOR_FILE, egg_recent_model_monitor_cb, model); - if (res != GNOME_VFS_OK) - g_warning ("Unable to monitor XML document. Notification " - "of changes in recent documents list will not be" - "available."); + /* if the above fails, don't worry about it. + * local notifications will still happen + */ + } else if (!should_monitor && model->priv->monitor != NULL) { gnome_vfs_monitor_cancel (model->priv->monitor); model->priv->monitor = NULL; @@ -791,7 +776,7 @@ egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list) item = (EggRecentItem *)list->data; - uri = egg_recent_item_get_uri (item); + uri = egg_recent_item_get_uri_utf8 (item); escaped_uri = g_markup_escape_text (uri, strlen (uri)); g_free (uri); @@ -873,6 +858,9 @@ egg_recent_model_open_file (EggRecentModel *model) file = fopen (model->priv->path, "r+"); if (file == NULL) { + /* be paranoid */ + umask (077); + file = fopen (model->priv->path, "w+"); g_return_val_if_fail (file != NULL, NULL); diff --git a/libnautilus-private/egg-recent-model.h b/cut-n-paste-code/libegg/egg-recent-model.h index 8c2eb8da1..8c2eb8da1 100644 --- a/libnautilus-private/egg-recent-model.h +++ b/cut-n-paste-code/libegg/egg-recent-model.h diff --git a/libnautilus-private/egg-recent-vfs-utils.c b/cut-n-paste-code/libegg/egg-recent-vfs-utils.c index 51083dd96..51083dd96 100644 --- a/libnautilus-private/egg-recent-vfs-utils.c +++ b/cut-n-paste-code/libegg/egg-recent-vfs-utils.c diff --git a/libnautilus-private/egg-recent-vfs-utils.h b/cut-n-paste-code/libegg/egg-recent-vfs-utils.h index 619b25b49..619b25b49 100644 --- a/libnautilus-private/egg-recent-vfs-utils.h +++ b/cut-n-paste-code/libegg/egg-recent-vfs-utils.h diff --git a/libnautilus-private/egg-screen-exec.c b/cut-n-paste-code/libegg/egg-screen-exec.c index 94a068e36..94a068e36 100644 --- a/libnautilus-private/egg-screen-exec.c +++ b/cut-n-paste-code/libegg/egg-screen-exec.c diff --git a/libnautilus-private/egg-screen-exec.h b/cut-n-paste-code/libegg/egg-screen-exec.h index 65a6df021..65a6df021 100644 --- a/libnautilus-private/egg-screen-exec.h +++ b/cut-n-paste-code/libegg/egg-screen-exec.h diff --git a/cut-n-paste-code/libegg/egg-screen-help.c b/cut-n-paste-code/libegg/egg-screen-help.c new file mode 100644 index 000000000..42e717f5e --- /dev/null +++ b/cut-n-paste-code/libegg/egg-screen-help.c @@ -0,0 +1,163 @@ +/* egg-screen-help.c + * Copyright (C) 2001 Sid Vicious + * Copyright (C) 2001 Jonathan Blandford <jrb@alum.mit.edu> + * Copyright (C) 2002 Sun Microsystems Inc. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. + * + * Authors: Mark McLoughlin <mark@skynet.ie> + */ + +#include <config.h> + +#include "egg-screen-help.h" + +#include <libgnome/gnome-help.h> + +#include "egg-screen-exec.h" + +/** + * egg_help_display_on_screen: + * @file_name: The name of the help document to display. + * @link_id: Can be %NULL. If set, refers to an anchor or section id within the + * requested document. + * @screen: a #GdkScreen. + * @error: A #GError instance that will hold the specifics of any error which + * occurs during processing, or %NULL + * + * Description: Like gnome_help_display(), but ensures that the help viewer + * application appears on @screen. + * + * Returns: %TRUE on success, %FALSE otherwise (in which case @error will + * contain the actual error). + **/ +gboolean +egg_help_display_on_screen (const char *file_name, + const char *link_id, + GdkScreen *screen, + GError **error) +{ + return egg_help_display_with_doc_id_on_screen ( + NULL, NULL, file_name, link_id, screen, error); +} + +/** + * egg_help_display_with_doc_id_on_screen: + * @program: The current application object, or %NULL for the default one. + * @doc_id: The document identifier, or %NULL to default to the application ID + * (app_id) of the specified @program. + * @file_name: The name of the help document to display. + * @link_id: Can be %NULL. If set, refers to an anchor or section id within the + * requested document. + * @screen: a #GdkScreen. + * @error: A #GError instance that will hold the specifics of any error which + * occurs during processing, or %NULL + * + * Description: Like gnome_help_display_with_doc_id(), but ensures that the help + * viewer application appears on @screen. + * + * Returns: %TRUE on success, %FALSE otherwise (in which case @error will + * contain the actual error). + **/ +gboolean +egg_help_display_with_doc_id_on_screen (GnomeProgram *program, + const char *doc_id, + const char *file_name, + const char *link_id, + GdkScreen *screen, + GError **error) +{ + gboolean retval; + char **env; + + env = egg_screen_exec_environment (screen); + + retval = gnome_help_display_with_doc_id_and_env ( + program, doc_id, file_name, link_id, env, error); + + g_strfreev (env); + + return retval; +} + +/** + * egg_help_display_desktop_on_screen: + * @program: The current application object, or %NULL for the default one. + * @doc_id: The name of the help file relative to the system's help domain + * (#GNOME_FILE_DOMAIN_HELP). + * @file_name: The name of the help document to display. + * @link_id: Can be %NULL. If set, refers to an anchor or section id within the + * requested document. + * @screen: a #GdkScreen. + * @error: A #GError instance that will hold the specifics of any error which + * occurs during processing, or %NULL + * + * Description: Like gnome_help_display_desktop(), but ensures that the help + * viewer application appears on @screen. + * + * Returns: %TRUE on success, %FALSE otherwise (in which case @error will + * contain the actual error). + **/ +gboolean +egg_help_display_desktop_on_screen (GnomeProgram *program, + const char *doc_id, + const char *file_name, + const char *link_id, + GdkScreen *screen, + GError **error) +{ + gboolean retval; + char **env; + + env = egg_screen_exec_environment (screen); + + retval = gnome_help_display_desktop_with_env ( + program, doc_id, file_name, link_id, env, error); + + g_strfreev (env); + + return retval; +} + +/** + * egg_help_display_uri_on_screen: + * @help_uri: The URI to display. + * @screen: a #GdkScreen. + * @error: A #GError instance that will hold the specifics of any error which + * occurs during processing, or %NULL + * + * Description: Like gnome_help_display_uri(), but ensures that the help viewer + * application appears on @screen. + * + * Returns: %TRUE on success, %FALSE otherwise (in which case @error will + * contain the actual error). + **/ +gboolean +egg_help_display_uri_on_screen (const char *help_uri, + GdkScreen *screen, + GError **error) +{ + gboolean retval; + char **env; + + env = egg_screen_exec_environment (screen); + + retval = gnome_help_display_uri_with_env (help_uri, env, error); + + g_strfreev (env); + + return retval; +} diff --git a/cut-n-paste-code/libegg/egg-screen-help.h b/cut-n-paste-code/libegg/egg-screen-help.h new file mode 100644 index 000000000..5c6770d43 --- /dev/null +++ b/cut-n-paste-code/libegg/egg-screen-help.h @@ -0,0 +1,56 @@ +/* egg-screen-help.h + * + * Copyright (C) 2002 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Mark McLoughlin <mark@skynet.ie> + */ + +#ifndef __EGG_SCREEN_HELP_H__ +#define __EGG_SCREEN_HELP_H__ + +#include <glib.h> +#include <gdk/gdk.h> +#include <libgnome/gnome-program.h> + +G_BEGIN_DECLS + +/* Destined for libgnomeui. + */ +gboolean egg_help_display_on_screen (const char *file_name, + const char *link_id, + GdkScreen *screen, + GError **error); +gboolean egg_help_display_with_doc_id_on_screen (GnomeProgram *program, + const char *doc_id, + const char *file_name, + const char *link_id, + GdkScreen *screen, + GError **error); +gboolean egg_help_display_desktop_on_screen (GnomeProgram *program, + const char *doc_id, + const char *file_name, + const char *link_id, + GdkScreen *screen, + GError **error); +gboolean egg_help_display_uri_on_screen (const char *help_uri, + GdkScreen *screen, + GError **error); + +G_END_DECLS + +#endif /* __EGG_SCREEN_HELP_H__ */ diff --git a/cut-n-paste-code/libegg/egg-screen-url.c b/cut-n-paste-code/libegg/egg-screen-url.c new file mode 100644 index 000000000..1fd0c5daa --- /dev/null +++ b/cut-n-paste-code/libegg/egg-screen-url.c @@ -0,0 +1,59 @@ +/* egg-screen-url.c + * Copyright (C) 1998, James Henstridge <james@daa.com.au> + * Copyright (C) 1999, 2000 Red Hat, Inc. + * Copyright (C) 2002, Sun Microsystems Inc. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. + * + * Authors: Mark McLoughlin <mark@skynet.ie> + */ + +#include <config.h> + +#include <libgnome/gnome-url.h> + +#include "egg-screen-url.h" +#include "egg-screen-exec.h" + +/** + * egg_url_show_on_screen: + * @url: The url to display. Should begin with the protocol to use (e.g. + * "http:", "ghelp:", etc) + * @screen: a #GdkScreen. + * @error: Used to store any errors that result from trying to display the @url. + * + * Description: Like gnome_url_show(), but ensures that the viewer application + * appears on @screen. + * + * Returns: %TRUE if everything went fine, %FALSE otherwise (in which case + * @error will contain the actual error). + **/ +gboolean +egg_url_show_on_screen (const char *url, + GdkScreen *screen, + GError **error) +{ + char **env; + gboolean retval; + + env = egg_screen_exec_environment (screen); + + retval = gnome_url_show_with_env (url, env, error); + + g_strfreev (env); + + return retval; +} diff --git a/libnautilus-private/egg-screen-url.h b/cut-n-paste-code/libegg/egg-screen-url.h index 7771b0abf..d4aa0144c 100644 --- a/libnautilus-private/egg-screen-url.h +++ b/cut-n-paste-code/libegg/egg-screen-url.h @@ -27,17 +27,9 @@ G_BEGIN_DECLS -/* Destined for libgnome. - */ -gboolean egg_url_show_with_env (const char *url, - char **envp, - GError **error); - -/* Destined for libgnomeui. - */ -gboolean egg_screen_url_show (GdkScreen *screen, - const char *url, - GError **error); +gboolean egg_url_show_on_screen (const char *url, + GdkScreen *screen, + GError **error); G_END_DECLS diff --git a/libnautilus-private/eggtreemultidnd.c b/cut-n-paste-code/libegg/eggtreemultidnd.c index ae863e786..ae7a4d5aa 100644 --- a/libnautilus-private/eggtreemultidnd.c +++ b/cut-n-paste-code/libegg/eggtreemultidnd.c @@ -34,7 +34,7 @@ typedef struct guint motion_notify_handler; guint button_release_handler; guint drag_data_get_handler; - GSList *events; + GSList *event_list; } EggTreeMultiDndData; /* CUT-N-PASTE from gtktreeview.c */ @@ -169,11 +169,11 @@ stop_drag_check (GtkWidget *widget) priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING); - for (l = priv_data->events; l != NULL; l = l->next) + for (l = priv_data->event_list; l != NULL; l = l->next) gdk_event_free (l->data); - g_slist_free (priv_data->events); - priv_data->events = NULL; + g_slist_free (priv_data->event_list); + priv_data->event_list = NULL; g_signal_handler_disconnect (widget, priv_data->motion_notify_handler); g_signal_handler_disconnect (widget, priv_data->button_release_handler); } @@ -188,7 +188,7 @@ egg_tree_multi_drag_button_release_event (GtkWidget *widget, priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING); - for (l = priv_data->events; l != NULL; l = l->next) + for (l = priv_data->event_list; l != NULL; l = l->next) gtk_propagate_event (widget, l->data); stop_drag_check (widget); @@ -355,13 +355,13 @@ egg_tree_multi_drag_button_press_event (GtkWidget *widget, g_object_set_data (G_OBJECT (tree_view), EGG_TREE_MULTI_DND_STRING, priv_data); } - if (g_slist_find (priv_data->events, event)) + if (g_slist_find (priv_data->event_list, event)) return FALSE; - if (priv_data->events) + if (priv_data->event_list) { /* save the event to be propagated in order */ - priv_data->events = g_slist_append (priv_data->events, gdk_event_copy ((GdkEvent*)event)); + priv_data->event_list = g_slist_append (priv_data->event_list, gdk_event_copy ((GdkEvent*)event)); return TRUE; } @@ -380,7 +380,7 @@ egg_tree_multi_drag_button_press_event (GtkWidget *widget, priv_data->pressed_button = event->button; priv_data->x = event->x; priv_data->y = event->y; - priv_data->events = g_slist_append (priv_data->events, gdk_event_copy ((GdkEvent*)event)); + priv_data->event_list = g_slist_append (priv_data->event_list, gdk_event_copy ((GdkEvent*)event)); priv_data->motion_notify_handler = g_signal_connect (G_OBJECT (tree_view), "motion_notify_event", G_CALLBACK (egg_tree_multi_drag_motion_event), NULL); priv_data->button_release_handler = @@ -408,7 +408,5 @@ egg_tree_multi_drag_add_drag_support (GtkTreeView *tree_view) { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_signal_connect (G_OBJECT (tree_view), "button_press_event", G_CALLBACK (egg_tree_multi_drag_button_press_event), NULL); - /* FIXME */ - } diff --git a/libnautilus-private/eggtreemultidnd.h b/cut-n-paste-code/libegg/eggtreemultidnd.h index 810d48ea7..810d48ea7 100644 --- a/libnautilus-private/eggtreemultidnd.h +++ b/cut-n-paste-code/libegg/eggtreemultidnd.h diff --git a/libnautilus-private/update-from-egg.sh b/cut-n-paste-code/libegg/update-from-egg.sh index 9be68a9b4..9be68a9b4 100755 --- a/libnautilus-private/update-from-egg.sh +++ b/cut-n-paste-code/libegg/update-from-egg.sh diff --git a/libnautilus-private/Makefile.am b/libnautilus-private/Makefile.am index db2e9c38b..5b1f3881a 100644 --- a/libnautilus-private/Makefile.am +++ b/libnautilus-private/Makefile.am @@ -5,6 +5,7 @@ lib_LTLIBRARIES=libnautilus-private.la INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ + -I$(top_srcdir)/cut-n-paste-code \ $(CORE_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ @@ -14,6 +15,7 @@ INCLUDES = \ dependency_static_libs = \ $(top_builddir)/cut-n-paste-code/widgets/gimphwrapbox/libgtkhwrapbox.la \ + $(top_builddir)/cut-n-paste-code/libegg/libegg.la \ $(top_builddir)/libbackground/libbackground.la \ $(NULL) @@ -35,28 +37,9 @@ marshal_sources = \ nautilus-marshal-guts.c \ $(NULL) -EGG_SCREEN_FILES = \ - egg-screen-exec.h \ - egg-screen-exec.c \ - egg-screen-url.h \ - egg-screen-url.c \ - egg-screen-help.h \ - egg-screen-help.c \ - $(NULL) - -EGG_RECENT_FILES = \ - egg-recent-model.c \ - egg-recent-model.h \ - egg-recent-item.c \ - egg-recent-item.h \ - egg-recent-vfs-utils.c \ - egg-recent-vfs-utils.h \ - $(NULL) libnautilus_private_la_SOURCES = \ $(nautilus_metafile_server_idl_sources) \ - eggtreemultidnd.c \ - eggtreemultidnd.h \ nautilus-audio-player.c \ nautilus-audio-player.h \ nautilus-authn-manager.c \ @@ -184,8 +167,6 @@ libnautilus_private_la_SOURCES = \ nautilus-view-identifier.h \ nautilus-volume-monitor.c \ nautilus-volume-monitor.h \ - $(EGG_SCREEN_FILES) \ - $(EGG_RECENT_FILES) \ $(NULL) fsattributesdir = $(datadir)/nautilus @@ -221,7 +202,6 @@ EXTRA_DIST = \ $(fsattributes_DATA) \ nautilus-metafile-server.idl \ nautilus-marshal.list \ - update-from-egg.sh \ $(schema_DATA) \ $(NULL) @@ -234,9 +214,3 @@ CLEANFILES = \ dist-hook: cd $(distdir); rm -f $(CLEANFILES) -EGG_SCREEN_DIR = $(srcdir)/../../libegg/libegg/screen-exec -EGG_RECENT_DIR = $(srcdir)/../../libegg/libegg/recent-files - -regenerate-built-sources: - EGGFILES="$(EGG_SCREEN_FILES)" EGGDIR="$(EGG_SCREEN_DIR)" $(srcdir)/update-from-egg.sh - EGGFILES="$(EGG_RECENT_FILES)" EGGDIR="$(EGG_RECENT_DIR)" $(srcdir)/update-from-egg.sh diff --git a/libnautilus-private/egg-screen-help.c b/libnautilus-private/egg-screen-help.c deleted file mode 100644 index fd8bb77cf..000000000 --- a/libnautilus-private/egg-screen-help.c +++ /dev/null @@ -1,487 +0,0 @@ -/* egg-screen-help.c - * Copyright (C) 2001 Sid Vicious - * Copyright (C) 2001 Jonathan Blandford <jrb@alum.mit.edu> - * Copyright (C) 2002 Sun Microsystems Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. - * - * Authors: Mark McLoughlin <mark@skynet.ie> - */ - -#include <config.h> - -#include "egg-screen-help.h" - -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <glib.h> -#include <libgnome/gnome-help.h> -#include <libgnome/gnome-program.h> -#include <libgnome/gnome-i18n.h> - -#include "egg-screen-url.h" -#include "egg-screen-exec.h" - -/******* START COPIED + PASTED CODE TO GO AWAY ******/ - -/* The _with_env methods need to go into and - * be exposed from libgnome. They can then be - * removed from here. - */ - -/** - * egg_help_display_uri_with_env: - * @help_uri: The URI to display. - * @envp: child's environment, or %NULL to inherit parent's. - * @error: return location for errors. - * - * Description: Like gnome_help_display_uri, except that the help viewer - * application is launched with its environment set to the contents of - * @envp. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_help_display_uri_with_env (const char *help_uri, - char **envp, - GError **error) -{ - GError *real_error; - gboolean retval; - - real_error = NULL; - retval = egg_url_show_with_env (help_uri, envp, &real_error); - - if (real_error != NULL) - g_propagate_error (error, real_error); - - return retval; -} - -static char * -locate_help_file (const char *path, const char *doc_name) -{ - int i; - char *exts[] = { ".xml", ".docbook", ".sgml", ".html", "", NULL }; - const GList *lang_list = gnome_i18n_get_language_list ("LC_MESSAGES"); - - for (;lang_list != NULL; lang_list = lang_list->next) { - const char *lang = lang_list->data; - - /* This has to be a valid language AND a language with - * no encoding postfix. The language will come up without - * encoding next */ - if (lang == NULL || - strchr (lang, '.') != NULL) - continue; - - for (i = 0; exts[i] != NULL; i++) { - char *name; - char *full; - - name = g_strconcat (doc_name, exts[i], NULL); - full = g_build_filename (path, lang, name, NULL); - g_free (name); - - if (g_file_test (full, G_FILE_TEST_EXISTS)) - return full; - - g_free (full); - } - } - - return NULL; -} - -/** - * egg_help_display_with_doc_id_with_env: - * @program: The current application object, or %NULL for the default one. - * @doc_id: The document identifier, or %NULL to default to the application ID - * (app_id) of the specified @program. - * @file_name: The name of the help document to display. - * @link_id: Can be %NULL. If set, refers to an anchor or section id within the - * requested document. - * @envp: child's environment, or %NULL to inherit parent's. - * @error: A #GError instance that will hold the specifics of any error which - * occurs during processing, or %NULL - * - * Description: Like gnome_help_display_with_doc_id(), except that the help - * viewer application is launched with its environment set to the contents - * of @envp. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_help_display_with_doc_id_with_env (GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - char **envp, - GError **error) -{ - gchar *local_help_path; - gchar *global_help_path; - gchar *file; - struct stat local_help_st; - struct stat global_help_st; - gchar *uri; - gboolean retval; - - g_return_val_if_fail (file_name != NULL, FALSE); - - retval = FALSE; - - local_help_path = NULL; - global_help_path = NULL; - file = NULL; - uri = NULL; - - if (program == NULL) - program = gnome_program_get (); - - if (doc_id == NULL) - doc_id = gnome_program_get_app_id (program); - - /* Compute the local and global help paths */ - - local_help_path = gnome_program_locate_file (program, - GNOME_FILE_DOMAIN_APP_HELP, - "", - FALSE /* only_if_exists */, - NULL /* ret_locations */); - - if (local_help_path == NULL) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_INTERNAL, - _("Unable to find the GNOME_FILE_DOMAIN_APP_HELP domain")); - goto out; - } - - global_help_path = gnome_program_locate_file (program, - GNOME_FILE_DOMAIN_HELP, - "", - FALSE /* only_if_exists */, - NULL /* ret_locations */); - if (global_help_path == NULL) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_INTERNAL, - _("Unable to find the GNOME_FILE_DOMAIN_HELP domain.")); - goto out; - } - - /* Try to access the help paths, first the app-specific help path - * and then falling back to the global help path if the first one fails. - */ - - if (stat (local_help_path, &local_help_st) == 0) { - if (!S_ISDIR (local_help_st.st_mode)) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_NOT_FOUND, - _("Unable to show help as %s is not a directory. " - "Please check your installation."), - local_help_path); - goto out; - } - - file = locate_help_file (local_help_path, file_name); - } - - if (file == NULL) { - if (stat (global_help_path, &global_help_st) == 0) { - if (!S_ISDIR (global_help_st.st_mode)) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_NOT_FOUND, - _("Unable to show help as %s is not a directory. " - "Please check your installation."), - global_help_path); - goto out; - } - } else { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_NOT_FOUND, - _("Unable to find the help files in either %s " - "or %s. Please check your installation"), - local_help_path, - global_help_path); - goto out; - } - - if (!(local_help_st.st_dev == global_help_st.st_dev - && local_help_st.st_ino == global_help_st.st_ino)) - file = locate_help_file (global_help_path, file_name); - } - - if (file == NULL) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_NOT_FOUND, - _("Unable to find the help files in either %s " - "or %s. Please check your installation"), - local_help_path, - global_help_path); - goto out; - } - - /* Now that we have a file name, try to display it in the help browser */ - - if (link_id) - uri = g_strconcat ("ghelp://", file, "?", link_id, NULL); - else - uri = g_strconcat ("ghelp://", file, NULL); - - retval = egg_help_display_uri_with_env (uri, envp, error); - - out: - - g_free (local_help_path); - g_free (global_help_path); - g_free (file); - g_free (uri); - - return retval; -} - -/** - * egg_help_display_desktop_with_env: - * @program: The current application object, or %NULL for the default one. - * @doc_id: The name of the help file relative to the system's help domain - * (#GNOME_FILE_DOMAIN_HELP). - * @file_name: The name of the help document to display. - * @link_id: Can be %NULL. If set, refers to an anchor or section id within the - * requested document. - * @envp: child's environment, or %NULL to inherit parent's. - * @error: A #GError instance that will hold the specifics of any error which - * occurs during processing, or %NULL - * - * Description: Like gnome_help_display_desktop(), except that the help - * viewer application is launched with its environment set to the contents - * of @envp. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_help_display_desktop_with_env (GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - char **envp, - GError **error) -{ - GSList *ret_locations, *li; - char *file; - gboolean retval; - char *url; - - g_return_val_if_fail (doc_id != NULL, FALSE); - g_return_val_if_fail (file_name != NULL, FALSE); - - if (program == NULL) - program = gnome_program_get (); - - ret_locations = NULL; - gnome_program_locate_file (program, - GNOME_FILE_DOMAIN_HELP, - doc_id, - FALSE /* only_if_exists */, - &ret_locations); - - if (ret_locations == NULL) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_NOT_FOUND, - _("Unable to find doc_id %s in the help path"), - doc_id); - return FALSE; - } - - file = NULL; - for (li = ret_locations; li != NULL; li = li->next) { - char *path = li->data; - - file = locate_help_file (path, file_name); - if (file != NULL) - break; - } - - g_slist_foreach (ret_locations, (GFunc)g_free, NULL); - g_slist_free (ret_locations); - - if (file == NULL) { - g_set_error (error, - GNOME_HELP_ERROR, - GNOME_HELP_ERROR_NOT_FOUND, - _("Help document %s/%s not found"), - doc_id, - file_name); - return FALSE; - } - - if (link_id != NULL) { - url = g_strconcat ("ghelp://", file, "?", link_id, NULL); - } else { - url = g_strconcat ("ghelp://", file, NULL); - } - - g_free (file); - - retval = egg_help_display_uri_with_env (url, envp, error); - - return retval; -} -/******* END COPIED + PASTED CODE TO GO AWAY ******/ - -/** - * egg_screen_help_display: - * @screen: a #GdkScreen. - * @file_name: The name of the help document to display. - * @link_id: Can be %NULL. If set, refers to an anchor or section id within the - * requested document. - * @error: A #GError instance that will hold the specifics of any error which - * occurs during processing, or %NULL - * - * Description: Like gnome_help_display(), but ensures that the help viewer - * application appears on @screen. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_screen_help_display (GdkScreen *screen, - const char *file_name, - const char *link_id, - GError **error) -{ - return egg_screen_help_display_with_doc_id ( - screen, NULL, NULL, file_name, link_id, error); -} - -/** - * egg_screen_help_display_with_doc_id - * @screen: a #GdkScreen. - * @program: The current application object, or %NULL for the default one. - * @doc_id: The document identifier, or %NULL to default to the application ID - * (app_id) of the specified @program. - * @file_name: The name of the help document to display. - * @link_id: Can be %NULL. If set, refers to an anchor or section id within the - * requested document. - * @error: A #GError instance that will hold the specifics of any error which - * occurs during processing, or %NULL - * - * Description: Like gnome_help_display_with_doc_id(), but ensures that the help - * viewer application appears on @screen. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_screen_help_display_with_doc_id (GdkScreen *screen, - GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - GError **error) -{ - gboolean retval; - char **env; - - env = egg_screen_exec_environment (screen); - - retval = egg_help_display_with_doc_id_with_env ( - program, doc_id, file_name, link_id, env, error); - - g_strfreev (env); - - return retval; -} - -/** - * egg_screen_help_display_desktop - * @screen: a #GdkScreen. - * @program: The current application object, or %NULL for the default one. - * @doc_id: The name of the help file relative to the system's help domain - * (#GNOME_FILE_DOMAIN_HELP). - * @file_name: The name of the help document to display. - * @link_id: Can be %NULL. If set, refers to an anchor or section id within the - * requested document. - * @error: A #GError instance that will hold the specifics of any error which - * occurs during processing, or %NULL - * - * Description: Like gnome_help_display_desktop(), but ensures that the help - * viewer application appears on @screen. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_screen_help_display_desktop (GdkScreen *screen, - GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - GError **error) -{ - gboolean retval; - char **env; - - env = egg_screen_exec_environment (screen); - - retval = egg_help_display_desktop_with_env ( - program, doc_id, file_name, link_id, env, error); - - g_strfreev (env); - - return retval; -} - -/** - * egg_screen_help_display_uri - * @screen: a #GdkScreen. - * @help_uri: The URI to display. - * @error: A #GError instance that will hold the specifics of any error which - * occurs during processing, or %NULL - * - * Description: Like gnome_help_display_uri(), but ensures that the help viewer - * application appears on @screen. - * - * Returns: %TRUE on success, %FALSE otherwise (in which case @error will - * contain the actual error). - **/ -gboolean -egg_screen_help_display_uri (GdkScreen *screen, - const char *help_uri, - GError **error) -{ - gboolean retval; - char **env; - - env = egg_screen_exec_environment (screen); - - retval = egg_help_display_uri_with_env (help_uri, env, error); - - g_strfreev (env); - - return retval; -} diff --git a/libnautilus-private/egg-screen-help.h b/libnautilus-private/egg-screen-help.h deleted file mode 100644 index 5be7e9749..000000000 --- a/libnautilus-private/egg-screen-help.h +++ /dev/null @@ -1,75 +0,0 @@ -/* egg-screen-help.h - * - * Copyright (C) 2002 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Mark McLoughlin <mark@skynet.ie> - */ - -#ifndef __EGG_SCREEN_HELP_H__ -#define __EGG_SCREEN_HELP_H__ - -#include <glib.h> -#include <gdk/gdk.h> -#include <libgnome/gnome-program.h> - -G_BEGIN_DECLS - -/* Destined for libgnome. - */ -gboolean egg_help_display_uri_with_env (const char *help_uri, - char **envp, - GError **error); -gboolean egg_help_display_with_doc_id_with_env (GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - char **envp, - GError **error); -gboolean egg_help_display_desktop_with_env (GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - char **envp, - GError **error); - -/* Destined for libgnomeui. - */ -gboolean egg_screen_help_display (GdkScreen *screen, - const char *file_name, - const char *link_id, - GError **error); -gboolean egg_screen_help_display_with_doc_id (GdkScreen *screen, - GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - GError **error); -gboolean egg_screen_help_display_desktop (GdkScreen *screen, - GnomeProgram *program, - const char *doc_id, - const char *file_name, - const char *link_id, - GError **error); -gboolean egg_screen_help_display_uri (GdkScreen *screen, - const char *help_uri, - GError **error); - - -G_END_DECLS - -#endif /* __EGG_SCREEN_HELP_H__ */ diff --git a/libnautilus-private/egg-screen-url.c b/libnautilus-private/egg-screen-url.c deleted file mode 100644 index 729fa5d78..000000000 --- a/libnautilus-private/egg-screen-url.c +++ /dev/null @@ -1,183 +0,0 @@ -/* egg-screen-url.c - * Copyright (C) 1998, James Henstridge <james@daa.com.au> - * Copyright (C) 1999, 2000 Red Hat, Inc. - * Copyright (C) 2002, Sun Microsystems Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. - * - * Authors: Mark McLoughlin <mark@skynet.ie> - */ - -#include <config.h> - -#include "egg-screen-url.h" - -#include <string.h> -#include <glib.h> -#include <glib-object.h> -#include <gconf/gconf-client.h> -#include <libgnome/gnome-url.h> - -#include "egg-screen-exec.h" - -/******* START COPIED + PASTED CODE TO GO AWAY ******/ - -#define URL_HANDLER_DIR "/desktop/gnome/url-handlers/" -#define DEFAULT_HANDLER_PATH "/desktop/gnome/url-handlers/unknown/command" - -/* This needs to be exposed from libgnome and - * removed from here. - */ - -/** - * egg_url_show_with_env: - * @url: The url to display. Should begin with the protocol to use (e.g. - * "http:", "ghelp:", etc) - * @envp: child's environment, or %NULL to inherit parent's. - * @error: Used to store any errors that result from trying to display the @url. - * - * Description: Like gnome_url_show(), except that the viewer application - * is launched with its environment set to the contents of @envp. - * - * Returns: %TRUE if everything went fine, %FALSE otherwise (in which case - * @error will contain the actual error). - **/ -gboolean -egg_url_show_with_env (const char *url, - char **envp, - GError **error) -{ - GConfClient *client; - gint i; - gchar *pos, *template; - int argc; - char **argv; - gboolean ret; - - g_return_val_if_fail (url != NULL, FALSE); - - pos = strchr (url, ':'); - - client = gconf_client_get_default (); - - if (pos != NULL) { - gchar *protocol, *path; - - g_return_val_if_fail (pos >= url, FALSE); - - protocol = g_new (gchar, pos - url + 1); - strncpy (protocol, url, pos - url); - protocol[pos - url] = '\0'; - g_ascii_strdown (protocol, -1); - - path = g_strconcat (URL_HANDLER_DIR, protocol, "/command", NULL); - template = gconf_client_get_string (client, path, NULL); - - if (template == NULL) { - gchar* template_temp; - - template_temp = gconf_client_get_string (client, - DEFAULT_HANDLER_PATH, - NULL); - - /* Retry to get the right url handler */ - template = gconf_client_get_string (client, path, NULL); - - if (template == NULL) - template = template_temp; - else - g_free (template_temp); - - } - - g_free (path); - g_free (protocol); - - } else { - /* no ':' ? this shouldn't happen. Use default handler */ - template = gconf_client_get_string (client, - DEFAULT_HANDLER_PATH, - NULL); - } - - g_object_unref (G_OBJECT (client)); - - if (!g_shell_parse_argv (template, - &argc, - &argv, - error)) { - g_free (template); - return FALSE; - } - - g_free (template); - - for (i = 0; i < argc; i++) { - char *arg; - - if (strcmp (argv[i], "%s") != 0) - continue; - - arg = argv[i]; - argv[i] = g_strdup (url); - g_free (arg); - } - - /* This can return some errors */ - ret = g_spawn_async (NULL /* working directory */, - argv, - envp, - G_SPAWN_SEARCH_PATH /* flags */, - NULL /* child_setup */, - NULL /* data */, - NULL /* child_pid */, - error); - - g_strfreev (argv); - - return ret; -} -/******* END COPIED + PASTED CODE TO GO AWAY ******/ - -/** - * egg_screen_url_show: - * @screen: a #GdkScreen. - * @url: The url to display. Should begin with the protocol to use (e.g. - * "http:", "ghelp:", etc) - * @error: Used to store any errors that result from trying to display the @url. - * - * Description: Like gnome_url_show(), but ensures that the viewer application - * appears on @screen. - * - * Returns: %TRUE if everything went fine, %FALSE otherwise (in which case - * @error will contain the actual error). - **/ -gboolean -egg_screen_url_show (GdkScreen *screen, - const char *url, - GError **error) -{ - char **env; - gboolean retval; - - env = egg_screen_exec_environment (screen); - - retval = egg_url_show_with_env (url, env, error); - - g_strfreev (env); - - return retval; -} diff --git a/libnautilus-private/nautilus-program-chooser.c b/libnautilus-private/nautilus-program-chooser.c index c49e88c4a..a2fa5d46c 100644 --- a/libnautilus-private/nautilus-program-chooser.c +++ b/libnautilus-private/nautilus-program-chooser.c @@ -181,9 +181,8 @@ help_cb (GtkWidget *button, NautilusProgramChooser *program_chooser) break; } - egg_screen_help_display_desktop ( - gtk_window_get_screen (GTK_WINDOW (program_chooser)), - NULL, "user-guide", "wgosnautilus.xml", section, &error); + egg_help_display_desktop_on_screen (NULL, "user-guide", "wgosnautilus.xml", section, + gtk_window_get_screen (GTK_WINDOW (program_chooser)), &error); if (error) { GtkWidget *err_dialog; diff --git a/src/Makefile.am b/src/Makefile.am index 0d9b73933..3639b444a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,25 +7,26 @@ bin_PROGRAMS= \ nautilus-file-management-properties \ nautilus-server-connect -INCLUDES =\ - -I$(top_srcdir) \ - -I$(top_srcdir)/cut-n-paste-code/widgets/gimphwrapbox \ - -I$(top_builddir)/libnautilus-private \ - $(CORE_CFLAGS) \ - -DDATADIR=\""$(datadir)"\" \ +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/cut-n-paste-code/widgets/gimphwrapbox \ + -I$(top_srcdir)/cut-n-paste-code \ + -I$(top_builddir)/libnautilus-private \ + $(CORE_CFLAGS) \ + -DDATADIR=\""$(datadir)"\" \ -DGNOMELOCALEDIR=\""$(prefix)/${DATADIRNAME}/locale"\" \ - -DLIBDIR=\""$(libdir)"\" \ - -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ - -DGLADEDIR=\""$(datadir)/nautilus/glade"\" \ - -DNAUTILUS_PIXMAPDIR=\""$(datadir)/pixmaps/nautilus"\" \ - -DPREFIX=\""$(prefix)"\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DVERSION="\"$(VERSION)\"" \ - -DG_DISABLE_DEPRECATED \ - -DGDK_DISABLE_DEPRECATED \ - -DGDK_PIXBUF_DISABLE_DEPRECATED \ - -DGTK_DISABLE_DEPRECATED \ - -DGNOME_DISABLE_DEPRECATED \ + -DLIBDIR=\""$(libdir)"\" \ + -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ + -DGLADEDIR=\""$(datadir)/nautilus/glade"\" \ + -DNAUTILUS_PIXMAPDIR=\""$(datadir)/pixmaps/nautilus"\" \ + -DPREFIX=\""$(prefix)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DVERSION="\"$(VERSION)\"" \ + -DG_DISABLE_DEPRECATED \ + -DGDK_DISABLE_DEPRECATED \ + -DGDK_PIXBUF_DISABLE_DEPRECATED \ + -DGTK_DISABLE_DEPRECATED \ + -DGNOME_DISABLE_DEPRECATED \ $(NULL) LDADD =\ diff --git a/src/file-manager/Makefile.am b/src/file-manager/Makefile.am index 1cf9722a8..167be52d4 100644 --- a/src/file-manager/Makefile.am +++ b/src/file-manager/Makefile.am @@ -4,6 +4,7 @@ noinst_LTLIBRARIES=libnautilus-file-manager.la INCLUDES = \ -I$(top_srcdir) \ + -I$(top_srcdir)/cut-n-paste-code \ $(CORE_CFLAGS) \ -DVERSION="\"$(VERSION)\"" \ -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index fdc79de90..d56cf4dd1 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -45,7 +45,7 @@ #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <libgnomevfs/gnome-vfs.h> -#include <libnautilus-private/egg-screen-exec.h> +#include <egg-screen-exec.h> #include <libnautilus-private/nautilus-bonobo-extensions.h> #include <libnautilus-private/nautilus-directory-background.h> #include <libnautilus-private/nautilus-directory-notify.h> diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index db27be9d8..5d9da1cb0 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -62,7 +62,7 @@ #include <libgnomevfs/gnome-vfs-uri.h> #include <libgnomevfs/gnome-vfs-utils.h> #include <libnautilus-private/nautilus-recent.h> -#include <libnautilus-private/egg-screen-exec.h> +#include <egg-screen-exec.h> #include <libnautilus-private/nautilus-bonobo-extensions.h> #include <libnautilus-private/nautilus-directory-background.h> #include <libnautilus-private/nautilus-directory.h> diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index 925e21ebb..ae6bd22eb 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -24,7 +24,7 @@ #include <config.h> #include "fm-list-model.h" -#include <libnautilus-private/eggtreemultidnd.h> +#include <libegg/eggtreemultidnd.h> #include <string.h> #include <eel/eel-gtk-macros.h> diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 097695214..f5c30087e 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -36,10 +36,10 @@ #include <gtk/gtkcellrenderertext.h> #include <gtk/gtktreeselection.h> #include <gtk/gtktreeview.h> +#include <libegg/eggtreemultidnd.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-macros.h> #include <libgnomevfs/gnome-vfs-utils.h> -#include <libnautilus-private/eggtreemultidnd.h> #include <libnautilus-private/nautilus-directory-background.h> #include <libnautilus-private/nautilus-dnd.h> #include <libnautilus-private/nautilus-file-dnd.h> diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 0cc06d758..4ada1d38d 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -54,6 +54,7 @@ #include <gtk/gtkstock.h> #include <gtk/gtktable.h> #include <gtk/gtkvbox.h> +#include <libegg/egg-screen-help.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-macros.h> #include <libgnomeui/gnome-dialog.h> @@ -68,7 +69,6 @@ #include <libnautilus-private/nautilus-link.h> #include <libnautilus-private/nautilus-metadata.h> #include <libnautilus-private/nautilus-undo-signal-handlers.h> -#include <libnautilus-private/egg-screen-help.h> #include <libnautilus-private/nautilus-mime-actions.h> #include <libnautilus-private/nautilus-view-identifier.h> #include <libnautilus/nautilus-undo.h> @@ -2339,9 +2339,9 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_window) GError *error = NULL; char *message; - egg_screen_help_display_desktop ( - gtk_window_get_screen (GTK_WINDOW (property_window)), - NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-51", &error); + egg_help_display_desktop_on_screen (NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-51", + gtk_window_get_screen (GTK_WINDOW (property_window)), +&error); if (error) { message = g_strdup_printf (_("There was an error displaying help: \n%s"), diff --git a/src/file-manager/update-from-egg.sh b/src/file-manager/update-from-egg.sh deleted file mode 100755 index 9be68a9b4..000000000 --- a/src/file-manager/update-from-egg.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -function die() { - echo $* - exit 1 -} - -if test -z "$EGGDIR"; then - echo "Must set EGGDIR" - exit 1 -fi - -if test -z "$EGGFILES"; then - echo "Must set EGGFILES" - exit 1 -fi - -for FILE in $EGGFILES; do - if cmp -s $EGGDIR/$FILE $FILE; then - echo "File $FILE is unchanged" - else - cp $EGGDIR/$FILE $FILE || die "Could not move $EGGDIR/$FILE to $FILE" - echo "Updated $FILE" - fi -done diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c index f2e387841..86885271f 100644 --- a/src/nautilus-bookmarks-window.c +++ b/src/nautilus-bookmarks-window.c @@ -31,9 +31,9 @@ #include <libnautilus-private/nautilus-global-preferences.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-gnome-extensions.h> +#include <libegg/egg-screen-help.h> #include <libnautilus-private/nautilus-icon-factory.h> #include <libnautilus-private/nautilus-undo-signal-handlers.h> -#include <libnautilus-private/egg-screen-help.h> #include <gtk/gtkhbbox.h> #include <gnome.h> #include <glade/glade.h> @@ -125,9 +125,9 @@ nautilus_bookmarks_window_response_callback (GtkDialog *dialog, if (response_id == GTK_RESPONSE_HELP) { GError *error = NULL; - egg_screen_help_display_desktop ( - gtk_window_get_screen (GTK_WINDOW (dialog)), - NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-36", &error); + egg_help_display_desktop_on_screen ( + NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-36", + gtk_window_get_screen (GTK_WINDOW (dialog)), &error); if (error) { GtkWidget *err_dialog; diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c index ed574b559..e9453a376 100644 --- a/src/nautilus-navigation-window-menus.c +++ b/src/nautilus-navigation-window-menus.c @@ -50,6 +50,7 @@ #include <eel/eel-xml-extensions.h> #include <libxml/parser.h> #include <gtk/gtkmain.h> +#include <libegg/egg-screen-help.h> #include <libgnome/gnome-help.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> @@ -62,7 +63,6 @@ #include <libnautilus-private/nautilus-file-utilities.h> #include <libnautilus-private/nautilus-icon-factory.h> #include <libnautilus-private/nautilus-undo-manager.h> -#include <libnautilus-private/egg-screen-help.h> #include <libnautilus/nautilus-bonobo-ui.h> #ifdef ENABLE_PROFILER @@ -698,9 +698,9 @@ help_menu_nautilus_manual_callback (BonoboUIComponent *component, error = NULL; window = NAUTILUS_WINDOW (user_data); - egg_screen_help_display_desktop ( - gtk_window_get_screen (GTK_WINDOW (window)), - NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-21", &error); + egg_help_display_desktop_on_screen ( + NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-21", + gtk_window_get_screen (GTK_WINDOW (window)), &error); if (error) { dialog = gtk_message_dialog_new (GTK_WINDOW (window), diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index 940c7d0c7..8fca23d07 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -66,6 +66,7 @@ #include <gtk/gtkradiobutton.h> #include <gtk/gtkvbox.h> #include <gtk/gtkviewport.h> +#include <libegg/egg-screen-help.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <libgnome/gnome-help.h> @@ -84,7 +85,6 @@ #include <libnautilus-private/nautilus-global-preferences.h> #include <libnautilus-private/nautilus-metadata.h> #include <libnautilus-private/nautilus-theme.h> -#include <libnautilus-private/egg-screen-help.h> #include <math.h> #include <atk/atkrelationset.h> @@ -1426,9 +1426,9 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_browser) GError *error = NULL; GtkWidget *dialog; - egg_screen_help_display_desktop ( - gtk_window_get_screen (GTK_WINDOW (property_browser)), - NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-50", &error); + egg_help_display_desktop_on_screen ( + NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-50", + gtk_window_get_screen (GTK_WINDOW (property_browser)), &error); if (error) { dialog = gtk_message_dialog_new (GTK_WINDOW (property_browser), diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c index ed574b559..e9453a376 100644 --- a/src/nautilus-window-menus.c +++ b/src/nautilus-window-menus.c @@ -50,6 +50,7 @@ #include <eel/eel-xml-extensions.h> #include <libxml/parser.h> #include <gtk/gtkmain.h> +#include <libegg/egg-screen-help.h> #include <libgnome/gnome-help.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> @@ -62,7 +63,6 @@ #include <libnautilus-private/nautilus-file-utilities.h> #include <libnautilus-private/nautilus-icon-factory.h> #include <libnautilus-private/nautilus-undo-manager.h> -#include <libnautilus-private/egg-screen-help.h> #include <libnautilus/nautilus-bonobo-ui.h> #ifdef ENABLE_PROFILER @@ -698,9 +698,9 @@ help_menu_nautilus_manual_callback (BonoboUIComponent *component, error = NULL; window = NAUTILUS_WINDOW (user_data); - egg_screen_help_display_desktop ( - gtk_window_get_screen (GTK_WINDOW (window)), - NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-21", &error); + egg_help_display_desktop_on_screen ( + NULL, "user-guide", "wgosnautilus.xml", "gosnautilus-21", + gtk_window_get_screen (GTK_WINDOW (window)), &error); if (error) { dialog = gtk_message_dialog_new (GTK_WINDOW (window), |