mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* report-gnome/report-gnome.scm -- Create sorted menu items
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7279 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
2002-10-06 Derek Atkins <derek@ihtfp.com>
|
2002-10-06 Derek Atkins <derek@ihtfp.com>
|
||||||
* Rename a bunch of reports as per Chris Lyttle's suggestions
|
* Rename a bunch of reports as per Chris Lyttle's suggestions
|
||||||
|
|
||||||
|
* report-gnome/report-gnome.scm -- Create sorted menu items
|
||||||
|
|
||||||
2002-10-06 David Hampton <hampton@employees.org>
|
2002-10-06 David Hampton <hampton@employees.org>
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,12 @@
|
|||||||
|
|
||||||
(define (gnc:add-report-template-menu-items)
|
(define (gnc:add-report-template-menu-items)
|
||||||
(define menu-namer (gnc:new-menu-namer))
|
(define menu-namer (gnc:new-menu-namer))
|
||||||
|
(define *template-items* '())
|
||||||
|
|
||||||
(define (add-template-menu-item name template)
|
(define (add-template-menu-item name template)
|
||||||
(if (gnc:report-template-in-menu? template)
|
(if (gnc:report-template-in-menu? template)
|
||||||
(let ((title (string-append (_ "Report") ": " (_ name)))
|
(let ((title (string-append (_ "Report") ": " (_ name)))
|
||||||
(menu-path (gnc:report-template-menu-path template))
|
(menu-path (gnc:report-template-menu-path template))
|
||||||
(menu-name (gnc:report-template-menu-name template))
|
|
||||||
(menu-tip (gnc:report-template-menu-tip template))
|
(menu-tip (gnc:report-template-menu-tip template))
|
||||||
(item #f))
|
(item #f))
|
||||||
|
|
||||||
@@ -58,8 +58,6 @@
|
|||||||
|
|
||||||
(set! menu-path (append (list gnc:window-name-main gnc:menuname-reports) menu-path))
|
(set! menu-path (append (list gnc:window-name-main gnc:menuname-reports) menu-path))
|
||||||
|
|
||||||
(if menu-name (set! name menu-name))
|
|
||||||
|
|
||||||
(if (not menu-tip)
|
(if (not menu-tip)
|
||||||
(set! menu-tip
|
(set! menu-tip
|
||||||
(sprintf #f (_ "Display the %s report") (_ name))))
|
(sprintf #f (_ "Display the %s report") (_ name))))
|
||||||
@@ -75,7 +73,20 @@
|
|||||||
(gnc:main-window-open-report report #f)))))
|
(gnc:main-window-open-report report #f)))))
|
||||||
(gnc:add-extension item))))
|
(gnc:add-extension item))))
|
||||||
|
|
||||||
(gnc:report-templates-for-each add-template-menu-item))
|
(define (add-template name template)
|
||||||
|
(let ((menu-name (gnc:report-template-menu-name template)))
|
||||||
|
(if menu-name (set! name menu-name))
|
||||||
|
(set! *template-items* (cons (cons name template) *template-items*))))
|
||||||
|
|
||||||
|
(define (sort-templates a b)
|
||||||
|
(string>? (car a) (car b)))
|
||||||
|
|
||||||
|
(gnc:report-templates-for-each add-template)
|
||||||
|
(for-each
|
||||||
|
(lambda (item)
|
||||||
|
(add-template-menu-item (car item) (cdr item)))
|
||||||
|
(sort *template-items* sort-templates)))
|
||||||
|
|
||||||
|
|
||||||
(define (gnc:report-menu-setup)
|
(define (gnc:report-menu-setup)
|
||||||
;; since this menu gets added to every child window, we say it
|
;; since this menu gets added to every child window, we say it
|
||||||
|
|||||||
Reference in New Issue
Block a user