diff --git a/ChangeLog b/ChangeLog index 0fdbbcc145..728550a0b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ 2001-03-27 Dave Peticolas + * src/scm/report/stylesheet-plain.scm: more reports centered + by default + + * src/scm/html-document.scm: Christopher Browne's markup + style extension. + + * src/gnome/window-main.c (gnc_report_in_main_window): show new + page + + * doc/sgml/pt_PT/Makefile.am: remove demo html files + + * doc/sgml/es/Makefile.am: remove demo html files + + * doc/sgml/C/Makefile.am: remove demo html files + + * src/gnome/dialog-column-view.c: mark the options dialog + changes as appropriate + + * src/gnome/dialog-options.c (gnc_options_dialog_changed): new + public func + * src/gnome/dialog-tax-info.c: more work * src/gnome/dialog-options.c: set apply button sensitivity diff --git a/doc/html/C/account-tree-demo.html b/doc/html/C/account-tree-demo.html deleted file mode 100644 index 69599fef9f..0000000000 --- a/doc/html/C/account-tree-demo.html +++ /dev/null @@ -1,21 +0,0 @@ - - -GnuCash account tree demo - - - -

GnuCash account tree demo

- -

The GnuCash main window account tree widget can be embedded live -in HTML. This is mainly useful for special reports designed to go in the -main window. - -

- - - -THIS IS ALT TEXT - - - - diff --git a/doc/html/C/guppi-bar-demo.html b/doc/html/C/guppi-bar-demo.html deleted file mode 100644 index c629521b3c..0000000000 --- a/doc/html/C/guppi-bar-demo.html +++ /dev/null @@ -1,32 +0,0 @@ - - -Guppi Bar Chart Demo - - - -

Guppi Bar Chart Demo

- -

Live Guppi bar charts can now be embedded in any HTML viewed in -Gnucash. This demo doesn't do much but it's possible to add callbacks -to mouse clicks on the graph or the legend. - -

- - - - - - - - - - - - -

and this one. - - diff --git a/doc/html/C/guppi-pie-demo.html b/doc/html/C/guppi-pie-demo.html deleted file mode 100644 index aa6ba4e2be..0000000000 --- a/doc/html/C/guppi-pie-demo.html +++ /dev/null @@ -1,42 +0,0 @@ - - -Guppi Pie Chart Demo - - - -

Guppi Pie Chart Demo

- -

Live Guppi pie charts can be directly embedded in any HTML that is -displayed withing Gnucash, including reports. The left mouse button -lets you move pie slices around, and the right button lets you rotate -the whole pie. - -

- - - - - - - - -THIS IS ALT TEXT - - -

This is the first pie segment.

- -

This is the second pie segment.

- -

This is the third pie segment.

- -

This is the fourth pie segment.

- -

This is the fifth pie segment.

- -

This is the sixth pie segment.

- - diff --git a/doc/html/C/guppi-points-demo.html b/doc/html/C/guppi-points-demo.html deleted file mode 100644 index b71b04062d..0000000000 --- a/doc/html/C/guppi-points-demo.html +++ /dev/null @@ -1,29 +0,0 @@ - - -Guppi Scatter Chart Demo - - - -

Guppi Scatter Chart Demo

- -

Gnucash can't do Guppi line graphs just yet, but we can do scatter -charts. The left mouse button zooms in, the right button zooms out, -and the middle button lets you drag the viewport around. - -

- - - - - - - - - - - -

