Fix #488: Issues using Geeqie to compare pictures
[geeqie.git] / src / layout_util.c
index f5ed7ff..ffc5d6c 100644 (file)
@@ -1,16 +1,24 @@
 /*
- * Geeqie
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-
 #include "main.h"
 #include "layout_util.h"
 
@@ -48,7 +56,7 @@
 #include "desktop_file.h"
 
 #include <gdk/gdkkeysyms.h> /* for keyboard values */
-
+#include "keymap_template.c"
 
 #define MENU_EDIT_ACTION_OFFSET 16
 
@@ -195,7 +203,9 @@ static void layout_menu_new_window_cb(GtkAction *action, gpointer data)
        LayoutWindow *nw;
        LayoutOptions lop;
        gboolean tmp = options->save_window_positions;
-       options->save_window_positions = FALSE; /* let the windowmanager decide for the first time */
+
+       if (!options->use_saved_window_positions_for_new_windows)
+               options->save_window_positions = FALSE; /* let the windowmanager decide for the first time */
 
        layout_exit_fullscreen(lw);
 
@@ -238,7 +248,7 @@ static void layout_menu_dupes_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       dupe_window_new(DUPE_MATCH_NAME);
+       dupe_window_new();
 }
 
 static void layout_menu_pan_cb(GtkAction *action, gpointer data)
@@ -298,6 +308,16 @@ static void layout_menu_delete_cb(GtkAction *action, gpointer data)
        file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
 }
 
+static void layout_menu_delete_key_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       if (options->file_ops.enable_delete_key)
+               {
+               file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
+               }
+}
+
 static void layout_menu_disable_grouping_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -374,6 +394,14 @@ static void layout_menu_alter_none_cb(GtkAction *action, gpointer data)
        layout_image_alter_orientation(lw, ALTER_NONE);
 }
 
+static void layout_menu_exif_rotate_cb(GtkToggleAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       options->image.exif_rotate_enable = gtk_toggle_action_get_active(action);
+       layout_image_reset_orientation(lw);
+}
+
 static void layout_menu_config_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -609,12 +637,20 @@ static void layout_menu_list_cb(GtkRadioAction *action, GtkRadioAction *current,
        layout_views_set(lw, lw->options.dir_view_type, (FileViewType) gtk_radio_action_get_current_value(action));
 }
 
-static void layout_menu_view_dir_as_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data)
+static void layout_menu_view_dir_as_cb(GtkToggleAction *action,  gpointer data)
 {
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       layout_views_set(lw, (DirViewType) gtk_radio_action_get_current_value(action), lw->options.file_view_type);
+
+       if (gtk_toggle_action_get_active(action))
+               {
+               layout_views_set(lw, DIRVIEW_TREE, lw->options.file_view_type);
+               }
+       else
+               {
+               layout_views_set(lw, DIRVIEW_LIST, lw->options.file_view_type);
+               }
 }
 
 static void layout_menu_view_in_new_window_cb(GtkAction *action, gpointer data)
@@ -685,6 +721,21 @@ static void layout_menu_histogram_cb(GtkToggleAction *action, gpointer data)
                }
 }
 
+static void layout_menu_animate_cb(GtkToggleAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       if (lw->options.animate == gtk_toggle_action_get_active(action)) return;
+       layout_image_animate_toggle(lw);
+}
+
+static void layout_menu_rectangular_selection_cb(GtkToggleAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       options->collections.rectangular_selection = gtk_toggle_action_get_active(action);
+}
+
 static void layout_menu_histogram_toggle_channel_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -845,7 +896,7 @@ static void layout_menu_help_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       help_window_show("html_contents");
+       help_window_show("index.html");
 }
 
 static void layout_menu_help_keys_cb(GtkAction *action, gpointer data)
@@ -853,7 +904,7 @@ static void layout_menu_help_keys_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       help_window_show("documentation");
+       help_window_show("GuideReferenceKeyboardShortcuts.html");
 }
 
 static void layout_menu_notes_cb(GtkAction *action, gpointer data)
