[Gnucash-changes] r12974 - gnucash/trunk/src - Process --debug command-line option from C instead of guile.

Chris Shoemaker chris at cvs.gnucash.org
Tue Jan 24 20:21:29 EST 2006


Author: chris
Date: 2006-01-24 20:21:28 -0500 (Tue, 24 Jan 2006)
New Revision: 12974
Trac: http://svn.gnucash.org/trac/changeset/12974

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/core-utils/gnc-main.c
   gnucash/trunk/src/core-utils/gnc-main.h
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
   Process --debug command-line option from C instead of guile.
   This re-enables the debugging "extensions" menu.


Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2006-01-24 21:26:30 UTC (rev 12973)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2006-01-25 01:21:28 UTC (rev 12974)
@@ -206,13 +206,14 @@
     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 @@
         exit(0);
     }
 
+    gnc_set_debugging(debugging);
     if (namespace_regexp)
         gnc_main_set_namespace_regexp(namespace_regexp);
 }

Modified: gnucash/trunk/src/core-utils/gnc-main.c
===================================================================
--- gnucash/trunk/src/core-utils/gnc-main.c	2006-01-24 21:26:30 UTC (rev 12973)
+++ gnucash/trunk/src/core-utils/gnc-main.c	2006-01-25 01:21:28 UTC (rev 12974)
@@ -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 @@
         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;
+}

Modified: gnucash/trunk/src/core-utils/gnc-main.h
===================================================================
--- gnucash/trunk/src/core-utils/gnc-main.h	2006-01-24 21:26:30 UTC (rev 12973)
+++ gnucash/trunk/src/core-utils/gnc-main.h	2006-01-25 01:21:28 UTC (rev 12974)
@@ -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 */

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-01-24 21:26:30 UTC (rev 12973)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-01-25 01:21:28 UTC (rev 12974)
@@ -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 @@
 	GList *plugins;
 	GError *error = NULL;
 	gchar *filename;
-	SCM debugging;
 
 	ENTER(" ");
 
@@ -2539,11 +2539,11 @@
 
         /* 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);
 	}
 



More information about the gnucash-changes mailing list