and this one. - - diff --git a/doc/sgml/C/Makefile.am b/doc/sgml/C/Makefile.am index a976208b9d..ffa43f163d 100644 --- a/doc/sgml/C/Makefile.am +++ b/doc/sgml/C/Makefile.am @@ -49,12 +49,7 @@ gnucash_html_dir = $(top_srcdir)/doc/html/C GNUCASH_HTML_FILES = \ $(gnucash_html_dir)/xacc-tax-report-example.html \ - $(gnucash_html_dir)/xacc-txf-categories.html \ - $(gnucash_html_dir)/account-tree-demo.html \ - $(gnucash_html_dir)/guppi-pie-demo.html \ - $(gnucash_html_dir)/guppi-bar-demo.html \ - $(gnucash_html_dir)/guppi-points-demo.html - + $(gnucash_html_dir)/xacc-txf-categories.html install-data-local: gnucash/index.html gnucash/help-search-index.db $(mkinstalldirs) $(DESTDIR)$(gnucash_helpdir) diff --git a/doc/sgml/es/Makefile.am b/doc/sgml/es/Makefile.am index 7327fdaa1b..2f58cf3899 100644 --- a/doc/sgml/es/Makefile.am +++ b/doc/sgml/es/Makefile.am @@ -50,12 +50,7 @@ gnucash_html_dir = $(top_srcdir)/doc/html/C GNUCASH_HTML_FILES = \ $(gnucash_html_dir)/xacc-tax-report-example.html \ - $(gnucash_html_dir)/xacc-txf-categories.html \ - $(gnucash_html_dir)/account-tree-demo.html \ - $(gnucash_html_dir)/guppi-pie-demo.html \ - $(gnucash_html_dir)/guppi-bar-demo.html \ - $(gnucash_html_dir)/guppi-points-demo.html - + $(gnucash_html_dir)/xacc-txf-categories.html install-data-local: gnucash/index.html gnucash/help-search-index.db $(mkinstalldirs) $(DESTDIR)$(gnucash_helpdir) diff --git a/doc/sgml/pt_PT/Makefile.am b/doc/sgml/pt_PT/Makefile.am index 9a033726e3..926739b3c5 100644 --- a/doc/sgml/pt_PT/Makefile.am +++ b/doc/sgml/pt_PT/Makefile.am @@ -47,12 +47,7 @@ gnucash_html_dir = $(top_srcdir)/doc/html/C GNUCASH_HTML_FILES = \ $(gnucash_html_dir)/xacc-tax-report-example.html \ - $(gnucash_html_dir)/xacc-txf-categories.html \ - $(gnucash_html_dir)/account-tree-demo.html \ - $(gnucash_html_dir)/guppi-pie-demo.html \ - $(gnucash_html_dir)/guppi-bar-demo.html \ - $(gnucash_html_dir)/guppi-points-demo.html - + $(gnucash_html_dir)/xacc-txf-categories.html install-data-local: gnucash/index.html gnucash/help-search-index.db $(mkinstalldirs) $(DESTDIR)$(gnucash_helpdir) diff --git a/src/gnome/dialog-column-view.c b/src/gnome/dialog-column-view.c index 19df6021d9..6a1b5160c2 100644 --- a/src/gnome/dialog-column-view.c +++ b/src/gnome/dialog-column-view.c @@ -240,8 +240,11 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data) { scm_protect_object(r->contents_list); gnc_option_db_set_option(r->odb, "__general", "report-list", - r->contents_list); - } + r->contents_list); + + gnc_options_dialog_changed (r->optwin); + } + update_display_lists(r); } @@ -277,10 +280,12 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data) { scm_protect_object(r->contents_list); gnc_option_db_set_option(r->odb, "__general", "report-list", - r->contents_list); - } - update_display_lists(r); + r->contents_list); + gnc_options_dialog_changed (r->optwin); + } + + update_display_lists(r); } void @@ -311,7 +316,10 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data) { r->contents_selected = r->contents_selected - 1; gnc_option_db_set_option(r->odb, "__general", "report-list", - r->contents_list); + r->contents_list); + + gnc_options_dialog_changed (r->optwin); + update_display_lists(r); } } @@ -345,9 +353,11 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data) { gnc_option_db_set_option(r->odb, "__general", "report-list", r->contents_list); + + gnc_options_dialog_changed (r->optwin); + update_display_lists(r); } - } void @@ -376,7 +386,7 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data) { (float)gh_scm2int(gh_caddr(current))); dlg_ret = gnome_dialog_run_and_close(GNOME_DIALOG(dlg)); - + if(dlg_ret == 0) { current = SCM_LIST3(gh_car(current), gh_int2scm(gtk_spin_button_get_value_as_int @@ -388,6 +398,7 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data) { gh_int2scm(r->contents_selected), current); scm_protect_object(r->contents_list); + gnc_options_dialog_changed (r->optwin); update_display_lists(r); } } diff --git a/src/gnome/dialog-options.c b/src/gnome/dialog-options.c index 64b2f54ec5..dd0e8f1201 100644 --- a/src/gnome/dialog-options.c +++ b/src/gnome/dialog-options.c @@ -71,7 +71,7 @@ typedef enum { static void -gnc_option_dialog_changed (GtkWidget *dialog) +gnc_options_dialog_changed_internal (GtkWidget *dialog) { GtkWidget *button; @@ -83,6 +83,14 @@ gnc_option_dialog_changed (GtkWidget *dialog) gtk_widget_set_sensitive (button, TRUE); } +void +gnc_options_dialog_changed (GNCOptionWin *win) +{ + if (!win) return; + + gnc_options_dialog_changed_internal (win->container); +} + static void gnc_option_changed_cb(GtkEditable *editable, gpointer data) { @@ -95,7 +103,7 @@ gnc_option_changed_cb(GtkEditable *editable, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(raw); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -108,7 +116,7 @@ gnc_date_option_changed_cb(GtkWidget *dummy, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(option->widget); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -709,7 +717,7 @@ default_button_cb(GtkButton *button, gpointer data) option->changed = TRUE; pbox = gtk_widget_get_toplevel(GTK_WIDGET(button)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static GtkWidget * @@ -739,7 +747,7 @@ gnc_option_toggled_cb(GtkToggleButton *button, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(button)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } @@ -768,7 +776,7 @@ gnc_option_multichoice_cb(GtkWidget *w, gint index, gpointer data) omenu = gtk_object_get_data(GTK_OBJECT(w), "gnc_option_menu"); pbox = gtk_widget_get_toplevel(omenu); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -801,7 +809,7 @@ gnc_option_rd_combo_cb(GtkWidget *w, gint index, gpointer data) omenu = gtk_object_get_data(GTK_OBJECT(w), "gnc_option_menu"); pbox = gtk_widget_get_toplevel(omenu); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static GtkWidget * @@ -985,7 +993,7 @@ gnc_option_account_cb(GNCAccountTree *tree, Account * account, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(tree)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -1001,7 +1009,7 @@ gnc_option_account_select_all_cb(GtkWidget *widget, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(widget)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -1017,7 +1025,7 @@ gnc_option_account_clear_all_cb(GtkWidget *widget, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(widget)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } @@ -1103,7 +1111,7 @@ gnc_option_list_select_cb(GtkCList *clist, gint row, gint column, gtk_clist_set_row_data(clist, row, GINT_TO_POINTER(TRUE)); pbox = gtk_widget_get_toplevel(GTK_WIDGET(clist)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -1120,7 +1128,7 @@ gnc_option_list_unselect_cb(GtkCList *clist, gint row, gint column, gtk_clist_set_row_data(clist, row, GINT_TO_POINTER(FALSE)); pbox = gtk_widget_get_toplevel(GTK_WIDGET(clist)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -1136,7 +1144,7 @@ gnc_option_list_select_all_cb(GtkWidget *widget, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(widget)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -1152,7 +1160,7 @@ gnc_option_list_clear_all_cb(GtkWidget *widget, gpointer data) gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(widget)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static GtkWidget * @@ -1254,7 +1262,7 @@ gnc_option_color_changed_cb(GnomeColorPicker *picker, guint arg1, guint arg2, gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(picker)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void @@ -1269,7 +1277,7 @@ gnc_option_font_changed_cb(GnomeFontPicker *picker, gchar *font_name, gnc_option_call_option_widget_changed_proc(option); pbox = gtk_widget_get_toplevel(GTK_WIDGET(picker)); - gnc_option_dialog_changed (pbox); + gnc_options_dialog_changed_internal (pbox); } static void diff --git a/src/gnome/dialog-options.h b/src/gnome/dialog-options.h index a00f19a73f..30fa1005cb 100644 --- a/src/gnome/dialog-options.h +++ b/src/gnome/dialog-options.h @@ -38,6 +38,8 @@ void gnc_options_dialog_destroy(GNCOptionWin * win); GtkWidget * gnc_options_dialog_widget(GNCOptionWin * win); GtkWidget * gnc_options_dialog_notebook(GNCOptionWin * win); +void gnc_options_dialog_changed (GNCOptionWin *win); + void gnc_options_dialog_set_apply_cb(GNCOptionWin * win, GNCOptionWinCallback thunk, gpointer cb_data); diff --git a/src/gnome/window-main.c b/src/gnome/window-main.c index bfa8a7193e..bcde0edc74 100644 --- a/src/gnome/window-main.c +++ b/src/gnome/window-main.c @@ -1698,6 +1698,7 @@ gnc_report_in_main_window (int report_id) { SCM get_report = gh_eval_str("gnc:find-report"); SCM get_name = gh_eval_str("gnc:report-name"); char * report_name; + gint page_num; gtk_frame_set_shadow_type(GTK_FRAME(fr), GTK_SHADOW_NONE); @@ -1708,8 +1709,13 @@ gnc_report_in_main_window (int report_id) { gtk_widget_show_all(fr); gtk_notebook_append_page(GTK_NOTEBOOK(mainwin->notebook), fr, gtk_label_new(report_name)); - + + page_num = gtk_notebook_page_num(GTK_NOTEBOOK(mainwin->notebook), fr); + gtk_notebook_set_page(GTK_NOTEBOOK(mainwin->notebook), page_num); + + gnc_set_busy_cursor (NULL); gnc_report_window_show_report(reptwin, report_id); + gnc_unset_busy_cursor (NULL); } /********************* END OF FILE **********************************/ diff --git a/src/scm/help-topics-index.scm b/src/scm/help-topics-index.scm index 8753ba6492..ca85487112 100644 --- a/src/scm/help-topics-index.scm +++ b/src/scm/help-topics-index.scm @@ -56,10 +56,6 @@ "gnc-action:get?url=user-reg.php" #f) ((N_ "GnuCash Network Home") "gnc-action:get/auth?url=gnc-network-home.php" #f))) - ((N_ "Guppi Demos") "" - (((N_ "Pie chart") "gnc-help:guppi-pie-demo.html" #f) - ((N_ "Bar graph") "gnc-help:guppi-bar-demo.html" #f) - ((N_ "Points") "gnc-help:guppi-points-demo.html" #f))) ((N_ "URL Tests") "" (((N_ "gnucash.org") "http://www.gnucash.org" #f) ((N_ "gnumatic.com") "http://www.gnumatic.com" #f) diff --git a/src/scm/html-document.scm b/src/scm/html-document.scm index 3f6e0ce3ee..85a2736950 100644 --- a/src/scm/html-document.scm +++ b/src/scm/html-document.scm @@ -189,66 +189,65 @@ (define (gnc:html-document-markup-start doc markup . rest) (let ((childinfo (gnc:html-document-fetch-markup-style doc markup)) - (extra-attrib + (extra-attrib (if (not (null? rest)) rest #f)) (show-result #f)) - ;; now generate the start tag (let ((tag (gnc:html-markup-style-info-tag childinfo)) (attr (gnc:html-markup-style-info-attributes childinfo)) (face (gnc:html-markup-style-info-font-face childinfo)) (size (gnc:html-markup-style-info-font-size childinfo)) (color (gnc:html-markup-style-info-font-color childinfo))) - + ;; "" tags mean "show no tag"; #f tags means use default. (cond ((not tag) (set! tag markup)) - ((string=? tag "") + ((and (string? tag) (string=? tag "")) (set! tag #f))) - (let* ((retval '()) - (push (lambda (l) (set! retval (cons l retval))))) - (if tag - (begin - (push "\n<") - (push tag) - (if attr - (hash-fold - (lambda (key value prior) - (push " ") (push key) (push "=") - (push value) - #t) - #f - attr)) - (if extra-attrib - (for-each - (lambda (attr) - (cond ((string? attr) (push " ") (push attr)) - (attr (gnc:warn "non-string attribute" attr)))) - extra-attrib)) - (push ">"))) + (push (lambda (l) (set! retval (cons l retval)))) + (add-internal-tag (lambda (t) (push "<") (push tag) (push ">"))) + (add-attribute + (lambda (key value prior) (push " ") (push key) (push "=") + (push value) #t)) + (addextraatt + (lambda (attr) + (cond ((string? attr) (push " ") (push attr)) + (attr (gnc:warn "non-string attribute" attr))))) + (build-first-tag + (lambda (tag) + (push "\n<") (push tag) + (if attr (hash-fold add-attribute #f attr)) + (if extra-attrib (for-each addextraatt extra-attrib)) + (push ">")))) + (if tag + (if (list? tag) + (begin + (build-first-tag (car tag)) + (for-each add-internal-tag (cdr tag))) + (build-first-tag tag))) (if (or face size color) - (begin + (begin (push ""))) retval)))) (define (gnc:html-document-markup-end doc markup) - (let ((childinfo (gnc:html-document-fetch-markup-style doc markup))) + (let ((childinfo (gnc:html-document-fetch-markup-style doc markup))) ;; now generate the end tag - (let ((tag (gnc:html-markup-style-info-tag childinfo)) + (let ((tag (gnc:html-markup-style-info-tag childinfo)) (closing-font-tag - (gnc:html-markup-style-info-closing-font-tag childinfo))) + (gnc:html-markup-style-info-closing-font-tag childinfo))) ;; "" tags mean "show no tag"; #f tags means use default. (cond ((not tag) (set! tag markup)) @@ -258,12 +257,16 @@ (push (lambda (l) (set! retval (cons l retval))))) (if closing-font-tag (push "\n")) - (if tag - (begin - (push "\n"))) + (if tag + (let ((addtag (lambda (t) + (push "\n")))) + (cond + ((string? tag) + (addtag tag)) + ((list? tag) + (for-each addtag (reverse tag)))))) retval)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/scm/report/stylesheet-plain.scm b/src/scm/report/stylesheet-plain.scm index 5cd2b7933d..c9085eee0f 100644 --- a/src/scm/report/stylesheet-plain.scm +++ b/src/scm/report/stylesheet-plain.scm @@ -84,7 +84,8 @@ (border (opt-val "Tables" "Table border width"))) (gnc:html-document-set-style! - ssdoc "body" + ssdoc "body" + 'tag '("body" "center") 'attribute (list "bgcolor" bgcolor)) (if (and bgpixmap