Revision: 1861
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1861&view=rev
Author:   nadvornik
Date:     2009-09-28 09:57:06 +0000 (Mon, 28 Sep 2009)

Log Message:
-----------
consider sidecars in layout_image popup menu

Modified Paths:
--------------
    trunk/src/layout_image.c
    trunk/src/view_file.c
    trunk/src/view_file.h
    trunk/src/view_file_icon.c
    trunk/src/view_file_icon.h
    trunk/src/view_file_list.c
    trunk/src/view_file_list.h

Modified: trunk/src/layout_image.c
===================================================================
--- trunk/src/layout_image.c    2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/layout_image.c    2009-09-28 09:57:06 UTC (rev 1861)
@@ -33,6 +33,7 @@
 #include "ui_menu.h"
 #include "uri_utils.h"
 #include "utilops.h"
+#include "view_file.h"
 
 #include <gdk/gdkkeysyms.h> /* for keyboard values */
 
@@ -460,7 +461,13 @@
        FileData *fd = layout_image_get_fd(lw);
 
        if (fd)
-               list = g_list_append(NULL, file_data_ref(fd));
+               {
+               if (lw->vf)
+                       /* optionally include sidecars if the filelist entry is 
not expanded */
+                       list = vf_selection_get_one(lw->vf, fd);
+               else
+                       list = g_list_append(NULL, file_data_ref(fd));
+               }
        
        return list;
 }

Modified: trunk/src/view_file.c
===================================================================
--- trunk/src/view_file.c       2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/view_file.c       2009-09-28 09:57:06 UTC (rev 1861)
@@ -310,6 +310,19 @@
        return ret;
 }
 
+GList *vf_selection_get_one(ViewFile *vf, FileData *fd)
+{
+       GList *ret = NULL;
+
+       switch (vf->type)
+       {
+       case FILEVIEW_LIST: ret = vflist_selection_get_one(vf, fd); break;
+       case FILEVIEW_ICON: ret = vficon_selection_get_one(vf, fd); break;
+       }
+
+       return ret;
+}
+
 static void vf_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf;

Modified: trunk/src/view_file.h
===================================================================
--- trunk/src/view_file.h       2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/view_file.h       2009-09-28 09:57:06 UTC (rev 1861)
@@ -37,6 +37,7 @@
 guint vf_marks_get_filter(ViewFile *vf);
 void vf_mark_filter_toggle(ViewFile *vf, gint mark);
 
+GList *vf_selection_get_one(ViewFile *vf, FileData *fd);
 GList *vf_pop_menu_file_list(ViewFile *vf);
 GtkWidget *vf_pop_menu(ViewFile *vf);
 

Modified: trunk/src/view_file_icon.c
===================================================================
--- trunk/src/view_file_icon.c  2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/view_file_icon.c  2009-09-28 09:57:06 UTC (rev 1861)
@@ -161,6 +161,11 @@
  *-----------------------------------------------------------------------------
  */
 
+GList *vficon_selection_get_one(ViewFile *vf, FileData *fd)
+{
+       return g_list_prepend(filelist_copy(fd->sidecar_files), 
file_data_ref(fd));
+}
+
 GList *vficon_pop_menu_file_list(ViewFile *vf)
 {
        if (!VFICON(vf)->click_id) return NULL;
@@ -170,8 +175,7 @@
                return vf_selection_get_list(vf);
                }
 
-       
-       return 
g_list_prepend(filelist_copy(VFICON(vf)->click_id->fd->sidecar_files), 
file_data_ref(VFICON(vf)->click_id->fd));
+       return vficon_selection_get_one(vf, VFICON(vf)->click_id->fd);
 }
 
 void vficon_pop_menu_view_cb(GtkWidget *widget, gpointer data)

Modified: trunk/src/view_file_icon.h
===================================================================
--- trunk/src/view_file_icon.h  2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/view_file_icon.h  2009-09-28 09:57:06 UTC (rev 1861)
@@ -29,6 +29,7 @@
 
 void vficon_marks_set(ViewFile *vf, gboolean enable);
 
+GList *vficon_selection_get_one(ViewFile *vf, FileData *fd);
 GList *vficon_pop_menu_file_list(ViewFile *vf);
 void vficon_pop_menu_view_cb(GtkWidget *widget, gpointer data);
 void vficon_pop_menu_rename_cb(GtkWidget *widget, gpointer data);

Modified: trunk/src/view_file_list.c
===================================================================
--- trunk/src/view_file_list.c  2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/view_file_list.c  2009-09-28 09:57:06 UTC (rev 1861)
@@ -363,26 +363,18 @@
  *-----------------------------------------------------------------------------
  */
 
-GList *vflist_pop_menu_file_list(ViewFile *vf)
+GList *vflist_selection_get_one(ViewFile *vf, FileData *fd)
 {
-       GList *list;
-       if (!VFLIST(vf)->click_fd) return NULL;
+       GList *list = g_list_append(NULL, file_data_ref(fd));
 
-       if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
+       if (fd->sidecar_files)
                {
-               return vf_selection_get_list(vf);
-               }
-
-       list = g_list_append(NULL, file_data_ref(VFLIST(vf)->click_fd));
-
-       if (VFLIST(vf)->click_fd->sidecar_files)
-               {
                /* check if the row is expanded */
                GtkTreeModel *store;
                GtkTreeIter iter;
                
                store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
-               if (vflist_find_row(vf, VFLIST(vf)->click_fd, &iter) >= 0)
+               if (vflist_find_row(vf, fd, &iter) >= 0)
                        {
                        GtkTreePath *tpath;
 
@@ -390,7 +382,7 @@
                        if 
(!gtk_tree_view_row_expanded(GTK_TREE_VIEW(vf->listview), tpath))
                                {
                                /* unexpanded - add whole group */
-                               GList *work = 
VFLIST(vf)->click_fd->sidecar_files;
+                               GList *work = fd->sidecar_files;
                                while (work)
                                        {
                                        FileData *sfd = work->data;
@@ -406,6 +398,18 @@
        return list;
 }
 
+GList *vflist_pop_menu_file_list(ViewFile *vf)
+{
+       if (!VFLIST(vf)->click_fd) return NULL;
+
+       if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
+               {
+               return vf_selection_get_list(vf);
+               }
+       return vflist_selection_get_one(vf, VFLIST(vf)->click_fd);
+}
+
+
 void vflist_pop_menu_view_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf = data;

Modified: trunk/src/view_file_list.h
===================================================================
--- trunk/src/view_file_list.h  2009-09-26 11:37:09 UTC (rev 1860)
+++ trunk/src/view_file_list.h  2009-09-28 09:57:06 UTC (rev 1861)
@@ -32,6 +32,7 @@
 void vflist_marks_set(ViewFile *vf, gboolean enable);
 void vflist_sort_set(ViewFile *vf, SortType type, gboolean ascend);
 
+GList *vflist_selection_get_one(ViewFile *vf, FileData *fd);
 GList *vflist_pop_menu_file_list(ViewFile *vf);
 void vflist_pop_menu_view_cb(GtkWidget *widget, gpointer data);
 void vflist_pop_menu_rename_cb(GtkWidget *widget, gpointer data);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to