[Nautilus-list] RH merge



Ok.

Removes ~/Nautilus, disables first time druid, don't fight with kdesktop, 
add start-here, move scripts to ~/.gnome/nautilus-scripts.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.4750
diff -u -p -r1.4750 ChangeLog
--- ChangeLog	2001/09/04 21:16:06	1.4750
+++ ChangeLog	2001/09/04 23:35:21
@@ -2,6 +2,47 @@
 	
 	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 tree to "show only directories" mode.
+	(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
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/Makefile.am,v
retrieving revision 1.52
diff -u -p -r1.52 Makefile.am
--- Makefile.am	2001/09/04 15:37:03	1.52
+++ Makefile.am	2001/09/04 23:35:21
@@ -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)
Index: gnome-starthere-96.png
===================================================================
RCS file: gnome-starthere-96.png
diff -N gnome-starthere-96.png
Binary files /dev/null and gnome-starthere-96.png differ
Index: gnome-starthere.png
===================================================================
RCS file: gnome-starthere.png
diff -N gnome-starthere.png
Binary files /dev/null and gnome-starthere.png differ
Index: data/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/data/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- data/Makefile.am	2001/04/04 00:05:51	1.12
+++ data/Makefile.am	2001/09/04 23:35:22
@@ -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
Index: data/favorites.desktop.in
===================================================================
RCS file: favorites.desktop.in
diff -N favorites.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ favorites.desktop.in	Tue Sep  4 19:35:22 2001
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Link
+_Name=Favorites
+_Comment=Favorite applications
+URL=favorites:
+Icon=gnome-favorites.png
+Terminal=0
Index: data/preferences.desktop.in
===================================================================
RCS file: preferences.desktop.in
diff -N preferences.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ preferences.desktop.in	Tue Sep  4 19:35:22 2001
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Link
+_Name=Preferences
+_Comment=Adjust your user environment
+URL=preferences:
+Icon=apple-red.png
+Terminal=0
Index: data/programs.desktop.in
===================================================================
RCS file: programs.desktop.in
diff -N programs.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ programs.desktop.in	Tue Sep  4 19:35:22 2001
@@ -0,0 +1,7 @@
+[Desktop Entry]
+_Name=Programs
+_Comment=Browse available software
+URL=programs:
+Icon=gnome-default-dlg.png
+Terminal=0
+Type=Link
Index: data/serverconfig.desktop.in
===================================================================
RCS file: serverconfig.desktop.in
diff -N serverconfig.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ serverconfig.desktop.in	Tue Sep  4 19:35:22 2001
@@ -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
Index: data/serverconfig.directory.in
===================================================================
RCS file: serverconfig.directory.in
diff -N serverconfig.directory.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ serverconfig.directory.in	Tue Sep  4 19:35:22 2001
@@ -0,0 +1,5 @@
+[Desktop Entry]
+_Name=Server Configuration
+_Comment=Configure network services
+Icon=gnome-globe.png
+Type=Directory
Index: data/starthere-link.desktop.in
===================================================================
RCS file: starthere-link.desktop.in
diff -N starthere-link.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ starthere-link.desktop.in	Tue Sep  4 19:35:22 2001
@@ -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
Index: data/starthere.desktop.in
===================================================================
RCS file: starthere.desktop.in
diff -N starthere.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ starthere.desktop.in	Tue Sep  4 19:35:22 2001
@@ -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
Index: data/starthere.directory.in
===================================================================
RCS file: starthere.directory.in
diff -N starthere.directory.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ starthere.directory.in	Tue Sep  4 19:35:22 2001
@@ -0,0 +1,6 @@
+[Desktop Entry]
+_Name=Start Here
+_Comment=Start Here
+Icon=gnome-starthere.png
+X-Nautilus-Icon=gnome-starthere
+Type=Directory
Index: data/sysconfig.desktop.in
===================================================================
RCS file: sysconfig.desktop.in
diff -N sysconfig.desktop.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ sysconfig.desktop.in	Tue Sep  4 19:35:22 2001
@@ -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
Index: data/sysconfig.directory.in
===================================================================
RCS file: sysconfig.directory.in
diff -N sysconfig.directory.in
--- /dev/null	Tue May  5 16:32:27 1998
+++ sysconfig.directory.in	Tue Sep  4 19:35:22 2001
@@ -0,0 +1,5 @@
+[Desktop Entry]
+_Name=System Settings
+_Comment=Change systemwide settings (affects all users)
+Icon=gnome-settings.png
+Type=Directory
Index: libnautilus-private/nautilus-file-utilities.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-utilities.c,v
retrieving revision 1.100
diff -u -p -r1.100 nautilus-file-utilities.c
--- libnautilus-private/nautilus-file-utilities.c	2001/08/15 21:03:59	1.100
+++ libnautilus-private/nautilus-file-utilities.c	2001/09/04 23:35:22
@@ -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)
 {
@@ -169,83 +167,6 @@ char *
 nautilus_get_gmc_desktop_directory (void)
 {
 	return nautilus_make_path (g_get_home_dir (), DESKTOP_DIRECTORY_NAME);
-}
-
-/**
-  * 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;
 }
 
 /**
Index: libnautilus-private/nautilus-file-utilities.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-utilities.h,v
retrieving revision 1.41
diff -u -p -r1.41 nautilus-file-utilities.h
--- libnautilus-private/nautilus-file-utilities.h	2001/08/15 21:03:59	1.41
+++ libnautilus-private/nautilus-file-utilities.h	2001/09/04 23:35:22
@@ -42,15 +42,9 @@ char *   nautilus_make_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
Index: libnautilus-private/nautilus-global-preferences.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-global-preferences.c,v
retrieving revision 1.173
diff -u -p -r1.173 nautilus-global-preferences.c
--- libnautilus-private/nautilus-global-preferences.c	2001/07/01 17:48:08	1.173
+++ libnautilus-private/nautilus-global-preferences.c	2001/09/04 23:35:22
@@ -511,7 +511,7 @@ static const PreferenceDefault preferenc
 	{ NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
 	  PREFERENCE_BOOLEAN,
 	  EEL_USER_LEVEL_INTERMEDIATE,
-	  { EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (FALSE) },
+	  { EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (TRUE) },
 	  { USER_LEVEL_NONE }
 	},
 
@@ -902,23 +902,8 @@ default_default_folder_viewer_callback (
 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 ());
 }
 
 /*
Index: src/nautilus-application.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-application.c,v
retrieving revision 1.159
diff -u -p -r1.159 nautilus-application.c
--- src/nautilus-application.c	2001/09/02 02:56:48	1.159
+++ src/nautilus-application.c	2001/09/04 23:35:22
@@ -98,6 +98,7 @@ static void          volume_unmounted_ca
 							    NautilusApplication      *application);
 static void	     update_session			    (gpointer		      callback_data);
 static void	     init_session 			    (void);
+static gboolean      check_for_kdesktop                     (void);
 
 EEL_DEFINE_CLASS_BOILERPLATE (NautilusApplication, nautilus_application, BONOBO_OBJECT_TYPE)
 
@@ -239,7 +240,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 +251,6 @@ check_required_directories (NautilusAppl
 	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,13 +258,8 @@ check_required_directories (NautilusAppl
 	if (!g_file_test (user_directory, G_FILE_TEST_ISDIR)) {
 		eel_string_list_insert (directories, user_directory);
 	}
-	g_free (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);
-	    
 	if (!g_file_test (desktop_directory, G_FILE_TEST_ISDIR)) {
 		eel_string_list_insert (directories, desktop_directory);
 	}
@@ -416,6 +410,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 +490,12 @@ nautilus_application_startup (NautilusAp
 
 	/* 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 +610,10 @@ nautilus_application_startup (NautilusAp
 	} else if (restart_shell) {
 		Nautilus_Shell_restart (shell, &ev);
 	} else {
+		/* If KDE desktop is running, then force no_desktop */
+		if (check_for_kdesktop ())
+			no_desktop = TRUE;
+		
 		if (!no_desktop && eel_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP)) {
 			Nautilus_Shell_start_desktop (shell, &ev);
 		}
