REFACTOR: combine 2 key-choice-list into 1

Previously key-choice-list was selected from 2 lists depending
on use-split-action setting. This commit combines to 1 list
with suitable (if) clause in the middle.
This commit is contained in:
Christopher Lam 2017-12-22 17:40:11 +08:00
parent ee01038ee5
commit 02905fe38f

View File

@ -587,108 +587,62 @@ tags within description, notes or memo. ")
(vector 'both (N_ "Both") (N_ "Show both (and include void transactions in totals)."))))) (vector 'both (N_ "Both") (N_ "Show both (and include void transactions in totals).")))))
;; Sorting options ;; Sorting options
(let ((key-choice-list
(if (qof-book-use-split-action-for-num-field (gnc-get-current-book))
(list (vector 'none
(N_ "None")
(N_ "Do not sort."))
(vector 'account-name
(N_ "Account Name")
(N_ "Sort & subtotal by account name."))
(vector 'account-code
(N_ "Account Code")
(N_ "Sort & subtotal by account code."))
(vector 'date
(N_ "Date")
(N_ "Sort by date."))
(vector 'reconciled-date
(N_ "Reconciled Date")
(N_ "Sort by the Reconciled Date."))
(vector 'register-order
(N_ "Register Order")
(N_ "Sort as in the register."))
(vector 'corresponding-acc-name
(N_ "Other Account Name")
(N_ "Sort by account transferred from/to's name."))
(vector 'corresponding-acc-code
(N_ "Other Account Code")
(N_ "Sort by account transferred from/to's code."))
(vector 'amount
(N_ "Amount")
(N_ "Sort by amount."))
(vector 'description
(N_ "Description")
(N_ "Sort by description."))
(vector 'number
(N_ "Number/Action")
(N_ "Sort by check number/action."))
(vector 't-number (let ((key-choice-list
(N_ "Transaction Number") (append
(N_ "Sort by transaction number.")) (list (vector 'none
(N_ "None")
(N_ "Do not sort."))
(vector 'memo (vector 'account-name
(N_ "Memo") (N_ "Account Name")
(N_ "Sort by memo."))) (N_ "Sort & subtotal by account name."))
(list (vector 'none (vector 'account-code
(N_ "None") (N_ "Account Code")
(N_ "Do not sort.")) (N_ "Sort & subtotal by account code."))
(vector 'account-name (vector 'date
(N_ "Account Name") (N_ "Date")
(N_ "Sort & subtotal by account name.")) (N_ "Sort by date."))
(vector 'account-code (vector 'reconciled-date
(N_ "Account Code") (N_ "Reconciled Date")
(N_ "Sort & subtotal by account code.")) (N_ "Sort by the Reconciled Date."))
(vector 'date (vector 'register-order
(N_ "Date") (N_ "Register Order")
(N_ "Sort by date.")) (N_ "Sort as in the register."))
(vector 'reconciled-date (vector 'corresponding-acc-name
(N_ "Reconciled Date") (N_ "Other Account Name")
(N_ "Sort by the Reconciled Date.")) (N_ "Sort by account transferred from/to's name."))
(vector 'register-order (vector 'corresponding-acc-code
(N_ "Register Order") (N_ "Other Account Code")
(N_ "Sort as in the register.")) (N_ "Sort by account transferred from/to's code."))
(vector 'corresponding-acc-name (vector 'amount
(N_ "Other Account Name") (N_ "Amount")
(N_ "Sort by account transferred from/to's name.")) (N_ "Sort by amount."))
(vector 'corresponding-acc-code (vector 'description
(N_ "Other Account Code") (N_ "Description")
(N_ "Sort by account transferred from/to's code.")) (N_ "Sort by description."))
(vector 'amount (vector 'number
(N_ "Amount") (N_ "Number/Action")
(N_ "Sort by amount.")) (N_ "Sort by check number/action.")))
(if (qof-book-use-split-action-for-num-field (gnc-get-current-book))
(vector 'description (list
(N_ "Description") (vector 't-number
(N_ "Sort by description.")) (N_ "Transaction Number")
(N_ "Sort by transaction number.")))
(vector 'number '())
(N_ "Number") (list
(N_ "Sort by check/transaction number.")) (vector 'memo
(N_ "Memo")
(vector 'memo (N_ "Sort by memo.")))))
(N_ "Memo")
(N_ "Sort by memo.")))))
(ascending-choice-list (ascending-choice-list
(list (list