# HG changeset patch
# User zas_
# Date 1208089482 0
# Node ID 5c82855feba73be42266990995065c00569b1a12
# Parent 691fcf15aca1425e6aa1421924f195f2602304a8
Add a button to reset fullscreen info string to default value.
diff -r 691fcf15aca1 -r 5c82855feba7 src/fullscreen.c
--- a/src/fullscreen.c Sun Apr 13 12:12:44 2008 +0000
+++ b/src/fullscreen.c Sun Apr 13 12:24:42 2008 +0000
@@ -32,6 +32,15 @@
*----------------------------------------------------------------------------
*/
+void set_default_fullscreen_info(ConfOptions *options)
+{
+ if (options->fullscreen.info) g_free(options->fullscreen.info);
+ options->fullscreen.info = g_strdup("%collection%(%number%/%total%) %name%\n"
+ "%res%|%date%|%size%\n"
+ "%fAperture%|%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength%|%fExposureBias%\n"
+ "%fCamera%|%fFlash%");
+}
+
static void clear_mouse_cursor(GtkWidget *widget, gint state)
{
if (!widget->window) return;
diff -r 691fcf15aca1 -r 5c82855feba7 src/fullscreen.h
--- a/src/fullscreen.h Sun Apr 13 12:12:44 2008 +0000
+++ b/src/fullscreen.h Sun Apr 13 12:24:42 2008 +0000
@@ -16,6 +16,8 @@
#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 691fcf15aca1 -r 5c82855feba7 src/main.c
--- a/src/main.c Sun Apr 13 12:12:44 2008 +0000
+++ b/src/main.c Sun Apr 13 12:24:42 2008 +0000
@@ -18,6 +18,7 @@
#include "dnd.h"
#include "editors.h"
#include "filelist.h"
+#include "fullscreen.h"
#include "image-overlay.h"
#include "img-view.h"
#include "layout.h"
@@ -1178,11 +1179,7 @@
options->color_profile.input_name[i] = NULL;
}
- options->fullscreen.info = g_strdup("%collection%(%number%/%total%) %name%\n"
- "%res%|%date%|%size%\n"
- "%fAperture%|%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength%|%fExposureBias%\n"
- "%fCamera%|%fFlash%");
-
+ set_default_fullscreen_info(options);
sidecar_ext_add_defaults();
}
diff -r 691fcf15aca1 -r 5c82855feba7 src/preferences.c
--- a/src/preferences.c Sun Apr 13 12:12:44 2008 +0000
+++ b/src/preferences.c Sun Apr 13 12:24:42 2008 +0000
@@ -780,6 +780,32 @@
c_options->fullscreen.info = gtk_text_buffer_get_text(pTextBuffer, &iStart, &iEnd, TRUE);
}
+static void fullscreen_info_default_ok_cb(GenericDialog *gd, gpointer data)
+{
+ GtkTextView *text_view = data;
+ GtkTextBuffer *buffer;
+
+ set_default_fullscreen_info(options);
+ if (!configwindow) return;
+
+ buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
+ gtk_text_buffer_set_text(buffer, options->fullscreen.info, -1);
+}
+
+static void fullscreen_info_default_cb(GtkWidget *widget, gpointer data)
+{
+ GenericDialog *gd;
+
+ gd = generic_dialog_new(_("Reset fullscreen info string"),
+ GQ_WMCLASS, "reset_fullscreen_info", 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);
+ gtk_widget_show(gd->dialog);
+}
+
+
/* general options tab */
static void config_tab_general(GtkWidget *notebook)
{
@@ -1302,6 +1328,13 @@
gtk_container_add(GTK_CONTAINER(scrolled), fullscreen_info_view);
gtk_widget_show(fullscreen_info_view);
+ 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), fullscreen_info_view);
+ gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+ gtk_widget_show(button);
+
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(fullscreen_info_view));
gtk_text_buffer_set_text(buffer, options->fullscreen.info, -1);
g_signal_connect(G_OBJECT(buffer), "changed",