[Rawstudio-commit] r4130 - trunk/src

Klaus Post klauspost at gmail.com
Sat Feb 11 18:22:16 CET 2012


Author: post
Date: 2012-02-11 18:22:16 +0100 (Sat, 11 Feb 2012)
New Revision: 4130

Modified:
   trunk/src/gtk-interface.c
   trunk/src/rs-store.c
   trunk/src/rs-store.h
Log:
Always select next image when image is removed from the active tab.

Modified: trunk/src/gtk-interface.c
===================================================================
--- trunk/src/gtk-interface.c	2012-02-11 17:20:40 UTC (rev 4129)
+++ trunk/src/gtk-interface.c	2012-02-11 17:22:16 UTC (rev 4130)
@@ -357,21 +357,19 @@
 	selected = rs_store_get_selected_iters(rs->store);
 	num_selected = g_list_length(selected);
 
-	/* If we are deleting images, select next */
-	if (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;
+	/* If moving to another iconview, select next */
+	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;
 
-		/* Load next image if deleting */
-		if (next_name)
-			next_name = rs_store_get_prevnext(rs->store, next_name, 2);
+	/* Select next image if moving */
+	if (next_name)
+		next_name = rs_store_get_prevnext(rs->store, next_name, 10 + prio);
 
+	if (next_name)
 		gui_set_block_keyboard(TRUE);
-	}
 
 /* Iterate throuh all selected thumbnails */
 	for(i=0;i<num_selected;i++)

Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c	2012-02-11 17:20:40 UTC (rev 4129)
+++ trunk/src/rs-store.c	2012-02-11 17:22:16 UTC (rev 4130)
@@ -1814,6 +1814,31 @@
 	/* get the iconview */
 	iconview = GTK_ICON_VIEW(store->current_iconview);
 
+	if (direction >= 10 )
+	{
+		gint new_prio = direction - 10;
+		if (new_prio <= 3)
+		{
+			switch (store->current_priority)
+			{
+			case PRIO_ALL:
+					return(NULL);
+				break;
+			case PRIO_U:
+				if (new_prio == 0)
+					return(NULL);
+				break;
+			case PRIO_D:
+				if (new_prio == 51)
+					return(NULL);
+			default:
+				if (store->current_priority == new_prio) 
+					return(NULL);
+				break;
+			}
+		}
+		direction = 2;
+	}
 	/* Get a list of selected icons */
 	selected = gtk_icon_view_get_selected_items(iconview);
 	if (g_list_length(selected) == 1)

Modified: trunk/src/rs-store.h
===================================================================
--- trunk/src/rs-store.h	2012-02-11 17:20:40 UTC (rev 4129)
+++ trunk/src/rs-store.h	2012-02-11 17:22:16 UTC (rev 4130)
@@ -173,7 +173,7 @@
  * Get the filename of the previous or next thumbnail
  * @param store A RSStore
  * @param current_filename Current filename or NULL if none
- * @param direction 1: previous, 2: next
+ * @param direction 1: previous, 2: next, 10 + priority will select next if priority will remove it from current view
  * @return filename of next or previous file, NULL if none.
  */
 const gchar*




More information about the Rawstudio-commit mailing list