Description: modify configure stuff
Author: Francesco Paolo Lovergine <frankie@debian.org>
Last-Update: 2008-09-24
--- a/ROX-Filer/src/choices.c
+++ b/ROX-Filer/src/choices.c
@@ -98,12 +98,13 @@
 	{
 		saving_disabled = FALSE;
 		
-		dir_list = g_new(gchar *, 4);
-		dir_list[0] = g_build_filename(g_get_home_dir(), "Choices",
-					       NULL);
-		dir_list[1] = g_strdup("/usr/local/share/Choices");
-		dir_list[2] = g_strdup("/usr/share/Choices");
-		dir_list[3] = NULL;
+		dir_list = g_new(gchar *, 5);
+                dir_list[0] = g_strconcat(g_get_home_dir(),".choice", NULL);
+                dir_list[1] = g_strconcat(g_get_home_dir(),".rox/choices", NULL);
+                dir_list[2] = g_strconcat(g_get_home_dir(),".rox_choices", NULL);
+                dir_list[3] = g_strdup("/usr/share/rox/Choices");
+                dir_list[4] = NULL;
+
 	}
 
 	/* Initialize new system */
--- a/ROX-Filer/src/config.h.in
+++ b/ROX-Filer/src/config.h.in
@@ -3,6 +3,9 @@
 #define PROJECT "ROX-Filer"
 #define VERSION "Unknown"
 #define GTK_VERSION "Unknown"
+#define APP_DIR "/usr/share/rox"
+#define HTMLHELP_DIR "/usr/share/doc/rox-filer"
+extern const char *htmlhelp_dir;
 
 #undef STDC_HEADERS
 #undef HAVE_SYS_UCRED_H
@@ -49,7 +52,7 @@
 
 #ifdef HAVE_LIBINTL_H
 # include <libintl.h>
-# define _(String) dgettext("ROX-Filer", String)
+# define _(String) dgettext("rox", String)
 #else
 # define _(String) (String)
 #endif
--- a/ROX-Filer/src/i18n.c
+++ b/ROX-Filer/src/i18n.c
@@ -53,14 +53,12 @@
 {
 	const char *lang;
 
-	gtk_set_locale();
 
-#ifdef HAVE_LIBINTL_H
-	gchar *path = g_strdup_printf("%s/Messages", app_dir);
-	bindtextdomain("ROX-Filer", path);
-	bind_textdomain_codeset("ROX-Filer", "UTF-8");
+	gchar *path = g_strdup_printf("/usr/share/locale");
+	bindtextdomain("rox", path);
+	bind_textdomain_codeset("rox", "UTF-8");
 	g_free(path);
-#endif
+	gtk_set_locale();
 
 	/* This is a hang-over from when we did translations ourselves.
 	 * Maybe we can get this info from the gettext library?
--- a/ROX-Filer/src/main.c
+++ b/ROX-Filer/src/main.c
@@ -89,7 +89,7 @@
 const gchar *show_user_message = NULL;
 
 int home_dir_len;
-const char *home_dir, *app_dir;
+const char *home_dir, *app_dir, *htmlhelp_dir;
 
 GtkTooltips *tooltips = NULL;
 
@@ -103,10 +103,10 @@
 		"see the file named COPYING.\n")
 
 #ifdef HAVE_GETOPT_LONG
-#  define USAGE   N_("Try `ROX-Filer/AppRun --help' for more information.\n")
+#  define USAGE   N_("Try `rox --help' for more information.\n")
 #  define SHORT_ONLY_WARNING ""
 #else
-#  define USAGE   N_("Try `ROX-Filer/AppRun -h' for more information.\n")
+#  define USAGE   N_("Try `rox -h' for more information.\n")
 #  define SHORT_ONLY_WARNING	\
 		_("NOTE: Your system does not support long options - \n" \
 		"you must use the short versions instead.\n\n")
@@ -114,7 +114,7 @@
 
 #define BUGS_TO "<rox-devel@lists.sourceforge.net>"
 
-#define HELP N_("Usage: ROX-Filer/AppRun [OPTION]... [FILE]...\n"	\
+#define HELP N_("Usage: rox [OPTION]... [FILE]...\n"	\
        "Open each directory or file listed, or the current working\n"	\
        "directory if no arguments are given.\n\n"			\
        "  -b, --border=PANEL	open PANEL as a border panel\n"	\
@@ -281,7 +281,8 @@
 
 	home_dir = g_get_home_dir();
 	home_dir_len = strlen(home_dir);
-	app_dir = g_strdup(getenv("APP_DIR"));
+	app_dir = g_strdup(APP_DIR);
+ 	htmlhelp_dir = g_strdup(HTMLHELP_DIR);
 
 	/* Get internationalisation up and running. This requires the
 	 * choices system, to discover the user's preferred language.
@@ -291,20 +292,6 @@
 	i18n_init();
 	xattr_init();
 
-	if (!app_dir)
-	{
-		g_warning("APP_DIR environment variable was unset!\n"
-			"Use the AppRun script to invoke ROX-Filer...\n");
-		app_dir = g_get_current_dir();
-	}
-#ifdef HAVE_UNSETENV 
-	else
-	{
-		/* Don't pass it on to our child processes... */
-		unsetenv("APP_DIR");
-	}
-#endif
-
 	/* Sometimes we want to take special action when a child
 	 * process exits. This hash table is used to convert the
 	 * child's PID to the callback function.
--- a/ROX-Filer/src/menu.c
+++ b/ROX-Filer/src/menu.c
@@ -1803,14 +1803,14 @@
 	if (action == HELP_ABOUT)
 		infobox_new(app_dir);
 	else if (action == HELP_DIR)
-		filer_opendir(make_path(app_dir, "Help"), NULL, NULL);
+		filer_opendir(make_path(htmlhelp_dir, "html"), NULL, NULL);
 	else if (action == HELP_MANUAL)
 	{
 		gchar *manual = NULL;
 
 		if (current_lang)
 		{
-			manual = g_strconcat(app_dir, "/Help/Manual-",
+			manual = g_strconcat(htmlhelp_dir, "/html/Manual-",
 					     current_lang, ".html", NULL);
 			if (!file_exists(manual) && strchr(current_lang, '_'))
 			{
@@ -1822,8 +1822,8 @@
 		}
 
 		if (!manual)
-			manual = g_strconcat(app_dir,
-						"/Help/Manual.html", NULL);
+			manual = g_strconcat(htmlhelp_dir,
+						"/html/Manual.html", NULL);
 		
 		run_by_path(manual);
 
--- a/ROX-Filer/src/session.c
+++ b/ROX-Filer/src/session.c
@@ -140,7 +140,7 @@
 	}
 	else
 	{
-		bin_path = g_strconcat(app_dir, "/AppRun", NULL);
+		bin_path = g_strconcat("", "/rox", NULL);
 		clone_cmd[0] = bin_path;
 		clone_cmd[1] = "-n";
 		clone_cmd[2] = NULL;
--- a/ROX-Filer/src/toolbar.c
+++ b/ROX-Filer/src/toolbar.c
@@ -319,7 +319,7 @@
 			((GdkEventButton *) event)->button != 1)
 		menu_rox_help(NULL, HELP_MANUAL, NULL);
 	else
-		filer_opendir(make_path(app_dir, "Help"), NULL, NULL);
+		filer_opendir(make_path(htmlhelp_dir, "html"), NULL, NULL);
 	gdk_event_free(event);
 }
 
