Author: post
Date: 2009-09-22 22:20:39 +0200 (Tue, 22 Sep 2009)
New Revision: 2646
Modified:
trunk/src/gtk-interface.c
trunk/src/rs-store.c
Log:
Move to next image on delete (Bug#305), icon view also selects image on
prev/next keyboard shortcut.
Modified: trunk/src/gtk-interface.c
===================================================================
--- trunk/src/gtk-interface.c 2009-09-22 19:04:05 UTC (rev 2645)
+++ trunk/src/gtk-interface.c 2009-09-22 20:20:39 UTC (rev 2646)
@@ -235,10 +235,21 @@
GList *selected = NULL;
gint i, num_selected;
GString *gs;
+ const gchar* next_name = NULL;
selected = rs_store_get_selected_iters(rs->store);
num_selected = g_list_length(selected);
+ /* If we are deleting images, select next */
+ if (num_selected && prio == 51)
+ {
+ GList *selected_names = rs_store_get_selected_names(rs->store);
+ if (g_list_length(selected_names))
+ next_name = (const
gchar*)(g_list_last(selected_names)->data);
+ else if (rs->photo)
+ next_name = rs->photo->filename;
+ }
+
/* Iterate throuh all selected thumbnails */
for(i=0;i<num_selected;i++)
{
@@ -264,6 +275,10 @@
g_string_printf(gs, _("Changed photo priority (%d)"),prio);
gui_status_notify(gs->str);
+ /* Load next image if deleting */
+ if (next_name)
+ rs_store_select_prevnext(rs->store, next_name, 2);
+
g_string_free(gs, TRUE);
}
Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c 2009-09-22 19:04:05 UTC (rev 2645)
+++ trunk/src/rs-store.c 2009-09-22 20:20:39 UTC (rev 2646)
@@ -1577,6 +1577,8 @@
gtk_icon_view_scroll_to_path(iconview, newpath, FALSE, 0.5f,
0.5f);
#endif
gtk_icon_view_select_path(iconview, newpath);
+ gtk_icon_view_set_cursor (iconview, newpath, NULL, FALSE);
+ gtk_widget_grab_focus(GTK_WIDGET(iconview));
/* Free the new path */
gtk_tree_path_free(newpath);
}
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit