# HG changeset patch # User zas_ # Date 1208808769 0 # Node ID a05c72927e23972b2d0e44bed0c318bc8d92c03f # Parent 2df505c60459b201ba611f408fb9c56df4ff2e2a Rename few functions and replace fullscreen info with image overlay template string. fullscreen_info_default_cb() -> image_overlay_default_template_cb() fullscreen_info_default_ok_cb() -> image_overlay_default_template_ok_cb() set_default_fullscreen_info() -> set_default_image_overlay_template_string() (moved to image-overlay.h) diff -r 2df505c60459 -r a05c72927e23 src/fullscreen.c --- a/src/fullscreen.c Mon Apr 21 20:01:22 2008 +0000 +++ b/src/fullscreen.c Mon Apr 21 20:12:49 2008 +0000 @@ -32,12 +32,6 @@ *---------------------------------------------------------------------------- */ -void set_default_fullscreen_info(ConfOptions *options) -{ - if (options->image_overlay.common.template_string) g_free(options->image_overlay.common.template_string); - options->image_overlay.common.template_string = g_strdup(DEFAULT_OVERLAY_INFO); -} - static void clear_mouse_cursor(GtkWidget *widget, gint state) { if (!widget->window) return; diff -r 2df505c60459 -r a05c72927e23 src/fullscreen.h --- a/src/fullscreen.h Mon Apr 21 20:01:22 2008 +0000 +++ b/src/fullscreen.h Mon Apr 21 20:12:49 2008 +0000 @@ -16,8 +16,6 @@ #define FULL_SCREEN_HIDE_MOUSE_DELAY 3000 #define FULL_SCREEN_BUSY_MOUSE_DELAY 200 -void set_default_fullscreen_info(ConfOptions *options); - FullScreenData *fullscreen_start(GtkWidget *window, ImageWindow *imd, void (*stop_func)(FullScreenData *, gpointer), gpointer stop_data); diff -r 2df505c60459 -r a05c72927e23 src/image-overlay.c --- a/src/image-overlay.c Mon Apr 21 20:01:22 2008 +0000 +++ b/src/image-overlay.c Mon Apr 21 20:12:49 2008 +0000 @@ -75,6 +75,13 @@ #define IMAGE_OSD_DEFAULT_DURATION 30 #define HISTOGRAM_HEIGHT 140 + +void set_default_image_overlay_template_string(ConfOptions *options) +{ + if (options->image_overlay.common.template_string) g_free(options->image_overlay.common.template_string); + options->image_overlay.common.template_string = g_strdup(DEFAULT_OVERLAY_INFO); +} + /* *---------------------------------------------------------------------------- * image histogram diff -r 2df505c60459 -r a05c72927e23 src/image-overlay.h --- a/src/image-overlay.h Mon Apr 21 20:01:22 2008 +0000 +++ b/src/image-overlay.h Mon Apr 21 20:12:49 2008 +0000 @@ -23,6 +23,7 @@ IMAGE_OSD_COUNT } ImageOSDFlag; +void set_default_image_overlay_template_string(ConfOptions *options); void image_osd_set(ImageWindow *imd, gint info, gint status); gint image_osd_get(ImageWindow *imd, gint *info, gint *status); diff -r 2df505c60459 -r a05c72927e23 src/main.c --- a/src/main.c Mon Apr 21 20:01:22 2008 +0000 +++ b/src/main.c Mon Apr 21 20:12:49 2008 +0000 @@ -1238,7 +1238,7 @@ options->color_profile.input_name[i] = NULL; } - set_default_fullscreen_info(options); + set_default_image_overlay_template_string(options); sidecar_ext_add_defaults(); options->layout.order = g_strdup("123"); } diff -r 2df505c60459 -r a05c72927e23 src/preferences.c --- a/src/preferences.c Mon Apr 21 20:01:22 2008 +0000 +++ b/src/preferences.c Mon Apr 21 20:12:49 2008 +0000 @@ -18,6 +18,7 @@ #include "filelist.h" #include "fullscreen.h" #include "image.h" +#include "image-overlay.h" #include "color-man.h" #include "img-view.h" #include "layout_config.h" @@ -792,28 +793,28 @@ c_options->image_overlay.common.template_string = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE); } -static void fullscreen_info_default_ok_cb(GenericDialog *gd, gpointer data) +static void image_overlay_default_template_ok_cb(GenericDialog *gd, gpointer data) { GtkTextView *text_view = data; GtkTextBuffer *buffer; - set_default_fullscreen_info(options); + set_default_image_overlay_template_string(options); if (!configwindow) return; buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view)); gtk_text_buffer_set_text(buffer, options->image_overlay.common.template_string, -1); } -static void fullscreen_info_default_cb(GtkWidget *widget, gpointer data) +static void image_overlay_default_template_cb(GtkWidget *widget, gpointer data) { GenericDialog *gd; - gd = generic_dialog_new(_("Reset fullscreen info string"), - GQ_WMCLASS, "reset_fullscreen_info", widget, TRUE, + gd = generic_dialog_new(_("Reset image overlay template string"), + GQ_WMCLASS, "reset_image_overlay_template_string", widget, TRUE, dummy_cancel_cb, data); - generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset fullscreen info string"), - _("This will reset the fullscreen info string to the default.\nContinue?")); - generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, fullscreen_info_default_ok_cb, TRUE); + generic_dialog_add_message(gd, GTK_STOCK_DIALOG_QUESTION, _("Reset image overlay template string"), + _("This will reset the image overlay template string to the default.\nContinue?")); + generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, image_overlay_default_template_ok_cb, TRUE); gtk_widget_show(gd->dialog); } @@ -1345,7 +1346,7 @@ hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_BUTTON_GAP); button = pref_button_new(NULL, NULL, _("Defaults"), FALSE, - G_CALLBACK(fullscreen_info_default_cb), image_overlay_template_view); + G_CALLBACK(image_overlay_default_template_cb), image_overlay_template_view); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button);