*** empty log message ***

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2042 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldreleases/1.4
Dave Peticolas 27 years ago
parent e0a0f388f8
commit fa0e7590b6

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gnucash 1.2.0\n"
"POT-Creation-Date: 2000-02-25 02:11-0800\n"
"POT-Creation-Date: 2000-02-29 02:59-0800\n"
"PO-Revision-Date: 1999-08-24 20:03+0200\n"
"Last-Translator: Jan-Uwe Finck <Jan-Uwe.Finck@bigfoot.de>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gnucash 1.2.0\n"
"POT-Creation-Date: 2000-02-25 02:11-0800\n"
"POT-Creation-Date: 2000-02-29 02:59-0800\n"
"PO-Revision-Date: 1999-08-24 19:15+0200\n"
"Last-Translator: Yannick LE NY <y-le-ny@ifrance.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

@ -800,7 +800,10 @@ leaveCombo (BasicCell *bcell, const char *value)
if (find == NULL &&
((box->ignore_string == NULL) ||
(safe_strcmp(value, box->ignore_string) != 0)))
{
xaccSetBasicCellValue(bcell, "");
return strdup("");
}
}
return value;

@ -202,7 +202,7 @@
(define (multichoice-legal val p-vals)
(cond ((null? p-vals) #f)
((eq? val (vector-ref (car p-vals) 0)) #t)
(else multichoice-legal (cdr p-vals))))
(else (multichoice-legal val (cdr p-vals)))))
(let* ((value default-value)
(value->string (lambda ()
@ -222,6 +222,46 @@
(list #f "multichoice-option: illegal choice")))
ok-values)))
;; list options use the option-data in the same way as multichoice
;; options. List options allow the user to select more than one option.
(define (gnc:make-list-option
section
name
sort-tag
documentation-string
default-value
ok-values)
(define (legal-value? value legal-values)
(cond ((null? legal-values) #f)
((eq? value (vector-ref (car legal-values) 0)) #t)
(else (legal-value? value (cdr legal-values)))))
(define (list-legal values)
(cond ((null? values) #t)
(else
(and
(legal-value? (car values) ok-values)
(list-legal (cdr values))))))
(let* ((value default-value)
(value->string (lambda ()
(string-append "'" (gnc:value->string value)))))
(gnc:make-option
section name sort-tag 'list documentation-string
(lambda () value)
(lambda (x)
(if (list-legal x)
(set! value x)
(gnc:error "Illegal list option set")))
(lambda () default-value)
(gnc:restore-form-generator value->string)
(lambda (x)
(if (list-legal x)
(list #t x)
(list #f "list-option: illegal value")))
ok-values)))
;; number range options use the option-data as a list whose
;; elements are: (lower-bound upper-bound num-decimals step-size)
(define (gnc:make-number-range-option

@ -67,105 +67,38 @@
;;;;;; Create default options and config vars
;; Account Types options
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show bank accounts"
"a" "Show bank accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show cash accounts"
"b" "Show cash accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show credit accounts"
"c" "Show credit accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show asset accounts"
"d" "Show asset accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show liability accounts"
"e" "Show liability accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show stock accounts"
"f" "Show stock accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show mutual fund accounts"
"g" "Show mutual fund accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show currency accounts"
"h" "Show currency accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show income accounts"
"i" "Show income accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show expense accounts"
"j" "Show expense accounts in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Types" "Show equity accounts"
"k" "Show equity accounts in the account tree." #t))
;; Account Fields options
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account name"
"a" "Show the account name column in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account type"
"b" "Show the account type column in the account tree." #f))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account code"
"c" "Show the account code column in the account tree." #f))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account description"
"d" "Show the account description column in the account tree." #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account notes"
"e" "Show the account notes column in the account tree." #f))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account currency"
"f" "Show the account currency column in the account tree." #f))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account security"
"g" "Show the account security column in the account tree." #f))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
"Account Fields" "Show account balance"
"h" "Show the account balance column in the account tree." #t))
;; Main Window options
(gnc:register-configuration-option
(gnc:make-list-option
"Main Window" "Account types to display"
"a" ""
(list 'equity 'expense 'income 'currency 'mutual
'stock 'liability 'asset 'credit 'cash 'bank)
(list #(bank "Bank" "")
#(cash "Cash" "")
#(credit "Credit" "")
#(asset "Asset" "")
#(liability "Liability" "")
#(stock "Stock" "")
#(mutual "Mutual Fund" "")
#(currency "Currency" "")
#(income "Income" "")
#(expense "Expense" "")
#(equity "Equity" ""))))
(gnc:register-configuration-option
(gnc:make-list-option
"Main Window" "Account fields to display"
"b" ""
(list 'balance 'description)
(list #(type "Type" "")
#(code "Code" "")
#(description "Description" "")
#(notes "Notes" "")
#(currency "Currency" "")
#(security "Security" "")
#(balance "Balance" ""))))
;; International options

@ -534,7 +534,7 @@
(gnc:init-query gncq)
(if (null? accounts)
(set! report-lines
(set! rept-text
(list "<TR><TD>You have not selected an account.</TD></TR>"))
(begin
; Grab account names
@ -557,65 +557,66 @@
(map (lambda(acct) (gnc:query-add-account gncq acct)) accounts)
(set! tempstruct
(build-mystruct-instance
(define-mystruct
(gnc:acctnames-from-list accounts))))
(set! acctcurrency (gnc:account-get-currency (car accounts)))
(set! report-lines
(gnc:convert-split-list (gnc:query-get-splits gncq)))))
(gnc:free-query gncq)
(display (length report-lines))
(display " Splits\n")
; Set initial balances to zero
(map (lambda(an) (tempstruct 'put an 0))
(gnc:acctnames-from-list accounts))
(dateloop begindate
enddate
(eval stepsize))
(set! rept-data
(reduce-split-list
(dateloop begindate
enddate
(eval stepsize))
report-lines zdate tempstruct))
(set! sum-data (get-averages rept-data))
;; Create HTML
(set! rept-text
(html-table
collist
(append rept-data
(list "<TR cellspacing=0><TD><TD><TD colspan=3><HR size=2 noshade><TD colspan=3><HR size=2 noshade></TR>" sum-data))))
;; Do a plot
(if (not (equal? NoPlot (eval plotstr)))
(let* ((fn "/tmp/gncplot.dat")
(preplot (string-append
"set xdata time\n"
"set timefmt '%m/%d/%Y'\n"
"set pointsize 2\n"
"set title '" acctname "'\n"
"set ylabel '" acctcurrency "'\n"
"set xlabel 'Period Ending'\n"
)
)
)
(data-to-gpfile collist rept-data fn (eval plotstr))
(system
(string-append "echo \"" preplot "plot '" fn "'" (eval plotstr)
"\"|gnuplot -persist " )))
)
(append prefix (list "Report for " acctname "<p>\n" )
(set! tempstruct
(build-mystruct-instance
(define-mystruct
(gnc:acctnames-from-list accounts))))
(set! acctcurrency (gnc:account-get-currency (car accounts)))
(set! report-lines
(gnc:convert-split-list (gnc:query-get-splits gncq)))
(gnc:free-query gncq)
(display (length report-lines))
(display " Splits\n")
; Set initial balances to zero
(map (lambda(an) (tempstruct 'put an 0))
(gnc:acctnames-from-list accounts))
(dateloop begindate
enddate
(eval stepsize))
(set! rept-data
(reduce-split-list
(dateloop begindate
enddate
(eval stepsize))
report-lines zdate tempstruct))
(set! sum-data (get-averages rept-data))
;; Create HTML
(set! rept-text
(html-table
collist
(append rept-data
(list "<TR cellspacing=0><TD><TD><TD colspan=3><HR size=2 noshade><TD colspan=3><HR size=2 noshade></TR>" sum-data))))
;; Do a plot
(if (not (equal? NoPlot (eval plotstr)))
(let* ((fn "/tmp/gncplot.dat")
(preplot (string-append
"set xdata time\n"
"set timefmt '%m/%d/%Y'\n"
"set pointsize 2\n"
"set title '" acctname "'\n"
"set ylabel '" acctcurrency "'\n"
"set xlabel 'Period Ending'\n"
)))
(data-to-gpfile collist rept-data fn (eval plotstr))
(system
(string-append "echo \"" preplot "plot '"
fn "'" (eval plotstr)
"\"|gnuplot -persist " ))))
))
(append prefix
(if (null? accounts)
()
(list "Report for " acctname "<p>\n"))
(list rept-text) suffix)))
)

@ -14,12 +14,12 @@
(define (options-generator)
;; This will be the new set of options.
(define gnc:*dummy-options* (gnc:new-options))
(define gnc:*hello-world-options* (gnc:new-options))
;; This is just a helper function for making options.
;; See gnucash/src/scm/options.scm for details.
(define (gnc:register-dummy-option new-option)
(gnc:register-option gnc:*dummy-options* new-option))
(define (gnc:register-hello-world-option new-option)
(gnc:register-option gnc:*hello-world-options* new-option))
;; This is a boolean option. It is in Section 'Hello, World!'
;; and is named 'Boolean Option'. Its sorting key is 'a',
@ -28,7 +28,7 @@
;; is #t (true). The phrase 'This is a boolean option'
;; will be displayed as help text when the user puts
;; the mouse pointer over the option.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-simple-boolean-option
"Hello, World!" "Boolean Option"
"a" "This is a boolean option." #t))
@ -38,13 +38,13 @@
;; symbols. The value 'first will be displayed as "First Option"
;; and have a help string of "Help for first option.". The default
;; value is 'third.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-multichoice-option
"Hello, World!" "Multi Choice Option"
"b" "This is a multi choice option." 'third
(list #(first "First Option" "Help for first option.")
#(second "Second Option" "Help for second option.")
#(third "Third Option" "Help for third option.")
(list #(first "First Option" "Help for first option")
#(second "Second Option" "Help for second option")
#(third "Third Option" "Help for third option")
#(fourth "Fourth Options" "The fourth option rules!"))))
;; This is a string option. Users can type anything they want
@ -52,7 +52,7 @@
;; in the same section as the option above. It will be shown
;; after the option above because its key is 'b' while the
;; other key is 'a'.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-string-option
"Hello, World!" "String Option"
"c" "This is a string option" "Hello, World"))
@ -63,7 +63,7 @@
;; Unix time. The last option is false, so the user can only
;; select a date, not a time. The default value is the current
;; time.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-date-option
"Hello, World!" "Just a Date Option"
"d" "This is a date option"
@ -72,7 +72,7 @@
;; This is another date option, but the user can also select
;; the time.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-date-option
"Hello, World!" "Time and Date Option"
"e" "This is a date option with time"
@ -86,7 +86,7 @@
;; (#f) indicates the alpha value should be ignored. You can get
;; a color string from a color option with gnc:color-option->html,
;; which will scale the values appropriately according the range.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-color-option
"Hello, World!" "Background Color"
"f" "This is a color option"
@ -109,23 +109,36 @@
;; the user is allowed to select more than one account.
;; The default value for this option is the currently
;; selected account in the main window, if any.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-account-list-option
"Hello, World!" "An account list option"
"Hello Again" "An account list option"
"g" "This is an account list option"
(lambda () (gnc:get-current-accounts))
#f #t))
;; This is a list option. The user can select one or (possibly)
;; more values from a list. The list of acceptable values is
;; the same format as a multichoice option. The value of the
;; option is a list of symbols.
(gnc:register-hello-world-option
(gnc:make-list-option
"Hello Again" "A list option"
"h" "This is a list option"
(list 'good)
(list #(good "The Good" "Good option")
#(bad "The Bad" "Bad option")
#(ugly "The Ugly" "Ugly option"))))
;; This option is for testing. When true, the report generates
;; an exception.
(gnc:register-dummy-option
(gnc:register-hello-world-option
(gnc:make-simple-boolean-option
"Testing" "Crash the report"
"a" (string-append "This is for testing. "
"Your reports probably shouldn't have an "
"option like this.") #f))
gnc:*dummy-options*)
gnc:*hello-world-options*)
;; This is a helper function to generate an html list of account names
;; given an account list option.
@ -141,6 +154,19 @@
(map (lambda (name) (list "<li>" name "</li>")) names)
"</ul>"))))
;; This is a helper function to generate an html list for the list option.
(define (list-option-list list-op)
(let* ((values (gnc:option-value list-op))
(names (map symbol->string values)))
(if (null? values)
"<p>You have selected no values in the list option.</p>"
(list "<p>"
"The items selected in the list option are:"
"</p>"
"<ul>"
(map (lambda (name) (list "<li>" name "</li>")) names)
"</ul>"))))
;; Here's another helper function. You can guess what it does.
(define (bold string)
(string-append "<b>" string "</b>"))
@ -175,8 +201,10 @@
(colorop (gnc:lookup-option options
"Hello, World!" "Background Color"))
(account-list-op (gnc:lookup-option options
"Hello, World!"
"Hello Again"
"An account list option"))
(list-op (gnc:lookup-option options
"Hello Again" "A list option"))
(crash-op (gnc:lookup-option options "Testing" "Crash the report")))
(let ((time-string (strftime "%X" (localtime (current-time))))
@ -245,6 +273,8 @@
"The date and time option is " (bold date-string2) "."
"</p>")
(list-option-list list-op)
(account-list account-list-op)
(list "<p>"

@ -491,6 +491,8 @@
trep-options-generator
;; renderer
(lambda (options)
(gnc:set-total-inflow! 0)
(gnc:set-total-outflow! 0)
(let* ((begindate (gnc:lookup-option options "Report Options" "From"))
(enddate (gnc:lookup-option options "Report Options" "To"))
(tr-report-account-op (gnc:lookup-option options

Loading…
Cancel
Save