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>
|
2001-04-26 Christian Stimming <stimming@tuhh.de>
|
||||||
|
|
||||||
* src/scm/report/net-barchart.scm: New file, it is the merger of
|
* src/scm/report/net-barchart.scm: New file, it is the merger of
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <guile/gh.h>
|
#include <guile/gh.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "gfec.h"
|
||||||
#include "gnc-engine.h"
|
#include "gnc-engine.h"
|
||||||
#include "gnc-ui.h"
|
#include "gnc-ui.h"
|
||||||
#include "gnucash.h"
|
#include "gnucash.h"
|
||||||
@ -389,31 +390,53 @@ gnc_main_window_configure_mdi_cb (gpointer data)
|
|||||||
* MDI session restore time
|
* 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 *
|
GnomeMDIChild *
|
||||||
gnc_main_window_create_child(const gchar * configstring) {
|
gnc_main_window_create_child(const gchar * configstring) {
|
||||||
|
GnomeMDIChild *child;
|
||||||
URLType type;
|
URLType type;
|
||||||
char * location;
|
char * location;
|
||||||
char * label;
|
char * label;
|
||||||
char * url;
|
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);
|
type = gnc_html_parse_url(NULL, url, &location, &label);
|
||||||
g_free(location);
|
g_free(location);
|
||||||
g_free(label);
|
g_free(label);
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case URL_TYPE_REPORT:
|
case URL_TYPE_REPORT:
|
||||||
return gnc_report_window_create_child(url);
|
child = gnc_report_window_create_child(url);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case URL_TYPE_ACCTTREE:
|
case URL_TYPE_ACCTTREE:
|
||||||
return gnc_acct_tree_window_create_child(url);
|
child = gnc_acct_tree_window_create_child(url);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
child = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free (url);
|
||||||
|
|
||||||
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@
|
|||||||
(if (gnc:report-parent report)
|
(if (gnc:report-parent report)
|
||||||
(gnc:report-set-dirty?!
|
(gnc:report-set-dirty?!
|
||||||
(gnc:find-report (gnc:report-parent report)) val))
|
(gnc:find-report (gnc:report-parent report)) val))
|
||||||
|
|
||||||
;; reload the window
|
;; reload the window
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (win)
|
(lambda (win)
|
||||||
@ -466,9 +466,10 @@
|
|||||||
|
|
||||||
(define (gnc:report-generate-restore-forms-complete report)
|
(define (gnc:report-generate-restore-forms-complete report)
|
||||||
(define (find-root r)
|
(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))))
|
(if (not p) r (find-root p))))
|
||||||
|
|
||||||
(define (generate-forms/children r)
|
(define (generate-forms/children r)
|
||||||
(apply
|
(apply
|
||||||
string-append
|
string-append
|
||||||
@ -478,7 +479,7 @@
|
|||||||
(let ((child (gnc:find-report c)))
|
(let ((child (gnc:find-report c)))
|
||||||
(generate-forms/children child)))
|
(generate-forms/children child)))
|
||||||
(gnc:report-children r))))
|
(gnc:report-children r))))
|
||||||
|
|
||||||
(let ((toplevel (find-root report)))
|
(let ((toplevel (find-root report)))
|
||||||
(string-append
|
(string-append
|
||||||
";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"
|
";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user