gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Fri Apr 23 23:24:10 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/2e7fcad8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/66f22844 (commit)
	from  https://github.com/Gnucash/gnucash/commit/92dac828 (commit)



commit 2e7fcad833b93a359525de5170b9d47fea6d773b
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Apr 24 11:14:47 2021 +0800

    [balsheet-pnl] simplify code
    
    inline single-use functions

diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index beeac17d3..ac8cf75c9 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -134,40 +134,6 @@ also show overall period profit & loss."))
 (define networth-barchart-uuid "cbba1696c8c24744848062c7f1cf4a72")
 (define pnl-barchart-uuid "80769921e87943adade887b9835a7685")
 
-(define periodlist
-  (list
-   (list 'disabled
-         (cons 'text (G_ "Disabled")))
-
-   (list 'YearDelta
-         (cons 'text (G_ "Year")))
-
-   (list 'HalfYearDelta
-         (cons 'text (G_ "Half Year")))
-
-   (list 'QuarterDelta
-         (cons 'text (G_ "Quarter")))
-
-   (list 'MonthDelta
-         (cons 'text (G_ "Month")))
-
-   (list 'TwoWeekDelta
-         (cons 'text (G_ "2Week")))
-
-   (list 'WeekDelta
-         (cons 'text (G_ "Week")))))
-
-(define (keylist->vectorlist keylist)
-  (map
-   (lambda (item)
-     (vector
-      (car item)
-      (keylist-get-info keylist (car item) 'text)))
-   keylist))
-
-(define (keylist-get-info keylist key info)
-  (assq-ref (assq-ref keylist key) info))
-
 ;; options generator
 (define (multicol-report-options-generator report-type)
   (let* ((options (gnc:new-options))
@@ -184,7 +150,14 @@ also show overall period profit & loss."))
       gnc:pagename-general optname-period
       "c2" opthelp-period
       'disabled
-      (keylist->vectorlist periodlist)
+      (list
+       (vector 'disabled (G_ "Disabled"))
+       (vector 'YearDelta (G_ "Year"))
+       (vector 'HalfYearDelta (G_ "Half Year"))
+       (vector 'QuarterDelta (G_ "Quarter"))
+       (vector 'MonthDelta (G_ "Month"))
+       (vector 'TwoWeekDelta (G_ "2Week"))
+       (vector 'WeekDelta (G_ "Week")))
       #f
       (lambda (x)
         (let ((x (not (eq? x 'disabled))))

commit 66f228440b2468ce5be90e301d2ae178073eda29
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Apr 24 10:25:58 2021 +0800

    Remove more multichoice tooltips missed in #917

diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index 5ef82c9c0..beeac17d3 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -137,40 +137,32 @@ also show overall period profit & loss."))
 (define periodlist
   (list
    (list 'disabled
-         (cons 'text (G_ "Disabled"))
-         (cons 'tip (G_ "Disabled")))
+         (cons 'text (G_ "Disabled")))
 
    (list 'YearDelta
-         (cons 'text (G_ "Year"))
-         (cons 'tip (G_ "One Year.")))
+         (cons 'text (G_ "Year")))
 
    (list 'HalfYearDelta
-         (cons 'text (G_ "Half Year"))
-         (cons 'tip (G_ "Half Year.")))
+         (cons 'text (G_ "Half Year")))
 
    (list 'QuarterDelta
-         (cons 'text (G_ "Quarter"))
-         (cons 'tip (G_ "One Quarter.")))
+         (cons 'text (G_ "Quarter")))
 
    (list 'MonthDelta
-         (cons 'text (G_ "Month"))
-         (cons 'tip (G_ "One Month.")))
+         (cons 'text (G_ "Month")))
 
    (list 'TwoWeekDelta
-         (cons 'text (G_ "2Week"))
-         (cons 'tip (G_ "Two Weeks.")))
+         (cons 'text (G_ "2Week")))
 
    (list 'WeekDelta
-         (cons 'text (G_ "Week"))
-         (cons 'tip (G_ "One Week.")))))
+         (cons 'text (G_ "Week")))))
 
 (define (keylist->vectorlist keylist)
   (map
    (lambda (item)
      (vector
       (car item)
-      (keylist-get-info keylist (car item) 'text)
-      (keylist-get-info keylist (car item) 'tip)))
+      (keylist-get-info keylist (car item) 'text)))
    keylist))
 
 (define (keylist-get-info keylist key info)
diff --git a/gnucash/report/reports/standard/budget-barchart.scm b/gnucash/report/reports/standard/budget-barchart.scm
index 0b4917f6f..f371cadf1 100644
--- a/gnucash/report/reports/standard/budget-barchart.scm
+++ b/gnucash/report/reports/standard/budget-barchart.scm
@@ -62,24 +62,12 @@
   (N_ "Select exact period that ends the reporting range."))
 
 (define period-options
-  (list (vector 'first
-                (N_ "First")
-                (N_ "The first period of the budget"))
-        (vector 'previous
-                (N_ "Previous")
-                (N_ "Budget period was before current period, according to report evaluation date"))
-        (vector 'current
-                (N_ "Current")
-                (N_ "Current period, according to report evaluation date"))
-        (vector 'next
-                (N_ "Next")
-                (N_ "Next period, according to report evaluation date"))
-        (vector 'last
-                (N_ "Last")
-                (N_ "Last budget period"))
-        (vector 'manual
-                (N_ "Manual period selection")
-                (N_ "Explicitly select period value with spinner below"))))
+  (list (vector 'first (N_ "First budget period"))
+        (vector 'previous (N_ "Previous budget period"))
+        (vector 'current (N_ "Current budget period"))
+        (vector 'next (N_ "Next budget period"))
+        (vector 'last (N_ "Last budget period"))
+        (vector 'manual (N_ "Manual period selection"))))
 
 (define (options-generator)
   (let ((options (gnc:new-options))
diff --git a/gnucash/report/reports/standard/budget.scm b/gnucash/report/reports/standard/budget.scm
index a54d65f09..a960d50c7 100644
--- a/gnucash/report/reports/standard/budget.scm
+++ b/gnucash/report/reports/standard/budget.scm
@@ -108,24 +108,12 @@
           (lambda (new-option)
             (gnc:register-option options new-option)))
          (period-options
-          (list (vector 'first
-                        (N_ "First")
-                        (N_ "The first period of the budget"))
-                (vector 'previous
-                        (N_ "Previous")
-                        (N_ "Budget period was before current period, according to report evaluation date"))
-                (vector 'current
-                        (N_ "Current")
-                        (N_ "Current period, according to report evaluation date"))
-                (vector 'next
-                        (N_ "Next")
-                        (N_ "Next period, according to report evaluation date"))
-                (vector 'last
-                        (N_ "Last")
-                        (N_ "Last budget period"))
-                (vector 'manual
-                        (N_ "Manual period selection")
-                        (N_ "Explicitly select period value with spinner below"))))
+          (list (vector 'first (N_ "First budget period"))
+                (vector 'previous (N_ "Previous budget period"))
+                (vector 'current (N_ "Current budget period"))
+                (vector 'next (N_ "Next budget period"))
+                (vector 'last (N_ "Last budget period"))
+                (vector 'manual (N_ "Manual period selection"))))
          (ui-use-periods #f)
          (ui-start-period-type 'current)
          (ui-end-period-type 'next))



Summary of changes:
 gnucash/report/reports/standard/balsheet-pnl.scm   | 51 ++++------------------
 .../report/reports/standard/budget-barchart.scm    | 24 +++-------
 gnucash/report/reports/standard/budget.scm         | 24 +++-------
 3 files changed, 20 insertions(+), 79 deletions(-)



More information about the gnucash-changes mailing list