For windows, determine glade and accounts path at runtime instead of configure time.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14776 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-09-01 15:25:25 +00:00
parent 9fa8e0c1b8
commit e01902ba2f
2 changed files with 22 additions and 8 deletions

View File

@ -810,10 +810,7 @@ gnc_glade_xml_new (const char *filename, const char *root)
{
GladeXML *xml;
char *fname;
const gchar *gnc_glade_dir = GNC_GLADE_DIR;
/* FIXME: On windows, gnc_glade_dir needs to be looked up
somewhere where it was specified at installation time instead
of compile time, e.g. in the registry. */
gchar *gnc_glade_dir;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (root != NULL, NULL);
@ -824,7 +821,15 @@ gnc_glade_xml_new (const char *filename, const char *root)
glade_inited = TRUE;
}
#ifdef G_OS_WIN32
gnc_glade_dir = g_win32_get_package_installation_subdirectory
(GETTEXT_PACKAGE, NULL, "glade");
#else
gnc_glade_dir = g_strdup (GNC_GLADE_DIR);
#endif
fname = g_build_filename(gnc_glade_dir, filename, (char *)NULL);
g_free (gnc_glade_dir);
xml = glade_xml_new (fname, root, NULL);

View File

@ -194,7 +194,7 @@ gnc_get_ea_locale_dir(const char *top_dir)
#endif
i = strlen(locale);
ret = g_strdup_printf("%s/%s", top_dir, locale);
ret = g_build_filename(top_dir, locale, (char *)NULL);
while (stat(ret, &buf) != 0)
{
@ -202,12 +202,12 @@ gnc_get_ea_locale_dir(const char *top_dir)
if (i<1)
{
g_free(ret);
ret = g_strdup_printf("%s/%s", top_dir, default_locale);
ret = g_build_filename(top_dir, default_locale, (char *)NULL);
break;
}
locale[i] = '\0';
g_free(ret);
ret = g_strdup_printf("%s/%s", top_dir, locale);
ret = g_build_filename(top_dir, locale, (char *)NULL);
}
g_free(locale);
@ -358,6 +358,7 @@ static void
account_categories_tree_view_prepare (hierarchy_data *data)
{
GSList *list;
gchar *gnc_accounts_dir;
gchar *locale_dir;
GtkTreeView *tree_view;
GtkListStore *model;
@ -366,9 +367,17 @@ account_categories_tree_view_prepare (hierarchy_data *data)
GtkTreeSelection *selection;
GtkTreePath *path;
locale_dir = gnc_get_ea_locale_dir (GNC_ACCOUNTS_DIR);
#ifdef G_OS_WIN32
gnc_accounts_dir =
g_win32_get_package_installation_subdirectory
(GETTEXT_PACKAGE, NULL, "accounts");
#else
gnc_accounts_dir = g_strdup (GNC_ACCOUNTS_DIR);
#endif
locale_dir = gnc_get_ea_locale_dir (gnc_accounts_dir);
list = gnc_load_example_account_list (data->temporary,
locale_dir);
g_free (gnc_accounts_dir);
g_free (locale_dir);
/* Prepare the account_categories GtkTreeView with a model and with some columns */