Rename few functions and replace fullscreen info with image overlay template string.
authorLaurent Monin <geeqie@norz.org>
Mon, 21 Apr 2008 20:12:49 +0000 (20:12 +0000)
committerLaurent Monin <geeqie@norz.org>
Mon, 21 Apr 2008 20:12:49 +0000 (20:12 +0000)
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)

src/fullscreen.c
src/fullscreen.h
src/image-overlay.c
src/image-overlay.h
src/main.c
src/preferences.c

index d78a00f..d98833b 100644 (file)
@@ -32,12 +32,6 @@ enum {
  *----------------------------------------------------------------------------
  */
 
-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;
index 84120f8..121400a 100644 (file)
@@ -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);
index 4ec8c9d..4a9b666 100644 (file)
@@ -75,6 +75,13 @@ static OSDIcon osd_icons[] = {
 #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
index bd6a6bd..6afdea1 100644 (file)
@@ -23,6 +23,7 @@ typedef enum {
        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);
index 1f5e152..3b45979 100644 (file)
@@ -1238,7 +1238,7 @@ static void setup_default_options(void)
                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");
 }
index c23ad2d..204f634 100644 (file)
@@ -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 @@ static void image_overlay_template_view_changed_cb(GtkWidget* widget, gpointer d
        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 @@ static void config_tab_advanced(GtkWidget *notebook)
        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);