summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog25
-rw-r--r--cut-n-paste-code/libegg/Makefile.am12
-rw-r--r--cut-n-paste-code/libegg/egg-screen-exec.c261
-rw-r--r--cut-n-paste-code/libegg/egg-screen-exec.h46
-rw-r--r--cut-n-paste-code/libegg/egg-screen-help.c163
-rw-r--r--cut-n-paste-code/libegg/egg-screen-help.h56
-rw-r--r--cut-n-paste-code/libegg/egg-screen-url.c59
-rw-r--r--cut-n-paste-code/libegg/egg-screen-url.h36
-rw-r--r--libnautilus-private/nautilus-program-chooser.c4
-rw-r--r--libnautilus-private/nautilus-program-choosing.c49
-rw-r--r--src/file-manager/fm-desktop-icon-view.c1
-rw-r--r--src/file-manager/fm-directory-view.c1
-rw-r--r--src/file-manager/fm-properties-window.c6
-rw-r--r--src/nautilus-bookmarks-window.c4
-rw-r--r--src/nautilus-navigation-window-menus.c1
-rw-r--r--src/nautilus-property-browser.c4
-rw-r--r--src/nautilus-window-menus.c7
17 files changed, 81 insertions, 654 deletions
diff --git a/ChangeLog b/ChangeLog
index b9cad1598..294dbeb50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
2004-02-11 Alexander Larsson <alexl@redhat.com>
+ * cut-n-paste-code/libegg/Makefile.am:
+ * cut-n-paste-code/libegg/egg-screen-exec.c:
+ * cut-n-paste-code/libegg/egg-screen-exec.h:
+ * cut-n-paste-code/libegg/egg-screen-help.c:
+ * cut-n-paste-code/libegg/egg-screen-help.h:
+ * cut-n-paste-code/libegg/egg-screen-url.c:
+ * cut-n-paste-code/libegg/egg-screen-url.h:
+ * libnautilus-private/nautilus-program-chooser.c: (help_cb):
+ * libnautilus-private/nautilus-program-choosing.c:
+ (my_gdk_spawn_make_environment_for_screen),
+ (nautilus_launch_show_file), (nautilus_launch_action),
+ (nautilus_launch_application), (nautilus_launch_desktop_file):
+ * src/file-manager/fm-desktop-icon-view.c:
+ * src/file-manager/fm-directory-view.c:
+ * src/file-manager/fm-properties-window.c: (help_button_callback):
+ * src/nautilus-bookmarks-window.c:
+ (nautilus_bookmarks_window_response_callback):
+ * src/nautilus-navigation-window-menus.c:
+ * src/nautilus-property-browser.c: (help_button_callback):
+ * src/nautilus-window-menus.c:
+ (help_menu_nautilus_manual_callback):
+ replace egg_screen with new gdk/libgnomeui functions.
+
+2004-02-11 Alexander Larsson <alexl@redhat.com>
+
* libnautilus-private/nautilus-view-identifier.c (get_lang_list):
Pass LC_MESSAGES. Fixes #48358.
Patch from Nuno Ferreira.
diff --git a/cut-n-paste-code/libegg/Makefile.am b/cut-n-paste-code/libegg/Makefile.am
index cf33c608b..11eb5ff08 100644
--- a/cut-n-paste-code/libegg/Makefile.am
+++ b/cut-n-paste-code/libegg/Makefile.am
@@ -4,15 +4,6 @@ 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 \
@@ -26,7 +17,6 @@ EGG_TREE_DND_FILES = \
$(NULL)
libegg_la_SOURCES = \
- $(EGG_SCREEN_FILES) \
$(EGG_RECENT_FILES) \
$(EGG_TREE_DND_FILES) \
$(NULL)
@@ -35,11 +25,9 @@ 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/cut-n-paste-code/libegg/egg-screen-exec.c b/cut-n-paste-code/libegg/egg-screen-exec.c
deleted file mode 100644
index 2a96e8c8b..000000000
--- a/cut-n-paste-code/libegg/egg-screen-exec.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/* egg-screen-exec.c
- *
- * 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>
- */
-
-#include <config.h>
-
-#include "egg-screen-exec.h"
-
-#include <string.h>
-#include <libgnome/gnome-exec.h>
-
-#ifndef HAVE_GTK_MULTIHEAD
-#include <gdk/gdkx.h>
-#endif
-
-extern char **environ;
-
-/**
- * egg_screen_exec_display_string:
- * @screen: A #GdkScreen
- *
- * Description: Returns a string that when passed to XOpenDisplay()
- * would cause @screen to be the default screen on the newly opened
- * X display. This string is suitable for setting $DISPLAY when
- * launching an application which should appear on @screen.
- *
- * Returns: a newly allocated string or %NULL on error.
- **/
-char *
-egg_screen_exec_display_string (GdkScreen *screen)
-{
-#ifdef HAVE_GTK_MULTIHEAD
- GString *str;
- const char *old_display;
- char *retval;
- char *p;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-
- if (gdk_screen_get_default () == screen)
- return g_strdup_printf ("DISPLAY=%s",
- gdk_display_get_name (
- gdk_screen_get_display (screen)));
-
- old_display = gdk_display_get_name (gdk_screen_get_display (screen));
-
- str = g_string_new ("DISPLAY=");
- g_string_append (str, old_display);
-
- p = strrchr (str->str, '.');
- if (p && p > strchr (str->str, ':'))
- g_string_truncate (str, p - str->str);
-
- g_string_append_printf (str, ".%d", gdk_screen_get_number (screen));
-
- retval = str->str;
-
- g_string_free (str, FALSE);
-
- return retval;
-#else
- return g_strdup (DisplayString (GDK_DISPLAY ()));
-#endif
-}
-
-/**
- * egg_screen_exec_environment:
- * @screen: A #GdkScreen
- *
- * Description: Modifies the current program environment to
- * ensure that $DISPLAY is set such that a launched application
- * inheriting this environment would appear on @screen.
- *
- * Returns: a newly-allocated %NULL-terminated array of strings or
- * %NULL on error. Use g_strfreev() to free it.
- **/
-char **
-egg_screen_exec_environment (GdkScreen *screen)
-{
- char **retval = NULL;
- int i, env_len;
-#ifdef HAVE_GTK_MULTIHEAD
- int display_index = -1;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-
- for (env_len = 0; environ [env_len]; env_len++)
- if (!strncmp (environ [env_len], "DISPLAY", 7))
- display_index = env_len;
-
- if (display_index == -1)
- display_index = env_len++;
-#else
- for (env_len = 0; environ [env_len]; env_len++);
-#endif
-
- retval = g_new (char *, env_len + 1);
- retval [env_len] = NULL;
-
- for (i = 0; i < env_len; i++)
-#ifdef HAVE_GTK_MULTIHEAD
- if (i == display_index)
- retval [i] = egg_screen_exec_display_string (screen);
- else
-#endif
- retval [i] = g_strdup (environ [i]);
-
- g_assert (i == env_len);
-
- return retval;
-}
-
-/**
- * egg_screen_execute_async:
- * @screen: A #GdkScreen
- * @dir: Directory in which child should be executed, or %NULL for current
- * directory
- * @argc: Number of arguments
- * @argv: Argument vector to exec child
- *
- * Description: Like gnome_execute_async(), but ensures that the child
- * is launched in an environment such that if it calls XOpenDisplay()
- * the resulting display would have @screen as the default screen.
- *
- * Returns: process id of child, or %-1 on error.
- **/
-int
-egg_screen_execute_async (GdkScreen *screen,
- const char *dir,
- int argc,
- char * const argv [])
-{
-#ifdef HAVE_GTK_MULTIHEAD
- char **envp = NULL;
- int envc = 0;
- int retval;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
-
- if (gdk_screen_get_default () != screen) {
- envc = 1;
- envp = g_new0 (char *, 2);
- envp [0] = egg_screen_exec_display_string (screen);
- }
-
- retval = gnome_execute_async_with_env (dir, argc, argv, envc, envp);
-
- g_strfreev (envp);
-
- return retval;
-#else
- return gnome_execute_async (dir, argc, argv);
-#endif
-}
-
-/**
- * egg_screen_execute_shell:
- * @screen: A #GdkScreen.
- * @dir: Directory in which child should be executed, or %NULL for current
- * directory
- * @commandline: Shell command to execute
- *
- * Description: Like gnome_execute_shell(), but ensures that the child
- * is launched in an environment such that if it calls XOpenDisplay()
- * the resulting display would have @screen as the default screen.
- *
- * Returns: process id of shell, or %-1 on error.
- **/
-int
-egg_screen_execute_shell (GdkScreen *screen,
- const char *dir,
- const char *command)
-{
-#ifdef HAVE_GTK_MULTIHEAD
- int retval = -1;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
-
- if (gdk_screen_get_default () == screen)
- retval = gnome_execute_shell (dir, command);
-
- else {
- char *exec;
- char *display;
-
- display = egg_screen_exec_display_string (screen);
- exec = g_strconcat (display, " ", command, NULL);
-
- retval = gnome_execute_shell (dir, exec);
-
- g_free (display);
- g_free (exec);
- }
-
- return retval;
-#else
- return gnome_execute_shell (dir, command);
-#endif
-}
-
-/**
- * egg_screen_execute_command_line_async:
- * @screen: A #GdkScreen.
- * @command_line: a command line
- * @error: return location for errors
- *
- * Description: Like g_spawn_command_line_async(), but ensures that
- * the child is launched in an environment such that if it calls
- * XOpenDisplay() the resulting display would have @screen as the
- * default screen.
- *
- * Returns: %TRUE on success, %FALSE if error is set.
- **/
-gboolean
-egg_screen_execute_command_line_async (GdkScreen *screen,
- const char *command,
- GError **error)
-{
-#ifdef HAVE_GTK_MULTIHEAD
- gboolean retval;
- char **argv = NULL;
- char **envp = NULL;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
- g_return_val_if_fail (command != NULL, FALSE);
-
- if (!g_shell_parse_argv (command, NULL, &argv, error))
- return FALSE;
-
- if (gdk_screen_get_default () != screen)
- envp = egg_screen_exec_environment (screen);
-
- retval = g_spawn_async (NULL,
- argv, envp, G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL, error);
- g_strfreev (argv);
- g_strfreev (envp);
-
- return retval;
-#else
- return g_spawn_command_line_async (command, error);
-#endif
-}
diff --git a/cut-n-paste-code/libegg/egg-screen-exec.h b/cut-n-paste-code/libegg/egg-screen-exec.h
deleted file mode 100644
index 65a6df021..000000000
--- a/cut-n-paste-code/libegg/egg-screen-exec.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* egg-screen-exec.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_EXEC_H__
-#define __EGG_SCREEN_EXEC_H__
-
-#include <gdk/gdk.h>
-
-G_BEGIN_DECLS
-
-char *egg_screen_exec_display_string (GdkScreen *screen);
-char **egg_screen_exec_environment (GdkScreen *screen);
-
-int egg_screen_execute_async (GdkScreen *screen,
- const char *dir,
- int argc,
- char * const argv []);
-int egg_screen_execute_shell (GdkScreen *screen,
- const char *dir,
- const char *command);
-gboolean egg_screen_execute_command_line_async (GdkScreen *screen,
- const char *command,
- GError **error);
-
-G_END_DECLS
-
-#endif /* __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
deleted file mode 100644
index 42e717f5e..000000000
--- a/cut-n-paste-code/libegg/egg-screen-help.c
+++ /dev/null
@@ -1,163 +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 <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
deleted file mode 100644
index 5c6770d43..000000000
--- a/cut-n-paste-code/libegg/egg-screen-help.h
+++ /dev/null
@@ -1,56 +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 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
deleted file mode 100644
index 1fd0c5daa..000000000
--- a/cut-n-paste-code/libegg/egg-screen-url.c
+++ /dev/null
@@ -1,59 +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 <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/cut-n-paste-code/libegg/egg-screen-url.h b/cut-n-paste-code/libegg/egg-screen-url.h
deleted file mode 100644
index d4aa0144c..000000000
--- a/cut-n-paste-code/libegg/egg-screen-url.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* egg-screen-url.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_URL_H__
-#define __EGG_SCREEN_URL_H__
-
-#include <gdk/gdk.h>
-
-G_BEGIN_DECLS
-
-gboolean egg_url_show_on_screen (const char *url,
- GdkScreen *screen,
- GError **error);
-
-G_END_DECLS
-
-#endif /* __EGG_SCREEN_URL_H__ */
diff --git a/libnautilus-private/nautilus-program-chooser.c b/libnautilus-private/nautilus-program-chooser.c
index 39704a588..9c4112736 100644
--- a/libnautilus-private/nautilus-program-chooser.c
+++ b/libnautilus-private/nautilus-program-chooser.c
@@ -32,7 +32,6 @@
#include "nautilus-mime-actions.h"
#include "nautilus-program-choosing.h"
#include "nautilus-view-identifier.h"
-#include <libegg/egg-screen-help.h>
#include <eel/eel-gnome-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
@@ -53,6 +52,7 @@
#include <gtk/gtkvbox.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-macros.h>
+#include <libgnomeui/gnome-help.h>
#include <libgnomeui/gnome-stock-icons.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gtk/gtkmessagedialog.h>
@@ -181,7 +181,7 @@ help_cb (GtkWidget *button, NautilusProgramChooser *program_chooser)
break;
}
- egg_help_display_desktop_on_screen (NULL, "user-guide", "user-guide.xml", section,
+ gnome_help_display_desktop_on_screen (NULL, "user-guide", "user-guide.xml", section,
gtk_window_get_screen (GTK_WINDOW (program_chooser)), &error);
if (error) {
diff --git a/libnautilus-private/nautilus-program-choosing.c b/libnautilus-private/nautilus-program-choosing.c
index 23430b1a1..92da4b284 100644
--- a/libnautilus-private/nautilus-program-choosing.c
+++ b/libnautilus-private/nautilus-program-choosing.c
@@ -30,7 +30,6 @@
#include "nautilus-program-chooser.h"
#include "nautilus-global-preferences.h"
#include "nautilus-icon-factory.h"
-#include <libegg/egg-screen-exec.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gnome-extensions.h>
#include <eel/eel-vfs-extensions.h>
@@ -72,6 +71,46 @@ typedef struct {
static GHashTable *choose_application_hash_table, *choose_component_hash_table;
+extern char **environ;
+
+/* Cut and paste from gdkspawn-x11.c */
+static gchar **
+my_gdk_spawn_make_environment_for_screen (GdkScreen *screen,
+ gchar **envp)
+{
+ gchar **retval = NULL;
+ gchar *display_name;
+ gint display_index = -1;
+ gint i, env_len;
+
+ g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
+
+ if (envp == NULL)
+ envp = environ;
+
+ for (env_len = 0; envp[env_len]; env_len++)
+ if (strncmp (envp[env_len], "DISPLAY", strlen ("DISPLAY")) == 0)
+ display_index = env_len;
+
+ retval = g_new (char *, env_len + 1);
+ retval[env_len] = NULL;
+
+ display_name = gdk_screen_make_display_name (screen);
+
+ for (i = 0; i < env_len; i++)
+ if (i == display_index)
+ retval[i] = g_strconcat ("DISPLAY=", display_name, NULL);
+ else
+ retval[i] = g_strdup (envp[i]);
+
+ g_assert (i == env_len);
+
+ g_free (display_name);
+
+ return retval;
+}
+
+
static guint
choose_application_hash (gconstpointer p)
{
@@ -798,7 +837,7 @@ void nautilus_launch_show_file (NautilusFile *file,
GNOME_VFS_MIME_ACTION_TYPE_NONE;
screen = gtk_window_get_screen (parent_window);
- envp = egg_screen_exec_environment (screen);
+ envp = my_gdk_spawn_make_environment_for_screen (screen, NULL);
#ifdef HAVE_STARTUP_NOTIFICATION
sn_display = sn_display_new (gdk_display,
@@ -955,7 +994,7 @@ void nautilus_launch_action (GnomeVFSMimeAction *action,
uris.data = uri;
screen = gtk_window_get_screen (parent_window);
- envp = egg_screen_exec_environment (screen);
+ envp = my_gdk_spawn_make_environment_for_screen (screen, NULL);
result = gnome_vfs_mime_action_launch_with_env (action, &uris, envp);
@@ -1019,7 +1058,7 @@ nautilus_launch_application (GnomeVFSMimeApplication *application,
uris.data = uri;
screen = gtk_window_get_screen (parent_window);
- envp = egg_screen_exec_environment (screen);
+ envp = my_gdk_spawn_make_environment_for_screen (screen, NULL);
#ifdef HAVE_STARTUP_NOTIFICATION
sn_display = sn_display_new (gdk_display,
@@ -1253,7 +1292,7 @@ nautilus_launch_desktop_file (GdkScreen *screen,
}
}
- envp = egg_screen_exec_environment (screen);
+ envp = my_gdk_spawn_make_environment_for_screen (screen, NULL);
/* we append local paths only if all parameters are local */
if (count == total) {
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index cac78173c..65b1a7314 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -45,7 +45,6 @@
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs.h>
-#include <libegg/egg-screen-exec.h>
#include <libnautilus-private/nautilus-bonobo-extensions.h>
#include <libnautilus-private/nautilus-desktop-icon-file.h>
#include <libnautilus-private/nautilus-directory-background.h>
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 1f91d046c..d45a9eaae 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -68,7 +68,6 @@
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-private/nautilus-recent.h>
-#include <libegg/egg-screen-exec.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-private/nautilus-bonobo-extensions.h>
#include <libnautilus-private/nautilus-clipboard-monitor.h>
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 627499701..fe0ec2e16 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -56,10 +56,10 @@
#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>
+#include <libgnomeui/gnome-help.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomevfs/gnome-vfs.h>
#include <libnautilus-extension/nautilus-property-page-provider.h>
@@ -3178,8 +3178,8 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_window)
{
GError *error = NULL;
- egg_help_display_desktop_on_screen (NULL, "user-guide", "user-guide.xml", "gosnautilus-51",
- gtk_window_get_screen (GTK_WINDOW (property_window)),
+ gnome_help_display_desktop_on_screen (NULL, "user-guide", "user-guide.xml", "gosnautilus-51",
+ gtk_window_get_screen (GTK_WINDOW (property_window)),
&error);
if (error) {
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index 214388091..852562e7f 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -32,11 +32,11 @@
#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 <gtk/gtkhbbox.h>
#include <gnome.h>
+#include <libgnomeui/gnome-help.h>
#include <glade/glade.h>
@@ -133,7 +133,7 @@ nautilus_bookmarks_window_response_callback (GtkDialog *dialog,
if (response_id == GTK_RESPONSE_HELP) {
GError *error = NULL;
- egg_help_display_desktop_on_screen (
+ gnome_help_display_desktop_on_screen (
NULL, "user-guide", "user-guide.xml", "gosnautilus-36",
gtk_window_get_screen (GTK_WINDOW (dialog)), &error);
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 2c32d0cb5..d225c1f46 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -50,7 +50,6 @@
#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>
diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c
index 36bda98f5..c286ca51f 100644
--- a/src/nautilus-property-browser.c
+++ b/src/nautilus-property-browser.c
@@ -67,12 +67,12 @@
#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>
#include <libgnomeui/gnome-color-picker.h>
#include <libgnomeui/gnome-icon-entry.h>
+#include <libgnomeui/gnome-help.h>
#include <libgnomeui/gnome-stock-icons.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomevfs/gnome-vfs.h>
@@ -1444,7 +1444,7 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_browser)
GError *error = NULL;
GtkWidget *dialog;
- egg_help_display_desktop_on_screen (
+ gnome_help_display_desktop_on_screen (
NULL, "user-guide", "user-guide.xml", "gosnautilus-50",
gtk_window_get_screen (GTK_WINDOW (property_browser)), &error);
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index e61067feb..1cb2f9732 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -49,12 +49,11 @@
#include <eel/eel-xml-extensions.h>
#include <libxml/parser.h>
#include <gtk/gtkmain.h>
-#include <libegg/egg-screen-help.h>
-#include <libegg/egg-screen-exec.h>
#include <libgnome/gnome-help.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-about.h>
+#include <libgnomeui/gnome-help.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-utils.h>
@@ -631,11 +630,11 @@ help_menu_nautilus_manual_callback (BonoboUIComponent *component,
window = NAUTILUS_WINDOW (user_data);
if (NAUTILUS_IS_DESKTOP_WINDOW (window)) {
- egg_screen_execute_command_line_async (
+ gdk_spawn_command_line_on_screen (
gtk_window_get_screen (GTK_WINDOW (window)),
"gnome-help", &error);
} else {
- egg_help_display_desktop_on_screen (
+ gnome_help_display_desktop_on_screen (
NULL, "user-guide", "user-guide.xml", "gosnautilus-21",
gtk_window_get_screen (GTK_WINDOW (window)), &error);
}