mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
9fa8e0c1b8
commit
e01902ba2f
@ -810,10 +810,7 @@ gnc_glade_xml_new (const char *filename, const char *root)
|
|||||||
{
|
{
|
||||||
GladeXML *xml;
|
GladeXML *xml;
|
||||||
char *fname;
|
char *fname;
|
||||||
const gchar *gnc_glade_dir = GNC_GLADE_DIR;
|
gchar *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. */
|
|
||||||
|
|
||||||
g_return_val_if_fail (filename != NULL, NULL);
|
g_return_val_if_fail (filename != NULL, NULL);
|
||||||
g_return_val_if_fail (root != 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;
|
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);
|
fname = g_build_filename(gnc_glade_dir, filename, (char *)NULL);
|
||||||
|
g_free (gnc_glade_dir);
|
||||||
|
|
||||||
xml = glade_xml_new (fname, root, NULL);
|
xml = glade_xml_new (fname, root, NULL);
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ gnc_get_ea_locale_dir(const char *top_dir)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
i = strlen(locale);
|
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)
|
while (stat(ret, &buf) != 0)
|
||||||
{
|
{
|
||||||
@ -202,12 +202,12 @@ gnc_get_ea_locale_dir(const char *top_dir)
|
|||||||
if (i<1)
|
if (i<1)
|
||||||
{
|
{
|
||||||
g_free(ret);
|
g_free(ret);
|
||||||
ret = g_strdup_printf("%s/%s", top_dir, default_locale);
|
ret = g_build_filename(top_dir, default_locale, (char *)NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
locale[i] = '\0';
|
locale[i] = '\0';
|
||||||
g_free(ret);
|
g_free(ret);
|
||||||
ret = g_strdup_printf("%s/%s", top_dir, locale);
|
ret = g_build_filename(top_dir, locale, (char *)NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(locale);
|
g_free(locale);
|
||||||
@ -358,6 +358,7 @@ static void
|
|||||||
account_categories_tree_view_prepare (hierarchy_data *data)
|
account_categories_tree_view_prepare (hierarchy_data *data)
|
||||||
{
|
{
|
||||||
GSList *list;
|
GSList *list;
|
||||||
|
gchar *gnc_accounts_dir;
|
||||||
gchar *locale_dir;
|
gchar *locale_dir;
|
||||||
GtkTreeView *tree_view;
|
GtkTreeView *tree_view;
|
||||||
GtkListStore *model;
|
GtkListStore *model;
|
||||||
@ -366,9 +367,17 @@ account_categories_tree_view_prepare (hierarchy_data *data)
|
|||||||
GtkTreeSelection *selection;
|
GtkTreeSelection *selection;
|
||||||
GtkTreePath *path;
|
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,
|
list = gnc_load_example_account_list (data->temporary,
|
||||||
locale_dir);
|
locale_dir);
|
||||||
|
g_free (gnc_accounts_dir);
|
||||||
g_free (locale_dir);
|
g_free (locale_dir);
|
||||||
|
|
||||||
/* Prepare the account_categories GtkTreeView with a model and with some columns */
|
/* Prepare the account_categories GtkTreeView with a model and with some columns */
|
||||||
|
Loading…
Reference in New Issue
Block a user