mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-04-26 Dave Peticolas <dave@krondo.com>
* src/gnome/window-main.c: handle scm parsing errors * src/scm/report.scm: fix bug * src/guile/gfec.c: handle NULLs git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4053 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e8a5a9677c
commit
1953f9773b
@ -1,3 +1,11 @@
|
||||
2001-04-26 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/gnome/window-main.c: handle scm parsing errors
|
||||
|
||||
* src/scm/report.scm: fix bug
|
||||
|
||||
* src/guile/gfec.c: handle NULLs
|
||||
|
||||
2001-04-26 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/scm/report/net-barchart.scm: New file, it is the merger of
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <guile/gh.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gfec.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnucash.h"
|
||||
@ -389,31 +390,53 @@ gnc_main_window_configure_mdi_cb (gpointer data)
|
||||
* MDI session restore time
|
||||
********************************************************************/
|
||||
|
||||
static void
|
||||
gfec_create_child_error (const char *error_string)
|
||||
{
|
||||
g_warning ("error creating mdi child\n\n%s",
|
||||
error_string ? error_string : "(null)");
|
||||
}
|
||||
|
||||
GnomeMDIChild *
|
||||
gnc_main_window_create_child(const gchar * configstring) {
|
||||
GnomeMDIChild *child;
|
||||
URLType type;
|
||||
char * location;
|
||||
char * label;
|
||||
char * url;
|
||||
SCM scm;
|
||||
|
||||
url = gh_scm2newstr(gh_eval_str(configstring), NULL);
|
||||
if (!configstring)
|
||||
return NULL;
|
||||
|
||||
scm = gfec_eval_string(configstring, gfec_create_child_error);
|
||||
if (!gh_string_p(scm))
|
||||
return NULL;
|
||||
|
||||
url = gh_scm2newstr(scm, NULL);
|
||||
if (!url)
|
||||
return NULL;
|
||||
|
||||
type = gnc_html_parse_url(NULL, url, &location, &label);
|
||||
g_free(location);
|
||||
g_free(label);
|
||||
|
||||
|
||||
switch(type) {
|
||||
case URL_TYPE_REPORT:
|
||||
return gnc_report_window_create_child(url);
|
||||
child = gnc_report_window_create_child(url);
|
||||
break;
|
||||
|
||||
case URL_TYPE_ACCTTREE:
|
||||
return gnc_acct_tree_window_create_child(url);
|
||||
child = gnc_acct_tree_window_create_child(url);
|
||||
break;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
child = NULL;
|
||||
}
|
||||
|
||||
free (url);
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
|
||||
|
@ -291,7 +291,7 @@
|
||||
(if (gnc:report-parent report)
|
||||
(gnc:report-set-dirty?!
|
||||
(gnc:find-report (gnc:report-parent report)) val))
|
||||
|
||||
|
||||
;; reload the window
|
||||
(for-each
|
||||
(lambda (win)
|
||||
@ -466,9 +466,10 @@
|
||||
|
||||
(define (gnc:report-generate-restore-forms-complete report)
|
||||
(define (find-root r)
|
||||
(let ((p (gnc:report-parent r)))
|
||||
(let* ((pid (gnc:report-parent r))
|
||||
(p (if pid (gnc:find-report pid) #f)))
|
||||
(if (not p) r (find-root p))))
|
||||
|
||||
|
||||
(define (generate-forms/children r)
|
||||
(apply
|
||||
string-append
|
||||
@ -478,7 +479,7 @@
|
||||
(let ((child (gnc:find-report c)))
|
||||
(generate-forms/children child)))
|
||||
(gnc:report-children r))))
|
||||
|
||||
|
||||
(let ((toplevel (find-root report)))
|
||||
(string-append
|
||||
";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"
|
||||
|
Loading…
Reference in New Issue
Block a user