Author: post
Date: 2010-12-05 15:55:42 +0100 (Sun, 05 Dec 2010)
New Revision: 3662

Modified:
   trunk/src/rs-actions.c
   trunk/src/rs-store.c
   trunk/src/rs-store.h
   trunk/src/ui.xml
Log:
Add button/menu item to disable loading images when clicked. Useful for 
tagging, pasting settings, quickly deleting images, etc.

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c      2010-12-05 13:11:40 UTC (rev 3661)
+++ trunk/src/rs-actions.c      2010-12-05 14:55:42 UTC (rev 3662)
@@ -920,6 +920,10 @@
        
rs_preview_widget_set_show_exposure_mask(RS_PREVIEW_WIDGET(rs->preview), 
gtk_toggle_action_get_active(toggleaction));
 }
 
+TOGGLEACTION(load_selected)
+{
+       gtk_toggle_action_set_active(toggleaction, 
!rs_store_set_open_selected(rs->store, 
!gtk_toggle_action_get_active(toggleaction)));
+}
 TOGGLEACTION(split)
 {
        rs_preview_widget_set_split(RS_PREVIEW_WIDGET(rs->preview), 
gtk_toggle_action_get_active(toggleaction));
@@ -1269,6 +1273,7 @@
        { "FullscreenPreview", GTK_STOCK_FULLSCREEN, _("_Show Photo On 
Secondary Monitor"), "F10", NULL, ACTION_CB(fullscreen_preview), FALSE },
        { "ShowFilenames", NULL, _("Show Filenames in Iconbox"), NULL, NULL, 
ACTION_CB(show_filenames), show_filenames },
        { "Load8Bit", NULL, _("Load non-RAW images"), NULL, NULL, 
ACTION_CB(load_8bit), load_8bit },
+       { "LoadSelected", NULL, _("Do not Load Selected Images"), "Pause", 
NULL, ACTION_CB(load_selected), FALSE },
        { "ExposureMask", NULL, _("_Exposure mask"), "<control>E", NULL, 
ACTION_CB(exposure_mask), FALSE },
        { "Split", NULL, _("_Split"), "<control>D", NULL, ACTION_CB(split), 
FALSE },
 #if GTK_CHECK_VERSION(2,12,0)

Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c        2010-12-05 13:11:40 UTC (rev 3661)
+++ trunk/src/rs-store.c        2010-12-05 14:55:42 UTC (rev 3662)
@@ -32,6 +32,7 @@
 #include "rs-store.h"
 #include "gtk-helper.h"
 #include "gtk-progress.h"
+#include "gtk-interface.h"
 #include "rs-cache.h"
 #include "rs-pixbuf.h"
 #include "eog-pixbuf-cell-renderer.h"
@@ -93,6 +94,7 @@
        GtkTreePath *tooltip_last_path;
        volatile gint jobs_to_do;
        gboolean counter_blocked;               /* Only access when thread has 
gdk lock */
+       gint open_selected;  /* Contains status message ID, if enabled, 0 
otherwise */
 };
 
 /* Classes to user for io-system */ 
@@ -219,6 +221,7 @@
        GtkWidget *label_priorities;
 
        store->counter_blocked = FALSE;
+       store->open_selected = 0;
        store->notebook = GTK_NOTEBOOK(gtk_notebook_new());
        store->store = gtk_list_store_new (NUM_COLUMNS,
                GDK_TYPE_PIXBUF,
@@ -458,6 +461,35 @@
        }
 }
 
+
+gboolean
+rs_store_set_open_selected(RSStore *store, gboolean open_selected)
+{
+       const static GdkColor red = {0, 0xffff, 0x0000, 0x0000 };
+       if (!store || !RS_IS_STORE(store))
+               return TRUE;
+
+       /* just return, if already at requested state */
+       if (store->open_selected == 0 && open_selected)
+               return TRUE;
+       if (store->open_selected != 0 && !open_selected)
+               return FALSE;
+
+       /* Re-enable */
+       if (store->open_selected != 0)
+       {
+               gui_status_pop(store->open_selected);
+               store->open_selected = 0;
+               
gtk_widget_modify_bg(GTK_WIDGET(store->notebook),GTK_STATE_NORMAL, NULL);
+       }
+       else /* Disable */
+       {
+               store->open_selected = gui_status_push(_("NOTE: Iconview Update 
Disabled. New Files will not be Loaded! Press <Pause> to Re-Enable."));
+               
gtk_widget_modify_bg(GTK_WIDGET(store->notebook),GTK_STATE_NORMAL, &red);
+       }
+       return open_selected;
+}
+
 static void
 selection_changed(GtkIconView *iconview, gpointer data)
 {
@@ -476,7 +508,7 @@
        num_selected = g_list_length(selected);
 
        /* Emit signal if only one thumbnail is selected */
-       if (num_selected == 1)
+       if (num_selected == 1 && store->open_selected == 0)
        {
                iter = * (GtkTreeIter *) g_list_nth_data(selected, 0);
 
@@ -495,12 +527,11 @@
                                g_signal_emit(G_OBJECT(data), 
signals[THUMB_ACTIVATED_SIGNAL], 0, name);
                                break;
                }
+               predict_preload(data, FALSE);
        }
 
        g_list_foreach(selected, (GFunc)g_free, NULL);
        g_list_free(selected);
-
-       predict_preload(data, FALSE);
 }
 
 #if GTK_CHECK_VERSION(2,12,0)

Modified: trunk/src/rs-store.h
===================================================================
--- trunk/src/rs-store.h        2010-12-05 13:11:40 UTC (rev 3661)
+++ trunk/src/rs-store.h        2010-12-05 14:55:42 UTC (rev 3662)
@@ -244,4 +244,7 @@
 extern gint
 rs_store_get_iconview_size(RSStore *store);
 
+extern gboolean
+rs_store_set_open_selected(RSStore *store, gboolean open_selected);
+
 #endif /* RS_STORE_H */

Modified: trunk/src/ui.xml
===================================================================
--- trunk/src/ui.xml    2010-12-05 13:11:40 UTC (rev 3661)
+++ trunk/src/ui.xml    2010-12-05 14:55:42 UTC (rev 3662)
@@ -70,6 +70,7 @@
    <menuitem action="Fullscreen" />
    <menuitem action="FullscreenPreview" />
    <separator />
+   <menuitem action="LoadSelected" />
    <menuitem action="ShowFilenames" />
    <menuitem action="Load8Bit" />
    <separator />


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to