Remove the function gnc_option_permissible_value_description

Remove function and scheme using this function which deals with
individual tool tips on multi-choice options.
This commit is contained in:
Robert Fewell 2021-04-12 11:30:49 +01:00
parent 00bde6a32c
commit 02a6a0ae4a
3 changed files with 7 additions and 51 deletions

View File

@ -95,7 +95,6 @@ struct _Getters
SCM value_validator;
SCM option_data;
SCM index_to_name;
SCM index_to_description;
SCM index_to_value;
SCM value_to_index;
SCM number_of_indices;
@ -552,8 +551,6 @@ initialize_getters(void)
scm_c_eval_string ("gnc:option-value-validator");
getters.option_data = scm_c_eval_string ("gnc:option-data");
getters.index_to_name = scm_c_eval_string ("gnc:option-index-get-name");
getters.index_to_description =
scm_c_eval_string ("gnc:option-index-get-description");
getters.number_of_indices = scm_c_eval_string ("gnc:option-number-of-indices");
getters.index_to_value = scm_c_eval_string ("gnc:option-index-get-value");
getters.value_to_index = scm_c_eval_string ("gnc:option-value-get-index");
@ -915,36 +912,6 @@ gnc_option_permissible_value_name (GNCOption *option, int index)
return gnc_scm_to_utf8_string (name);
}
/********************************************************************\
* gnc_option_permissible_value_description *
* returns the malloc'd description of the indexth permissible *
* value in the option, or NULL if the index was out of range or *
* there are no values available. *
* *
* Args: option - the GNCOption *
* index - the index of the permissible value *
* Returns: malloc'd description of permissible value or NULL *
\********************************************************************/
char *
gnc_option_permissible_value_description (GNCOption *option, int index)
{
SCM help;
if (index < 0)
return NULL;
initialize_getters ();
help = scm_call_2 (getters.index_to_description, option->guile_option,
scm_from_int (index));
if (help == SCM_UNDEFINED)
return NULL;
if (!scm_is_string (help))
return NULL;
return gnc_scm_to_utf8_string (help);
}
/********************************************************************\
* gnc_option_show_time *
* returns true if the gui should display the time as well as *

View File

@ -107,7 +107,6 @@ int gnc_option_num_permissible_values (GNCOption *option);
int gnc_option_permissible_value_index (GNCOption *option, SCM value);
SCM gnc_option_permissible_value (GNCOption *option, int index);
char * gnc_option_permissible_value_name (GNCOption *option, int index);
char * gnc_option_permissible_value_description (GNCOption *option, int index);
gboolean gnc_option_show_time (GNCOption *option);

View File

@ -89,7 +89,6 @@
(export gnc:option-generate-restore-form)
(export gnc:option-get-value)
(export gnc:option-getter)
(export gnc:option-index-get-description)
(export gnc:option-index-get-name)
(export gnc:option-index-get-value)
(export gnc:option-kvp->scm)
@ -204,8 +203,7 @@ the option '~a'."))
;; Function 3: taking one argument, a non-negative integer,
;; that returns the string matching the nth choice
;;
;; Function 4: takes one argument and returns the description
;; containing the nth choice
;; Function 4: #f, this was the individual tool tip and not used now
;;
;; Function 5: giving a possible value and returning the index
;; if an option doesn't use these, this should just be a #f
@ -298,11 +296,6 @@ the option '~a'."))
(name-fn (vector-ref option-data-fns 2)))
(name-fn index)))
(define (gnc:option-index-get-description option index)
(let* ((option-data-fns (gnc:option-data-fns option))
(name-fn (vector-ref option-data-fns 3)))
(name-fn index)))
(define (gnc:option-index-get-value option index)
(let* ((option-data-fns (gnc:option-data-fns option))
(name-fn (vector-ref option-data-fns 1)))
@ -1047,8 +1040,7 @@ the option '~a'."))
(if (null? p-vals)
'()
(cons (vector-ref (car p-vals) 1)
(cons (vector-ref (car p-vals) 2)
(multichoice-strings (cdr p-vals))))))
(multichoice-strings (cdr p-vals)))))
(let* ((value default-value)
(value->string (lambda ()
@ -1084,7 +1076,7 @@ the option '~a'."))
(vector (lambda () (length ok-values))
(lambda (x) (vector-ref (list-ref ok-values x) 0))
(lambda (x) (vector-ref (list-ref ok-values x) 1))
(lambda (x) (vector-ref (list-ref ok-values x) 2))
#f ;old tooltip
(lambda (x)
(gnc:multichoice-list-lookup ok-values x)))
(lambda () (multichoice-strings ok-values))
@ -1139,8 +1131,7 @@ the option '~a'."))
(if (null? p-vals)
'()
(cons (vector-ref (car p-vals) 1)
(cons (vector-ref (car p-vals) 2)
(radiobutton-strings (cdr p-vals))))))
(radiobutton-strings (cdr p-vals)))))
(let* ((value default-value)
(value->string (lambda ()
@ -1170,7 +1161,7 @@ the option '~a'."))
(vector (lambda () (length ok-values))
(lambda (x) (vector-ref (list-ref ok-values x) 0))
(lambda (x) (vector-ref (list-ref ok-values x) 1))
(lambda (x) (vector-ref (list-ref ok-values x) 2))
#f ;old tooltip
(lambda (x)
(gnc:multichoice-list-lookup ok-values x)))
(lambda () (radiobutton-strings ok-values))
@ -1204,8 +1195,7 @@ the option '~a'."))
(if (null? p-vals)
'()
(cons (vector-ref (car p-vals) 1)
(cons (vector-ref (car p-vals) 2)
(list-strings (cdr p-vals))))))
(list-strings (cdr p-vals)))))
(let* ((value default-value)
(value->string (lambda ()
@ -1242,7 +1232,7 @@ the option '~a'."))
(vector (lambda () (length ok-values))
(lambda (x) (vector-ref (list-ref ok-values x) 0))
(lambda (x) (vector-ref (list-ref ok-values x) 1))
(lambda (x) (vector-ref (list-ref ok-values x) 2))
#f ;old tooltip
(lambda (x) (gnc:multichoice-list-lookup ok-values x)))
(lambda () (list-strings ok-values)) #f)))