summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog40
-rw-r--r--Makefile.am6
-rw-r--r--data/Makefile.am55
-rw-r--r--data/favorites.desktop.in7
-rw-r--r--data/preferences.desktop.in7
-rw-r--r--data/programs.desktop.in7
-rw-r--r--data/serverconfig.desktop.in7
-rw-r--r--data/serverconfig.directory.in5
-rw-r--r--data/starthere-link.desktop.in8
-rw-r--r--data/starthere.desktop.in8
-rw-r--r--data/starthere.directory.in6
-rw-r--r--data/sysconfig.desktop.in7
-rw-r--r--data/sysconfig.directory.in5
-rw-r--r--gnome-starthere-96.pngbin0 -> 13966 bytes
-rw-r--r--gnome-starthere.pngbin0 -> 4237 bytes
-rw-r--r--libnautilus-private/nautilus-file-utilities.c79
-rw-r--r--libnautilus-private/nautilus-file-utilities.h6
-rw-r--r--libnautilus-private/nautilus-global-preferences.c17
-rw-r--r--src/file-manager/fm-directory-view.c20
-rw-r--r--src/nautilus-application.c180
-rw-r--r--src/nautilus-first-time-druid.c17
-rw-r--r--src/nautilus-first-time-druid.h2
-rw-r--r--src/nautilus-navigation-window-menus.c22
-rw-r--r--src/nautilus-shell-ui.xml4
-rw-r--r--src/nautilus-window-menus.c22
25 files changed, 371 insertions, 166 deletions
diff --git a/ChangeLog b/ChangeLog
index 3aef0c512..ceffa5e94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,46 @@
Merge some stuff from the redhat-outstanding-patches branch
+ * libnautilus-private/nautilus-file-utilities.[ch]
+ (nautilus_user_main_directory_exists, nautilus_get_user_main_directory):
+ Get rid of these. No more ~/Nautilus
+
+ * libnautilus-private/nautilus-global-preferences.c:
+ (default_home_location_callback): Always use your normal homedir
+ as the home dir.
+
+ * src/nautilus-application.c (check_required_directories): Don't
+ create ~/Nautilus.
+ (create_starthere_link_callback, nautilus_application_startup):
+ Create a start here icon on the desktop.
+ Turn of first time druid (by setting first time flag).
+ (nautilus_application_startup, check_for_kdesktop, look_for_kdesktop_recursive,
+ has_wm_state, get_self_typed_prop)
+ Don't manage the desktop if kdesktop is running.
+
+ * src/nautilus-first-time-druid.[ch]:
+ Remove ~/Nautilus handling.
+ s/druid_set_first_time_file_flag/nautilus_set_first_time_file_flag/
+
+ * src/nautilus-shell-ui.xml:
+ * src/nautilus-window-menus.c:
+ Add start here to the go menu. Remove leftovers of the "support" menuimem.
+
+ * src/file-manager/fm-directory-view.c:
+ Move scripts to ~/.gnome/nautilus-scripts
+
+ * Makefile.am:
+ Add starthere icons
+
+ * data/Makefile.am:
+ * data/*.desktop.in:
+ * data/*.directory.in:
+ Add starthere desktop files.
+
+2001-09-04 Alex Larsson <alexl@redhat.com>
+
+ Merge some stuff from the redhat-outstanding-patches branch
+
* libnautilus-private/nautilus-icon-container.c:
* libnautilus-private/nautilus-icon-dnd.c:
Change signature of the "handle_uri_list" callback to include the
diff --git a/Makefile.am b/Makefile.am
index 52fa50a8f..be853d4ca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,8 @@ EXTRA_DIST= \
nautilus-help.desktop \
nautilus-help.desktop.in \
nautilus-launch-icon.png \
+ gnome-starthere-96.png \
+ gnome-starthere.png \
nautilusConf.sh.in \
nautilus-config.in \
ChangeLog-20000414 \
@@ -57,7 +59,9 @@ EXTRA_DIST= \
$(NULL)
appicondir = $(datadir)/pixmaps
-appicon_DATA = nautilus-launch-icon.png
+appicon_DATA = nautilus-launch-icon.png \
+ gnome-starthere-96.png \
+ gnome-starthere.png
Applicationsdir = $(datadir)/gnome/apps/Applications
Applications_DATA = $(DESKTOP_FILES)
diff --git a/data/Makefile.am b/data/Makefile.am
index d2f55afd0..fd76d553b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,18 +1,63 @@
NULL=
+@XML_I18N_MERGE_DESKTOP_RULE@
+@XML_I18N_MERGE_DIRECTORY_RULE@
+
+DESKTOP_IN_FILES= favorites.desktop.in \
+ programs.desktop.in \
+ starthere.desktop.in \
+ sysconfig.desktop.in \
+ preferences.desktop.in \
+ serverconfig.desktop.in \
+ starthere-link.desktop.in \
+ $(NULL)
+
+DIRECTORY_IN_FILES= serverconfig.directory.in \
+ starthere.directory.in \
+ sysconfig.directory.in \
+ $(NULL)
+
+DESKTOP_FILES=$(DESKTOP_IN_FILES:.desktop.in=.desktop)
+DIRECTORY_FILES=$(DIRECTORY_IN_FILES:.directory.in=.directory)
+
+startheredir= $(sysconfdir)/X11/starthere
+starthere_DATA= favorites.desktop \
+ programs.desktop \
+ sysconfig.desktop \
+ preferences.desktop \
+ serverconfig.desktop \
+ $(NULL)
+
+DESKTOP_FILES=$(DESKTOP_IN_FILES:.in=)
+
nautilusdatadir = $(datadir)/nautilus
nautilusdata_DATA = \
- browser.xml \
- static_bookmarks.xml \
- nautilus-extras.placeholder \
- nautilus-suggested.placeholder \
+ browser.xml \
+ static_bookmarks.xml \
+ nautilus-extras.placeholder \
+ nautilus-suggested.placeholder \
+ starthere.desktop \
+ starthere-link.desktop \
$(NULL)
-EXTRA_DIST = $(nautilusdata_DATA)
+EXTRA_DIST = $(nautilusdata_DATA) \
+ $(DESKTOP_IN_FILES) \
+ $(DESKTOP_FILES) \
+ $(DIRECTORY_IN_FILES) \
+ $(DIRECTORY_FILES) \
+ $(NULL)
SUBDIRS = \
emblems \
linksets \
patterns \
$(NULL)
+
+install-data-local: $(DIRECTORY_FILES)
+ $(mkinstalldirs) $(sysconfdir)/X11/starthere
+ $(mkinstalldirs) $(sysconfdir)/X11/starthere/sysconfig
+ $(mkinstalldirs) $(sysconfdir)/X11/starthere/serverconfig
+ $(INSTALL_DATA) starthere.directory $(sysconfdir)/X11/starthere/.directory
+ $(INSTALL_DATA) sysconfig.directory $(sysconfdir)/X11/starthere/sysconfig/.directory
+ $(INSTALL_DATA) serverconfig.directory $(sysconfdir)/X11/starthere/serverconfig/.directory
diff --git a/data/favorites.desktop.in b/data/favorites.desktop.in
new file mode 100644
index 000000000..96ede889a
--- /dev/null
+++ b/data/favorites.desktop.in
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Link
+_Name=Favorites
+_Comment=Favorite applications
+URL=favorites:
+Icon=gnome-favorites.png
+Terminal=0
diff --git a/data/preferences.desktop.in b/data/preferences.desktop.in
new file mode 100644
index 000000000..a054df109
--- /dev/null
+++ b/data/preferences.desktop.in
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Link
+_Name=Preferences
+_Comment=Adjust your user environment
+URL=preferences:
+Icon=apple-red.png
+Terminal=0
diff --git a/data/programs.desktop.in b/data/programs.desktop.in
new file mode 100644
index 000000000..179efcb7f
--- /dev/null
+++ b/data/programs.desktop.in
@@ -0,0 +1,7 @@
+[Desktop Entry]
+_Name=Programs
+_Comment=Browse available software
+URL=programs:
+Icon=gnome-default-dlg.png
+Terminal=0
+Type=Link
diff --git a/data/serverconfig.desktop.in b/data/serverconfig.desktop.in
new file mode 100644
index 000000000..566bfb974
--- /dev/null
+++ b/data/serverconfig.desktop.in
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Link
+_Name=Server Configuration
+_Comment=Configure network services (web server, DNS server, etc.)
+URL=server-settings:
+Icon=gnome-globe.png
+Terminal=0
diff --git a/data/serverconfig.directory.in b/data/serverconfig.directory.in
new file mode 100644
index 000000000..2cf5eeb93
--- /dev/null
+++ b/data/serverconfig.directory.in
@@ -0,0 +1,5 @@
+[Desktop Entry]
+_Name=Server Configuration
+_Comment=Configure network services
+Icon=gnome-globe.png
+Type=Directory
diff --git a/data/starthere-link.desktop.in b/data/starthere-link.desktop.in
new file mode 100644
index 000000000..7f61ed0a5
--- /dev/null
+++ b/data/starthere-link.desktop.in
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Link
+_Name=Start Here
+_Comment=Start Here
+URL=start-here:
+Icon=gnome-starthere.png
+X-Nautilus-Icon=gnome-starthere
+Terminal=0
diff --git a/data/starthere.desktop.in b/data/starthere.desktop.in
new file mode 100644
index 000000000..0a87659ed
--- /dev/null
+++ b/data/starthere.desktop.in
@@ -0,0 +1,8 @@
+[Desktop Entry]
+_Name=Start Here
+_Comment=Start Here
+Exec=nautilus start-here:
+Icon=gnome-starthere.png
+X-Nautilus-Icon=gnome-starthere
+Terminal=0
+Type=Application
diff --git a/data/starthere.directory.in b/data/starthere.directory.in
new file mode 100644
index 000000000..a70f05dbb
--- /dev/null
+++ b/data/starthere.directory.in
@@ -0,0 +1,6 @@
+[Desktop Entry]
+_Name=Start Here
+_Comment=Start Here
+Icon=gnome-starthere.png
+X-Nautilus-Icon=gnome-starthere
+Type=Directory
diff --git a/data/sysconfig.desktop.in b/data/sysconfig.desktop.in
new file mode 100644
index 000000000..0d5e3cf30
--- /dev/null
+++ b/data/sysconfig.desktop.in
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Link
+_Name=System Settings
+_Comment=Change systemwide settings (affects all users)
+URL=system-settings:
+Icon=gnome-settings.png
+Terminal=0
diff --git a/data/sysconfig.directory.in b/data/sysconfig.directory.in
new file mode 100644
index 000000000..c6301ec40
--- /dev/null
+++ b/data/sysconfig.directory.in
@@ -0,0 +1,5 @@
+[Desktop Entry]
+_Name=System Settings
+_Comment=Change systemwide settings (affects all users)
+Icon=gnome-settings.png
+Type=Directory
diff --git a/gnome-starthere-96.png b/gnome-starthere-96.png
new file mode 100644
index 000000000..71398e634
--- /dev/null
+++ b/gnome-starthere-96.png
Binary files differ
diff --git a/gnome-starthere.png b/gnome-starthere.png
new file mode 100644
index 000000000..f35f707b4
--- /dev/null
+++ b/gnome-starthere.png
Binary files differ
diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c
index 66b282b24..ecce168f6 100644
--- a/libnautilus-private/nautilus-file-utilities.c
+++ b/libnautilus-private/nautilus-file-utilities.c
@@ -43,8 +43,6 @@
#define DESKTOP_DIRECTORY_NAME ".gnome-desktop"
#define DEFAULT_DESKTOP_DIRECTORY_MODE (0755)
-#define NAUTILUS_USER_MAIN_DIRECTORY_NAME "Nautilus"
-
gboolean
nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri)
{
@@ -172,83 +170,6 @@ nautilus_get_gmc_desktop_directory (void)
}
/**
- * nautilus_user_main_directory_exists:
- *
- * returns true if the user directory exists. This must be called
- * before nautilus_get_user_main_directory, which creates it if necessary
- *
- **/
-gboolean
-nautilus_user_main_directory_exists(void)
-{
- gboolean directory_exists;
- char *main_directory;
-
- main_directory = g_strdup_printf ("%s/%s",
- g_get_home_dir(),
- NAUTILUS_USER_MAIN_DIRECTORY_NAME);
- directory_exists = g_file_exists(main_directory);
- g_free(main_directory);
- return directory_exists;
-}
-
-
-/**
- * nautilus_get_user_main_directory:
- *
- * Get the path for the user's main Nautilus directory.
- * Usually ~/Nautilus
- *
- * Return value: the directory path.
- **/
-char *
-nautilus_get_user_main_directory (void)
-{
- char *user_main_directory = NULL;
- GnomeVFSResult result;
- char *destination_directory_uri_text;
- GnomeVFSURI *destination_directory_uri;
- GnomeVFSURI *destination_uri;
-
- user_main_directory = g_strdup_printf ("%s/%s",
- g_get_home_dir(),
- NAUTILUS_USER_MAIN_DIRECTORY_NAME);
-
- if (!g_file_exists (user_main_directory)) {
- destination_directory_uri_text = gnome_vfs_get_uri_from_local_path (g_get_home_dir());
- destination_directory_uri = gnome_vfs_uri_new (destination_directory_uri_text);
- g_free (destination_directory_uri_text);
- destination_uri = gnome_vfs_uri_append_file_name (destination_directory_uri,
- NAUTILUS_USER_MAIN_DIRECTORY_NAME);
- gnome_vfs_uri_unref (destination_directory_uri);
-
- result = gnome_vfs_make_directory_for_uri (destination_uri,
- GNOME_VFS_PERM_USER_ALL
- | GNOME_VFS_PERM_GROUP_ALL
- | GNOME_VFS_PERM_OTHER_READ);
-
- /* FIXME bugzilla.eazel.com 1286:
- * How should we handle error codes returned from gnome_vfs_xfer_uri?
- * Note that nautilus_application_startup will refuse to launch if this
- * directory doesn't get created, so that case is OK. But the directory
- * could be deleted after Nautilus was launched, and perhaps
- * there is some bad side-effect of not handling that case.
- */
- gnome_vfs_uri_unref (destination_uri);
-
- /* If this fails to create the directory, nautilus_application_startup will
- * notice and refuse to launch.
- */
-
- /* install the default link sets */
- nautilus_link_set_install (user_main_directory, "apps");
- nautilus_link_set_install (user_main_directory, "home");
- }
-
- return user_main_directory;
-}
-
-/**
* nautilus_get_pixmap_directory
*
* Get the path for the directory containing Nautilus pixmaps.
diff --git a/libnautilus-private/nautilus-file-utilities.h b/libnautilus-private/nautilus-file-utilities.h
index 2d7fa0075..2632163a9 100644
--- a/libnautilus-private/nautilus-file-utilities.h
+++ b/libnautilus-private/nautilus-file-utilities.h
@@ -42,16 +42,10 @@ char * nautilus_make_path (const char *path,
* freed with g_free, is not NULL, and is guaranteed to exist.
*/
char * nautilus_get_user_directory (void);
-char * nautilus_get_user_main_directory (void);
char * nautilus_get_desktop_directory (void);
char * nautilus_get_gmc_desktop_directory (void);
char * nautilus_get_pixmap_directory (void);
-/* See if the user_main_directory exists. This should be called before
- * nautilus_get_user_main_directory, which creates the directory.
- */
-gboolean nautilus_user_main_directory_exists (void);
-
/* A version of gnome's gnome_pixmap_file that works for the nautilus prefix.
* Otherwise similar to gnome_pixmap_file in that it checks to see if the file
* exists and returns NULL if it doesn't.
diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c
index c1b3308f0..20a9334a7 100644
--- a/libnautilus-private/nautilus-global-preferences.c
+++ b/libnautilus-private/nautilus-global-preferences.c
@@ -902,23 +902,8 @@ default_default_folder_viewer_callback (int user_level)
static gpointer
default_home_location_callback (int user_level)
{
- char *default_home_location;
- char *user_main_directory;
-
g_return_val_if_fail (eel_preferences_user_level_is_valid (user_level), NULL);
-
- if (user_level == EEL_USER_LEVEL_NOVICE) {
- user_main_directory = nautilus_get_user_main_directory ();
- default_home_location = gnome_vfs_get_uri_from_local_path (user_main_directory);
- g_free (user_main_directory);
- return default_home_location;
- }
-
- if (user_level == EEL_USER_LEVEL_INTERMEDIATE) {
- return gnome_vfs_get_uri_from_local_path (g_get_home_dir ());
- }
-
- return NULL;
+ return gnome_vfs_get_uri_from_local_path (g_get_home_dir ());
}
/*
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 379045a7a..22d93b77c 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -1076,27 +1076,15 @@ static float fm_directory_view_preferred_zoom_levels[] = {
static void
set_up_scripts_directory_global (void)
{
- char *main_directory_path, *scripts_directory_path;
+ char *scripts_directory_path;
if (scripts_directory_uri != NULL) {
return;
}
- main_directory_path = nautilus_get_user_main_directory ();
-
- /* FIXME: We've discussed that we don't want names of
- * directories to be localized, and we also don't think that
- * this should be in ~/Nautilus, since we want to get rid of
- * the novice home directory, so this should be changed.
- */
- /* Localizers: This is the name of a directory that's created
- * in ~/Nautilus, and stores the scripts that appear in the
- * Scripts submenu.
- */
- scripts_directory_path = nautilus_make_path (main_directory_path, _("scripts"));
-
- g_free (main_directory_path);
-
+ scripts_directory_path = nautilus_make_path (g_get_home_dir (),
+ ".gnome/nautilus-scripts");
+
scripts_directory_uri = gnome_vfs_get_uri_from_local_path (scripts_directory_path);
scripts_directory_uri_length = strlen (scripts_directory_uri);
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index f4f02b7c7..45f3072c9 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -66,6 +66,10 @@
#include <libnautilus-private/nautilus-authn-manager.h>
#include <liboaf/liboaf.h>
+/* Needed for the is_kdesktop_present check */
+#include <gdk/gdkx.h>
+#include <X11/Xlib.h>
+
#define FACTORY_IID "OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3"
#define SEARCH_LIST_VIEW_IID "OAFIID:nautilus_file_manager_search_list_view:b186e381-198e-43cf-9c46-60b6bb35db0b"
#define SHELL_IID "OAFIID:nautilus_shell:cd5183b2-3913-4b74-9b8e-10528b0de08d"
@@ -98,6 +102,7 @@ static void volume_unmounted_callback (NautilusVolumeMonito
NautilusApplication *application);
static void update_session (gpointer callback_data);
static void init_session (void);
+static gboolean is_kdesktop_present (void);
EEL_DEFINE_CLASS_BOILERPLATE (NautilusApplication, nautilus_application, BONOBO_OBJECT_TYPE)
@@ -239,7 +244,6 @@ static gboolean
check_required_directories (NautilusApplication *application)
{
char *user_directory;
- char *user_main_directory;
char *desktop_directory;
EelStringList *directories;
char *directories_as_string;
@@ -251,7 +255,6 @@ check_required_directories (NautilusApplication *application)
g_assert (NAUTILUS_IS_APPLICATION (application));
user_directory = nautilus_get_user_directory ();
- user_main_directory = nautilus_get_user_main_directory ();
desktop_directory = nautilus_get_desktop_directory ();
directories = eel_string_list_new (TRUE);
@@ -259,12 +262,7 @@ check_required_directories (NautilusApplication *application)
if (!g_file_test (user_directory, G_FILE_TEST_ISDIR)) {
eel_string_list_insert (directories, user_directory);
}
- g_free (user_directory);
-
- if (!g_file_test (user_main_directory, G_FILE_TEST_ISDIR)) {
- eel_string_list_insert (directories, user_main_directory);
- }
- g_free (user_main_directory);
+ g_free (user_directory);
if (!g_file_test (desktop_directory, G_FILE_TEST_ISDIR)) {
eel_string_list_insert (directories, desktop_directory);
@@ -416,6 +414,35 @@ migrate_old_nautilus_files (void)
g_free (old_desktop_dir);
}
+static gint
+create_starthere_link_callback (gpointer data)
+{
+ char *desktop_path;
+ char *desktop_link_file;
+ char *cmd;
+
+ /* Create default services icon on the desktop */
+ desktop_path = nautilus_get_desktop_directory ();
+ desktop_link_file = nautilus_make_path (desktop_path,
+ "starthere.desktop");
+
+ cmd = g_strconcat ("/bin/cp ",
+ NAUTILUS_DATADIR,
+ "/starthere-link.desktop ",
+ desktop_link_file,
+ NULL);
+
+ if (system (cmd) != 0) {
+ g_warning ("Failed to execute command '%s'\n", cmd);
+ }
+
+ g_free (desktop_path);
+ g_free (desktop_link_file);
+ g_free (cmd);
+
+ return FALSE;
+}
+
static void
finish_startup (NautilusApplication *application)
{
@@ -467,8 +494,12 @@ nautilus_application_startup (NautilusApplication *application,
/* Run the first time startup druid if needed. */
if (do_first_time_druid_check && need_to_show_first_time_druid ()) {
- nautilus_first_time_druid_show (application, urls);
- return;
+ /* Do this at idle time, once nautilus has initialized
+ * itself. Otherwise we may spawn a second nautilus
+ * process when looking for a metadata factory..
+ */
+ g_idle_add (create_starthere_link_callback, NULL);
+ nautilus_set_first_time_file_flag ();
}
CORBA_exception_init (&ev);
@@ -583,6 +614,10 @@ nautilus_application_startup (NautilusApplication *application,
} else if (restart_shell) {
Nautilus_Shell_restart (shell, &ev);
} else {
+ /* If KDE desktop is running, then force no_desktop */
+ if (is_kdesktop_present ())
+ no_desktop = TRUE;
+
if (!no_desktop && eel_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP)) {
Nautilus_Shell_start_desktop (shell, &ev);
}
@@ -975,3 +1010,128 @@ init_session (void)
update_session (client);
}
+
+static gboolean
+get_self_typed_prop (Window xwindow,
+ Atom atom,
+ gulong *val)
+{
+ Atom type;
+ int format;
+ gulong nitems;
+ gulong bytes_after;
+ gulong *num;
+ int err;
+
+ gdk_error_trap_push ();
+ type = None;
+ XGetWindowProperty (gdk_display,
+ xwindow,
+ atom,
+ 0, G_MAXLONG,
+ False, atom, &type, &format, &nitems,
+ &bytes_after, (guchar **)&num);
+
+ err = gdk_error_trap_pop ();
+ if (err != Success) {
+ return FALSE;
+ }
+
+ if (type != atom) {
+ return FALSE;
+ }
+
+ if (val)
+ *val = *num;
+
+ XFree (num);
+
+ return TRUE;
+}
+
+static gboolean
+has_wm_state (Window xwindow)
+{
+ return get_self_typed_prop (xwindow,
+ XInternAtom (gdk_display, "WM_STATE", False),
+ NULL);
+}
+
+static gboolean
+look_for_kdesktop_recursive (Window xwindow)
+{
+
+ Window ignored1, ignored2;
+ Window *children;
+ unsigned int n_children;
+ unsigned int i;
+ gboolean retval;
+
+ /* If WM_STATE is set, this is a managed client, so look
+ * for the class hint and end recursion. Otherwise,
+ * this is probably just a WM frame, so keep recursing.
+ */
+ if (has_wm_state (xwindow)) {
+ XClassHint ch;
+
+ gdk_error_trap_push ();
+ ch.res_name = NULL;
+ ch.res_class = NULL;
+
+ XGetClassHint (gdk_display, xwindow, &ch);
+
+ gdk_error_trap_pop ();
+
+ if (ch.res_name)
+ XFree (ch.res_name);
+
+ if (ch.res_class) {
+ if (strcmp (ch.res_class, "kdesktop") == 0) {
+ XFree (ch.res_class);
+ return TRUE;
+ }
+ else
+ XFree (ch.res_class);
+ }
+
+ return FALSE;
+ }
+
+ retval = FALSE;
+
+ gdk_error_trap_push ();
+
+ XQueryTree (gdk_display,
+ xwindow,
+ &ignored1, &ignored2, &children, &n_children);
+
+ if (gdk_error_trap_pop ()) {
+ return FALSE;
+ }
+
+ i = 0;
+ while (i < n_children) {
+ if (look_for_kdesktop_recursive (children[i])) {
+ retval = TRUE;
+ break;
+ }
+
+ ++i;
+ }
+
+ if (children)
+ XFree (children);
+
+ return retval;
+}
+
+static gboolean
+is_kdesktop_present (void)
+{
+ /* FIXME this is a pretty lame hack, should be replaced
+ * eventually with e.g. a requirement that desktop managers
+ * support a manager selection, ICCCM sec 2.8
+ */
+
+ return look_for_kdesktop_recursive (GDK_ROOT_WINDOW ());
+}
diff --git a/src/nautilus-first-time-druid.c b/src/nautilus-first-time-druid.c
index 43083068c..b56742e3c 100644
--- a/src/nautilus-first-time-druid.c
+++ b/src/nautilus-first-time-druid.c
@@ -164,8 +164,8 @@ druid_cancel (GtkWidget *druid)
/* handle the final page finishing */
-static void
-druid_set_first_time_file_flag (void)
+void
+nautilus_set_first_time_file_flag (void)
{
FILE *stream;
char *user_directory, *druid_flag_file_name;
@@ -189,19 +189,14 @@ druid_set_first_time_file_flag (void)
static void
druid_finished (GtkWidget *druid_page)
{
- char *user_main_directory;
const char *signup_uris[3];
/* Hide druid so we don't have a blocked dialog visible while we process the startup tasks. */
- gtk_widget_hide_all (gtk_widget_get_toplevel (druid_page));
-
- user_main_directory = nautilus_get_user_main_directory ();
-
- g_free (user_main_directory);
+ gtk_widget_hide_all (gtk_widget_get_toplevel (druid_page));
/* write out the first time file to indicate that we've successfully traversed the druid */
- druid_set_first_time_file_flag ();
+ nautilus_set_first_time_file_flag ();
/* Do the user level config */
eel_preferences_set_user_level (current_user_level);
@@ -235,7 +230,7 @@ druid_finished (GtkWidget *druid_page)
gtk_idle_add (convert_gmc_desktop_icons, NULL);
}
#endif
-
+
/* Time to start. Hooray! */
nautilus_application_startup (save_application, FALSE, FALSE, draw_desktop,
FALSE, FALSE, NULL, (signup_uris[0] != NULL) ? signup_uris : NULL);
@@ -1263,7 +1258,7 @@ initiate_file_download (GnomeDruid *druid)
/* FIXME bugzilla.eazel.com 5054: We might hang here for a while; if we do, we don't want
* the user to get forced through the druid again
*/
- druid_set_first_time_file_flag ();
+ nautilus_set_first_time_file_flag ();
/* We need to exercise the main loop so that gnome-vfs can get its
* gconf callback for the HTTP proxy autoconfiguration case.
diff --git a/src/nautilus-first-time-druid.h b/src/nautilus-first-time-druid.h
index a2892b47d..8910fa7bf 100644
--- a/src/nautilus-first-time-druid.h
+++ b/src/nautilus-first-time-druid.h
@@ -35,4 +35,6 @@
GtkWidget *nautilus_first_time_druid_show (NautilusApplication *application,
const char *urls[]);
+void nautilus_set_first_time_file_flag (void);
+
#endif /* NAUTILUS_FIRST_TIME_DRUID_H */
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 0ab9f70fc..78cdb6e00 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -100,8 +100,8 @@
#define USER_MANUAL_URI "help:nautilus-user-manual"
#define QUICK_REFERENCE_URI "help:nautilus-quick-reference"
#define RELEASE_NOTES_URI "help:nautilus-release-notes"
-#define CUSTOMER_SUPPORT_URI "http://support.eazel.com"
#define CUSTOMER_FEEDBACK_URI "http://www.eazel.com/feedback.html"
+#define START_HERE_URI "start-here:"
static GtkWindow *bookmarks_window = NULL;
@@ -336,6 +336,15 @@ go_menu_home_callback (BonoboUIComponent *component,
}
static void
+go_menu_start_here_callback (BonoboUIComponent *component,
+ gpointer user_data,
+ const char *verb)
+{
+ nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
+ START_HERE_URI);
+}
+
+static void
forget_history_if_confirmed (NautilusWindow *window)
{
GnomeDialog *dialog;
@@ -675,15 +684,6 @@ help_menu_nautilus_release_notes_callback (BonoboUIComponent *component,
}
static void
-help_menu_support (BonoboUIComponent *component,
- gpointer callback_data,
- const char *verb)
-{
- nautilus_window_go_to (NAUTILUS_WINDOW (callback_data),
- CUSTOMER_SUPPORT_URI);
-}
-
-static void
help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
gpointer user_data,
const char *verb)
@@ -1264,6 +1264,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
BONOBO_UI_VERB ("Forward", go_menu_forward_callback),
BONOBO_UI_VERB ("Up", go_menu_up_callback),
BONOBO_UI_VERB ("Home", go_menu_home_callback),
+ BONOBO_UI_VERB ("Start Here", go_menu_start_here_callback),
BONOBO_UI_VERB ("Go to Location", go_menu_location_callback),
BONOBO_UI_VERB ("Forget History", go_menu_forget_history_callback),
BONOBO_UI_VERB ("Reload", view_menu_reload_callback),
@@ -1289,7 +1290,6 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
BONOBO_UI_VERB ("Nautilus Manual", help_menu_nautilus_manual_callback),
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
- BONOBO_UI_VERB ("Support", help_menu_support),
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
BONOBO_UI_VERB ("Switch to Beginner Level", user_level_menu_item_callback),
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index 28f9313ad..da2813efd 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -198,6 +198,10 @@
_tip="Go to the home location"
accel="*Control*h"
verb="Home"/>
+ <menuitem name="Start Here"
+ _label="_Start Here"
+ _tip="Go to the Start Here folder"
+ verb="Start Here"/>
<menuitem name="Go to Location"
_label="_Location..."
accel="*Control*l"
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 0ab9f70fc..78cdb6e00 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -100,8 +100,8 @@
#define USER_MANUAL_URI "help:nautilus-user-manual"
#define QUICK_REFERENCE_URI "help:nautilus-quick-reference"
#define RELEASE_NOTES_URI "help:nautilus-release-notes"
-#define CUSTOMER_SUPPORT_URI "http://support.eazel.com"
#define CUSTOMER_FEEDBACK_URI "http://www.eazel.com/feedback.html"
+#define START_HERE_URI "start-here:"
static GtkWindow *bookmarks_window = NULL;
@@ -336,6 +336,15 @@ go_menu_home_callback (BonoboUIComponent *component,
}
static void
+go_menu_start_here_callback (BonoboUIComponent *component,
+ gpointer user_data,
+ const char *verb)
+{
+ nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
+ START_HERE_URI);
+}
+
+static void
forget_history_if_confirmed (NautilusWindow *window)
{
GnomeDialog *dialog;
@@ -675,15 +684,6 @@ help_menu_nautilus_release_notes_callback (BonoboUIComponent *component,
}
static void
-help_menu_support (BonoboUIComponent *component,
- gpointer callback_data,
- const char *verb)
-{
- nautilus_window_go_to (NAUTILUS_WINDOW (callback_data),
- CUSTOMER_SUPPORT_URI);
-}
-
-static void
help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
gpointer user_data,
const char *verb)
@@ -1264,6 +1264,7 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
BONOBO_UI_VERB ("Forward", go_menu_forward_callback),
BONOBO_UI_VERB ("Up", go_menu_up_callback),
BONOBO_UI_VERB ("Home", go_menu_home_callback),
+ BONOBO_UI_VERB ("Start Here", go_menu_start_here_callback),
BONOBO_UI_VERB ("Go to Location", go_menu_location_callback),
BONOBO_UI_VERB ("Forget History", go_menu_forget_history_callback),
BONOBO_UI_VERB ("Reload", view_menu_reload_callback),
@@ -1289,7 +1290,6 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
BONOBO_UI_VERB ("Nautilus Manual", help_menu_nautilus_manual_callback),
BONOBO_UI_VERB ("Nautilus Quick Reference", help_menu_nautilus_quick_reference_callback),
BONOBO_UI_VERB ("Nautilus Release Notes", help_menu_nautilus_release_notes_callback),
- BONOBO_UI_VERB ("Support", help_menu_support),
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
BONOBO_UI_VERB ("Switch to Beginner Level", user_level_menu_item_callback),