changeset 469:a05c72927e23

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)
author zas_
date Mon, 21 Apr 2008 20:12:49 +0000
parents 2df505c60459
children 7a13223f9229
files src/fullscreen.c src/fullscreen.h src/image-overlay.c src/image-overlay.h src/main.c src/preferences.c
diffstat 6 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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);
--- 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
--- 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);
--- 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");
 }
--- 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);