* src/scm/report/transaction-report.scm: use new api for

changing sensitivity

	* src/guile/gnc.gwp: wrap new function

	* src/guile/global-options.c (gnc_set_option_selectable_by_name):
	new func

	* src/guile/option-util.c
	(gnc_option_db_set_option_selectable_by_name): new func

	* src/gnome/dialog-options.c (gnc_set_option_selectable): new func

	* src/gnome/dialog-account.c (gnc_type_list_unselect_cb): fix bug

	* src/scm/report/register.scm: use query option to store query

	* src/gnome/window-register.c (report_helper): don't copy
	the query -- it's converted to scm now

	* src/guile/gnc-helpers.c: more work on scm<->query


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4009 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-22 11:43:03 +00:00
parent df26729bf1
commit 085a167be9
9 changed files with 60 additions and 47 deletions

View File

@ -1,3 +1,27 @@
2001-04-22 Dave Peticolas <dave@krondo.com>
* src/scm/report/transaction-report.scm: use new api for
changing sensitivity
* src/guile/gnc.gwp: wrap new function
* src/guile/global-options.c (gnc_set_option_selectable_by_name):
new func
* src/guile/option-util.c
(gnc_option_db_set_option_selectable_by_name): new func
* src/gnome/dialog-options.c (gnc_set_option_selectable): new func
* src/gnome/dialog-account.c (gnc_type_list_unselect_cb): fix bug
* src/scm/report/register.scm: use query option to store query
* src/gnome/window-register.c (report_helper): don't copy
the query -- it's converted to scm now
* src/guile/gnc-helpers.c: more work on scm<->query
2001-04-22 Christian Stimming <stimming@tuhh.de>
* src/scm/report/transaction-report.scm: Added new options for

View File

@ -1332,7 +1332,7 @@ gnc_type_list_unselect_cb(GtkCList * type_list, gint row, gint column,
aw->type = BAD_TYPE;
gtk_widget_set_sensitive(aw->security_edit, FALSE);
gtk_widget_set_sensitive(aw->source_menu, FALSE);
gtk_widget_set_sensitive(aw->quote_frame, FALSE);
}

View File

@ -693,32 +693,24 @@ gnc_option_get_ui_value(GNCOption *option)
/********************************************************************\
* gnc_set_option_selectable_by_name *
* gnc_set_option_selectable *
* Change the selectable state of the widget that represents a *
* GUI option. *
* *
* Args: section - section of option *
* name - name of option *
* Args: option - option to change widget state for *
* selectable - if false, update the widget so that it *
* cannot be selected by the user. If true, *
* update the widget so that it can be selected.*
* Return: nothing *
\********************************************************************/
void
gnc_set_option_selectable_by_name( const char *section,
const char *name,
gboolean selectable)
gnc_set_option_selectable (GNCOption *option, gboolean selectable)
{
GNCOption *option = gnc_get_option_by_name( section, name );
if ((option == NULL) || (option->widget == NULL))
return;
gtk_widget_set_sensitive( GTK_WIDGET(option->widget),
selectable );
return;
} /* gnc_set_option_selectable_by_name */
gtk_widget_set_sensitive (GTK_WIDGET(option->widget), selectable);
}
static void

View File

@ -774,7 +774,7 @@ create_Find_Transactions (void)
GtkWidget *balance_balanced_toggle;
GtkWidget *balance_not_balanced_toggle;
GtkWidget *label843;
GtkWidget *frame34;
GtkWidget *tags_frame;
GtkWidget *vbox82;
GtkWidget *label844;
GtkWidget *tag_entry;
@ -1531,19 +1531,19 @@ create_Find_Transactions (void)
gtk_widget_show (label843);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 10), label843);
frame34 = gtk_frame_new (_("Match transaction tags (CURRENTLY INOPERABLE)"));
gtk_widget_ref (frame34);
gtk_object_set_data_full (GTK_OBJECT (Find_Transactions), "frame34", frame34,
tags_frame = gtk_frame_new (_("Match transaction tags (CURRENTLY INOPERABLE)"));
gtk_widget_ref (tags_frame);
gtk_object_set_data_full (GTK_OBJECT (Find_Transactions), "tags_frame", tags_frame,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame34);
gtk_container_add (GTK_CONTAINER (notebook2), frame34);
gtk_widget_show (tags_frame);
gtk_container_add (GTK_CONTAINER (notebook2), tags_frame);
vbox82 = gtk_vbox_new (FALSE, 0);
gtk_widget_ref (vbox82);
gtk_object_set_data_full (GTK_OBJECT (Find_Transactions), "vbox82", vbox82,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox82);
gtk_container_add (GTK_CONTAINER (frame34), vbox82);
gtk_container_add (GTK_CONTAINER (tags_frame), vbox82);
gtk_container_set_border_width (GTK_CONTAINER (vbox82), 5);
label844 = gtk_label_new (_("Find transactions with the tag:"));

View File

@ -2349,7 +2349,7 @@ Exactly
<widget>
<class>GtkFrame</class>
<name>frame34</name>
<name>tags_frame</name>
<label>Match transaction tags (CURRENTLY INOPERABLE)</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>

View File

@ -3084,17 +3084,12 @@ report_helper (RegWindow *regData, SCM func, Query *query)
{
query = xaccLedgerDisplayGetQuery (regData->ledger);
g_return_if_fail (query != NULL);
query = xaccQueryCopy (query);
}
arg = gw_wcp_assimilate_ptr (query, qtype);
args = gh_cons (arg, args);
if (arg == SCM_UNDEFINED)
{
xaccFreeQuery (query);
return;
}
gh_apply (func, args);
}