@@ -974,4 +1005,133 @@ init_session (void)
 		 update_session, client);
 
 	update_session (client);
+}
+
+/* Keep these out of the way of the rest of the file */
+#include <gdk/gdkx.h>
+#include <X11/Xlib.h>
+
+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
+check_for_kdesktop (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 ());
 }
Index: src/nautilus-first-time-druid.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-first-time-druid.c,v
retrieving revision 1.108
diff -u -p -r1.108 nautilus-first-time-druid.c
--- src/nautilus-first-time-druid.c	2001/08/15 21:04:00	1.108
+++ src/nautilus-first-time-druid.c	2001/09/04 23:35:22
@@ -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 ();
+	gtk_widget_hide_all (gtk_widget_get_toplevel (druid_page));	
 
-	g_free (user_main_directory);
-
 	/* 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 *drui
 	/* 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.
Index: src/nautilus-first-time-druid.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-first-time-druid.h,v
retrieving revision 1.4
diff -u -p -r1.4 nautilus-first-time-druid.h
--- src/nautilus-first-time-druid.h	2001/04/24 00:46:13	1.4
+++ src/nautilus-first-time-druid.h	2001/09/04 23:35:22
@@ -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 */
Index: src/nautilus-shell-ui.xml
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-shell-ui.xml,v
retrieving revision 1.68
diff -u -p -r1.68 nautilus-shell-ui.xml
--- src/nautilus-shell-ui.xml	2001/08/22 00:51:21	1.68
+++ src/nautilus-shell-ui.xml	2001/09/04 23:35:22
@@ -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"
Index: src/nautilus-window-menus.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-menus.c,v
retrieving revision 1.202
diff -u -p -r1.202 nautilus-window-menus.c
--- src/nautilus-window-menus.c	2001/08/22 17:24:16	1.202
+++ src/nautilus-window-menus.c	2001/09/04 23:35:22
@@ -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
 }
 
 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_callbac
 }
 
 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 
 		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 
 		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),
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.466
diff -u -p -r1.466 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	2001/08/24 15:41:29	1.466
+++ src/file-manager/fm-directory-view.c	2001/09/04 23:35:22
@@ -1076,27 +1076,15 @@ static float fm_directory_view_preferred
 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);
 	








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]