pass args to gnome

James LewisMoss dres@phoenixdsl.com
04 Dec 2000 16:10:15 -0500


This is a temporary patch to solve a problem in the short term while I
figure out what's wrong with my long term patch.  This should cause no
problems.  Basically the only things this does that the long term
won't are 1) ignore bogus options, 2) give gnome a crack at options
already parsed by the gnucash code.  Neither should be especially
harmful.  Oh.  I also added a "-*- c -*-" to the top of gnucash.c.in
since .in files aren't anything in particular.

Jim

Index: src/gnome/top-level.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/top-level.c,v
retrieving revision 1.52
diff -u -b -r1.52 top-level.c
--- src/gnome/top-level.c	2000/11/29 20:40:25	1.52
+++ src/gnome/top-level.c	2000/12/04 21:03:52
@@ -152,7 +152,7 @@
      specific args... */
   if (!gnome_is_initialized)
   {
-    gnome_init("GnuCash", NULL, fake_argc, fake_argv);
+    gnome_init("GnuCash", NULL, get_global_argc(), get_global_argv());
     gnome_is_initialized = TRUE;
     
     /* initialization required for gtkhtml */
Index: src/guile/gnucash.c.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/guile/gnucash.c.in,v
retrieving revision 1.19
diff -u -b -r1.19 gnucash.c.in
--- src/guile/gnucash.c.in	2000/11/02 04:07:17	1.19
+++ src/guile/gnucash.c.in	2000/12/04 21:04:16
@@ -1,4 +1,4 @@
-/********************************************************************\
+/**-*- c -*-*********************************************************\
  * gnucash.c -- gnucash startup functions                           *
  * (C) 1998 Rob Browning <rlb@cs.utexas.edu>                        *
  * (C) 1999-2000 Linas Vepstas <linas@linas.org>                    *
@@ -195,6 +195,15 @@
 
   assert(0);  /* Just to be anal */
   return 0;   /* Just to shut gcc up. */
+}
+
+int get_global_argc()
+{
+    return gargc;
+}
+char *get_global_argv()
+{
+    return gargv;
 }
 
 /* ==================== END OF FILE ============================== */
Index: src/guile/gnucash.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/guile/gnucash.h,v
retrieving revision 1.8
diff -u -b -r1.8 gnucash.h
--- src/guile/gnucash.h	2000/09/13 22:32:50	1.8
+++ src/guile/gnucash.h	2000/12/04 21:04:30
@@ -44,4 +44,7 @@
 
 void gnc_shutdown(int exit_status);
 
+int get_global_argc();
+char *get_global_argv();
+
 #endif
Index: src/scm/command-line.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/scm/command-line.scm,v
retrieving revision 1.14
diff -u -b -r1.14 command-line.scm
--- src/scm/command-line.scm	2000/10/23 09:41:44	1.14
+++ src/scm/command-line.scm	2000/12/04 21:06:30
@@ -183,9 +276,12 @@
             
                 (if (not arg-def)
                     (begin
-                      (gnc:prefs-show-usage)
-                      (set! result #f)
-                      (set! quit? #t))
+                      ;;(gnc:prefs-show-usage)
+                      ;;(set! result #f)
+                      ;;(set! quit? #t))
+                      (display "Ignoring unused option ")(display arg-string)
+                      (newline)
+		      (set! rest (cdr rest)))
                     
                     (let* ((arg-type (car arg-def))
                            (arg-parse-result


-- 
@James LewisMoss <dres@debian.org>      |  Blessed Be!
@    http://jimdres.home.mindspring.com |  Linux is kewl!
@"Argue for your limitations and sure enough, they're yours." Bach