mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Rename gnc-main to gnc-core-prefs
And add proper namespace prefixes to its functions git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22939 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
4cf7b1f045
commit
f4872f6e6c
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "qof.h"
|
#include "qof.h"
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
#include "qofsession-p.h"
|
#include "qofsession-p.h"
|
||||||
#include "cashobjects.h"
|
#include "cashobjects.h"
|
||||||
#include "test-dbi-stuff.h"
|
#include "test-dbi-stuff.h"
|
||||||
@ -385,7 +385,7 @@ test_dbi_version_control( const gchar* driver, const gchar* url )
|
|||||||
QofBook *book;
|
QofBook *book;
|
||||||
QofBackend *qbe;
|
QofBackend *qbe;
|
||||||
QofBackendError err;
|
QofBackendError err;
|
||||||
gint ourversion = gnc_get_long_version();
|
gint ourversion = gnc_core_prefs_get_long_version();
|
||||||
|
|
||||||
g_test_message ( "Testing safe save %s\n", driver );
|
g_test_message ( "Testing safe save %s\n", driver );
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
#include "gnc-tax-table-sql.h"
|
#include "gnc-tax-table-sql.h"
|
||||||
#include "gnc-vendor-sql.h"
|
#include "gnc-vendor-sql.h"
|
||||||
|
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
|
|
||||||
#if defined( S_SPLINT_S )
|
#if defined( S_SPLINT_S )
|
||||||
#include "splint-defs.h"
|
#include "splint-defs.h"
|
||||||
@ -497,7 +497,7 @@ gnc_sql_sync_all( GncSqlBackend* be, /*@ dependent @*/ QofBook *book )
|
|||||||
ENTER( "book=%p, be->book=%p", book, be->book );
|
ENTER( "book=%p, be->book=%p", book, be->book );
|
||||||
update_progress( be );
|
update_progress( be );
|
||||||
(void)reset_version_info( be );
|
(void)reset_version_info( be );
|
||||||
gnc_sql_set_table_version( be, "Gnucash", gnc_get_long_version() );
|
gnc_sql_set_table_version( be, "Gnucash", gnc_core_prefs_get_long_version() );
|
||||||
gnc_sql_set_table_version( be, "Gnucash-Resave", GNUCASH_RESAVE_VERSION );
|
gnc_sql_set_table_version( be, "Gnucash-Resave", GNUCASH_RESAVE_VERSION );
|
||||||
|
|
||||||
/* Create new tables */
|
/* Create new tables */
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include "top-level.h"
|
#include "top-level.h"
|
||||||
#include "gfec.h"
|
#include "gfec.h"
|
||||||
#include "gnc-commodity.h"
|
#include "gnc-commodity.h"
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
#include "gnc-main-window.h"
|
#include "gnc-main-window.h"
|
||||||
#include "gnc-splash.h"
|
#include "gnc-splash.h"
|
||||||
#include "gnc-gnome-utils.h"
|
#include "gnc-gnome-utils.h"
|
||||||
@ -550,8 +550,8 @@ gnc_parse_command_line(int *argc, char ***argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gnc_set_debugging(debugging);
|
gnc_core_prefs_set_debugging(debugging);
|
||||||
gnc_set_extra(extra);
|
gnc_core_prefs_set_extra(extra);
|
||||||
|
|
||||||
if (!gconf_path)
|
if (!gconf_path)
|
||||||
{
|
{
|
||||||
@ -561,10 +561,10 @@ gnc_parse_command_line(int *argc, char ***argv)
|
|||||||
else
|
else
|
||||||
gconf_path = GCONF_PATH;
|
gconf_path = GCONF_PATH;
|
||||||
}
|
}
|
||||||
gnc_set_gconf_path(g_strdup(gconf_path));
|
gnc_gconf_set_path_prefix(g_strdup(gconf_path));
|
||||||
|
|
||||||
if (namespace_regexp)
|
if (namespace_regexp)
|
||||||
gnc_main_set_namespace_regexp(namespace_regexp);
|
gnc_core_prefs_set_namespace_regexp(namespace_regexp);
|
||||||
|
|
||||||
if (args_remaining)
|
if (args_remaining)
|
||||||
file_to_load = args_remaining[0];
|
file_to_load = args_remaining[0];
|
||||||
@ -779,7 +779,7 @@ gnc_log_init()
|
|||||||
|
|
||||||
gnc_log_default();
|
gnc_log_default();
|
||||||
|
|
||||||
if (gnc_is_debugging())
|
if (gnc_core_prefs_is_debugging_enabled())
|
||||||
{
|
{
|
||||||
qof_log_set_level("", QOF_LOG_INFO);
|
qof_log_set_level("", QOF_LOG_INFO);
|
||||||
qof_log_set_level("qof", QOF_LOG_INFO);
|
qof_log_set_level("qof", QOF_LOG_INFO);
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#include "gnc-session.h"
|
#include "gnc-session.h"
|
||||||
#include "gnome-utils/gnc-icons.h" /* for GNC_STOCK_INVOICE_NEW */
|
#include "gnome-utils/gnc-icons.h" /* for GNC_STOCK_INVOICE_NEW */
|
||||||
|
|
||||||
#include "core-utils/gnc-main.h" /* for GCONF_PATH */
|
#include "gnc-core-prefs.h" /* for GCONF_PATH */
|
||||||
#include "core-utils/gnc-gconf-utils.h"
|
#include "core-utils/gnc-gconf-utils.h"
|
||||||
#include "gnome-utils/gnc-main-window.h"
|
#include "gnome-utils/gnc-main-window.h"
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ lib_LTLIBRARIES = libgnc-core-utils.la
|
|||||||
|
|
||||||
libgnc_core_utils_la_SOURCES = \
|
libgnc_core_utils_la_SOURCES = \
|
||||||
binreloc.c \
|
binreloc.c \
|
||||||
|
gnc-core-prefs.c \
|
||||||
gnc-features.c \
|
gnc-features.c \
|
||||||
gnc-filepath-utils.c \
|
gnc-filepath-utils.c \
|
||||||
gnc-gconf-utils.c \
|
gnc-gconf-utils.c \
|
||||||
@ -13,7 +14,6 @@ libgnc_core_utils_la_SOURCES = \
|
|||||||
gnc-guile-utils.c \
|
gnc-guile-utils.c \
|
||||||
gnc-jalali.c \
|
gnc-jalali.c \
|
||||||
gnc-locale-utils.c \
|
gnc-locale-utils.c \
|
||||||
gnc-main.c \
|
|
||||||
gnc-path.c \
|
gnc-path.c \
|
||||||
gnc-uri-utils.c \
|
gnc-uri-utils.c \
|
||||||
swig-core-utils-guile.c
|
swig-core-utils-guile.c
|
||||||
@ -29,7 +29,7 @@ libgnc_core_utils_la_LIBADD = \
|
|||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
binreloc.h \
|
binreloc.h \
|
||||||
gnc-main.h \
|
gnc-core-prefs.h \
|
||||||
gnc-features.h \
|
gnc-features.h \
|
||||||
gnc-filepath-utils.h \
|
gnc-filepath-utils.h \
|
||||||
gnc-gconf-utils.h \
|
gnc-gconf-utils.h \
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%module sw_core_utils
|
%module sw_core_utils
|
||||||
%{
|
%{
|
||||||
#include <gnc-glib-utils.h>
|
#include <gnc-glib-utils.h>
|
||||||
#include <gnc-main.h>
|
#include <gnc-core-prefs.h>
|
||||||
#include <gnc-path.h>
|
#include <gnc-path.h>
|
||||||
#include <gnc-filepath-utils.h>
|
#include <gnc-filepath-utils.h>
|
||||||
#include <gnc-locale-utils.h>
|
#include <gnc-locale-utils.h>
|
||||||
@ -25,7 +25,7 @@ void
|
|||||||
#endif
|
#endif
|
||||||
%import "base-typemaps.i"
|
%import "base-typemaps.i"
|
||||||
|
|
||||||
gboolean gnc_is_debugging(void);
|
gboolean gnc_core_prefs_is_debugging_enabled(void);
|
||||||
|
|
||||||
%newobject gnc_path_get_bindir;
|
%newobject gnc_path_get_bindir;
|
||||||
gchar * gnc_path_get_bindir(void);
|
gchar * gnc_path_get_bindir(void);
|
||||||
@ -56,7 +56,7 @@ gchar * gnc_locale_from_utf8(const gchar *);
|
|||||||
%newobject gnc_locale_to_utf8;
|
%newobject gnc_locale_to_utf8;
|
||||||
gchar * gnc_locale_to_utf8(const gchar *);
|
gchar * gnc_locale_to_utf8(const gchar *);
|
||||||
|
|
||||||
gboolean gnc_is_extra_enabled();
|
gboolean gnc_core_prefs_is_extra_enabled();
|
||||||
|
|
||||||
const char * gnc_locale_default_iso_currency_code (void);
|
const char * gnc_locale_default_iso_currency_code (void);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
(use-modules (sw_core_utils))
|
(use-modules (sw_core_utils))
|
||||||
|
|
||||||
(re-export gnc-is-debugging)
|
(re-export gnc-core-prefs-is-debugging-enabled)
|
||||||
(re-export gnc-path-get-bindir)
|
(re-export gnc-path-get-bindir)
|
||||||
(re-export gnc-path-get-stdreportsdir)
|
(re-export gnc-path-get-stdreportsdir)
|
||||||
(re-export gnc-path-find-localized-html-file)
|
(re-export gnc-path-find-localized-html-file)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* gnc-main.c:
|
* gnc-core-prefs.c:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Chris Shoemaker <c.shoemaker@cox.net>
|
* Copyright (C) 2006 Chris Shoemaker <c.shoemaker@cox.net>
|
||||||
*
|
*
|
||||||
@ -23,16 +23,22 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
#include "core-utils/gnc-version.h"
|
#include "gnc-version.h"
|
||||||
|
|
||||||
static gchar *namespace_regexp = NULL;
|
static gchar *namespace_regexp = NULL;
|
||||||
static gboolean is_debugging = 0;
|
static gboolean is_debugging = 0;
|
||||||
static gboolean extras_enabled = 0;
|
static gboolean extras_enabled = 0;
|
||||||
static const gchar *gconf_path;
|
static const gchar *gconf_path;
|
||||||
|
|
||||||
|
const gchar *
|
||||||
|
gnc_core_prefs_get_namespace_regexp(void)
|
||||||
|
{
|
||||||
|
return namespace_regexp;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gnc_main_set_namespace_regexp(const gchar *str)
|
gnc_core_prefs_set_namespace_regexp(const gchar *str)
|
||||||
{
|
{
|
||||||
if (namespace_regexp)
|
if (namespace_regexp)
|
||||||
g_free(namespace_regexp);
|
g_free(namespace_regexp);
|
||||||
@ -41,50 +47,32 @@ gnc_main_set_namespace_regexp(const gchar *str)
|
|||||||
namespace_regexp = g_strdup(str);
|
namespace_regexp = g_strdup(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar *
|
|
||||||
gnc_main_get_namespace_regexp(void)
|
|
||||||
{
|
|
||||||
return namespace_regexp;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gnc_is_debugging(void)
|
gnc_core_prefs_is_debugging_enabled(void)
|
||||||
{
|
{
|
||||||
return is_debugging;
|
return is_debugging;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gnc_set_debugging(gboolean d)
|
gnc_core_prefs_set_debugging(gboolean d)
|
||||||
{
|
{
|
||||||
is_debugging = d;
|
is_debugging = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
gnc_is_extra_enabled(void)
|
|
||||||
{
|
|
||||||
return extras_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gnc_set_extra(gboolean enabled)
|
|
||||||
{
|
|
||||||
extras_enabled = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gnc_set_gconf_path (const gchar *path)
|
|
||||||
{
|
|
||||||
gconf_path = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
gnc_get_gconf_path (void)
|
gnc_gconf_get_path_prefix (void)
|
||||||
{
|
{
|
||||||
return gconf_path;
|
return gconf_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gnc_gconf_set_path_prefix (const gchar *path)
|
||||||
|
{
|
||||||
|
gconf_path = path;
|
||||||
|
}
|
||||||
|
|
||||||
guint
|
guint
|
||||||
gnc_get_long_version()
|
gnc_core_prefs_get_long_version()
|
||||||
{
|
{
|
||||||
return GNUCASH_MAJOR_VERSION * 1000000 +
|
return GNUCASH_MAJOR_VERSION * 1000000 +
|
||||||
GNUCASH_MINOR_VERSION * 10000 +
|
GNUCASH_MINOR_VERSION * 10000 +
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* gnc-main.h:
|
* gnc-core-prefs.h:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 Chris Shoemaker <c.shoemaker@cox.net>
|
* Copyright (C) 2006 Chris Shoemaker <c.shoemaker@cox.net>
|
||||||
*
|
*
|
||||||
@ -28,18 +28,18 @@
|
|||||||
|
|
||||||
#define GCONF_PATH "/apps/gnucash"
|
#define GCONF_PATH "/apps/gnucash"
|
||||||
|
|
||||||
void gnc_main_set_namespace_regexp(const gchar *str);
|
const gchar *gnc_core_prefs_get_namespace_regexp(void);
|
||||||
const gchar *gnc_main_get_namespace_regexp(void);
|
void gnc_core_prefs_set_namespace_regexp(const gchar *str);
|
||||||
|
|
||||||
gboolean gnc_is_debugging(void);
|
gboolean gnc_core_prefs_is_debugging_enabled(void);
|
||||||
void gnc_set_debugging(gboolean d);
|
void gnc_core_prefs_set_debugging(gboolean d);
|
||||||
|
|
||||||
gboolean gnc_is_extra_enabled(void);
|
gboolean gnc_core_prefs_is_extra_enabled(void);
|
||||||
void gnc_set_extra(gboolean enabled);
|
void gnc_core_prefs_set_extra(gboolean enabled);
|
||||||
|
|
||||||
void gnc_set_gconf_path(const gchar *prefix);
|
const gchar *gnc_gconf_get_path_prefix(void);
|
||||||
const gchar *gnc_get_gconf_path(void);
|
void gnc_gconf_set_path_prefix(const gchar *prefix);
|
||||||
|
|
||||||
guint gnc_get_long_version( void );
|
guint gnc_core_prefs_get_long_version( void );
|
||||||
|
|
||||||
#endif /* GNC_MAIN_H */
|
#endif /* GNC_MAIN_H */
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
#include "gnc-gconf-utils.h"
|
#include "gnc-gconf-utils.h"
|
||||||
|
|
||||||
#define CLIENT_TAG "%s-%s-client"
|
#define CLIENT_TAG "%s-%s-client"
|
||||||
@ -273,7 +273,7 @@ gnc_gconf_section_name (const char *name)
|
|||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
/* Need to return a newly allocated string */
|
/* Need to return a newly allocated string */
|
||||||
return g_strdup(gnc_get_gconf_path());
|
return g_strdup(gnc_gconf_get_path_prefix());
|
||||||
}
|
}
|
||||||
if (*name == '/')
|
if (*name == '/')
|
||||||
{
|
{
|
||||||
@ -287,7 +287,7 @@ gnc_gconf_section_name (const char *name)
|
|||||||
* order to keep this file completely "gnome-free" this approach was
|
* order to keep this file completely "gnome-free" this approach was
|
||||||
* used.
|
* used.
|
||||||
*/
|
*/
|
||||||
return g_strjoin("/", gnc_get_gconf_path(), name, NULL);
|
return g_strjoin("/", gnc_gconf_get_path_prefix(), name, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@ -305,7 +305,7 @@ gnc_gconf_schema_section_name (const char *name)
|
|||||||
* order to keep this file completely "gnome-free" this approach was
|
* order to keep this file completely "gnome-free" this approach was
|
||||||
* used.
|
* used.
|
||||||
*/
|
*/
|
||||||
return g_strconcat("/schemas", gnc_get_gconf_path(), "/", name, NULL);
|
return g_strconcat("/schemas", gnc_gconf_get_path_prefix(), "/", name, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
|
|
||||||
#include "gnc-commodity.h"
|
#include "gnc-commodity.h"
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
|
|
||||||
static QofLogModule log_module = GNC_MOD_COMMODITY;
|
static QofLogModule log_module = GNC_MOD_COMMODITY;
|
||||||
|
|
||||||
@ -2023,7 +2023,7 @@ gnc_commodity_table_get_quotable_commodities(const gnc_commodity_table * table)
|
|||||||
GList * nslist, * tmp;
|
GList * nslist, * tmp;
|
||||||
GList * l = NULL;
|
GList * l = NULL;
|
||||||
regex_t pattern;
|
regex_t pattern;
|
||||||
const char *expression = gnc_main_get_namespace_regexp();
|
const char *expression = gnc_core_prefs_get_namespace_regexp();
|
||||||
|
|
||||||
ENTER("table=%p, expression=%s", table, expression);
|
ENTER("table=%p, expression=%s", table, expression);
|
||||||
if (!table)
|
if (!table)
|
||||||
|
@ -39,7 +39,7 @@ extern "C"
|
|||||||
#include "core-utils/gnc-filepath-utils.h"
|
#include "core-utils/gnc-filepath-utils.h"
|
||||||
#include "engine/gnc-hooks.h"
|
#include "engine/gnc-hooks.h"
|
||||||
#include "engine/gnc-commodity.h"
|
#include "engine/gnc-commodity.h"
|
||||||
#include "core-utils/gnc-main.h"
|
#include "core-utils/gnc-core-prefs.h"
|
||||||
#include "engine/gnc-session.h"
|
#include "engine/gnc-session.h"
|
||||||
#include "engine/engine-helpers.h"
|
#include "engine/engine-helpers.h"
|
||||||
#include "engine/gnc-engine.h"
|
#include "engine/gnc-engine.h"
|
||||||
@ -103,7 +103,7 @@ gnc_log_init()
|
|||||||
|
|
||||||
gnc_log_default();
|
gnc_log_default();
|
||||||
|
|
||||||
if (gnc_is_debugging())
|
if (gnc_core_prefs_is_debugging_enabled())
|
||||||
{
|
{
|
||||||
qof_log_set_level("", QOF_LOG_INFO);
|
qof_log_set_level("", QOF_LOG_INFO);
|
||||||
qof_log_set_level("qof", QOF_LOG_INFO);
|
qof_log_set_level("qof", QOF_LOG_INFO);
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
#include "gnc-uri-utils.h"
|
#include "gnc-uri-utils.h"
|
||||||
#include "core-utils/gnc-version.h"
|
#include "core-utils/gnc-version.h"
|
||||||
#include "gnc-window.h"
|
#include "gnc-window.h"
|
||||||
#include "gnc-main.h"
|
#include "gnc-core-prefs.h"
|
||||||
#include "gnc-gconf-utils.h"
|
#include "gnc-gconf-utils.h"
|
||||||
#include "option-util.h"
|
#include "option-util.h"
|
||||||
// +JSLED
|
// +JSLED
|
||||||
@ -3447,7 +3447,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
|
|
||||||
/* Testing */
|
/* Testing */
|
||||||
/* Now update the "eXtensions" menu */
|
/* Now update the "eXtensions" menu */
|
||||||
if (!gnc_is_extra_enabled())
|
if (!gnc_core_prefs_is_extra_enabled())
|
||||||
{
|
{
|
||||||
GtkAction* action;
|
GtkAction* action;
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import sys
|
import sys
|
||||||
import _sw_app_utils
|
import _sw_app_utils
|
||||||
from gnucash import *
|
from gnucash import *
|
||||||
from _sw_core_utils import gnc_is_extra_enabled
|
from _sw_core_utils import gnc_core_prefs_is_extra_enabled
|
||||||
import gtk
|
import gtk
|
||||||
import os
|
import os
|
||||||
sys.path.append(os.path.dirname(__file__))
|
sys.path.append(os.path.dirname(__file__))
|
||||||
noisy = gnc_is_extra_enabled()
|
noisy = gnc_core_prefs_is_extra_enabled()
|
||||||
if noisy:
|
if noisy:
|
||||||
print "woop", os.path.dirname(__file__)
|
print "woop", os.path.dirname(__file__)
|
||||||
import pycons.console as cons
|
import pycons.console as cons
|
||||||
|
Loading…
Reference in New Issue
Block a user