@@ -864,6 +915,168 @@ static void layout_menu_notes_cb(GtkAction *action, gpointer data)
        help_window_show("release_notes");
 }
 
+static char *keyboard_map_hardcoded[][2] = {
+       {"Scroll","Left"},
+       {"FastScroll", "&lt;Shift&gt;Left"},
+       {"Left Border", "&lt;Primary&gt;Left"},
+       {"Left Border", "&lt;Primary&gt;&lt;Shift&gt;Left"},
+       {"Scroll", "Right"},
+       {"FastScroll", "&lt;Shift&gt;Right"},
+       {"Right Border", "&lt;Primary&gt;Right"},
+       {"Right Border", "&lt;Primary&gt;&lt;Shift&gt;Right"},
+       {"Scroll", "Up"},
+       {"FastScroll", "&lt;Shift&gt;Up"},
+       {"Uper Border", "&lt;Primary&gt;Up"},
+       {"Uper Border", "&lt;Primary&gt;&lt;Shift&gt;Up"},
+       {"Scroll", "Down"},
+       {"FastScroll", "&lt;Shift&gt;Down"},
+       {"Lower Border", "&lt;Primary&gt;Down"},
+       {"Lower Border", "&lt;Primary&gt;&lt;Shift&gt;Down"},
+       {"Next/Drag", "M1"},
+       {"FastDrag", "&lt;Shift&gt;M1"},
+       {"DnD Start", "M2"},
+       {"Menu", "M3"},
+       {"PrevImage", "MW4"},
+       {"NextImage", "MW5"},
+       {"ScrollUp", "&lt;Shift&gt;MW4"},
+       {"ScrollDown", "&lt;Shift&gt;MW5"},
+       {"ZoomIn", "&lt;Primary&gt;MW4"},
+       {"ZoomOut", "&lt;Primary&gt;MW5"},
+       {NULL, NULL}
+};
+
+static void layout_menu_foreach_func(
+                                       gpointer data,
+                                       const gchar *accel_path,
+                                       guint accel_key,
+                                       GdkModifierType accel_mods,
+                                       gboolean changed)
+{
+       gchar *path, *name;
+       gchar *key_name, *menu_name;
+       gchar **subset_lt_arr, **subset_gt_arr;
+       gchar *subset_lt, *converted_name;
+       GPtrArray *array = data;
+
+       path = g_strescape(accel_path, NULL);
+       name = gtk_accelerator_name(accel_key, accel_mods);
+
+       menu_name = g_strdup(g_strrstr(path, "/")+1);
+
+       if (g_strrstr(name, ">"))
+               {
+               subset_lt_arr = g_strsplit_set(name,"<", 4);
+               subset_lt = g_strjoinv("&lt;", subset_lt_arr);
+               subset_gt_arr = g_strsplit_set(subset_lt,">", 4);
+               converted_name = g_strjoinv("&gt;", subset_gt_arr);
+               key_name = g_strdup(converted_name);
+
+               g_free(converted_name);
+               g_free(subset_lt);
+               g_strfreev(subset_lt_arr);
+               g_strfreev(subset_gt_arr);
+               }
+       else
+               key_name = g_strdup(name);
+
+       g_ptr_array_add(array, (gpointer)menu_name);
+       g_ptr_array_add(array, (gpointer)key_name);
+
+       g_free(name);
+       g_free(path);
+}
+
+static void layout_menu_kbd_map_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+       gint fd = -1;
+       GPtrArray *array;
+       char * tmp_file;
+       GError *error = NULL;
+       GIOChannel *channel;
+       char **pre_key, **post_key;
+       char *key_name, *converted_line;
+       int keymap_index, index;
+
+       fd = g_file_open_tmp("geeqie_keymap_XXXXXX.svg", &tmp_file, &error);
+       if (error)
+               {
+               DEBUG_0("Keyboard Map - cannot create file:%s\n",error->message);
+               g_error_free(error);
+               }
+       else
+               {
+               array = g_ptr_array_new();
+
+               gtk_accel_map_foreach(array, layout_menu_foreach_func);
+
+               channel = g_io_channel_unix_new(fd);
+
+               keymap_index = 0;
+               while (keymap_template[keymap_index])
+                       {
+                       if (g_strrstr(keymap_template[keymap_index], ">key:"))
+                               {
+                               pre_key = g_strsplit(keymap_template[keymap_index],">key:",2);
+                               post_key = g_strsplit(pre_key[1],"<",2);
+
+                               index=0;
+                               key_name = " ";
+                               for (index=0; index < array->len-2; index=index+2)
+                                       {
+                                       if (!(g_ascii_strcasecmp(g_ptr_array_index(array,index+1), post_key[0])))
+                                               {
+                                               key_name = g_ptr_array_index(array,index+0);
+                                               break;
+                                               }
+                                       }
+
+                               index=0;
+                               while (keyboard_map_hardcoded[index][0])
+                                       {
+                                       if (!(g_strcmp0(keyboard_map_hardcoded[index][1], post_key[0])))
+                                               {
+                                               key_name = keyboard_map_hardcoded[index][0];
+                                               break;
+                                               }
+                                       index++;
+                                       }
+
+                               converted_line = g_strconcat(pre_key[0], ">", key_name, "<", post_key[1], "\n", NULL);
+                               g_io_channel_write_chars(channel, converted_line, -1, NULL, &error);
+                               if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+
+                               g_free(converted_line);
+                               g_strfreev(pre_key);
+                               g_strfreev(post_key);
+                               }
+                       else
+                               {
+                               g_io_channel_write_chars(channel, keymap_template[keymap_index], -1, NULL, &error);
+                               if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+                               g_io_channel_write_chars(channel, "\n", -1, NULL, &error);
+                               if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+                               }
+                       keymap_index++;
+                       }
+
+               g_io_channel_flush(channel, &error);
+               if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+               g_io_channel_unref(channel);
+
+               index=0;
+               for (index=0; index < array->len-2; index=index+2)
+                       {
+                       g_free(g_ptr_array_index(array,index));
+                       g_free(g_ptr_array_index(array,index+1));
+                       }
+               g_ptr_array_unref(array);
+
+               view_window_new(file_data_new_simple(tmp_file));
+               g_free(tmp_file);
+               }
+}
+
 static void layout_menu_about_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -1014,6 +1227,46 @@ static void layout_menu_image_next_cb(GtkAction *action, gpointer data)
        layout_image_next(lw);
 }
 
