* src/scm/report/hello-world.scm: add a menu tip as an example

* src/scm/report.scm: add menu names and menu tips to reports


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3947 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-04-12 06:08:09 +00:00
parent 818eaefc66
commit ab0db323e9
3 changed files with 27 additions and 7 deletions

View File

@@ -1,3 +1,9 @@
2001-04-11 Dave Peticolas <dave@krondo.com>
* src/scm/report/hello-world.scm: add a menu tip as an example
* src/scm/report.scm: add menu names and menu tips to reports
2001-04-11 Christian Stimming <stimming@tuhh.de>
* src/scm/report/average-balance.scm, category-barchart.scm,

View File

@@ -52,6 +52,8 @@
(if (gnc:report-in-menu? report)
(let ((title (string-append (_ "Report") ": " (_ name)))
(menu-path (gnc:report-menu-path report))
(menu-name (gnc:report-menu-name report))
(menu-tip (gnc:report-menu-tip report))
(item #f))
(if (not menu-path)
@@ -61,10 +63,16 @@
(set! menu-path (cons "_Reports" menu-path))
(if menu-name (set! name menu-name))
(if (not menu-tip)
(set! menu-tip
(sprintf #f (_ "Display the %s report") name)))
(set! item
(gnc:make-menu-item
((menu-namer 'add-name) name)
(sprintf #f (_ "Display the %s report") name)
menu-tip
menu-path
(lambda ()
(gnc:backtrace-if-exception
@@ -102,7 +110,8 @@
(make-record-type "<report-template>"
;; The data items in a report record
'(version name options-generator options-editor
renderer in-menu? menu-path)))
renderer in-menu? menu-path menu-name
menu-tip)))
(define (gnc:define-report . args)
;; For now the version is ignored, but in the future it'll let us
@@ -115,7 +124,7 @@
(define (blank-report)
;; Number of #f's == Number of data members
((record-constructor <report-template>)
#f #f #f gnc:default-options-editor #f #t #f))
#f #f #f gnc:default-options-editor #f #t #f #f #f))
(define (args-to-defn in-report-rec args)
(let ((report-rec (if in-report-rec
@@ -150,6 +159,10 @@
(record-accessor <report-template> 'in-menu?))
(define gnc:report-menu-path
(record-accessor <report-template> 'menu-path))
(define gnc:report-menu-name
(record-accessor <report-template> 'menu-name))
(define gnc:report-menu-tip
(record-accessor <report-template> 'menu-tip))
(define (gnc:report-template-new-options report-template)
(let ((generator (gnc:report-template-options-generator report-template))
@@ -457,5 +470,3 @@
#f)))))
(gnc:hook-add-dangler gnc:*main-window-opened-hook* gnc:report-menu-setup)

View File

@@ -465,10 +465,13 @@ new, totally cool report, consult the mailing list %s.")
;; for making its menu item in the main menu. You need to use the
;; untranslated value here!
'name (N_ "Hello, World")
;; A tip that is used to provide additional information about the
;; report to the user.
'menu-tip (N_ "A sample report with examples.")
;; The options generator function defined above.
'options-generator options-generator
;; The rendering function defined above.
'renderer hello-world-renderer))