Fix #903, #904: Slideshow settings
[geeqie.git] / src / layout_util.c
index dca69e8..a9c7da7 100644 (file)
@@ -35,6 +35,7 @@
 #include "editors.h"
 #include "filedata.h"
 #include "history_list.h"
+#include "image.h"
 #include "image-overlay.h"
 #include "histogram.h"
 #include "img-view.h"
@@ -47,6 +48,7 @@
 #include "print.h"
 #include "rcfile.h"
 #include "search.h"
+#include "search_and_run.h"
 #include "slideshow.h"
 #include "ui_fileops.h"
 #include "ui_menu.h"
@@ -59,8 +61,9 @@
 #include "metadata.h"
 #include "desktop_file.h"
 
+#include <sys/wait.h>
 #include <gdk/gdkkeysyms.h> /* for keyboard values */
-#include "keymap_template.c"
+#include "keymap_template.h"
 
 #define MENU_EDIT_ACTION_OFFSET 16
 #define FILE_COLUMN_POINTER 0
@@ -69,6 +72,7 @@ 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);
+static void layout_search_and_run_window_new(LayoutWindow *lw);
 
 /*
  *-----------------------------------------------------------------------------
@@ -274,11 +278,6 @@ static void layout_menu_clear_marks_cb(GtkAction *action, gpointer data)
        gtk_widget_show(gd->dialog);
 }
 
-static void layout_menu_new_window_cb(GtkAction *action, gpointer data)
-{
-       layout_menu_new_window(action, data);
-}
-
 static void layout_menu_new_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -384,16 +383,6 @@ static void layout_menu_move_to_trash_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)
-               {
-               options->file_ops.safe_delete_enable = FALSE;
-               file_util_delete(NULL, layout_selection_list(lw), layout_window(lw));
-               }
-}
 static void layout_menu_move_to_trash_key_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -523,6 +512,15 @@ static void layout_menu_alter_desaturate_cb(GtkToggleAction *action, gpointer da
        layout_image_set_desaturate(lw, gtk_toggle_action_get_active(action));
 }
 
+static void layout_menu_alter_ignore_alpha_cb(GtkToggleAction *action, gpointer data)
+{
+   LayoutWindow *lw = data;
+
+       if (lw->options.ignore_alpha == gtk_toggle_action_get_active(action)) return;
+
+   layout_image_set_ignore_alpha(lw, gtk_toggle_action_get_active(action));
+}
+
 static void layout_menu_alter_none_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -539,10 +537,15 @@ static void layout_menu_exif_rotate_cb(GtkToggleAction *action, gpointer data)
 }
 
 static void layout_menu_select_rectangle_cb(GtkToggleAction *action, gpointer data)
+{
+       options->draw_rectangle = gtk_toggle_action_get_active(action);
+}
+
+static void layout_menu_split_pane_sync_cb(GtkToggleAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
 
-       options->draw_rectangle = gtk_toggle_action_get_active(action);
+       lw->options.split_pane_sync = gtk_toggle_action_get_active(action);
 }
 
 static void layout_menu_select_overunderexposed_cb(GtkToggleAction *action, gpointer data)
@@ -599,7 +602,7 @@ static void layout_menu_write_rotate(GtkToggleAction *action, gpointer data, gbo
                        }
 
                rotation = g_strdup_printf("%d", fd_n->user_orientation);
-               command = g_strconcat(GQ_BIN_DIR, "/geeqie-rotate -r ", rotation,
+               command = g_strconcat(gq_bin_dir, "/geeqie-rotate -r ", rotation,
                                                                keep_date ? " -t \"" : " \"", fd_n->path, "\"", NULL);
                cmdstatus = runcmd(command);
                run_result = WEXITSTATUS(cmdstatus);
@@ -658,7 +661,7 @@ static void layout_menu_config_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       show_config_window();
+       show_config_window(lw);
 }
 
 static void layout_menu_editors_cb(GtkAction *action, gpointer data)
@@ -978,7 +981,6 @@ static void layout_menu_guidelines_cb(GtkToggleAction *action, gpointer data)
 
        if (gtk_toggle_action_get_active(action))
                {
-               OsdShowFlags flags = image_osd_get(lw->image);
                image_osd_set(lw->image, OSD_SHOW_INFO | OSD_SHOW_STATUS | OSD_SHOW_GUIDELINES);
                layout_util_sync_views(lw);
                }
@@ -1058,6 +1060,15 @@ static void layout_menu_bar_exif_cb(GtkAction *action, gpointer data)
        layout_exif_window_new(lw);
 }
 
+static void layout_menu_search_and_run_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_exit_fullscreen(lw);
+       layout_search_and_run_window_new(lw);
+}
+
+
 static void layout_menu_float_cb(GtkToggleAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
@@ -1234,8 +1245,8 @@ static char *keyboard_map_hardcoded[][2] = {
        {"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"},
+       {"Upper Border", "&lt;Primary&gt;Up"},
+       {"Upper Border", "&lt;Primary&gt;&lt;Shift&gt;Up"},
        {"Scroll", "Down"},
        {"FastScroll", "&lt;Shift&gt;Down"},
        {"Lower Border", "&lt;Primary&gt;Down"},
@@ -1532,13 +1543,53 @@ static void layout_menu_image_first_cb(GtkAction *action, gpointer data)
 static void layout_menu_image_prev_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
-       layout_image_prev(lw);
+       gint i;
+
+       if (lw->options.split_pane_sync)
+               {
+               for (i = 0; i < MAX_SPLIT_IMAGES; i++)
+                       {
+                       if (lw->split_images[i])
+                               {
+                               if (i != -1)
+                                       {
+                                       DEBUG_1("image activate scroll %d", i);
+                                       layout_image_activate(lw, i, FALSE);
+                                       layout_image_prev(lw);
+                                       }
+                               }
+                       }
+               }
+       else
+               {
+               layout_image_prev(lw);
+               }
 }
 
 static void layout_menu_image_next_cb(GtkAction *action, gpointer data)
 {
        LayoutWindow *lw = data;
-       layout_image_next(lw);
+       gint i;
+
+       if (lw->options.split_pane_sync)
+               {
+               for (i = 0; i < MAX_SPLIT_IMAGES; i++)
+                       {
+                       if (lw->split_images[i])
+                               {
+                               if (i != -1)
+                                       {
+                                       DEBUG_1("image activate scroll %d", i);
+                                       layout_image_activate(lw, i, FALSE);
+                                       layout_image_next(lw);
+                                       }
+                               }
+                       }
+               }
+       else
+               {
+               layout_image_next(lw);
+               }
 }
 
 static void layout_menu_page_first_cb(GtkAction *action, gpointer data)
@@ -1546,7 +1597,10 @@ static void layout_menu_page_first_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
        FileData *fd = layout_image_get_fd(lw);
 
-       file_data_set_page_num(fd, 1);
+       if (fd->page_total > 0)
+               {
+               file_data_set_page_num(fd, 1);
+               }
 }
 
 static void layout_menu_page_last_cb(GtkAction *action, gpointer data)
@@ -1554,7 +1608,10 @@ static void layout_menu_page_last_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
        FileData *fd = layout_image_get_fd(lw);
 
-       file_data_set_page_num(fd, -1);
+       if (fd->page_total > 0)
+               {
+               file_data_set_page_num(fd, -1);
+               }
 }
 
 static void layout_menu_page_next_cb(GtkAction *action, gpointer data)
@@ -1562,7 +1619,10 @@ static void layout_menu_page_next_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
        FileData *fd = layout_image_get_fd(lw);
 
-       file_data_inc_page_num(fd);
+       if (fd->page_total > 0)
+               {
+               file_data_inc_page_num(fd);
+               }
 }
 
 static void layout_menu_page_previous_cb(GtkAction *action, gpointer data)
@@ -1570,7 +1630,26 @@ static void layout_menu_page_previous_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
        FileData *fd = layout_image_get_fd(lw);
 
-       file_data_dec_page_num(fd);
+       if (fd->page_total > 0)
+               {
+               file_data_dec_page_num(fd);
+               }
+}
+
+static void layout_menu_image_forward_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       /* Obtain next image */
+       layout_set_path(lw, image_chain_forward());
+}
+
+static void layout_menu_image_back_cb(GtkAction *action, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       /* Obtain previous image */
+       layout_set_path(lw, image_chain_back());
 }
 
 static void layout_menu_split_pane_next_cb(GtkAction *action, gpointer data)