View File

@ -714,8 +714,7 @@
(gnc:make-option
section name "" 'query #f
(lambda () value)
(lambda (x) (set! value (if (list? x) x (gnc:query->scm x)))
(display value) (newline))
(lambda (x) (set! value (if (list? x) x (gnc:query->scm x))))
(lambda () (if (list? default-value)
default-value
(gnc:query->scm default-value)))

View File

@ -234,10 +234,7 @@
(gnc:register-option gnc:*report-options* new-option))
(gnc:register-reg-option
(gnc:make-query-option "__reg" "query-new" #f))
(gnc:register-reg-option
(gnc:make-internal-option "__reg" "query" #f))
(gnc:make-query-option "__reg" "query" #f))
(gnc:register-reg-option
(gnc:make-internal-option "__reg" "journal" #f))
(gnc:register-reg-option
@ -576,7 +573,8 @@
(let ((document (gnc:make-html-document))
(splits '())
(table '())
(query (opt-val "__reg" "query"))
(query-scm (opt-val "__reg" "query"))
(query #f)
(journal? (opt-val "__reg" "journal"))
(debit-string (opt-val "__reg" "debit-string"))
(credit-string (opt-val "__reg" "credit-string"))
@ -586,6 +584,8 @@
(if invoice?
(set! title (_ "Invoice")))
(set! query (gnc:scm->query query-scm))
(gnc:query-set-group query (gnc:get-current-group))
(set! splits (gnc:glist->list
@ -630,6 +630,8 @@
(gnc:html-document-set-title! document title)
(gnc:html-document-add-object! document table)
(gnc:free-query query)
document))
(gnc:define-report
@ -652,7 +654,6 @@
(let* ((options (gnc:make-report-options "Register"))
(invoice-op (gnc:lookup-option options "Invoice" "Make an invoice"))
(query-op (gnc:lookup-option options "__reg" "query"))
(query-new-op (gnc:lookup-option options "__reg" "query-new"))
(journal-op (gnc:lookup-option options "__reg" "journal"))
(double-op (gnc:lookup-option options "__reg" "double"))
(title-op (gnc:lookup-option options "General" "Title"))
@ -667,7 +668,6 @@
(gnc:option-set-value invoice-op invoice?)
(gnc:option-set-value query-op query)
(gnc:option-set-value query-new-op query)
(gnc:option-set-value journal-op journal?)
(gnc:option-set-value double-op double?)
(gnc:option-set-value title-op title)
@ -675,7 +675,6 @@
(gnc:option-set-value credit-op credit-string)
(func (gnc:make-report "Register" options))))
(define (gnc:show-register-report . rest)
(apply gnc:apply-register-report
(cons gnc:report-window (cons #f rest))))

View File

@ -480,7 +480,8 @@
'account-name
key-choice-list #f
(lambda (x)
(gnc:set-option-selectable-by-name
(gnc:option-db-set-option-selectable-by-name
gnc:*transaction-report-options*
pagename-sorting optname-prime-subtotal
(and (member x subtotal-enabled) #t)))))
@ -497,7 +498,8 @@
"c"
(N_ "Subtotal according to the primary key?")
#t #f
(lambda (x) (gnc:set-option-selectable-by-name
(lambda (x) (gnc:option-db-set-option-selectable-by-name
gnc:*transaction-report-options*
pagename-sorting optname-prime-subtotal-by
(and x
(equal?
@ -523,7 +525,8 @@
'date
key-choice-list #f
(lambda (x)
(gnc:set-option-selectable-by-name
(gnc:option-db-set-option-selectable-by-name
gnc:*transaction-report-options*
pagename-sorting optname-sec-subtotal
(and (member x subtotal-enabled) #t)))))
@ -540,7 +543,8 @@
"g"
(N_ "Subtotal according to the secondary key?")
#t #f
(lambda (x) (gnc:set-option-selectable-by-name
(lambda (x) (gnc:option-db-set-option-selectable-by-name
gnc:*transaction-report-options*
pagename-sorting optname-sec-subtotal-by x))))
(gnc:register-trep-option