From 67dab6b320f8c93665b97bda9f9d00c5002c26bc Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 18 Jul 2021 14:13:29 -0700 Subject: [PATCH] Remove business-options.scm and business-prefs.scm. Their functions have been reimplemented elsewhere. --- libgnucash/app-utils/CMakeLists.txt | 31 +- libgnucash/app-utils/app-utils.scm | 1 - libgnucash/app-utils/business-options.scm | 386 ---------------------- libgnucash/app-utils/business-prefs.scm | 199 ----------- libgnucash/app-utils/gnc-optiondb.i | 44 ++- po/POTFILES.in | 2 - 6 files changed, 32 insertions(+), 631 deletions(-) delete mode 100644 libgnucash/app-utils/business-options.scm delete mode 100644 libgnucash/app-utils/business-prefs.scm diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt index 573c93db4c..68379509be 100644 --- a/libgnucash/app-utils/CMakeLists.txt +++ b/libgnucash/app-utils/CMakeLists.txt @@ -42,10 +42,11 @@ set (app_utils_HEADERS # Command to generate the swig-app-utils-guile.c wrapper file set(SWIG_ARGS "-c++" "-procdoc" "sw-gnc-option-doc" "-procdocformat" "plain") -gnc_add_swig_guile_command (swig-apputils-guile-cpp - SWIG_APP_UTILS_GUILE_CPP swig-app-utils-guile.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i - ${CMAKE_CURRENT_SOURCE_DIR}/gnc-optiondb.i "" +gnc_add_swig_guile_command (swig-apputils-guile-cpp #target + SWIG_APP_UTILS_GUILE_CPP swig-app-utils-guile.cpp #outvar, output + ${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i #input + "${CMAKE_SOURCE_DIR}/bindings;${CMAKE_SOURCE_DIR}/bindings/guile" #includes + ${CMAKE_CURRENT_SOURCE_DIR}/gnc-optiondb.i #additional dependencies ) unset(SWIG_ARGS) @@ -188,14 +189,6 @@ set (app_utils_SCHEME_1a options.scm ) -set (app_utils_SCHEME_1b - business-options.scm -) - -set (app_utils_SCHEME_1c - business-prefs.scm -) - set (app_utils_SCHEME_2 app-utils.scm ) @@ -217,22 +210,10 @@ gnc_add_scheme_targets(scm-app-utils-1a DEPENDS "scm-app-utils-1" MAKE_LINKS) -gnc_add_scheme_targets(scm-app-utils-1b - SOURCES "${app_utils_SCHEME_1b}" - OUTPUT_DIR "gnucash/app-utils" - DEPENDS "scm-app-utils-1a" - MAKE_LINKS) - -gnc_add_scheme_targets(scm-bus-prefs - SOURCES "${app_utils_SCHEME_1c}" - OUTPUT_DIR "gnucash/app-utils" - DEPENDS "scm-app-utils-1b" - MAKE_LINKS) - gnc_add_scheme_targets(scm-app-utils-2 SOURCES "${app_utils_SCHEME_2}" OUTPUT_DIR "gnucash" - DEPENDS "scm-bus-prefs" + DEPENDS "scm-app-utils-1a" MAKE_LINKS) add_custom_target(scm-app-utils ALL DEPENDS scm-app-utils-2 scm-app-utils-1) diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm index d0ed9635fc..be5c5d9db7 100644 --- a/libgnucash/app-utils/app-utils.scm +++ b/libgnucash/app-utils/app-utils.scm @@ -28,7 +28,6 @@ (load-and-reexport (sw_app_utils) (gnucash app-utils date-utilities) - (gnucash app-utils business-options) (gnucash app-utils options) (gnucash app-utils c-interface)) ;; gw-engine-spec.scm diff --git a/libgnucash/app-utils/business-options.scm b/libgnucash/app-utils/business-options.scm deleted file mode 100644 index 96a4e4087e..0000000000 --- a/libgnucash/app-utils/business-options.scm +++ /dev/null @@ -1,386 +0,0 @@ -;; Scheme code for supporting options for the business modules -;; -;; Created by: Derek Atkins -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 of -;; the License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, contact: -;; -;; Free Software Foundation Voice: +1-617-542-5942 -;; 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 -;; Boston, MA 02110-1301, USA gnu@gnu.org - - -;; Internally, values are always a guid. Externally, both guids and -;; invoice pointers may be used to set the value of the option. The -;; option always returns a single invoice pointer. - -(define-module (gnucash app-utils business-options)) - -(eval-when (compile load eval expand) - (load-extension "libgnc-app-utils" "scm_init_sw_app_utils_module")) - -(use-modules (gnucash core-utils)) -(use-modules (gnucash engine)) -(use-modules (gnucash utilities)) -(use-modules (gnucash app-utils options)) -(use-modules (sw_app_utils)) - -(export gnc:*business-label*) -(export gnc:*company-name*) -(export gnc:*company-addy*) -(export gnc:*company-id*) -(export gnc:*company-phone*) -(export gnc:*company-fax*) -(export gnc:*company-url*) -(export gnc:*company-email*) -(export gnc:*company-contact*) -(export gnc:*fancy-date-label*) -(export gnc:*fancy-date-format*) -(export gnc:*tax-label*) -(export gnc:*tax-nr-label*) -(export gnc:company-info) -(export gnc:fancy-date-info) -(export gnc:*option-section-budgeting*) -(export gnc:*option-name-auto-readonly-days*) -(export gnc:*option-name-num-field-source*) -(export gnc:*kvp-option-path*) -(export gnc:options-fancy-date) -(export gnc:*option-name-default-budget*) - -(define gnc:*kvp-option-path* (list KVP-OPTION-PATH)) -(define gnc:*option-name-auto-readonly-days* OPTION-NAME-AUTO-READONLY-DAYS) -(define gnc:*option-name-num-field-source* OPTION-NAME-NUM-FIELD-SOURCE) - -(define gnc:*option-section-budgeting* OPTION-SECTION-BUDGETING) -(define gnc:*option-name-default-budget* OPTION-NAME-DEFAULT-BUDGET) - -(define gnc:*business-label* (N_ "Business")) -(define gnc:*company-name* (N_ "Company Name")) -(define gnc:*company-addy* (N_ "Company Address")) -(define gnc:*company-id* (N_ "Company ID")) -(define gnc:*company-phone* (N_ "Company Phone Number")) -(define gnc:*company-fax* (N_ "Company Fax Number")) -(define gnc:*company-url* (N_ "Company Website URL")) -(define gnc:*company-email* (N_ "Company Email Address")) -(define gnc:*company-contact* (N_ "Company Contact Person")) -(define gnc:*fancy-date-label* (N_ "Fancy Date Format")) -(define gnc:*fancy-date-format* (N_ "custom")) -(define gnc:*tax-label* (N_ "Tax")) -(define gnc:*tax-nr-label* (N_ "Tax Number")) - - -(define (gnc:options-fancy-date book) - (let ((date-format (gnc:fancy-date-info book gnc:*fancy-date-format*))) - (if (boolean? date-format) ;; date-format does not exist - (qof-date-format-get-string (qof-date-format-get)) - date-format))) - -(define (gnc:company-info book key) - ;; Access company info from key-value pairs for current book - (gnc:option-get-value book gnc:*business-label* key)) - -(define (gnc:fancy-date-info book key) - ;; Access fancy date info from key-value pairs for current book - (gnc:option-get-value book gnc:*business-label* (list gnc:*fancy-date-label* key))) - -(define (gnc:make-invoice-option - section - name - sort-tag - documentation-string - default-getter - value-validator) - - (define (convert-to-guid item) - (if (string? item) - item - (gncInvoiceReturnGUID item))) - - (define (convert-to-invoice item) - (if (string? item) - (gncInvoiceLookupFlip item (gnc-get-current-book)) - item)) - - (let* ((option (convert-to-guid (default-getter))) - (option-set #f) - (getter (lambda () (convert-to-invoice - (if option-set - option - (default-getter))))) - (value->string (lambda () - (string-append - "'" (gnc:value->string (if option-set option #f))))) - (validator - (if (not value-validator) - (lambda (invoice) (list #t invoice)) - (lambda (invoice) - (value-validator (convert-to-invoice invoice)))))) - (gnc:make-option - section name sort-tag 'invoice documentation-string getter - (lambda (invoice) ;; setter - (if (null? invoice) (set! invoice (default-getter))) - (set! invoice (convert-to-invoice invoice)) - (let* ((result (validator invoice)) - (valid (car result)) - (value (cadr result))) - (if valid - (begin - (set! option (convert-to-guid value)) - (set! option-set #t)) - (gnc:error "Illegal invoice value set")))) - (lambda () (convert-to-invoice (default-getter))) - (gnc:restore-form-generator value->string) - (lambda (b p) (qof-book-set-option b option p)) - (lambda (b p) - (let ((v (qof-book-get-option b p))) - (if (and v (string? v)) - (begin - (set! option v) - (set! option-set #t))))) - validator - #f #f #f #f))) - -;; Internally, values are always a guid. Externally, both guids and -;; customer pointers may be used to set the value of the option. The -;; option always returns a single customer pointer. -(define (gnc:make-owner-option - section - name - sort-tag - documentation-string - default-getter - value-validator - owner-type) - - (let ((option-value (gncOwnerNew))) - - (define (convert-to-pair item) - (if (pair? item) - item - (cons (gncOwnerGetType item) - (gncOwnerReturnGUID item)))) - - (define (convert-to-owner pair) - (if (pair? pair) - (let ((type (car pair))) - (cond - ((eqv? type GNC-OWNER-CUSTOMER) - (gncOwnerInitCustomer - option-value - (gncCustomerLookupFlip (cdr pair) (gnc-get-current-book))) - option-value) - - ((eqv? type GNC-OWNER-VENDOR) - (gncOwnerInitVendor - option-value - (gncVendorLookupFlip (cdr pair) (gnc-get-current-book))) - option-value) - - ((eqv? type GNC-OWNER-EMPLOYEE) - (gncOwnerInitEmployee - option-value - (gncEmployeeLookupFlip (cdr pair) (gnc-get-current-book))) - option-value) - - ((eqv? type GNC-OWNER-JOB) - (gncOwnerInitJob - option-value - (gncJobLookupFlip (cdr pair) (gnc-get-current-book))) - option-value) - - (else '()))) - pair)) - - (let* ((option (convert-to-pair (default-getter))) - (option-set #f) - (getter (lambda () (convert-to-owner - (if option-set - option - (default-getter))))) - (value->string (lambda () - (string-append - "'" (gnc:value->string - (if option-set option #f))))) - (validator - (if (not value-validator) - (lambda (owner) - (let ((type (if (pair? owner) - (car owner) - (gncOwnerGetType owner)))) - (if (equal? type owner-type) - (list #t owner) - (list #f "Owner-Type Mismatch")))) - (lambda (owner) - (value-validator (convert-to-owner owner)))))) - - (gnc:make-option - section name sort-tag 'owner documentation-string getter - (lambda (owner) - (if (null? owner) (set! owner (default-getter))) - (set! owner (convert-to-owner owner)) - (let* ((result (validator owner)) - (valid (car result)) - (value (cadr result))) - (if valid - (begin - (set! option (convert-to-pair value)) - (set! option-set #t)) - (gnc:error "Illegal owner value set")))) - (lambda () (convert-to-owner (default-getter))) - (gnc:restore-form-generator value->string) - (lambda (b p) - (qof-book-set-option b (symbol->string (car option)) - (append p '("type"))) - (qof-book-set-option b (cdr option) - (append p '("value")))) - (lambda (b p) - (let ((t (qof-book-get-option b (append p '("type")))) - (v (qof-book-get-option b (append p '("value"))))) - (if (and t v (string? t) (string? v)) - (begin - (set! option (cons (string->symbol t) v)) - (set! option-set #t))))) - validator - owner-type #f #f #f)))) - - -;; Internally, values are always a guid. Externally, both guids and -;; taxtable pointers may be used to set the value of the option. The -;; option always returns a single taxtable pointer. - -(define (gnc:make-taxtable-option - section - name - sort-tag - documentation-string - default-getter - value-validator) - - (define (convert-to-guid item) - (if (string? item) - item - (gncTaxTableReturnGUID item))) - - (define (convert-to-taxtable item) - (if (string? item) - (gncTaxTableLookupFlip item (gnc-get-current-book)) - item)) - - (let* ((option (convert-to-guid (default-getter))) - (option-set #f) - (getter (lambda () (convert-to-taxtable - (if option-set - option - (default-getter))))) - (value->string (lambda () - (string-append - "'" (gnc:value->string (if option-set option #f))))) - (validator - (if (not value-validator) - (lambda (taxtable) (list #t taxtable)) - (lambda (taxtable) - (value-validator (convert-to-taxtable taxtable)))))) - (gnc:make-option - section name sort-tag 'taxtable documentation-string getter - (lambda (taxtable) - (if (null? taxtable) (set! taxtable (default-getter))) - (set! taxtable (convert-to-taxtable taxtable)) - (let* ((result (validator taxtable)) - (valid (car result)) - (value (cadr result))) - (if valid - (begin - (set! option (convert-to-guid value)) - (set! option-set #t)) - (gnc:error "Illegal taxtable value set")))) - (lambda () (convert-to-taxtable (default-getter))) - (gnc:restore-form-generator value->string) - (lambda (b p) (qof-book-set-option b option p)) - (lambda (b p) - (let ((v (qof-book-get-option b p))) - (if (and v (string? v)) - (begin - (set! option v) - (set! option-set #t))))) - validator - #f #f #f #f))) - -;; This defines an option to set a counter value. This is a slightly -;; different kind of option: Unlike all other options, the values edited -;; by this option are not saved in the "options"/
kvm slot, but -;; in the "counters" slot. This is mostly due to backwards compatibility -;; and partly because counters are a bit different from other options -;; anyway. -;; -;; This is implemented by overriding the scm->kvp and kvp->scm methods -;; to ignore the kvp path passed and replace it with a hardcoded -;; "counters". -(define (gnc:make-counter-option - section - name - key - sort-tag - documentation-string - default-value) - (let ((option (gnc:make-number-range-option - section name sort-tag documentation-string - default-value 0 999999999 0 1))) - (gnc:set-option-scm->kvp - option - (lambda (b p) - (qof-book-set-option - b (inexact->exact ((gnc:option-getter option))) - (list "counters" key)))) - (gnc:set-option-kvp->scm - option - (lambda (b p) - (let ((v (qof-book-get-option b (list "counters" key)))) - (if (and v (integer? v)) - ((gnc:option-setter option) v))))) - option)) - -;; This defines an option to set a counter format, which has the same -;; exception as gnc:make-counter-option above. -;; Note this function uses a hack to make sure there never is a default value -;; (default-value is set to #f and value subsequently set to whatever was passed as default-value) -;; This hack was introduced to fix https://bugs.gnucash.org/show_bug.cgi?id=687504 -(define (gnc:make-counter-format-option - section - name - key - sort-tag - documentation-string - default-value) - (let ((option (gnc:make-string-option - section name sort-tag documentation-string #f))) - (gnc:option-set-value option default-value) - (gnc:set-option-scm->kvp - option - (lambda (b p) - (let ((value ((gnc:option-getter option))) - (path (string-concatenate (list "counter_formats/" key)))) - (qof-book-set-string-option b path value)))) - (gnc:set-option-kvp->scm - option - (lambda (b p) - (let* ((path (string-concatenate (list "counter_formats/" key))) - (v (qof-book-get-string-option b path))) - (if (and v (string? v)) - ((gnc:option-setter option) v))))) - option)) - -(export gnc:make-invoice-option) -(export gnc:make-owner-option) -(export gnc:make-taxtable-option) -(export gnc:make-counter-option) -(export gnc:make-counter-format-option) diff --git a/libgnucash/app-utils/business-prefs.scm b/libgnucash/app-utils/business-prefs.scm deleted file mode 100644 index 84fc701fd1..0000000000 --- a/libgnucash/app-utils/business-prefs.scm +++ /dev/null @@ -1,199 +0,0 @@ -;; Business Preferences -;; -;; Created by: Derek Atkins -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 of -;; the License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, contact: -;; -;; Free Software Foundation Voice: +1-617-542-5942 -;; 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 -;; Boston, MA 02110-1301, USA gnu@gnu.org - -(define-module (gnucash app-utils business-prefs)) - -(eval-when (compile load eval expand) - (load-extension "libgnc-app-utils" "scm_init_sw_app_utils_module")) - -(use-modules (sw_app_utils)) -(use-modules (gnucash core-utils)) -(use-modules (gnucash engine)) -(use-modules (gnucash app-utils options)) -(use-modules (gnucash app-utils business-options)) - -(define gnc:*option-section-counters* (N_ "Counters")) - -;; This defines all available counter types to show options for. This a -;; list that contains a sublist for each counter type, containing: The -;; (untranslated) counter name, the format label, the previous number -;; label, the format help text and the previous number help text. -(define counter-types - (list (list "gncCustomer" (N_ "Customer number format") - (N_ "Customer number") - (N_ "The format string to use for generating customer numbers. This is a printf-style format string.") - (N_ "The previous customer number generated. This number will be incremented to generate the next customer number.")) - (list "gncEmployee" (N_ "Employee number format") - (N_ "Employee number") - (N_ "The format string to use for generating employee numbers. This is a printf-style format string.") - (N_ "The previous employee number generated. This number will be incremented to generate the next employee number.")) - (list "gncInvoice" (N_ "Invoice number format") - (N_ "Invoice number") - (N_ "The format string to use for generating invoice numbers. This is a printf-style format string.") - (N_ "The previous invoice number generated. This number will be incremented to generate the next invoice number.")) - (list "gncBill" (N_ "Bill number format") - (N_ "Bill number") - (N_ "The format string to use for generating bill numbers. This is a printf-style format string.") - (N_ "The previous bill number generated. This number will be incremented to generate the next bill number.")) - (list "gncExpVoucher" (N_ "Expense voucher number format") - (N_ "Expense voucher number") - (N_ "The format string to use for generating expense voucher numbers. This is a printf-style format string.") - (N_ "The previous expense voucher number generated. This number will be incremented to generate the next voucher number.")) - (list "gncJob" (N_ "Job number format") - (N_ "Job number") - (N_ "The format string to use for generating job numbers. This is a printf-style format string.") - (N_ "The previous job number generated. This number will be incremented to generate the next job number.")) - (list "gncOrder" (N_ "Order number format") - (N_ "Order number") - (N_ "The format string to use for generating order numbers. This is a printf-style format string.") - (N_ "The previous order number generated. This number will be incremented to generate the next order number.")) - (list "gncVendor" (N_ "Vendor number format") - (N_ "Vendor number") - (N_ "The format string to use for generating vendor numbers. This is a printf-style format string.") - (N_ "The previous vendor number generated. This number will be incremented to generate the next vendor number.")) -)) - -(define (book-options-generator options) - (define (reg-option new-option) - (gnc:register-option options new-option)) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-name* - "a" (N_ "The name of your business.") "")) - - (reg-option - (gnc:make-text-option - gnc:*business-label* gnc:*company-addy* - "b1" (N_ "The address of your business.") "")) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-contact* - "b2" (N_ "The contact person to print on invoices.") "")) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-phone* - "c1" (N_ "The phone number of your business.") "")) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-fax* - "c2" (N_ "The fax number of your business.") "")) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-email* - "c3" (N_ "The email address of your business.") "")) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-url* - "c4" (N_ "The URL address of your website.") "")) - - (reg-option - (gnc:make-string-option - gnc:*business-label* gnc:*company-id* - "c5" (N_ "The ID for your company (eg 'Tax-ID: 00-000000).") - "")) - - (reg-option - (gnc:make-taxtable-option - gnc:*business-label* (N_ "Default Customer TaxTable") - "e" (N_ "The default tax table to apply to customers.") - (lambda () '()) #f)) - - (reg-option - (gnc:make-taxtable-option - gnc:*business-label* (N_ "Default Vendor TaxTable") - "f" (N_ "The default tax table to apply to vendors.") - (lambda () '()) #f)) - - (reg-option - (gnc:make-dateformat-option - gnc:*business-label* gnc:*fancy-date-label* - "g" (N_ "The default date format used for fancy printed dates.") - #f)) - - ;; Accounts tab - - (reg-option - (gnc:make-number-range-option - gnc:*option-section-accounts* gnc:*option-name-auto-readonly-days* - "a" (N_ "Choose the number of days after which transactions will be read-only and cannot be edited anymore. This threshold is marked by a red line in the account register windows. If zero, all transactions can be edited and none are read-only.") - 0 ;; default - 0 ;; lower bound - 3650 ;; upper bound - 0 ;; number of decimals - 1 ;; step size - )) - - (reg-option - (gnc:make-simple-boolean-option - gnc:*option-section-accounts* gnc:*option-name-num-field-source* - "b" (N_ "Check to have split action field used in registers for 'Num' field in place of transaction number; transaction number shown as 'T-Num' on second line of register. Has corresponding effect on business features, reporting and imports/exports.") - #f)) - - (reg-option - (gnc:make-simple-boolean-option - gnc:*option-section-accounts* gnc:*option-name-trading-accounts* - "a" (N_ "Check to have trading accounts used for transactions involving more than one currency or commodity.") - #f)) - - ;; Budgeting Tab - - (reg-option - (gnc:make-budget-option - gnc:*option-section-budgeting* gnc:*option-name-default-budget* - "a" (N_ "Budget to be used when none has been otherwise specified."))) - - ;; Tax Tab - (reg-option - (gnc:make-string-option - gnc:*tax-label* gnc:*tax-nr-label* - "a" (N_ "The electronic tax number of your business") "")) - - ;; Counters Tab - (for-each - (lambda (vals) - ;; Unpack the list of strings for this counter type - (let* ((key (car vals)) - (format-label (cadr vals)) - (number-label (caddr vals)) - (format-description (cadddr vals)) - (number-description (cadddr (cdr vals)))) - ;; For each counter-type we create an option for the last used - ;; number and the format string to use. - (reg-option - (gnc:make-counter-option - gnc:*option-section-counters* number-label key - (string-append key "a") number-description 0)) - - (reg-option - (gnc:make-counter-format-option - gnc:*option-section-counters* format-label key - (string-append key "b") format-description "")))) - ;; Make counter and format option for each defined counter - counter-types)) - - -;;(gnc-register-kvp-option-generator QOF-ID-BOOK-SCM book-options-generator) diff --git a/libgnucash/app-utils/gnc-optiondb.i b/libgnucash/app-utils/gnc-optiondb.i index b22fd050c4..9fbfa90834 100644 --- a/libgnucash/app-utils/gnc-optiondb.i +++ b/libgnucash/app-utils/gnc-optiondb.i @@ -41,7 +41,6 @@ namespace std { %typemap(in) std::size_t "$1 = scm_to_ulong($input);"; %typemap(out) std::size_t "$result = scm_from_ulong($1);"; - //%module sw_gnc_optiondb %{ #include "gnc-optiondb.h" #include "gnc-optiondb.hpp" @@ -53,6 +52,13 @@ SCM scm_init_sw_gnc_optiondb_module(void); %include %import +%import (module="sw_engine") +%import (module="sw_engine") +%import (module="sw_engine") +%import (module="sw_engine") +%import (module="sw_engine") +%import (module="sw_engine") +%import (module="sw_engine") /* Implementation Note: Plain overloads failed to compile because * auto value{option.get_value()}; @@ -133,18 +139,6 @@ scm_from_value(SCM value) return value; } -template <> inline SCM -scm_from_value(QofQuery* value) -{ - return SCM_BOOL_F; -} - -template <> inline SCM -scm_from_value(QofInstance* value) -{ - return SCM_BOOL_F; -} - template <> inline SCM scm_from_value(std::string value) { @@ -188,11 +182,11 @@ scm_from_value(const QofInstance* value) else if (GNC_IS_ACCOUNT(value)) type = SWIGTYPE_p_Account; else if (GNC_IS_BUDGET(value)) - type = SWIGTYPE_p_GncBudget; + type = SWIGTYPE_p_budget_s; else if (GNC_IS_INVOICE(value)) - type = SWIGTYPE_p_GncInvoice; + type = SWIGTYPE_p__gncInvoice; else if (GNC_IS_TAXTABLE(value)) - type = SWIGTYPE_p_GncTaxTable; + type = SWIGTYPE_p__gncTaxTable; else if (GNC_IS_CUSTOMER(value)) type = SWIGTYPE_p__gncCustomer; else if (GNC_IS_EMPLOYEE(value)) @@ -215,6 +209,18 @@ scm_from_value(const QofQuery* value) return SWIG_NewPointerObj(ptr, SWIGTYPE_p__QofQuery, FALSE); } +template <> inline SCM +scm_from_value(QofQuery* value) +{ + return scm_from_value(value); +} + +template <> inline SCM +scm_from_value(QofInstance* value) +{ + return scm_from_value(value); +} + template inline ValueType scm_to_value(SCM new_value) { @@ -261,11 +267,13 @@ scm_to_value(SCM new_value) { if (new_value == SCM_BOOL_F) return nullptr; + + auto info = SWIG_PointerType(new_value); static const std::array types{ SWIGTYPE_p_QofInstance_s, SWIGTYPE_p_gnc_commodity, - SWIGTYPE_p_GncBudget, SWIGTYPE_p_GncInvoice, - SWIGTYPE_p_GncTaxTable, SWIGTYPE_p_Account, + SWIGTYPE_p_budget_s, SWIGTYPE_p__gncInvoice, + SWIGTYPE_p__gncTaxTable, SWIGTYPE_p_Account, SWIGTYPE_p__gncCustomer, SWIGTYPE_p__gncEmployee, SWIGTYPE_p__gncJob, SWIGTYPE_p__gncVendor }; diff --git a/po/POTFILES.in b/po/POTFILES.in index 75b34e8e68..cdd4db4e49 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -509,8 +509,6 @@ gnucash/report/stylesheets/head-or-tail.scm gnucash/report/stylesheets/plain.scm gnucash/report/trep-engine.scm libgnucash/app-utils/app-utils.scm -libgnucash/app-utils/business-options.scm -libgnucash/app-utils/business-prefs.scm libgnucash/app-utils/calculation/expression_parser.c libgnucash/app-utils/calculation/fin.c libgnucash/app-utils/c-interface.scm