예제 #1
0
파일: dialog-search.c 프로젝트: 573/gnucash
static void
search_active_only_cb (GtkToggleButton *button, GNCSearchWindow *sw)
{

    gnc_prefs_set_bool(sw->prefs_group, GNC_PREF_ACTIVE_ONLY,
                       gtk_toggle_button_get_active (button));
}
예제 #2
0
void
gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button,
                                    gpointer user_data)
{
    gboolean active;

    active = gtk_toggle_button_get_active(button);
    gnc_prefs_set_bool(GNC_PREFS_GROUP, GNC_PREF_SHOW_TIPS, active);
}
예제 #3
0
static void
close_handler (gpointer user_data)
{
    CommoditiesDialog *cd = user_data;

    gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(cd->dialog));

    gnc_prefs_set_bool(GNC_PREFS_GROUP, GNC_PREF_INCL_ISO, cd->show_currencies);

    gtk_widget_destroy(cd->dialog);
}
예제 #4
0
void gnc_prefs_init (void)
{
    gnc_gsettings_load_backend();

    /* Initialize the core preferences by reading their values from the loaded backend.
     * Note: of no backend was loaded, these functions will return sane default values.
     */
    file_retain_changed_cb (NULL, NULL, NULL);
    file_retain_type_changed_cb (NULL, NULL, NULL);
    file_compression_changed_cb (NULL, NULL, NULL);

    /* Check for invalid retain_type (days)/retain_days (0) combo.
     * This can happen either because a user changed the preferences
     * manually outside of GnuCash, or because the user upgraded from
     * gnucash version 2.3.15 or older. Back then, 0 retain_days meant
     * "keep forever". From 2.3.15 on this is controlled via a multiple
     * choice ("retain_type").
     * So if we find a 0 retain_days value with a "days" retain_type,
     * we will silently and conservatively interpret is as meaning
     * retain forever ("forever" retain_type).
     */
    if ( (gnc_prefs_get_file_retention_policy () == XML_RETAIN_DAYS) &&
            (gnc_prefs_get_file_retention_days () == 0 ) )
    {
        gnc_prefs_set_file_retention_policy (XML_RETAIN_ALL);
        gnc_prefs_set_file_retention_days (30);
        gnc_prefs_set_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_FOREVER, TRUE);
        gnc_prefs_set_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_DAYS, 30);
        PWARN("retain 0 days policy was set, but this is probably not what the user wanted,\n"
              "assuming conservative policy 'forever'");
    }

    /* Add hooks to update core preferences whenever the associated preference changes */
    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_DAYS,
                           file_retain_changed_cb, NULL);
    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_NEVER,
                           file_retain_type_changed_cb, NULL);
    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_DAYS,
                           file_retain_type_changed_cb, NULL);
    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_FOREVER,
                           file_retain_type_changed_cb, NULL);
    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_FILE_COMPRESSION,
                           file_compression_changed_cb, NULL);

}
예제 #5
0
void
gnc_set_first_startup (gboolean first_startup)
{
    gnc_prefs_set_bool (GNC_PREFS_GROUP_NEW_USER, GNC_PREF_FIRST_STARTUP, first_startup);
}