[Digikam-devel] [Bug 140227] remove or modify D&D tags menu from icon view area

Marcel Wiesweg marcel.wiesweg at gmx.de
Tue Feb 27 16:32:06 CET 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=140227         




------- Additional Comments From marcel.wiesweg gmx de  2007-02-27 16:32 -------
SVN commit 637724 by mwiesweg:

AlbumIconView Tag-drop popup menu:
Reorder menu entries
	1) Assign to selected
	2) Assign to item dropped on
	3) Assign to all
Do not offer "Assign to selected" if the dropped-on item is the only selected item.

CCBUG: 140227


 M  +29 -22    albumiconview.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumiconview.cpp #637723:637724
 @ -1178,27 +1178,33  @
         {
             QPopupMenu popMenu(this);
 
-            bool itemsSelected = false;
-            for (IconItem *it = firstItem(); it; it = it->nextItem())
-                if (it->isSelected())
-                    itemsSelected = true;
-    
+            bool moreItemsSelected = false;
             bool itemDropped = false;
+
             AlbumIconItem *albumItem = findItem(event->pos());
-            if (albumItem) 
+            if (albumItem)
                 itemDropped = true;
 
-            popMenu.insertItem(SmallIcon("tag"), 
-                               i18n("Assign '%1' to &All Items").arg(talbum->tagPath().mid(1)),          11);
+            for (IconItem *it = firstItem(); it; it = it->nextItem())
+            {
+                if (it->isSelected() && it != albumItem)
+                {
+                    moreItemsSelected = true;
+                    break;
+                }
+            }
 
-            if (itemsSelected)
+            if (moreItemsSelected)
                 popMenu.insertItem(SmallIcon("tag"), 
                                    i18n("Assign '%1' to &Selected Items").arg(talbum->tagPath().mid(1)), 10);
-            
+
             if (itemDropped)
                 popMenu.insertItem(SmallIcon("tag"),
                                    i18n("Assign '%1' to &Dropped Item").arg(talbum->tagPath().mid(1)),   12);
 
+            popMenu.insertItem(SmallIcon("tag"), 
+                               i18n("Assign '%1' to &All Items").arg(talbum->tagPath().mid(1)),          11);
+
             popMenu.insertSeparator(-1);
             popMenu.insertItem(SmallIcon("cancel"), i18n("&Cancel"));
 
 @ -1257,29 +1263,30  @
 
         QPopupMenu popMenu(this);
 
-        bool itemsSelected = false;
+        bool moreItemsSelected = false;
+        bool itemDropped = false;
+
+        AlbumIconItem *albumItem = findItem(event->pos());
+        if (albumItem)
+            itemDropped = true;
+
         for (IconItem *it = firstItem(); it; it = it->nextItem())
         {
-            if (it->isSelected())
+            if (it->isSelected() && it != albumItem)
             {
-                itemsSelected = true;
+                moreItemsSelected = true;
                 break;
             }
         }
 
-        bool itemDropped = false;
-        AlbumIconItem *albumItem = findItem(event->pos());
-        if (albumItem) 
-            itemDropped = true;
-
-        popMenu.insertItem(SmallIcon("tag"), i18n("Assign Tags to &All Items"),          11);
-
-        if (itemsSelected)
+        if (moreItemsSelected)
             popMenu.insertItem(SmallIcon("tag"), i18n("Assign Tags to &Selected Items"), 10);
 
         if (itemDropped)
             popMenu.insertItem(SmallIcon("tag"), i18n("Assign Tags to &Dropped Item"),   12);
-    
+
+        popMenu.insertItem(SmallIcon("tag"), i18n("Assign Tags to &All Items"),          11);
+
         popMenu.insertSeparator(-1);
         popMenu.insertItem(SmallIcon("cancel"), i18n("&Cancel"));


More information about the Digikam-devel mailing list