mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Initialize Gnome libraries before booting guile.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12942 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e7d824371a
commit
dc3bcabbb8
@ -42,6 +42,7 @@
|
||||
#include "gfec.h"
|
||||
#include "gnc-main.h"
|
||||
#include "gnc-splash.h"
|
||||
#include "gnc-gnome-utils.h"
|
||||
|
||||
static int gnucash_show_version;
|
||||
/* GNUCASH_SVN is defined whenever we're building from an SVN tree */
|
||||
@ -331,6 +332,7 @@ int main(int argc, char ** argv)
|
||||
#endif
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gnc_gnome_init (argc, argv, VERSION);
|
||||
gnc_module_system_init();
|
||||
envt_override();
|
||||
gnucash_command_line(argc, argv);
|
||||
|
@ -42,21 +42,6 @@
|
||||
static QofLogModule log_module = GNC_MOD_GUI;
|
||||
static GnomeProgram *gnucash_program = NULL;
|
||||
|
||||
static char**
|
||||
gnc_scm2argv (SCM scm, int prelen, const char **prependargv)
|
||||
{
|
||||
/* FIXME: when we drop support older guiles, drop the (char *) coercion. */
|
||||
return gnc_scheme_list_to_nulltermcharpp (prelen, prependargv, scm);
|
||||
}
|
||||
|
||||
static SCM
|
||||
gnc_argv2scm (int len, const char **rest)
|
||||
{
|
||||
return gnc_argvarr_to_scheme_list (len, rest);
|
||||
}
|
||||
|
||||
static const char *default_argv[] = {"", 0};
|
||||
|
||||
static const struct poptOption nullPoptTable[] = {
|
||||
{ NULL, 0, 0, NULL, 0 }
|
||||
};
|
||||
@ -127,50 +112,17 @@ gnc_gtk_add_rc_file (void)
|
||||
}
|
||||
}
|
||||
|
||||
SCM
|
||||
gnc_gnome_init (const char * arg0,
|
||||
const char * progname,
|
||||
const char * version,
|
||||
SCM command_line)
|
||||
void
|
||||
gnc_gnome_init (int argc, char **argv, const char * version)
|
||||
{
|
||||
poptContext returnedPoptContext; /* owned by the library */
|
||||
int restargc;
|
||||
char *fullname;
|
||||
char **restargv;
|
||||
char **restargv2;
|
||||
SCM ret = command_line;
|
||||
GError *error = NULL;
|
||||
GValue value = { 0, };
|
||||
|
||||
if (arg0)
|
||||
default_argv[0] = arg0;
|
||||
|
||||
restargv = gnc_scm2argv (command_line, 1, default_argv);
|
||||
if (!restargv)
|
||||
{
|
||||
restargv = g_new (char*, 2);
|
||||
restargv[0] = g_strdup (default_argv[0]);
|
||||
restargv[1] = NULL;
|
||||
}
|
||||
|
||||
restargc = argv_length (restargv);
|
||||
|
||||
gnc_gtk_add_rc_file();
|
||||
gnucash_program =
|
||||
gnome_program_init("gnucash", version, LIBGNOMEUI_MODULE,
|
||||
restargc, restargv,
|
||||
GNOME_PARAM_POPT_TABLE, nullPoptTable,
|
||||
GNOME_PROGRAM_STANDARD_PROPERTIES,
|
||||
GNOME_PARAM_NONE);
|
||||
|
||||
g_value_init(&value, G_TYPE_POINTER);
|
||||
g_object_get_property (G_OBJECT (gnucash_program),
|
||||
GNOME_PARAM_POPT_CONTEXT, &value);
|
||||
returnedPoptContext = g_value_get_pointer (&value);
|
||||
restargv2 = (char**) poptGetArgs (returnedPoptContext);
|
||||
ret = gnc_argv2scm (argv_length (restargv2), (const char**)restargv2);
|
||||
|
||||
gnc_free_argv (restargv);
|
||||
gnucash_program = gnome_program_init(
|
||||
"gnucash", version, LIBGNOMEUI_MODULE,
|
||||
argc, argv, GNOME_PARAM_POPT_TABLE, nullPoptTable,
|
||||
GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
|
||||
|
||||
/* initialization required for gtkhtml */
|
||||
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
|
||||
@ -188,7 +140,7 @@ gnc_gnome_init (const char * arg0,
|
||||
|
||||
druid_gconf_install_check_schemas();
|
||||
|
||||
return ret;
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -35,26 +35,8 @@
|
||||
#ifndef GNC_GNOME_UTILS_H
|
||||
#define GNC_GNOME_UTILS_H
|
||||
|
||||
#ifdef LIBGUILEH
|
||||
/** Initialize the Gnome libraries.
|
||||
*
|
||||
* @param arg0 The running application as it appears to a user.
|
||||
*
|
||||
* @param program The compiled name of the application. "gnucash"
|
||||
*
|
||||
* @param version The program version. (e.g. 1.8.7)
|
||||
*
|
||||
* @param command_line A scheme list containing all of the command
|
||||
* line arguments (or all of the arguments notyet pasrsed in scheme).
|
||||
*
|
||||
* @return The initial command_line argument minus any arguments
|
||||
* parsed by this function.
|
||||
*/
|
||||
SCM gnc_gnome_init (const char * arg0,
|
||||
const char * progname,
|
||||
const char * version,
|
||||
SCM command_line);
|
||||
#endif
|
||||
/** Initialize the Gnome libraries. */
|
||||
void gnc_gnome_init (int argc, char **argv, const char * version);
|
||||
|
||||
/** Shutdown/cleanup any gnome related libraries. */
|
||||
void gnc_gnome_shutdown (void);
|
||||
|
@ -49,17 +49,6 @@
|
||||
)))
|
||||
|
||||
|
||||
(gw:wrap-function
|
||||
ws
|
||||
'gnc:gnome-init
|
||||
'<gw:scm>
|
||||
"gnc_gnome_init"
|
||||
'(((<gw:mchars> caller-owned const) arg0)
|
||||
((<gw:mchars> caller-owned const) progname)
|
||||
((<gw:mchars> caller-owned const) version)
|
||||
(<gw:scm> command-line))
|
||||
"Initialize the GnuCash gnome system.")
|
||||
|
||||
(gw:wrap-function
|
||||
ws
|
||||
'gnc:gnome-shutdown
|
||||
|
@ -249,8 +249,6 @@ gnc_gui_init_splash (SCM command_line)
|
||||
{
|
||||
splash_is_initialized = TRUE;
|
||||
|
||||
ret = gnc_gnome_init ("gnucash", "GnuCash", VERSION, command_line);
|
||||
|
||||
/* put up splash screen */
|
||||
gnc_show_splash_screen ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user