From cd842a8f488542f69de7f9d726a51e15a7b065db Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 21 Oct 2011 15:37:59 +0200 Subject: [PATCH] Don't break backwards compatibility of the settings names --- config.c | 12 ++++++------ shortcuts.c | 6 +++--- zathura.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config.c b/config.c index 72deb5f..5cf1475 100644 --- a/config.c +++ b/config.c @@ -34,19 +34,19 @@ config_load_default(zathura_t* zathura) /* zathura settings */ int_value = 10; - girara_setting_add(gsession, "zoom-step", &int_value, INT, false, "Zoom step", NULL, NULL); + girara_setting_add(gsession, "zoom_step", &int_value, INT, false, "Zoom step", NULL, NULL); int_value = 1; - girara_setting_add(gsession, "page-padding", &int_value, INT, true, "Padding between pages", NULL, NULL); + girara_setting_add(gsession, "page_padding", &int_value, INT, true, "Padding between pages", NULL, NULL); int_value = 2; - girara_setting_add(gsession, "pages-per-row", &int_value, INT, false, "Number of pages per row", cb_pages_per_row_value_changed, zathura); + girara_setting_add(gsession, "pages_per_row", &int_value, INT, false, "Number of pages per row", cb_pages_per_row_value_changed, zathura); float_value = 40; - girara_setting_add(gsession, "scroll-step", &float_value, FLOAT, false, "Scroll step", NULL, NULL); + girara_setting_add(gsession, "scroll_step", &float_value, FLOAT, false, "Scroll step", NULL, NULL); string_value = "#FFFFFF"; - girara_setting_add(gsession, "recolor-dark-color", string_value, STRING, false, "Recoloring (dark color)", NULL, NULL); + girara_setting_add(gsession, "recolor_darkcolor", string_value, STRING, false, "Recoloring (dark color)", NULL, NULL); string_value = "#000000"; - girara_setting_add(gsession, "recolor-light-color", string_value, STRING, false, "Recoloring (light color)", NULL, NULL); + girara_setting_add(gsession, "recolor_lightcolor", string_value, STRING, false, "Recoloring (light color)", NULL, NULL); /* define default shortcuts */ girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_c, NULL, sc_abort, 0, 0, NULL); diff --git a/shortcuts.c b/shortcuts.c index f7183e7..b88d600 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -30,7 +30,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument, zathura_t* zathura = session->global.data; g_return_val_if_fail(argument != NULL, false); - unsigned int* pages_per_row = girara_setting_get(session, "pages-per-row"); + unsigned int* pages_per_row = girara_setting_get(session, "pages_per_row"); if (zathura->ui.page_view == NULL || zathura->document == NULL || pages_per_row == NULL) { goto error_ret; @@ -235,7 +235,7 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument, unsigned int gdouble value = gtk_adjustment_get_value(adjustment); gdouble max = gtk_adjustment_get_upper(adjustment) - view_size; gdouble scroll_step = 40; - float* tmp = girara_setting_get(session, "scroll-step"); + float* tmp = girara_setting_get(session, "scroll_step"); if (tmp != NULL) { scroll_step = *tmp; g_free(tmp); @@ -521,7 +521,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, unsigned int g_return_val_if_fail(zathura->document != NULL, false); /* retreive zoom step value */ - int* value = girara_setting_get(zathura->ui.session, "zoom-step"); + int* value = girara_setting_get(zathura->ui.session, "zoom_step"); if (value == NULL) { return false; } diff --git a/zathura.c b/zathura.c index 2e1c009..d5ee0da 100644 --- a/zathura.c +++ b/zathura.c @@ -182,7 +182,7 @@ zathura_init(int argc, char* argv[]) g_signal_connect(G_OBJECT(zathura->ui.session->gtk.window), "destroy", G_CALLBACK(cb_destroy), NULL); /* save page padding */ - int* page_padding = girara_setting_get(zathura->ui.session, "page-padding"); + int* page_padding = girara_setting_get(zathura->ui.session, "page_padding"); zathura->global.page_padding = (page_padding) ? *page_padding : 1; g_free(page_padding); @@ -190,13 +190,13 @@ zathura_init(int argc, char* argv[]) gtk_table_set_col_spacings(GTK_TABLE(zathura->ui.page_view), zathura->global.page_padding); /* parse colors */ - char* string_value = girara_setting_get(zathura->ui.session, "recolor-dark-color"); + char* string_value = girara_setting_get(zathura->ui.session, "recolor_darkcolor"); if (string_value != NULL) { gdk_color_parse(string_value, &(zathura->ui.colors.recolor_dark_color)); g_free(string_value); } - string_value = girara_setting_get(zathura->ui.session, "recolor-light-color"); + string_value = girara_setting_get(zathura->ui.session, "recolor_lightcolor"); if (string_value != NULL) { gdk_color_parse(string_value, &(zathura->ui.colors.recolor_light_color)); g_free(string_value); @@ -380,7 +380,7 @@ document_open(zathura_t* zathura, const char* path, const char* password) zathura->document = document; /* view mode */ - int* value = girara_setting_get(zathura->ui.session, "pages-per-row"); + int* value = girara_setting_get(zathura->ui.session, "pages_per_row"); int pages_per_row = (value) ? *value : 1; g_free(value); page_view_set_mode(zathura, pages_per_row);