@@ -1888,6 +1967,454 @@ void layout_recent_add_path(const gchar *path)
        layout_recent_update_all();
 }
 
+/*
+ *-----------------------------------------------------------------------------
+ * window layout menu
+ *-----------------------------------------------------------------------------
+ */
+typedef struct _WindowNames WindowNames;
+struct _WindowNames
+{
+       gboolean displayed;
+       gchar *name;
+       gchar *path;
+};
+
+typedef struct _RenameWindow RenameWindow;
+struct _RenameWindow
+{
+       GenericDialog *gd;
+       LayoutWindow *lw;
+
+       GtkWidget *button_ok;
+       GtkWidget *window_name_entry;
+};
+
+typedef struct _DeleteWindow DeleteWindow;
+struct _DeleteWindow
+{
+       GenericDialog *gd;
+       LayoutWindow *lw;
+
+       GtkWidget *button_ok;
+       GtkWidget *group;
+};
+
+static gint layout_window_menu_list_sort_cb(gconstpointer a, gconstpointer b)
+{
+       const WindowNames *wna = a;
+       const WindowNames *wnb = b;
+
+       return g_strcmp0((gchar *)wna->name, (gchar *)wnb->name);
+}
+
+static GList *layout_window_menu_list(GList *listin)
+{
+       GList *list;
+       WindowNames *wn;
+       gboolean dupe;
+       DIR *dp;
+       struct dirent *dir;
+       gchar *pathl;
+
+       pathl = path_from_utf8(get_window_layouts_dir());
+       dp = opendir(pathl);
+       if (!dp)
+               {
+               /* dir not found */
+               g_free(pathl);
+               return listin;
+               }
+
+       while ((dir = readdir(dp)) != NULL)
+               {
+               gchar *name_file = dir->d_name;
+
+               if (g_str_has_suffix(name_file, ".xml"))
+                       {
+                       LayoutWindow *lw_tmp ;
+                       gchar *name_utf8 = path_to_utf8(name_file);
+                       gchar *name_base = g_strndup(name_utf8, strlen(name_utf8) - 4);
+                       list = layout_window_list;
+                       dupe = FALSE;
+                       while (list)
+                               {
+                               lw_tmp = list->data;
+                               if (g_strcmp0(lw_tmp->options.id, name_base) == 0)
+                                       {
+                                       dupe = TRUE;
+                                       }
+                               list = list->next;
+                               }
+                       gchar *dpath = g_build_filename(pathl, name_utf8, NULL);
+                       wn  = g_new0(WindowNames, 1);
+                       wn->displayed = dupe;
+                       wn->name = g_strdup(name_base);
+                       wn->path = g_strdup(dpath);
+                       listin = g_list_append(listin, wn);
+
+                       g_free(dpath);
+                       g_free(name_utf8);
+                       g_free(name_base);
+                       }
+               }
+       closedir(dp);
+
+       g_free(pathl);
+
+       return g_list_sort(listin, layout_window_menu_list_sort_cb);
+}
+
+static void layout_menu_new_window_cb(GtkWidget *widget, gpointer data)
+{
+       gint n;
+
+       n = GPOINTER_TO_INT(data);
+       GList *menulist = NULL;
+
+       menulist = layout_window_menu_list(menulist);
+       WindowNames *wn = g_list_nth(menulist, n )->data;
+
+       if (wn->path)
+               {
+               load_config_from_file(wn->path, FALSE);
+               }
+       else
+               {
+               log_printf(_("Error: window layout name: %s does not exist\n"), wn->path);
+               }
+}
+
+static void layout_menu_new_window_update(LayoutWindow *lw)
+{
+       GtkWidget *menu;
+       GtkWidget *sub_menu;
+       GtkWidget *item;
+       GList *children, *iter;
+       gint n;
+       GList *list = NULL;
+       gint i = 0;
+       WindowNames *wn;
+
+       if (!lw->ui_manager) return;
+
+       list = layout_window_menu_list(list);
+
+       menu = gtk_ui_manager_get_widget(lw->ui_manager, "/MainMenu/WindowsMenu/NewWindow");
+       sub_menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu));
+
+       children = gtk_container_get_children(GTK_CONTAINER(sub_menu));
+       for (iter = children; iter != NULL; iter = g_list_next(iter), i++)
+               {
+               if (i >= 4) // separator, default, from current, separator
+                       {
+                       gtk_widget_destroy(GTK_WIDGET(iter->data));
+                       }
+               }
+       g_list_free(children);
+
+       menu_item_add_divider(sub_menu);
+
+       n = 0;
+       while (list)
+               {
+               wn = list->data;
+               item = menu_item_add_simple(sub_menu, wn->name, G_CALLBACK(layout_menu_new_window_cb), GINT_TO_POINTER(n));
+               if (wn->displayed)
+                       {
+                       gtk_widget_set_sensitive(item, FALSE);
+                       }
+               list = list->next;
+               n++;
+               }
+}
+
+static void window_rename_cancel_cb(GenericDialog *gd, gpointer data)
+{
+       RenameWindow *rw = data;
+
+       generic_dialog_close(rw->gd);
+       g_free(rw);
+}
+
+static void window_rename_ok(GenericDialog *gd, gpointer data)
+{
+       RenameWindow *rw = data;
+       gchar *path;
+       gboolean window_layout_name_exists = FALSE;
+       GList *list = NULL;
+       gchar *xml_name;
+       gchar *new_id;
+
+       new_id = g_strdup(gtk_entry_get_text(GTK_ENTRY(rw->window_name_entry)));
+
+       list = layout_window_menu_list(list);
+       while (list)
+               {
+               WindowNames *ln = list->data;
+               if (g_strcmp0(ln->name, new_id) == 0)
+                       {
+                       gchar *buf;
+                       buf = g_strdup_printf(_("Window layout name \"%s\" already exists."), new_id);
+                       warning_dialog(_("Rename window"), buf, GTK_STOCK_DIALOG_WARNING, rw->gd->dialog);
+                       g_free(buf);
+                       window_layout_name_exists = TRUE;
+                       break;
+                       }
+               list = list->next;
+               }
+
+       if (!window_layout_name_exists)
+               {
+               xml_name = g_strdup_printf("%s.xml", rw->lw->options.id);
+               path = g_build_filename(get_window_layouts_dir(), xml_name, NULL);
+
+               if (isfile(path))
+                       {
+                       unlink_file(path);
+                       }
+               g_free(xml_name);
+               g_free(path);
+
+               g_free(rw->lw->options.id);
+               rw->lw->options.id = g_strdup(new_id);
+               layout_menu_new_window_update(rw->lw);
+               layout_refresh(rw->lw);
+               image_update_title(rw->lw->image);
+               }
+
+       save_layout(rw->lw);
+
+       g_free(new_id);
+       generic_dialog_close(rw->gd);
+       g_free(rw);
+}
+
+static void window_rename_ok_cb(GenericDialog *gd, gpointer data)
+{
+       RenameWindow *rw = data;
+
+       window_rename_ok(gd, rw);
+}
+
+static void window_rename_entry_activate_cb(GenericDialog *gd, gpointer data)
+{
+       RenameWindow *rw = data;
+
+       window_rename_ok(gd, rw);
+}
+
+static void window_delete_cancel_cb(GenericDialog *gd, gpointer data)
+{
+       DeleteWindow *dw = data;
+
+       g_free(dw);
+}
+
+static void window_delete_ok_cb(GenericDialog *gd, gpointer data)
+{
+       DeleteWindow *dw = data;
+       gchar *path;
+       gchar *xml_name;
+
+       xml_name = g_strdup_printf("%s.xml", dw->lw->options.id);
+       path = g_build_filename(get_window_layouts_dir(), xml_name, NULL);
+
+       layout_close(dw->lw);
+       g_free(dw);
+
+       if (isfile(path))
+               {
+               unlink_file(path);
+               }
+       g_free(xml_name);
+       g_free(path);
+}
+
+static void layout_menu_window_default_cb(GtkWidget *widget, gpointer data)
+{
+       layout_new_from_config(NULL, NULL, TRUE);
+}
+
+static void layout_menu_windows_menu_cb(GtkWidget *widget, gpointer data)
+{
+       LayoutWindow *lw = data;
+       GtkWidget *menu;
+       GtkWidget *sub_menu;
+       gchar *menu_label;
+       GList *children, *iter;
+       gint i;
+
+       menu = gtk_ui_manager_get_widget(lw->ui_manager, "/MainMenu/WindowsMenu/");
+       sub_menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu));
+
+       /* disable Delete for temporary windows */
+       if (g_str_has_prefix(lw->options.id, "lw"))
+               {
+               i = 0;
+               children = gtk_container_get_children(GTK_CONTAINER(sub_menu));
+               for (iter = children; iter != NULL; iter = g_list_next(iter), i++)
+                       {
+                       menu_label = g_strdup(gtk_menu_item_get_label(GTK_MENU_ITEM(iter->data)));
+                       if (g_strcmp0(menu_label, _("Delete window")) == 0)
+                               {
+                               gtk_widget_set_sensitive(GTK_WIDGET(iter->data), FALSE);
+                               }
+                       g_free(menu_label);
+                       }
+               g_list_free(children);
+               }
+}
+
+static void change_window_id(const gchar *infile, const gchar *outfile)
+{
+       GFile *in_file;
+       GFile *out_file;
+       GFileInputStream *in_file_stream;
+       GFileOutputStream *out_file_stream;
+       GDataInputStream *in_data_stream;
+       GDataOutputStream *out_data_stream;
+       gchar *line;
+       gchar *id_name;
+
+       id_name = layout_get_unique_id();
+
+       in_file = g_file_new_for_path(infile);
+       in_file_stream = g_file_read(in_file, NULL, NULL);
+       in_data_stream = g_data_input_stream_new(G_INPUT_STREAM(in_file_stream));
+
+       out_file = g_file_new_for_path(outfile);
+       out_file_stream = g_file_append_to(out_file, G_FILE_CREATE_PRIVATE, NULL, NULL);
+       out_data_stream = g_data_output_stream_new(G_OUTPUT_STREAM(out_file_stream));
+
+       while ((line = g_data_input_stream_read_line(in_data_stream, NULL, NULL, NULL)))
+               {
+               if (g_str_has_suffix(line, "<layout"))
+                       {
+                       g_data_output_stream_put_string(out_data_stream, line, NULL, NULL);
+                       g_data_output_stream_put_string(out_data_stream, "\n", NULL, NULL);
+                       g_free(line);
+
+                       line = g_data_input_stream_read_line(in_data_stream, NULL, NULL, NULL);
+                       g_data_output_stream_put_string(out_data_stream, "id = \"", NULL, NULL);
+                       g_data_output_stream_put_string(out_data_stream, id_name, NULL, NULL);
+                       g_data_output_stream_put_string(out_data_stream, "\"\n", NULL, NULL);
+                       }
+               else
+                       {
+                       g_data_output_stream_put_string(out_data_stream, line, NULL, NULL);
+                       g_data_output_stream_put_string(out_data_stream, "\n", NULL, NULL);
+                       }
+               g_free(line);
+               }
+
+       g_free(id_name);
+       g_object_unref(out_data_stream);
+       g_object_unref(in_data_stream);
+       g_object_unref(out_file_stream);
+       g_object_unref(in_file_stream);
+       g_object_unref(out_file);
+       g_object_unref(in_file);
+}
+
+static void layout_menu_window_from_current_cb(GtkWidget *widget, gpointer data)
+{
+       LayoutWindow *lw = data;
+       gint fd_in = -1;
+       gint fd_out = -1;
+       char * tmp_file_in;
+       char * tmp_file_out;
+       GError *error = NULL;
+
+       fd_in = g_file_open_tmp("geeqie_layout_name_XXXXXX.xml", &tmp_file_in, &error);
+       if (error)
+               {
+               log_printf("Error: Window layout - cannot create file:%s\n",error->message);
+               g_error_free(error);
+               return;
+               }
+       close(fd_in);
+       fd_out = g_file_open_tmp("geeqie_layout_name_XXXXXX.xml", &tmp_file_out, &error);
+       if (error)
+               {
+               log_printf("Error: Window layout - cannot create file:%s\n",error->message);
+               g_error_free(error);
+               return;
+               }
+       close(fd_out);
+
+       save_config_to_file(tmp_file_in, options, lw);
+       change_window_id(tmp_file_in, tmp_file_out);
+       load_config_from_file(tmp_file_out, FALSE);
+
+       unlink_file(tmp_file_in);
+       unlink_file(tmp_file_out);
+       g_free(tmp_file_in);
+       g_free(tmp_file_out);
+}
+
+static void layout_menu_window_cb(GtkWidget *widget, gpointer data)
+{
+       LayoutWindow *lw = data;
+
+       layout_menu_new_window_update(lw);
+}
+
+static void layout_menu_window_rename_cb(GtkWidget *widget, gpointer data)
+{
+       LayoutWindow *lw = data;
+       RenameWindow *rw;
+       GtkWidget *hbox;
+
+       rw = g_new0(RenameWindow, 1);
+       rw->lw = lw;
+
+       rw->gd = generic_dialog_new(_("Rename window"), "rename_window", NULL, FALSE, window_rename_cancel_cb, rw);
+       rw->button_ok = generic_dialog_add_button(rw->gd, GTK_STOCK_OK, _("OK"), window_rename_ok_cb, TRUE);
+
+       generic_dialog_add_message(rw->gd, NULL, _("rename window"), NULL, FALSE);
+
+       hbox = pref_box_new(rw->gd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, 0);
+       pref_spacer(hbox, PREF_PAD_INDENT);
+
+       hbox = pref_box_new(rw->gd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
+
+       rw->window_name_entry = gtk_entry_new();
+       gtk_widget_set_can_focus(rw->window_name_entry, TRUE);
+       gtk_editable_set_editable(GTK_EDITABLE(rw->window_name_entry), TRUE);
+       gtk_entry_set_text(GTK_ENTRY(rw->window_name_entry), lw->options.id);
+       gtk_box_pack_start(GTK_BOX(hbox), rw->window_name_entry, TRUE, TRUE, 0);
+       gtk_widget_grab_focus(GTK_WIDGET(rw->window_name_entry));
+       gtk_widget_show(rw->window_name_entry);
+       g_signal_connect(rw->window_name_entry, "activate", G_CALLBACK(window_rename_entry_activate_cb), rw);
+
+       gtk_widget_show(rw->gd->dialog);
+}
+
+static void layout_menu_window_delete_cb(GtkWidget *widget, gpointer data)
+{
+       LayoutWindow *lw = data;
+       DeleteWindow *dw;
+       GtkWidget *hbox;
+
+       dw = g_new0(DeleteWindow, 1);
+       dw->lw = lw;
+
+       dw->gd = generic_dialog_new(_("Delete window"), "delete_window", NULL, TRUE, window_delete_cancel_cb, dw);
+       dw->button_ok = generic_dialog_add_button(dw->gd, GTK_STOCK_OK, _("OK"), window_delete_ok_cb, TRUE);
+
+       generic_dialog_add_message(dw->gd, NULL, _("Delete window layout"), NULL, FALSE);
+
+       hbox = pref_box_new(dw->gd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, 0);
+       pref_spacer(hbox, PREF_PAD_INDENT);
+       dw->group = pref_box_new(hbox, TRUE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
+
+       hbox = pref_box_new(dw->group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
+       pref_label_new(hbox, (lw->options.id));
+
+       gtk_widget_show(dw->gd->dialog);
+}
+
 /*
  *-----------------------------------------------------------------------------
  * menu
@@ -1913,6 +2440,7 @@ static GtkActionEntry menu_entries[] = {
   { "StereoMenu",      NULL,                   N_("Stere_o"),                          NULL,                   NULL,                                   NULL },
   { "OverlayMenu",     NULL,                   N_("Image _Overlay"),                   NULL,                   NULL,                                   NULL },
   { "PluginsMenu",     NULL,                   N_("_Plugins"),                         NULL,                   NULL,                                   NULL },
+  { "WindowsMenu",             NULL,           N_("_Windows"),                         NULL,                   NULL,                                   CB(layout_menu_windows_menu_cb)  },
   { "HelpMenu",                NULL,                   N_("_Help"),                            NULL,                   NULL,                                   NULL },
 
   { "FirstImage",      GTK_STOCK_GOTO_TOP,     N_("_First Image"),                     "Home",                 N_("First Image"),                      CB(layout_menu_image_first_cb) },
@@ -1922,23 +2450,29 @@ static GtkActionEntry menu_entries[] = {
   { "NextImage",       GTK_STOCK_GO_DOWN,      N_("_Next Image"),                      "space",                N_("Next Image"),                       CB(layout_menu_image_next_cb) },
   { "NextImageAlt1",   GTK_STOCK_GO_DOWN,      N_("_Next Image"),                      "Page_Down",            N_("Next Image"),                       CB(layout_menu_image_next_cb) },
 
-  { "FirstPage",       GTK_STOCK_MEDIA_PREVIOUS,       N_("_First Page"),      "<control>Home",        N_( "First Page"),      CB(layout_menu_page_first_cb) },
-  { "LastPage",        GTK_STOCK_MEDIA_NEXT,   N_("_Last Page"),       "<control>End",         N_("Last Page"),        CB(layout_menu_page_last_cb) },
-  { "NextPage",        GTK_STOCK_MEDIA_FORWARD,        N_("_Next Page"),                       "<control>Page_Down",   N_("Next Page"),        CB(layout_menu_page_next_cb) },
-  { "PrevPage",        GTK_STOCK_MEDIA_REWIND, N_("_Previous Page"),   "<control>Page_Up",             N_("Previous Page"),    CB(layout_menu_page_previous_cb) },
+  { "ImageForward",    GTK_STOCK_GOTO_LAST,    N_("Image Forward"),    NULL,   N_("Forward in image history"), CB(layout_menu_image_forward_cb) },
+  { "ImageBack",       GTK_STOCK_GOTO_FIRST,   N_("Image Back"),               NULL,   N_("Back in image history"),            CB(layout_menu_image_back_cb) },
 
+  { "FirstPage",GTK_STOCK_MEDIA_PREVIOUS,      N_("_First Page"),              NULL,   N_( "First Page of multi-page image"),  CB(layout_menu_page_first_cb) },
+  { "LastPage",        GTK_STOCK_MEDIA_NEXT,           N_("_Last Page"),               NULL,   N_("Last Page of multi-page image"),    CB(layout_menu_page_last_cb) },
+  { "NextPage",        GTK_STOCK_MEDIA_FORWARD,        N_("_Next Page"),               NULL,   N_("Next Page of multi-page image"),    CB(layout_menu_page_next_cb) },
+  { "PrevPage",        GTK_STOCK_MEDIA_REWIND,         N_("_Previous Page"),   NULL,   N_("Previous Page of multi-page image"),        CB(layout_menu_page_previous_cb) },
 
-  { "NextImageAlt2",   GTK_STOCK_GO_DOWN,      N_("_Next Image"),                      "KP_Page_Down",         N_("Next Image"),                       CB(layout_menu_image_next_cb) },
-  { "LastImage",       GTK_STOCK_GOTO_BOTTOM,  N_("_Last Image"),                      "End",                  N_("Last Image"),                       CB(layout_menu_image_last_cb) },
-  { "Back",            GTK_STOCK_GO_BACK,      N_("_Back"),                            NULL,                   N_("Back"),                             CB(layout_menu_back_cb) },
-  { "Forward", GTK_STOCK_GO_FORWARD,   N_("_Forward"),                 NULL,                   N_("Forward"),                          CB(layout_menu_forward_cb) },
-  { "Home",            GTK_STOCK_HOME,         N_("_Home"),                            NULL,                   N_("Home"),                             CB(layout_menu_home_cb) },
-  { "Up",              GTK_STOCK_GO_UP,        N_("_Up"),                              NULL,                   N_("Up"),                               CB(layout_menu_up_cb) },
 
-  { "NewWindow",       GTK_STOCK_NEW,          N_("New _window"),                      "<control>N",           N_("New window"),                       CB(layout_menu_new_window_cb) },
+  { "NextImageAlt2",   GTK_STOCK_GO_DOWN,      N_("_Next Image"),                      "KP_Page_Down",         N_("Next Image"),               CB(layout_menu_image_next_cb) },
+  { "LastImage",       GTK_STOCK_GOTO_BOTTOM,  N_("_Last Image"),                      "End",                  N_("Last Image"),                       CB(layout_menu_image_last_cb) },
+  { "Back",            GTK_STOCK_GO_BACK,      N_("_Back"),                    NULL,   N_("Back in folder history"),           CB(layout_menu_back_cb) },
+  { "Forward", GTK_STOCK_GO_FORWARD,   N_("_Forward"),         NULL,   N_("Forward in folder history"),        CB(layout_menu_forward_cb) },
+  { "Home",            GTK_STOCK_HOME,         N_("_Home"),                    NULL,   N_("Home"),                             CB(layout_menu_home_cb) },
+  { "Up",              GTK_STOCK_GO_UP,        N_("_Up"),                              NULL,   N_("Up one folder"),                            CB(layout_menu_up_cb) },
+  { "NewWindow",       NULL,           N_("New window"),                       NULL,           N_("New window"),       CB(layout_menu_window_cb) },
+  { "NewWindowDefault",        NULL,   N_("default"),                  "<control>N",           N_("default"),  CB(layout_menu_window_default_cb)  },
+  { "NewWindowFromCurrent",    NULL,   N_("from current"),                     NULL,           N_("from current"),     CB(layout_menu_window_from_current_cb)  },
+  { "RenameWindow",    GTK_STOCK_EDIT,         N_("Rename window"),    NULL,   N_("Rename window"),    CB(layout_menu_window_rename_cb) },
+  { "DeleteWindow",    GTK_STOCK_DELETE,               N_("Delete window"),    NULL,   N_("Delete window"),    CB(layout_menu_window_delete_cb) },
   { "NewCollection",   GTK_STOCK_INDEX,        N_("_New collection"),                  "C",                    N_("New collection"),                   CB(layout_menu_new_cb) },
   { "OpenCollection",  GTK_STOCK_OPEN,         N_("_Open collection..."),              "O",                    N_("Open collection..."),               CB(layout_menu_open_cb) },
-  { "OpenRecent",      NULL,                   N_("Open recen_t"),                     NULL,                   N_("Open recent"),                      NULL },
+  { "OpenRecent",      NULL,                   N_("Open recen_t"),                     NULL,                   N_("Open recent collection"),                   NULL },
   { "Search",          GTK_STOCK_FIND,         N_("_Search..."),                       "F3",                   N_("Search..."),                        CB(layout_menu_search_cb) },
   { "FindDupes",       GTK_STOCK_FIND,         N_("_Find duplicates..."),              "D",                    N_("Find duplicates..."),               CB(layout_menu_dupes_cb) },
   { "PanView", PIXBUF_INLINE_ICON_PANORAMA,    N_("Pa_n view"),                        "<control>J",           N_("Pan view"),                         CB(layout_menu_pan_cb) },
@@ -1957,7 +2491,7 @@ static GtkActionEntry menu_entries[] = {
   { "CopyPathUnquoted",                NULL,                   N_("_Copy path unquoted to clipboard"),         NULL,                   N_("Copy path unquoted to clipboard"),          CB(layout_menu_copy_path_unquoted_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",                PIXBUF_INLINE_ICON_CW,                  N_("_Rotate clockwise 90°"),           "bracketright",         N_("Rotate clockwise 90°"),                    CB(layout_menu_alter_90_cb) },
+  { "RotateCW",                PIXBUF_INLINE_ICON_CW,                  N_("_Rotate clockwise 90°"),           "bracketright",         N_("Image Rotate clockwise 90°"),                      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) },
@@ -1966,10 +2500,10 @@ static GtkActionEntry menu_entries[] = {
   { "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",       PIXBUF_INLINE_ICON_CCW, N_("Rotate _counterclockwise 90°"),            "bracketleft",          N_("Rotate counterclockwise 90°"),             CB(layout_menu_alter_90cc_cb) },
-  { "Rotate180",       PIXBUF_INLINE_ICON_180, N_("Rotate 1_80°"),    "<shift>R",             N_("Rotate 180°"),                     CB(layout_menu_alter_180_cb) },
-  { "Mirror",          PIXBUF_INLINE_ICON_MIRROR,      N_("_Mirror"),  "<shift>M",             N_("Mirror"),                           CB(layout_menu_alter_mirror_cb) },
-  { "Flip",            PIXBUF_INLINE_ICON_FLIP,        N_("_Flip"),    "<shift>F",             N_("Flip"),                             CB(layout_menu_alter_flip_cb) },
-  { "AlterNone",       PIXBUF_INLINE_ICON_ORIGINAL,    N_("_Original state"),  "<shift>O",             N_("Original state"),                   CB(layout_menu_alter_none_cb) },
+  { "Rotate180",       PIXBUF_INLINE_ICON_180, N_("Rotate 1_80°"),    "<shift>R",             N_("Image Rotate 180°"),                       CB(layout_menu_alter_180_cb) },
+  { "Mirror",          PIXBUF_INLINE_ICON_MIRROR,      N_("_Mirror"),  "<shift>M",             N_("Image Mirror"),                             CB(layout_menu_alter_mirror_cb) },
+  { "Flip",            PIXBUF_INLINE_ICON_FLIP,        N_("_Flip"),    "<shift>F",             N_("Image Flip"),                               CB(layout_menu_alter_flip_cb) },
+  { "AlterNone",       PIXBUF_INLINE_ICON_ORIGINAL,    N_("_Original state"),  "<shift>O",             N_("Image rotate Original state"),                      CB(layout_menu_alter_none_cb) },
   { "SelectAll",       PIXBUF_INLINE_ICON_SELECT_ALL,                  N_("Select _all"),                      "<control>A",           N_("Select all"),                       CB(layout_menu_select_all_cb) },
   { "SelectNone",      PIXBUF_INLINE_ICON_SELECT_NONE,                 N_("Select _none"),                     "<control><shift>A",    N_("Select none"),                      CB(layout_menu_unselect_all_cb) },
   { "SelectInvert",    PIXBUF_INLINE_ICON_SELECT_INVERT,                       N_("_Invert Selection"),                "<control><shift>I",    N_("Invert Selection"),                 CB(layout_menu_invert_selection_cb) },
@@ -2023,8 +2557,8 @@ static GtkActionEntry menu_entries[] = {
   { "HistogramModeCycle",NULL,                 N_("Cycle through histogram mo_des"),   "J",                    N_("Cycle through histogram modes"),    CB(layout_menu_histogram_toggle_mode_cb) },
   { "HideTools",       PIXBUF_INLINE_ICON_HIDETOOLS,   N_("_Hide file list"),                  "<control>H",           N_("Hide file list"),                   CB(layout_menu_hide_cb) },
   { "SlideShowPause",  GTK_STOCK_MEDIA_PAUSE,  N_("_Pause slideshow"),                 "P",                    N_("Pause slideshow"),                  CB(layout_menu_slideshow_pause_cb) },
-  { "SlideShowFaster", GTK_STOCK_FILE, N_("Faster"),           "<control>KP_Add",                      N_("Faster"),                   CB(layout_menu_slideshow_faster_cb) },
-  { "SlideShowSlower", GTK_STOCK_FILE, N_("Slower"),           "<control>KP_Subtract",                 N_("Slower"),                   CB(layout_menu_slideshow_slower_cb) },
+  { "SlideShowFaster", GTK_STOCK_FILE, N_("Faster"),           "<control>equal",                       N_("Slideshow Faster"),                         CB(layout_menu_slideshow_faster_cb) },
+  { "SlideShowSlower", GTK_STOCK_FILE, N_("Slower"),           "<control>minus",                       N_("Slideshow Slower"),                         CB(layout_menu_slideshow_slower_cb) },
   { "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) },
   { "HelpSearch",      NULL,           N_("On-line help search"),                      NULL,                   N_("On-line help search"),                              CB(layout_menu_help_search_cb) },
@@ -2032,14 +2566,15 @@ static GtkActionEntry menu_entries[] = {
   { "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) },
   { "HelpChangeLog",   NULL,                   N_("_ChangeLog"),                       NULL,                   N_("ChangeLog notes"),                  CB(layout_menu_changelog_cb) },
+  { "SearchAndRunCommand",     GTK_STOCK_FIND,         N_("Search and Run command"),   "slash",        N_("Search commands by keyword and run them"),  CB(layout_menu_search_and_run_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",         PIXBUF_INLINE_ICON_EXIF,        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) },
+  { "SplitNextPane",   NULL,                   N_("_Next Pane"),       "<alt>Right",                   N_("Next Split Pane"),  CB(layout_menu_split_pane_next_cb) },
+  { "SplitPreviousPane",       NULL,                   N_("_Previous Pane"),   "<alt>Left",                    N_("Previous Split Pane"),      CB(layout_menu_split_pane_prev_cb) },
+  { "SplitUpPane",     NULL,                   N_("_Up Pane"), "<alt>Up",                      N_("Up Split Pane"),    CB(layout_menu_split_pane_updown_cb) },
+  { "SplitDownPane",   NULL,                   N_("_Down Pane"),       "<alt>Down",                    N_("Down Split 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) },
   { "ClearMarks",      NULL,           N_("Clear Marks..."),                   NULL,           N_("Clear Marks"),                      CB(layout_menu_clear_marks_cb) },
@@ -2050,6 +2585,7 @@ static GtkToggleActionEntry menu_toggle_entries[] = {
   { "ShowMarks",        PIXBUF_INLINE_ICON_MARKS,      N_("Show _Marks"),                      "M",                    N_("Show Marks"),                       CB(layout_menu_marks_cb),        FALSE  },
   { "ShowFileFilter", PIXBUF_INLINE_ICON_FILE_FILTER,  N_("Show File Filter"), NULL,   N_("Show File Filter"), CB(layout_menu_file_filter_cb),  FALSE  },
   { "ShowInfoPixel",   GTK_STOCK_COLOR_PICKER, N_("Pi_xel Info"),                      NULL,                   N_("Show Pixel Info"),                  CB(layout_menu_info_pixel_cb),   FALSE  },
+  { "IgnoreAlpha", GTK_STOCK_STRIKETHROUGH,           N_("Hide _alpha"),          "<shift>A",     N_("Hide alpha channel"),       CB(layout_menu_alter_ignore_alpha_cb), FALSE},
   { "FloatTools",      PIXBUF_INLINE_ICON_FLOAT,N_("_Float file list"),                "L",                    N_("Float file list"),                  CB(layout_menu_float_cb),        FALSE  },
   { "HideToolbar",     NULL,                   N_("Hide tool_bar"),                    NULL,                   N_("Hide toolbar"),                     CB(layout_menu_toolbar_cb),      FALSE  },
   { "SBar",    PIXBUF_INLINE_ICON_INFO,        N_("_Info sidebar"),                    "<control>K",           N_("Info sidebar"),                     CB(layout_menu_bar_cb),          FALSE  },
@@ -2067,6 +2603,7 @@ static GtkToggleActionEntry menu_toggle_entries[] = {
   { "ExifRotate",      GTK_STOCK_ORIENTATION_PORTRAIT,                 N_("_Exif rotate"),             "<alt>X",               N_("Exif rotate"),                      CB(layout_menu_exif_rotate_cb), FALSE },
   { "DrawRectangle",   PIXBUF_INLINE_ICON_DRAW_RECTANGLE,                      N_("Draw Rectangle"),           NULL,           N_("Draw Rectangle"),                   CB(layout_menu_select_rectangle_cb), FALSE },
   { "OverUnderExposed",        PIXBUF_INLINE_ICON_EXPOSURE,    N_("Over/Under Exposed"),       "<shift>E",             N_("Over/Under Exposed"),               CB(layout_menu_select_overunderexposed_cb), FALSE },
+  { "SplitPaneSync",   PIXBUF_INLINE_SPLIT_PANE_SYNC,                  N_("Split Pane Sync"),  NULL,           N_("Split Pane Sync"),  CB(layout_menu_split_pane_sync_cb), FALSE },
 };
 
 static GtkRadioActionEntry menu_radio_entries[] = {
@@ -2121,7 +2658,6 @@ static const gchar *menu_ui_description =
 "<ui>"
 "  <menubar name='MainMenu'>"
 "    <menu action='FileMenu'>"
-"      <menuitem action='NewWindow'/>"
 "      <menuitem action='NewCollection'/>"
 "      <menuitem action='OpenCollection'/>"
 "      <menuitem action='OpenRecent'/>"
@@ -2145,7 +2681,6 @@ static const gchar *menu_ui_description =
 "      <placeholder name='FileOpsSection'/>"
 "      <separator/>"
 "      <placeholder name='QuitSection'/>"
-"      <menuitem action='CloseWindow'/>"
 "      <menuitem action='Quit'/>"
 "      <separator/>"
 "    </menu>"
@@ -2154,6 +2689,8 @@ static const gchar *menu_ui_description =
 "      <menuitem action='PrevImage'/>"
 "      <menuitem action='NextImage'/>"
 "      <menuitem action='LastImage'/>"
+"      <menuitem action='ImageBack'/>"
+"      <menuitem action='ImageForward'/>"
 "      <separator/>"
 "      <menuitem action='Back'/>"
 "      <menuitem action='Forward'/>"
@@ -2287,6 +2824,8 @@ static const gchar *menu_ui_description =
 "        <menuitem action='SplitPreviousPane'/>"
 "        <menuitem action='SplitUpPane'/>"
 "        <menuitem action='SplitDownPane'/>"
+"        <separator/>"
+"        <menuitem action='SplitPaneSync'/>"
 "      </menu>"
 "      <menu action='StereoMenu'>"
 "        <menuitem action='StereoAuto'/>"
@@ -2333,6 +2872,7 @@ static const gchar *menu_ui_description =
 "      <menuitem action='SBarSort'/>"
 "      <menuitem action='HideBars'/>"
 "      <menuitem action='ShowInfoPixel'/>"
+"      <menuitem action='IgnoreAlpha'/>"
 "      <placeholder name='ToolsSection'/>"
 "      <separator/>"
 "      <menuitem action='Animate'/>"
@@ -2345,9 +2885,20 @@ static const gchar *menu_ui_description =
 "      <placeholder name='SlideShowSection'/>"
 "      <separator/>"
 "    </menu>"
+"    <menu action='WindowsMenu'>"
+"      <menu action='NewWindow'>"
+"        <menuitem action='NewWindowDefault'/>"
+"        <menuitem action='NewWindowFromCurrent'/>"
+"        <separator/>"
+"       </menu>"
+"      <menuitem action='RenameWindow'/>"
+"      <menuitem action='DeleteWindow'/>"
+"      <menuitem action='CloseWindow'/>"
+"    </menu>"
 "    <menu action='HelpMenu'>"
 "      <separator/>"
 "      <menuitem action='HelpContents'/>"
+"      <menuitem action='SearchAndRunCommand'/>"
 "      <menuitem action='HelpSearch'/>"
 "      <menuitem action='HelpShortcuts'/>"
 "      <menuitem action='HelpKbd'/>"
@@ -3096,9 +3647,10 @@ void layout_util_sync_color(LayoutWindow *lw)
        gboolean use_image = FALSE;
        gint i;
        gchar action_name[15];
+#ifdef HAVE_LCMS
        gchar *image_profile;
        gchar *screen_profile;
-
+#endif
 
        if (!lw->action_group) return;
        if (!layout_image_color_profile_get(lw, &input, &use_image)) return;
@@ -3205,6 +3757,9 @@ static void layout_util_sync_views(LayoutWindow *lw)
        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, "SplitPaneSync");
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.split_pane_sync);
+
        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);
 
@@ -3226,6 +3781,9 @@ 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, "IgnoreAlpha");
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.ignore_alpha);
+
        action = gtk_action_group_get_action(lw->action_group, "Animate");
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.animate);
 
@@ -3280,6 +3838,7 @@ static void layout_util_sync_views(LayoutWindow *lw)
 
        layout_util_sync_marks(lw);
        layout_util_sync_color(lw);
+       layout_image_set_ignore_alpha(lw, lw->options.ignore_alpha);
 }
 
 void layout_util_sync_thumb(LayoutWindow *lw)
@@ -3602,4 +4161,15 @@ void layout_exif_window_new(LayoutWindow *lw)
        advanced_exif_set_fd(lw->exif_window, layout_image_get_fd(lw));
 }
 
+static void layout_search_and_run_window_new(LayoutWindow *lw)
+{
+       if (lw->sar_window)
+               {
+               gtk_window_present(GTK_WINDOW(lw->sar_window));
+               return;
+               }
+
+       lw->sar_window = search_and_run_new(lw);
+}
+
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */