Addl fix #488: Issues using Geeqie to compare pictures
[geeqie.git] / src / layout_util.c
index 2f7d216..fc431c8 100644 (file)
@@ -51,6 +51,7 @@
 #include "ui_tabcomp.h"
 #include "utilops.h"
 #include "view_dir.h"
+#include "view_file.h"
 #include "window.h"
 #include "metadata.h"
 #include "desktop_file.h"
 #include "keymap_template.c"
 
 #define MENU_EDIT_ACTION_OFFSET 16
+#define FILE_COLUMN_POINTER 0
 
 static gboolean layout_bar_enabled(LayoutWindow *lw);
 static gboolean layout_bar_sort_enabled(LayoutWindow *lw);
+static void layout_bars_hide_toggle(LayoutWindow *lw);
 static void layout_util_sync_views(LayoutWindow *lw);
 
 /*
@@ -248,7 +251,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)
@@ -308,6 +311,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;
@@ -342,6 +355,55 @@ static void layout_menu_alter_90_cb(GtkAction *action, gpointer data)
        layout_image_alter_orientation(lw, ALTER_ROTATE_90);
 }
 
+static void layout_menu_rating_0_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "0");
+}
+
+static void layout_menu_rating_1_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "1");
+}
+
+static void layout_menu_rating_2_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "2");
+}
+
+static void layout_menu_rating_3_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "3");
+}
+
+static void layout_menu_rating_4_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "4");
+}
+
+static void layout_menu_rating_5_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "5");
+}
+
+static void layout_menu_rating_m1_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_image_rating(lw, "-1");
+}
+
 static void layout_menu_alter_90cc_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -384,6 +446,109 @@ 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_write_rotate(GtkToggleAction *action, gpointer data, gboolean keep_date)
+{
+       LayoutWindow *lw = data;
+       GtkTreeModel *store;
+       GList *work;
+       GtkTreeSelection *selection;
+       GtkTreePath *tpath;
+       FileData *fd_n;
+       GtkTreeIter iter;
+       IconData *id;
+       gchar *rotation;
+       gchar *command;
+       gint run_result;
+       GenericDialog *gd;
+       GString *message;
+
+       if (!layout_valid(&lw)) return;
+
+       if (!lw || !lw->vf) return;
+
+       if (lw->vf->type == FILEVIEW_ICON)
+               {
+               if (!VFICON(lw->vf)->selection) return;
+               work = VFICON(lw->vf)->selection;
+               }
+       else
+               {
+               selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(lw->vf->listview));
+               work = gtk_tree_selection_get_selected_rows(selection, &store);
+               }
+
+       while (work)
+               {
+               if (lw->vf->type == FILEVIEW_ICON)
+                       {
+                       id = work->data;
+                       fd_n = id->fd;
+                       work = work->next;
+                       }
+               else
+                       {
+                       tpath = work->data;
+                       gtk_tree_model_get_iter(store, &iter, tpath);
+                       gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd_n, -1);
+                       work = work->next;
+                       }
+
+               rotation = g_strdup_printf("%d", fd_n->user_orientation);
+               command = g_strconcat(GQ_BIN_DIR, "/geeqie-rotate -r ", rotation,
+                                                                                                       keep_date ? " -t " : " ", fd_n->path, NULL);
+
+               run_result = WEXITSTATUS(runcmd(command));
+               if (!run_result)
+                       {
+                       fd_n->user_orientation = 0;
+                       }
+               else
+                       {
+                       message = g_string_new("");
+                       message = g_string_append(message, _("Operation failed:\n"));
+
+                       if (run_result == 3)
+                               message = g_string_append(message, _("Cannot create tmp file"));
+                       else
+                               {
+                               message = g_string_append(message, _("File: "));
+                               message = g_string_append(message, fd_n->name);
+                               }
+
+                       gd = generic_dialog_new(_("Image orientation"),
+                       "Image orientation", NULL, TRUE, NULL, NULL);
+                       generic_dialog_add_message(gd, GTK_STOCK_DIALOG_ERROR,
+                       "Image orientation", message->str);
+                       generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, NULL, TRUE);
+
+                       gtk_widget_show(gd->dialog);
+
+                       g_string_free(message, TRUE);
+                       }
+
+               g_free(rotation);
+               g_free(command);
+               }
+}
+
+static void layout_menu_write_rotate_keep_date_cb(GtkToggleAction *action, gpointer data)
+{
+       layout_menu_write_rotate(action, data, TRUE);
+}
+
+static void layout_menu_write_rotate_cb(GtkToggleAction *action, gpointer data)
+{
+       layout_menu_write_rotate(action, data, FALSE);
+}
+
 static void layout_menu_config_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -619,12 +784,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)
@@ -695,6 +868,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;
@@ -809,6 +997,13 @@ static void layout_menu_bar_sort_cb(GtkToggleAction *action, gpointer data)
        layout_bar_sort_toggle(lw);
 }
 
+static void layout_menu_hide_bars_cb(GtkToggleAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_bars_hide_toggle(lw);
+}
+
 static void layout_menu_slideshow_cb(GtkToggleAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -855,7 +1050,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)
@@ -863,7 +1058,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)
@@ -1049,7 +1244,7 @@ static void layout_menu_log_window_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       log_window_new();
+       log_window_new(lw);
 }
 
 
@@ -1186,6 +1381,64 @@ 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_split_pane_updown_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+       gint active_frame;
+
+       active_frame = lw->active_split_image;
+
+       if (lw->split_images[MAX_SPLIT_IMAGES-1] )
+               {
+               active_frame = active_frame ^ 2;
+               }
+       else
+               {
+               active_frame = active_frame ^ 1;
+               }
+       layout_image_activate(lw, active_frame, FALSE);
+}
+
 static void layout_menu_image_last_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -1443,6 +1696,7 @@ static GtkActionEntry menu_entries[] = {
   { "EditMenu",                NULL,                   N_("_Edit"),                            NULL,                   NULL,                                   NULL },
   { "SelectMenu",      NULL,                   N_("_Select"),                          NULL,                   NULL,                                   NULL },
   { "OrientationMenu", NULL,                   N_("_Orientation"),                     NULL,                   NULL,                                   NULL },
+  { "RatingMenu",      NULL,                   N_("_Rating"),                                  NULL,                   NULL,                                   NULL },
   { "ExternalMenu",    NULL,                   N_("E_xternal Editors"),                NULL,                   NULL,                                   NULL },
   { "PreferencesMenu", NULL,                   N_("P_references"),                     NULL,                   NULL,                                   NULL },
   { "ViewMenu",                NULL,                   N_("_View"),                            NULL,                   NULL,                                   NULL },
@@ -1480,14 +1734,21 @@ 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) },
   { "CloseWindow",     GTK_STOCK_CLOSE,        N_("C_lose window"),                    "<control>W",           N_("Close window"),                     CB(layout_menu_close_cb) },
   { "Quit",            GTK_STOCK_QUIT,         N_("_Quit"),                            "<control>Q",           N_("Quit"),                             CB(layout_menu_exit_cb) },
   { "RotateCW",                NULL,                   N_("_Rotate clockwise"),                "bracketright",         N_("Rotate clockwise"),                 CB(layout_menu_alter_90_cb) },
+  { "Rating0",         NULL,                   N_("_Rating 0"),        "<alt>KP_0",    N_("Rating 0"),                 CB(layout_menu_rating_0_cb) },
+  { "Rating1",         NULL,                   N_("_Rating 1"),        "<alt>KP_1",    N_("Rating 1"),                 CB(layout_menu_rating_1_cb) },
+  { "Rating2",         NULL,                   N_("_Rating 2"),        "<alt>KP_2",    N_("Rating 2"),                 CB(layout_menu_rating_2_cb) },
+  { "Rating3",         NULL,                   N_("_Rating 3"),        "<alt>KP_3",    N_("Rating 3"),                 CB(layout_menu_rating_3_cb) },
+  { "Rating4",         NULL,                   N_("_Rating 4"),        "<alt>KP_4",    N_("Rating 4"),                 CB(layout_menu_rating_4_cb) },
+  { "Rating5",         NULL,                   N_("_Rating 5"),        "<alt>KP_5",    N_("Rating 5"),                 CB(layout_menu_rating_5_cb) },
+  { "RatingM1",                NULL,                   N_("_Rating -1"),       "<alt>KP_Subtract",     N_("Rating -1"),        CB(layout_menu_rating_m1_cb) },
   { "RotateCCW",       NULL,                   N_("Rotate _counterclockwise"),         "bracketleft",          N_("Rotate counterclockwise"),          CB(layout_menu_alter_90cc_cb) },
   { "Rotate180",       NULL,                   N_("Rotate 1_80"),                      "<shift>R",             N_("Rotate 180"),                       CB(layout_menu_alter_180_cb) },
   { "Mirror",          NULL,                   N_("_Mirror"),                          "<shift>M",             N_("Mirror"),                           CB(layout_menu_alter_mirror_cb) },
@@ -1554,6 +1815,12 @@ static GtkActionEntry menu_entries[] = {
   { "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) },
+  { "SplitUpPane",     NULL,                   N_("_Up Pane"), "<alt>Up",                      N_("Up Pane"),  CB(layout_menu_split_pane_updown_cb) },
+  { "SplitDownPane",   NULL,                   N_("_Down Pane"),       "<alt>Down",                    N_("Down Pane"),        CB(layout_menu_split_pane_updown_cb) },
+  { "WriteRotation",   NULL,                   N_("_Write orientation to file"),               NULL,           N_("Write orientation to file"),                        CB(layout_menu_write_rotate_cb) },
+  { "WriteRotationKeepDate",   NULL,                   N_("_Write orientation to file (preserve timestamp)"),                  NULL,           N_("Write orientation to file (preserve timestamp)"),                   CB(layout_menu_write_rotate_keep_date_cb) },
 
 };
 
@@ -1565,12 +1832,16 @@ static GtkToggleActionEntry menu_toggle_entries[] = {
   { "HideToolbar",     NULL,                   N_("Hide tool_bar"),                    NULL,                   N_("Hide toolbar"),                     CB(layout_menu_toolbar_cb),      FALSE  },
   { "SBar",            NULL,                   N_("_Info sidebar"),                    "<control>K",           N_("Info sidebar"),                     CB(layout_menu_bar_cb),          FALSE  },
   { "SBarSort",                NULL,                   N_("Sort _manager"),                    "<shift>S",             N_("Sort manager"),                     CB(layout_menu_bar_sort_cb),     FALSE  },
+  { "HideBars",                NULL,                   N_("Hide Bars"),                        "grave",                N_("Hide Bars"),                        CB(layout_menu_hide_bars_cb),    FALSE  },
   { "SlideShow",       GTK_STOCK_MEDIA_PLAY,   N_("Toggle _slideshow"),                "S",                    N_("Toggle slideshow"),                 CB(layout_menu_slideshow_cb),    FALSE  },
   { "UseColorProfiles",        GTK_STOCK_SELECT_COLOR, N_("Use _color profiles"),              NULL,                   N_("Use color profiles"),               CB(layout_color_menu_enable_cb), FALSE},
   { "UseImageProfile", NULL,                   N_("Use profile from _image"),          NULL,                   N_("Use profile from image"),           CB(layout_color_menu_use_image_cb), FALSE},
   { "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[] = {
@@ -1578,9 +1849,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[] = {
@@ -1666,6 +1936,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'/>"
@@ -1687,6 +1958,22 @@ static const gchar *menu_ui_description =
 "        <menuitem action='Mirror'/>"
 "        <menuitem action='Flip'/>"
 "        <menuitem action='AlterNone'/>"
+"        <separator/>"
+"        <menuitem action='ExifRotate'/>"
+"        <separator/>"
+"        <menuitem action='WriteRotation'/>"
+"        <menuitem action='WriteRotationKeepDate'/>"
+"        <separator/>"
+"      </menu>"
+"      <menu action='RatingMenu'>"
+"        <menuitem action='Rating0'/>"
+"        <menuitem action='Rating1'/>"
+"        <menuitem action='Rating2'/>"
+"        <menuitem action='Rating3'/>"
+"        <menuitem action='Rating4'/>"
+"        <menuitem action='Rating5'/>"
+"        <menuitem action='RatingM1'/>"
+"        <separator/>"
 "      </menu>"
 "      <menuitem action='SaveMetadata'/>"
 "      <placeholder name='PropertiesSection'/>"
@@ -1699,7 +1986,9 @@ static const gchar *menu_ui_description =
 "      </menu>"
 "      <placeholder name='PreferencesSection'/>"
 "      <separator/>"
+#if !GTK_CHECK_VERSION(3,0,0)
 "      <menuitem action='Wallpaper'/>"
+#endif
 "      <separator/>"
 "    </menu>"
 "    <menu action='ViewMenu'>"
@@ -1709,7 +1998,6 @@ static const gchar *menu_ui_description =
 "      <placeholder name='WindowSection'/>"
 "      <separator/>"
 "      <menu action='FileDirMenu'>"
-"        <menuitem action='FolderList'/>"
 "        <menuitem action='FolderTree'/>"
 "        <placeholder name='FolderSection'/>"
 "        <separator/>"
@@ -1757,6 +2045,11 @@ static const gchar *menu_ui_description =
 "        <menuitem action='SplitVertical'/>"
 "        <menuitem action='SplitQuad'/>"
 "        <menuitem action='SplitSingle'/>"
+"        <separator/>"
+"        <menuitem action='SplitNextPane'/>"
+"        <menuitem action='SplitPreviousPane'/>"
+"        <menuitem action='SplitUpPane'/>"
+"        <menuitem action='SplitDownPane'/>"
 "      </menu>"
 "      <menu action='StereoMenu'>"
 "        <menuitem action='StereoAuto'/>"
@@ -1799,9 +2092,11 @@ static const gchar *menu_ui_description =
 "      <separator/>"
 "      <menuitem action='SBar'/>"
 "      <menuitem action='SBarSort'/>"
+"      <menuitem action='HideBars'/>"
 "      <menuitem action='ShowInfoPixel'/>"
 "      <placeholder name='ToolsSection'/>"
 "      <separator/>"
+"      <menuitem action='Animate'/>"
 "      <menuitem action='SlideShow'/>"
 "      <menuitem action='SlideShowPause'/>"
 "      <menuitem action='Refresh'/>"
@@ -1836,6 +2131,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'/>"
@@ -2133,9 +2429,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);
@@ -2411,11 +2707,20 @@ 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);
 
+       action = gtk_action_group_get_action(lw->action_group, "SplitNextPane");
+       gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE));
+       action = gtk_action_group_get_action(lw->action_group, "SplitPreviousPane");
+       gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE));
+       action = gtk_action_group_get_action(lw->action_group, "SplitUpPane");
+       gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE));
+       action = gtk_action_group_get_action(lw->action_group, "SplitDownPane");
+       gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE));
+
        action = gtk_action_group_get_action(lw->action_group, "ViewIcons");
        gtk_radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->options.file_view_type);
 
@@ -2440,12 +2745,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");
@@ -2458,6 +2772,13 @@ static void layout_util_sync_views(LayoutWindow *lw)
        action = gtk_action_group_get_action(lw->action_group, "ConnectZoomMenu");
        gtk_action_set_sensitive(action, lw->split_mode != SPLIT_NONE);
 
+       action = gtk_action_group_get_action(lw->action_group, "WriteRotation");
+       gtk_action_set_sensitive(action, !(runcmd("which exiftran >/dev/null") ||
+                                                       runcmd("which mogrify >/dev/null") || options->metadata.write_orientation));
+       action = gtk_action_group_get_action(lw->action_group, "WriteRotationKeepDate");
+       gtk_action_set_sensitive(action, !(runcmd("which exiftran >/dev/null") ||
+                                                       runcmd("which mogrify >/dev/null") || options->metadata.write_orientation));
+
        action = gtk_action_group_get_action(lw->action_group, "StereoAuto");
        gtk_radio_action_set_current_value(GTK_RADIO_ACTION(action), layout_image_stereo_pixbuf_get(lw));
 
@@ -2655,6 +2976,39 @@ void layout_bar_sort_toggle(LayoutWindow *lw)
        layout_util_sync_views(lw);
 }
 
+static void layout_bars_hide_toggle(LayoutWindow *lw)
+{
+       if (lw->options.bars_state.hidden)
+               {
+               lw->options.bars_state.hidden = FALSE;
+               if (lw->options.bars_state.sort)
+                       {
+                       gtk_widget_show(lw->bar_sort);
+                       }
+               if (lw->options.bars_state.info)
+                       {
+                       gtk_widget_show(lw->bar);
+                       }
+               layout_tools_float_set(lw, lw->options.tools_float,
+                                                                       lw->options.bars_state.tools_hidden);
+               }
+       else
+               {
+               lw->options.bars_state.hidden = TRUE;
+               lw->options.bars_state.sort = layout_bar_sort_enabled(lw);
+               lw->options.bars_state.info = layout_bar_enabled(lw);
+               lw->options.bars_state.tools_float = lw->options.tools_float;
+               lw->options.bars_state.tools_hidden = lw->options.tools_hidden;
+
+               gtk_widget_hide(lw->bar);
+               if (lw->bar_sort)
+                       gtk_widget_hide(lw->bar_sort);
+               layout_tools_float_set(lw, lw->options.tools_float, TRUE);
+               }
+
+       layout_util_sync_views(lw);
+}
+
 void layout_bars_new_image(LayoutWindow *lw)
 {
        layout_bar_new_image(lw);