}
else
{
- g_warning (_("Modules not supported from this operating system."));
+ g_warning (_("Modules not supported by this operating system."));
}
return form;
static void
gtk_form_load_modules (GtkForm *form)
{
+ gchar *modulesdir;
GDir *dir;
GError *error;
GtkFormPrivate *priv = GTK_FORM_GET_PRIVATE (form);
+ modulesdir = (gchar *)g_getenv ("LIBGTKFORM_MODULESDIR");
+ if (modulesdir == NULL)
+ {
+#ifdef G_OS_WIN32
+
+ gchar *moddir;
+ gchar *p;
+
+ moddir = g_win32_get_package_installation_directory_of_module (NULL);
+
+ p = g_strrstr (moddir, g_strdup_printf ("%c", G_DIR_SEPARATOR));
+ if (p != NULL
+ && (g_ascii_strcasecmp (p + 1, "src") == 0
+ || g_ascii_strcasecmp (p + 1, ".libs") == 0))
+ {
+ modulesdir = g_strdup (MODULESDIR);
+ }
+ else
+ {
+ modulesdir = g_build_filename (moddir, "lib", PACKAGE, "modules", NULL);
+ }
+
+#else
+
+ modulesdir = g_strdup (MODULESDIR);
+
+#endif
+ }
+
/* for each file in MODULESDIR */
error = NULL;
- dir = g_dir_open (MODULESDIR, 0, &error);
+ dir = g_dir_open (modulesdir, 0, &error);
if (dir != NULL)
{
while ((filename = g_dir_read_name (dir)) != NULL)
if (module != NULL)
{
priv->modules = g_list_append (priv->modules, (gpointer)module);
- }
+ g_message (_("Loaded %s."), filename);
+ }
+ else
+ {
+ g_warning (_("Unable to load %s: %s."), filename, g_module_error ());
+ }
}
g_dir_close (dir);
}
else
{
- g_warning (_("Unable to open modules dir: %s."), error->message);
+ g_warning (_("Unable to open modules dir: %s."), error->message != NULL ? error->message : _("no details"));
}
}