Process --debug command-line option from C instead of guile.

This re-enables the debugging "extensions" menu.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12974 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/register-rewrite
Chris Shoemaker 21 years ago
parent 8a1e1197cf
commit 96cbfeab11

@ -206,13 +206,14 @@ gnucash_command_line(int argc, char **argv)
poptContext pc;
char *p;
int rc;
int debugging = 0;
char *namespace_regexp = NULL;
struct poptOption options[] = {
POPT_AUTOHELP
{"version", 'v', POPT_ARG_NONE, &gnucash_show_version, 1,
_("Show GnuCash version"), NULL},
{"debug", '\0', POPT_ARG_NONE, NULL, 0,
{"debug", '\0', POPT_ARG_NONE, &debugging, 0,
_("Enable debugging mode"), NULL},
{"loglevel", '\0', POPT_ARG_INT, NULL, 0,
_("Set the logging level from 0 (least) to 6 (most)"),
@ -250,6 +251,7 @@ gnucash_command_line(int argc, char **argv)
exit(0);
}
gnc_set_debugging(debugging);
if (namespace_regexp)
gnc_main_set_namespace_regexp(namespace_regexp);
}

@ -25,6 +25,7 @@
#include "gnc-main.h"
static char *namespace_regexp = NULL;
static int is_debugging;
void
gnc_main_set_namespace_regexp(const char *str)
@ -36,8 +37,20 @@ gnc_main_set_namespace_regexp(const char *str)
namespace_regexp = g_strdup(str);
}
const char *gnc_main_get_namespace_regexp(void)
const char *
gnc_main_get_namespace_regexp(void)
{
return namespace_regexp;
}
int
gnc_is_debugging(void)
{
return is_debugging;
}
void
gnc_set_debugging(int d)
{
is_debugging = d;
}

@ -29,5 +29,7 @@
void gnc_main_set_namespace_regexp(const char *str);
const char *gnc_main_get_namespace_regexp(void);
int gnc_is_debugging(void);
void gnc_set_debugging(int d);
#endif /* GNC_MAIN_H */

@ -65,6 +65,7 @@
#include "gnc-ui.h"
#include "gnc-version.h"
#include "gnc-window.h"
#include "gnc-main.h"
#include "gnc-gconf-utils.h"
// +JSLED
#include "gnc-html.h"
@ -2438,7 +2439,6 @@ gnc_main_window_setup_window (GncMainWindow *window)
GList *plugins;
GError *error = NULL;
gchar *filename;
SCM debugging;
ENTER(" ");
@ -2539,11 +2539,11 @@ gnc_main_window_setup_window (GncMainWindow *window)
/* Testing */
/* Now update the "eXtensions" menu */
debugging = scm_c_eval_string("(gnc:debugging?)");
if (debugging == SCM_BOOL_F) {
if (!gnc_is_debugging()) {
GtkAction* action;
action = gtk_action_group_get_action(priv->action_group,"ExtensionsAction");
action = gtk_action_group_get_action(priv->action_group,
"ExtensionsAction");
g_object_set(G_OBJECT(action), "visible", FALSE, (char *)NULL);
}

Loading…
Cancel
Save