[Nautilus-list] Patch : Mandrake customization in Nautilus



Hi,

here are current modifications we've made to Nautilus in order to get it
work better 
with Mandrake 8.0 (which has been released yesterday). They are against
1.0.1.1
and apply also against 1.0.2. Some have already been merged by Nautilus
hackers, therefore I don't add them in this mail :)

I think some (or maybe all) could be merged in Nautilus main tree.. :
*nautilus-1.0-gmc : this patch enable nautilus to run gmc desktop
scripts if no .gnome-desktop exist when importing gmc desktop :

--- nautilus-1.0.1.1/src/Makefile.am.gmc	Tue Feb 13 17:23:50 2001
+++ nautilus-1.0.1.1/src/Makefile.am	Tue Apr 17 10:22:49 2001
@@ -21,6 +21,7 @@
 	-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
 	-DNAUTILUS_PIXMAPDIR=\""$(datadir)/pixmaps/nautilus"\" \
 	-DDATADIR=\""$(datadir)"\" \
+	-DLIBDIR=\""$(libdir)"\" \
 	$(NULL)
 
 if EAZEL_SERVICES
--- nautilus-1.0.1.1/src/nautilus-first-time-druid.c.gmc	Fri Apr  6
22:07:43 2001
+++ nautilus-1.0.1.1/src/nautilus-first-time-druid.c	Tue Apr 17 10:22:49
2001
@@ -835,9 +840,58 @@
 	gmc_desktop_dir = g_strdup_printf ("%s/.gnome-desktop", home_dir);
 	
 	if (stat (gmc_desktop_dir, &st) != 0) {
-		g_free (gmc_desktop_dir);
-		return;
+		const int links_extlen = sizeof (".links")-1;
+		char * gmc_scripts_dir;
+
+		gmc_scripts_dir = g_strdup (LIBDIR "/mc/desktop-scripts");
+		dir = opendir (gmc_scripts_dir);
+		if (!dir) {
+			g_free(gmc_desktop_dir);
+			g_free(gmc_scripts_dir);
+			return;
+		}
+		mkdir (gmc_desktop_dir,0777);
+
+		/* let's initialize gmc desktop to import it */
+		while ((dirent = readdir (dir)) != NULL){
+			int len = strlen (dirent->d_name);
+			char *fname;
+
+			fname = g_concat_dir_and_file (gmc_scripts_dir, dirent->d_name);
+			if (stat (fname, &st) < 0) {
+				g_free (fname);
+				continue;
+			}
+			if (S_ISDIR (st.st_mode)) {
+				g_free (fname);
+				continue;
+			}
+			if ((S_IXUSR & st.st_mode) || (S_IXGRP & st.st_mode) || (S_IXOTH &
st.st_mode)) {
+				/* let's try running it */
+				char *command;
+
+				command = g_strconcat ("/bin/sh -c \"", fname, " --desktop-dir='",
gmc_desktop_dir,"'\"", NULL);
+				
+				system (command);
+				g_free (command);
+				g_free (fname);
+				continue;
+			}
+
+			if (len < links_extlen){
+				g_free (fname);
+				continue;
+			}
+
+			if (strcmp (dirent->d_name + len - links_extlen, ".links")){
+				g_free (fname);
+				continue;
+			}
+		}
+		closedir(dir);
+		stat (gmc_desktop_dir, &st) != 0;
 	}