+static void layout_menu_split_pane_next_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+       gint active_frame;
+
+       active_frame = lw->active_split_image;
+
+       if (active_frame < MAX_SPLIT_IMAGES-1 && lw->split_images[active_frame+1] )
+               {
+               active_frame++;
+               }
+       else
+               {
+               active_frame = 0;
+               }
+       layout_image_activate(lw, active_frame, FALSE);
+}
+
+static void layout_menu_split_pane_prev_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+       gint active_frame;
+
+       active_frame = lw->active_split_image;
+
+       if (active_frame >=1 && lw->split_images[active_frame-1] )
+               {
+               active_frame--;
+               }
+       else
+               {
+               active_frame = MAX_SPLIT_IMAGES-1;
+               while (!lw->split_images[active_frame])
+                       {
+                       active_frame--;
+                       }
+               }
+       layout_image_activate(lw, active_frame, FALSE);
+}
+
 static void layout_menu_image_last_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -1308,8 +1561,8 @@ static GtkActionEntry menu_entries[] = {
   { "Move",            NULL,                   N_("_Move..."),                         "<control>M",           N_("Move..."),                          CB(layout_menu_move_cb) },
   { "Rename",          NULL,                   N_("_Rename..."),                       "<control>R",           N_("Rename..."),                        CB(layout_menu_rename_cb) },
   { "Delete",          GTK_STOCK_DELETE,       N_("_Delete..."),                       "<control>D",           N_("Delete..."),                        CB(layout_menu_delete_cb) },
-  { "DeleteAlt1",      GTK_STOCK_DELETE,       N_("_Delete..."),                       "Delete",               N_("Delete..."),                        CB(layout_menu_delete_cb) },
-  { "DeleteAlt2",      GTK_STOCK_DELETE,       N_("_Delete..."),                       "KP_Delete",            N_("Delete..."),                        CB(layout_menu_delete_cb) },
+  { "DeleteAlt1",      GTK_STOCK_DELETE,       N_("_Delete..."),                       "Delete",               N_("Delete..."),                        CB(layout_menu_delete_key_cb) },
+  { "DeleteAlt2",      GTK_STOCK_DELETE,       N_("_Delete..."),                       "KP_Delete",            N_("Delete..."),                        CB(layout_menu_delete_key_cb) },
   { "EnableGrouping",  NULL,                   N_("Enable file _grouping"),            NULL,                   N_("Enable file grouping"),             CB(layout_menu_enable_grouping_cb) },
   { "DisableGrouping", NULL,                   N_("Disable file groupi_ng"),           NULL,                   N_("Disable file grouping"),            CB(layout_menu_disable_grouping_cb) },
   { "CopyPath",                NULL,                   N_("_Copy path to clipboard"),          NULL,                   N_("Copy path to clipboard"),           CB(layout_menu_copy_path_cb) },
@@ -1376,11 +1629,14 @@ static GtkActionEntry menu_entries[] = {
   { "Refresh",         GTK_STOCK_REFRESH,      N_("_Refresh"),                         "R",                    N_("Refresh"),                          CB(layout_menu_refresh_cb) },
   { "HelpContents",    GTK_STOCK_HELP,         N_("_Contents"),                        "F1",                   N_("Contents"),                         CB(layout_menu_help_cb) },
   { "HelpShortcuts",   NULL,                   N_("_Keyboard shortcuts"),              NULL,                   N_("Keyboard shortcuts"),               CB(layout_menu_help_keys_cb) },
+  { "HelpKbd",         NULL,                   N_("_Keyboard map"),                    NULL,                   N_("Keyboard map"),                     CB(layout_menu_kbd_map_cb) },
   { "HelpNotes",       NULL,                   N_("_Release notes"),                   NULL,                   N_("Release notes"),                    CB(layout_menu_notes_cb) },
   { "About",           GTK_STOCK_ABOUT,        N_("_About"),                           NULL,                   N_("About"),                            CB(layout_menu_about_cb) },
   { "LogWindow",       NULL,                   N_("_Log Window"),                      NULL,                   N_("Log Window"),                       CB(layout_menu_log_window_cb) },
   { "ExifWin",         NULL,                   N_("_Exif window"),                     "<control>E",           N_("Exif window"),                      CB(layout_menu_bar_exif_cb) },
   { "StereoCycle",     NULL,                   N_("_Cycle through stereo modes"),      NULL,                   N_("Cycle through stereo modes"),       CB(layout_menu_stereo_mode_next_cb) },
+  { "SplitNextPane",   NULL,                   N_("_Next Pane"),       "<alt>Right",                   N_("Next Pane"),        CB(layout_menu_split_pane_next_cb) },
+  { "SplitPreviousPane",       NULL,                   N_("_Previous Pane"),   "<alt>Left",                    N_("Previous Pane"),    CB(layout_menu_split_pane_prev_cb) },
 
 };
 
@@ -1398,6 +1654,9 @@ static GtkToggleActionEntry menu_toggle_entries[] = {
   { "Grayscale",       NULL,                   N_("Toggle _grayscale"),                "<shift>G",             N_("Toggle grayscale"),                 CB(layout_menu_alter_desaturate_cb), FALSE},
   { "ImageOverlay",    NULL,                   N_("Image _Overlay"),                   NULL,                   N_("Image Overlay"),                    CB(layout_menu_overlay_cb),      FALSE },
   { "ImageHistogram",  NULL,                   N_("_Show Histogram"),                  NULL,                   N_("Show Histogram"),                   CB(layout_menu_histogram_cb),    FALSE },
+  { "RectangularSelection",    NULL,                   N_("Rectangular Selection"),                    "<alt>R",                       N_("Rectangular Selection"),                    CB(layout_menu_rectangular_selection_cb),        FALSE },
+  { "Animate", NULL,   N_("GIF _animation"),           "A",                    N_("Toggle GIF animation"),                     CB(layout_menu_animate_cb),      FALSE  },
+  { "ExifRotate",      GTK_STOCK_ORIENTATION_PORTRAIT,                 N_("_Exif rotate"),             "<alt>X",               N_("Exif rotate"),                      CB(layout_menu_exif_rotate_cb), FALSE },
 };
 
 static GtkRadioActionEntry menu_radio_entries[] = {
@@ -1405,9 +1664,8 @@ static GtkRadioActionEntry menu_radio_entries[] = {
   { "ViewIcons",       NULL,                   N_("I_cons"),                           "<control>I",           N_("View Images as Icons"),             FILEVIEW_ICON }
 };
 
-static GtkRadioActionEntry menu_view_dir_radio_entries[] = {
-  { "FolderList",      NULL,                   N_("Folder Li_st"),                     "<meta>L",              N_("View Folders as List"),             DIRVIEW_LIST },
-  { "FolderTree",      NULL,                   N_("Folder T_ree"),                     "<control>T",           N_("View Folders as Tree"),             DIRVIEW_TREE },
+static GtkToggleActionEntry menu_view_dir_toggle_entries[] = {
+  { "FolderTree",      NULL,                   N_("T_oggle Folder View"),                      "<control>T",           N_("Toggle Folders View"),              CB(layout_menu_view_dir_as_cb),FALSE },
 };
 
 static GtkRadioActionEntry menu_split_radio_entries[] = {
@@ -1493,6 +1751,7 @@ static const gchar *menu_ui_description =
 "      <menuitem action='SelectAll'/>"
 "      <menuitem action='SelectNone'/>"
 "      <menuitem action='SelectInvert'/>"
+"      <menuitem action='RectangularSelection'/>"
 "      <placeholder name='SelectSection'/>"
 "      <separator/>"
 "      <menuitem action='CopyPath'/>"
@@ -1514,6 +1773,9 @@ static const gchar *menu_ui_description =
 "        <menuitem action='Mirror'/>"
 "        <menuitem action='Flip'/>"
 "        <menuitem action='AlterNone'/>"
+"        <separator/>"
+"        <menuitem action='ExifRotate'/>"
+"        <separator/>"
 "      </menu>"
 "      <menuitem action='SaveMetadata'/>"
 "      <placeholder name='PropertiesSection'/>"
@@ -1536,7 +1798,6 @@ static const gchar *menu_ui_description =
 "      <placeholder name='WindowSection'/>"
 "      <separator/>"
 "      <menu action='FileDirMenu'>"
-"        <menuitem action='FolderList'/>"
 "        <menuitem action='FolderTree'/>"
 "        <placeholder name='FolderSection'/>"
 "        <separator/>"
@@ -1584,6 +1845,9 @@ static const gchar *menu_ui_description =
 "        <menuitem action='SplitVertical'/>"
 "        <menuitem action='SplitQuad'/>"
 "        <menuitem action='SplitSingle'/>"
+"        <separator/>"
+"        <menuitem action='SplitNextPane'/>"
+"        <menuitem action='SplitPreviousPane'/>"
 "      </menu>"
 "      <menu action='StereoMenu'>"
 "        <menuitem action='StereoAuto'/>"
@@ -1629,6 +1893,7 @@ static const gchar *menu_ui_description =
 "      <menuitem action='ShowInfoPixel'/>"
 "      <placeholder name='ToolsSection'/>"
 "      <separator/>"
+"      <menuitem action='Animate'/>"
 "      <menuitem action='SlideShow'/>"
 "      <menuitem action='SlideShowPause'/>"
 "      <menuitem action='Refresh'/>"
@@ -1639,6 +1904,7 @@ static const gchar *menu_ui_description =
 "      <separator/>"
 "      <menuitem action='HelpContents'/>"
 "      <menuitem action='HelpShortcuts'/>"
+"      <menuitem action='HelpKbd'/>"
 "      <menuitem action='HelpNotes'/>"
 "      <placeholder name='HelpSection'/>"
 "      <separator/>"
@@ -1662,6 +1928,7 @@ static const gchar *menu_ui_description =
 "    <toolitem action='FloatTools'/>"
 "  </toolbar>"
 "  <toolbar name='StatusBar'>"
+"    <toolitem action='ExifRotate'/>"
 "    <toolitem action='ShowInfoPixel'/>"
 "    <toolitem action='UseColorProfiles'/>"
 "    <toolitem action='SaveMetadata'/>"
@@ -1959,9 +2226,9 @@ void layout_actions_setup(LayoutWindow *lw)
        gtk_action_group_add_radio_actions(lw->action_group,
                                           menu_split_radio_entries, G_N_ELEMENTS(menu_split_radio_entries),
                                           0, G_CALLBACK(layout_menu_split_cb), lw);
-       gtk_action_group_add_radio_actions(lw->action_group,
-                                          menu_view_dir_radio_entries, VIEW_DIR_TYPES_COUNT,
-                                          0, G_CALLBACK(layout_menu_view_dir_as_cb), lw);
+       gtk_action_group_add_toggle_actions(lw->action_group,
+                                          menu_view_dir_toggle_entries, G_N_ELEMENTS(menu_view_dir_toggle_entries),
+                                           lw);
        gtk_action_group_add_radio_actions(lw->action_group,
                                           menu_color_radio_entries, COLOR_PROFILE_FILE + COLOR_PROFILE_INPUTS,
                                           0, G_CALLBACK(layout_color_menu_input_cb), lw);
@@ -2237,7 +2504,7 @@ static void layout_util_sync_views(LayoutWindow *lw)
        if (!lw->action_group) return;
 
        action = gtk_action_group_get_action(lw->action_group, "FolderTree");
-       gtk_radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->options.dir_view_type);
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.dir_view_type);
 
        action = gtk_action_group_get_action(lw->action_group, "SplitSingle");
        gtk_radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->split_mode);
@@ -2266,12 +2533,21 @@ static void layout_util_sync_views(LayoutWindow *lw)
        action = gtk_action_group_get_action(lw->action_group, "SlideShow");
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), layout_image_slideshow_active(lw));
 
+       action = gtk_action_group_get_action(lw->action_group, "Animate");
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.animate);
+
        action = gtk_action_group_get_action(lw->action_group, "ImageOverlay");
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), osd_flags != OSD_SHOW_NOTHING);
 
        action = gtk_action_group_get_action(lw->action_group, "ImageHistogram");
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), osd_flags & OSD_SHOW_HISTOGRAM);
 
+       action = gtk_action_group_get_action(lw->action_group, "ExifRotate");
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), options->image.exif_rotate_enable);
+
+       action = gtk_action_group_get_action(lw->action_group, "RectangularSelection");
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), options->collections.rectangular_selection);
+
        if (osd_flags & OSD_SHOW_HISTOGRAM)
                {
                action = gtk_action_group_get_action(lw->action_group, "HistogramChanR");