changeset 433:5ddcf93278c7

Save Show Marks state to rc file and display current state in menu. It is saved as boolean option layout.show_marks.
author zas_
date Sat, 19 Apr 2008 21:30:19 +0000
parents 96f8389c36de
children 1b0aee2b162e
files src/globals.c src/layout.c src/layout.h src/layout_util.c src/main.c src/rcfile.c src/typedefs.h
diffstat 7 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/globals.c	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/globals.c	Sat Apr 19 21:30:19 2008 +0000
@@ -89,6 +89,7 @@
 	options->layout.main_window.y = 0;
 	options->layout.order = NULL;
 	options->layout.save_window_positions = FALSE;
+	options->layout.show_marks = FALSE;
 	options->layout.show_thumbnails = FALSE;
 	options->layout.style = 0;
 	options->layout.toolbar_hidden = FALSE;
--- a/src/layout.c	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/layout.c	Sat Apr 19 21:30:19 2008 +0000
@@ -1090,6 +1090,13 @@
 	return lw->thumbs_enabled;
 }
 
+gint layout_marks_get(LayoutWindow *lw)
+{
+	if (!layout_valid(&lw)) return FALSE;
+
+	return lw->marks_enabled;
+}
+
 void layout_sort_set(LayoutWindow *lw, SortType type, gint ascend)
 {
 	if (!layout_valid(&lw)) return;
@@ -1881,6 +1888,7 @@
 	lw = g_new0(LayoutWindow, 1);
 
 	lw->thumbs_enabled = options->layout.show_thumbnails;
+	lw->marks_enabled = options->layout.show_marks;
 	lw->sort_method = SORT_NAME;
 	lw->sort_ascend = TRUE;
 
--- a/src/layout.h	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/layout.h	Sat Apr 19 21:30:19 2008 +0000
@@ -59,6 +59,7 @@
 gint layout_thumb_get(LayoutWindow *lw);
 
 void layout_marks_set(LayoutWindow *lw, gint enable);
+gint layout_marks_get(LayoutWindow *lw);
 
 void layout_sort_set(LayoutWindow *lw, SortType type, gint ascend);
 gint layout_sort_get(LayoutWindow *lw, SortType *type, gint *ascend);
--- a/src/layout_util.c	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/layout_util.c	Sat Apr 19 21:30:19 2008 +0000
@@ -1556,6 +1556,9 @@
 
 	action = gtk_action_group_get_action(lw->action_group, "HideToolbar");
 	gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->toolbar_hidden);
+
+	action = gtk_action_group_get_action(lw->action_group, "ShowMarks");
+	gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->marks_enabled);
 }
 
 void layout_util_sync_thumb(LayoutWindow *lw)
--- a/src/main.c	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/main.c	Sat Apr 19 21:30:19 2008 +0000
@@ -1269,6 +1269,8 @@
 	layout_views_get(NULL, &options->layout.dir_view_type, &options->layout.view_as_icons);
 
 	options->layout.show_thumbnails = layout_thumb_get(NULL);
+	options->layout.show_marks = layout_marks_get(NULL);
+
 	layout_sort_get(NULL, &options->file_sort.method, &options->file_sort.ascending);
 
 	layout_geometry_get_tools(NULL, &options->layout.float_window.x, &options->layout.float_window.y,
--- a/src/rcfile.c	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/rcfile.c	Sat Apr 19 21:30:19 2008 +0000
@@ -337,6 +337,7 @@
 	WRITE_CHAR(layout.order);
 	WRITE_BOOL(layout.view_as_icons);
 	WRITE_UINT(layout.dir_view_type);
+	WRITE_BOOL(layout.show_marks);
 	WRITE_BOOL(layout.show_thumbnails);
 	WRITE_SEPARATOR();
 
@@ -617,6 +618,7 @@
 		READ_CHAR(layout.order);
 		READ_BOOL(layout.view_as_icons);
 		READ_UINT(layout.dir_view_type);
+		READ_BOOL(layout.show_marks);
 		READ_BOOL(layout.show_thumbnails);
 
 		/* window positions */
--- a/src/typedefs.h	Sat Apr 19 21:20:08 2008 +0000
+++ b/src/typedefs.h	Sat Apr 19 21:30:19 2008 +0000
@@ -850,6 +850,7 @@
 		DirViewType dir_view_type;
 		
 		gint show_thumbnails;
+		gint show_marks;
 
 		struct {
 			gint w;