+			
 	
 	if (!S_ISDIR (st.st_mode)) {
 		g_free (gmc_desktop_dir);

This patch fixes importing gmc link in nautilus :

--- nautilus-1.0.1.1/libnautilus-extensions/nautilus-link.c.gmc	Thu Feb
1 09:36:13 2001
+++ nautilus-1.0.1.1/libnautilus-extensions/nautilus-link.c	Tue Apr 17
10:25:44 2001
@@ -535,7 +535,7 @@
 			launch_string = g_strdup_printf ("command:%s", arguments);
 		}		
 	} else if (strcmp (entry->type, "URL") == 0) {
-		launch_string = g_strdup_printf ("command:%s", arguments);
+		launch_string = g_strdup_printf ("%s", arguments);
 	} else {
 		/* Unknown .desktop file type */
 		launch_string = NULL;

This patch add runtime check for eazel-service installed (instead of
compile check).
This patch is really ugly but it works for now..
--- nautilus-1.0.1/src/nautilus-window-toolbars.c.services	Sat Mar  3
14:49:14 2001
+++ nautilus-1.0.1/src/nautilus-window-toolbars.c	Thu Apr  5 10:05:52
2001
@@ -307,7 +307,8 @@
 	set_up_standard_bonobo_button (window, "/Toolbar/Go to Web Search",
"SearchWeb", TRUE);
 	set_up_standard_bonobo_button (window, "/Toolbar/Stop", "Stop",
FALSE);
 #ifdef EAZEL_SERVICES	
-	set_up_standard_bonobo_button (window, "/Toolbar/Extra Buttons
Placeholder/Services", "Services", TRUE);
+	if (bonobo_ui_util_get_ui_fname(DATADIR,"nautilus-service-ui.xml"))
+		set_up_standard_bonobo_button (window, "/Toolbar/Extra Buttons
Placeholder/Services", "Services", TRUE);
 #endif
 	bonobo_ui_component_thaw (window->details->shell_ui, NULL);
 
--- nautilus-1.0.1/src/nautilus-first-time-druid.c.services	Thu Apr  5
10:05:52 2001
+++ nautilus-1.0.1/src/nautilus-first-time-druid.c	Thu Apr  5 10:10:49
2001
@@ -254,10 +254,15 @@
 	nautilus_medusa_enable_services (launch_medusa);
 	
 	/* Create default services icon on the desktop */
-	desktop_path = nautilus_get_desktop_directory ();
-	nautilus_link_local_create (desktop_path, _("Eazel Services"),
"hand.png", 
-				    "eazel:", NULL, NAUTILUS_LINK_GENERIC);
-	g_free (desktop_path);
+#ifdef EAZEL_SERVICES
+	/* don't try to create service icon if service are not installed */
+	if (bonobo_ui_util_get_ui_fname(DATADIR,"nautilus-service-ui.xml")) {
+		desktop_path = nautilus_get_desktop_directory ();
+		nautilus_link_local_create (desktop_path, _("Eazel Services"),
"hand.png", 
+					    "eazel:", NULL, NAUTILUS_LINK_GENERIC);
+		g_free (desktop_path);
+	}
+#endif
 	
 	/* Time to start. Hooray! */
 	nautilus_application_startup (save_application, FALSE, FALSE,
draw_desktop, 
--- nautilus-1.0.1/src/nautilus-window-service-ui.c.services	Wed Feb 21
04:54:10 2001
+++ nautilus-1.0.1/src/nautilus-window-service-ui.c	Thu Apr  5 10:05:52
2001
@@ -125,6 +125,10 @@
 	};
 
 	/* Load UI from the XML file. */
+	/* check if UI is available ie nautilus-trilobite is installed */
+	if (!bonobo_ui_util_get_ui_fname(DATADIR,"nautilus-service-ui.xml"))
+		return;
+
 	service_ui = bonobo_ui_component_new ("Eazel Services");
 	bonobo_ui_component_add_verb_list_with_data (service_ui, verbs,
window);
 	bonobo_ui_component_set_container

-This patch add a '--nodesktop' option to nautilus, which overides
Nautilus
desktop settings. It is needed for our menu entries, since some KDE
people
may want to test Nautilus and we don't want to hide their desktop, even
if
their GNOME settings are to use Nautilus to display Desktop :))
--- nautilus-1.0/src/nautilus-main.c.nodesktop	Tue Feb 13 21:20:22 2001
+++ nautilus-1.0/src/nautilus-main.c	Mon Apr  2 18:56:54 2001
@@ -130,6 +130,7 @@
 	gboolean restart_shell;
 	gboolean start_desktop;
 	gboolean no_default_window;
+	gboolean disable_desktop;
 	char *geometry;
 	gboolean perform_self_check;
 	poptContext popt_context;
@@ -151,6 +152,8 @@
 		  N_("Quit Nautilus."), NULL },
 		{ "restart", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN,
&restart_shell, 0,
 		  N_("Restart Nautilus."), NULL },
+		{ "nodesktop", '\0', POPT_ARG_NONE, &disable_desktop, 0,
+		  N_("Don't display desktop icons."), NULL },
 		{ NULL, '\0', 0, NULL, 0, NULL, NULL }
 	};
 
@@ -192,6 +195,7 @@
 	no_default_window = FALSE;
 	perform_self_check = FALSE;
 	restart_shell = FALSE;
+	disable_desktop = FALSE;
 
 	gnomelib_register_popt_table (oaf_popt_options, 
 				      oaf_get_popt_table_name ());
@@ -243,7 +247,10 @@
 	 */
 	nautilus_global_preferences_initialize ();
 
-	start_desktop = nautilus_preferences_get_boolean
(NAUTILUS_PREFERENCES_SHOW_DESKTOP);
+	if (!disable_desktop) 
+		start_desktop = nautilus_preferences_get_boolean
(NAUTILUS_PREFERENCES_SHOW_DESKTOP);
+	else 
+		start_desktop = FALSE;
 		
 	/* Do either the self-check or the real work. */
 	if (perform_self_check) {

This patch disable scrollkeeper-update call when installing Nautilus,
since we are generating
rpms as simple user and scrollkeeper-update try too hard to update its
database, even if it can't
write on it :((
--- nautilus-1.0.1.1/omf-install/Makefile.am.orig	Sat Feb 17 09:39:38
2001
+++ nautilus-1.0.1.1/omf-install/Makefile.am	Mon Apr  9 15:57:24 2001
@@ -5,7 +5,6 @@
 	-for file in $(srcdir)/*.omf; do 			\
 		$(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(omf_dest_dir); \
 	done
-	-scrollkeeper-update
 
 uninstall-local:
 	-for file in $(srcdir)/*.omf; do 			\


That's all for now..

-- 
Frédéric Crozat
MandrakeSoft






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