changeset 618:b1a922a32d9c

Save full OSD state to rc file and restore it on startup. It allows to restore OSD with or without histogram depending on previous state.
author zas_
date Sat, 10 May 2008 09:00:14 +0000
parents aa883b6d2ef6
children 2ccc7d856d55
files src/image-overlay.c src/main.c src/options.h src/rcfile.c
diffstat 4 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/image-overlay.c	Fri May 09 12:43:10 2008 +0000
+++ b/src/image-overlay.c	Sat May 10 09:00:14 2008 +0000
@@ -829,7 +829,11 @@
 {
 	OverlayStateData *osd = image_get_osd_data(imd);
 
-	if (!osd) return FALSE;
+	if (!osd)
+		{
+		if (show) *show = OSD_SHOW_NOTHING;
+		return FALSE;
+		}
 
 	if (show) *show = osd->show;
 
--- a/src/main.c	Fri May 09 12:43:10 2008 +0000
+++ b/src/main.c	Sat May 10 09:00:14 2008 +0000
@@ -1208,7 +1208,8 @@
 			layout_geometry_get(NULL, &options->layout.main_window.x, &options->layout.main_window.y,
 					    &options->layout.main_window.w, &options->layout.main_window.h);
 			}
-		options->image_overlay.common.enabled = image_osd_get(lw->image, NULL);
+
+		image_osd_get(lw->image, &options->image_overlay.common.enabled);
 		}
 
 	layout_geometry_get_dividers(NULL, &options->layout.main_window.hdivider_pos, &options->layout.main_window.vdivider_pos);
@@ -1480,7 +1481,7 @@
 			}
 		}
 
-	image_osd_set(lw->image, (options->image_overlay.common.show_at_startup || options->image_overlay.common.enabled) ? OSD_SHOW_INFO : OSD_SHOW_NOTHING);
+	image_osd_set(lw->image, options->image_overlay.common.enabled | (options->image_overlay.common.show_at_startup ? OSD_SHOW_INFO : OSD_SHOW_NOTHING));
 
 	g_free(geometry);
 	g_free(cmd_path);
--- a/src/options.h	Fri May 09 12:43:10 2008 +0000
+++ b/src/options.h	Sat May 10 09:00:14 2008 +0000
@@ -138,7 +138,7 @@
 	/* image overlay */
 	struct {
 		struct {
-			gint enabled;
+			guint enabled;
 			gint show_at_startup;
 			gchar *template_string;
 		} common;
--- a/src/rcfile.c	Fri May 09 12:43:10 2008 +0000
+++ b/src/rcfile.c	Sat May 10 09:00:14 2008 +0000
@@ -448,7 +448,7 @@
 
 
 	WRITE_SUBTITLE("Image Overlay Options");
-	WRITE_BOOL(image_overlay.common.enabled);
+	WRITE_UINT(image_overlay.common.enabled);
 	WRITE_BOOL(image_overlay.common.show_at_startup);
 	WRITE_CHAR(image_overlay.common.template_string);
 
@@ -752,7 +752,7 @@
 		/* image overlay */
 		COMPAT_READ_BOOL(fullscreen.show_info, image_overlay.common.show_at_startup);
 		COMPAT_READ_CHAR(fullscreen.info, image_overlay.common.template_string);
-		READ_BOOL(image_overlay.common.enabled);
+		READ_UINT(image_overlay.common.enabled);
 		READ_BOOL(image_overlay.common.show_at_startup);
 		READ_CHAR(image_overlay.common.template_string);