Пример #1
0
/* Function to set the UI Value for a particular option */
static gboolean
owner_set_value (GNCOption *option, gboolean use_default,
                 GtkWidget *widget, SCM value)
{
    GncOwner owner_def;
    GncOwner *owner;

    if (!SWIG_IsPointer (value))
        scm_misc_error("business_options:owner_set_value",
                       "SCM is not a wrapped pointer.", value);

    owner = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncOwner"), 1, 0);

    /* XXX: should we verify that the owner type is correct? */
    if (!owner)
    {
        owner_def.type = get_owner_type_from_option (option);
        owner_def.owner.undefined = NULL;
        owner = &owner_def;
    }

    widget = gnc_option_get_gtk_widget (option);
    gnc_owner_set_owner (widget, owner);
    return FALSE;
}
Пример #2
0
/* Function to set the UI Value for a particular option */
static gboolean
taxtable_set_value (GNCOption *option, gboolean use_default,
                    GtkWidget *widget, SCM value)
{
    GncTaxTable *taxtable;

    if (!SWIG_IsPointer (value))
        scm_misc_error("business_options:taxtable_set_value",
                       "SCM is not a wrapped pointer.", value);

    taxtable = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncTaxTable"), 1, 0);

    widget = gnc_option_get_gtk_widget (option);
    gnc_simple_combo_set_value (GTK_COMBO_BOX(widget), taxtable);
    return FALSE;
}
Пример #3
0
/* Function to set the UI Value for a particular option */
static gboolean
invoice_set_value (GNCOption *option, gboolean use_default,
                   GtkWidget *widget, SCM value)
{
    GncInvoice *invoice;

    if (!SWIG_IsPointer (value))
        scm_misc_error("business_options:invoice_set_value",
                       "SCM is not a wrapped pointer.", value);

    invoice = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncInvoice"), 1, 0);

    widget = gnc_option_get_gtk_widget (option);
    gnc_general_search_set_selected (GNC_GENERAL_SEARCH (widget), invoice);
    return FALSE;
}
Пример #4
0
/* Function to set the UI Value for a particular option */
static gboolean
employee_set_value (GNCOption *option, gboolean use_default,
                    GtkWidget *widget, SCM value)
{
    GncOwner owner;
    GncEmployee *employee;

    if (!SWIG_IsPointer (value))
        scm_misc_error("business_options:employee_set_value",
                       "SCM is not a wrapped pointer.", value);

    employee = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncEmployee"), 1, 0);
    gncOwnerInitEmployee (&owner, employee);

    widget = gnc_option_get_gtk_widget (option);
    gnc_owner_set_owner (widget, &owner);
    return FALSE;
}
Пример #5
0
void
gnc_options_dialog_set_new_book_option_values (GNCOptionDB *odb)
{
    GNCOption *num_source_option;
    GtkWidget *num_source_is_split_action_button;
    gboolean num_source_is_split_action;

    if (!odb) return;
    num_source_is_split_action = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL,
                                                    GNC_PREF_NUM_SOURCE);
    if (num_source_is_split_action)
    {
        num_source_option = gnc_option_db_get_option_by_name(odb,
                                                 OPTION_SECTION_ACCOUNTS,
                                                 OPTION_NAME_NUM_FIELD_SOURCE);
        num_source_is_split_action_button =
                                gnc_option_get_gtk_widget (num_source_option);
        gtk_toggle_button_set_active
                    (GTK_TOGGLE_BUTTON (num_source_is_split_action_button),
                        num_source_is_split_action);
    }
}