Bug 124425 - [Improvement] Start index number counting on selected images instead of all images
Summary: [Improvement] Start index number counting on selected images instead of all i...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-IconView (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-28 16:59 UTC by sero4linux
Modified: 2017-08-17 17:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sero4linux 2006-03-28 16:59:48 UTC
Version:           0.9.0 SVN (using KDE KDE 3.5.1)
Installed from:    Gentoo Packages
OS:                Linux

When you choose in the Camera GUI to rename the images and to automatically add an index number, then this number starts on the first picture no matter which images are selected. It would be better if the index numbers are only applied for the selected images instead.

Example: 
I have 5 images on the camera, choose to rename them "example" and enable the index number. Now the photos are named example-0001.jpg to example-0005.jpg. When I select the last three images, then they still have the names example-0003.jpg to example-0005.jpg. I'd like better to have them 
named example-0001.jpg to example-0003.jpg.
Comment 1 caulier.gilles 2006-07-20 21:26:49 UTC
SVN commit 564659 by cgilles:

digikam from trunk : improvements of Camera Gui again !!!

Now the custom prefix index depand of current images selection in the camera icon items. A screenshot :

http://digikam3rdparty.free.fr/Screenshots/cameragui_custom_index_and_ pictures_selection.png

BUG: 124425

 M  +49 -9     cameraiconview.cpp  
 M  +1 -0      cameraiconview.h  
 M  +15 -3     cameraui.cpp  
 M  +1 -0      cameraui.h  


--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.cpp #564658:564659
@@ -89,7 +89,7 @@
     setMinimumSize(450, 400);
 
     connect(this, SIGNAL(signalSelectionChanged()),
-            this, SLOT(slotSelectionChanged()));
+            this, SLOT(slotDownloadNameChanged()));
             
     connect(this, SIGNAL(signalRightButtonClicked(IconItem*, const QPoint&)),
             this, SLOT(slotContextMenu(IconItem*, const QPoint&)));
@@ -195,20 +195,60 @@
     
     viewport()->setUpdatesEnabled(false);
 
+    int  index=0;
+    bool hasSelection=false;
     for (IconItem* item = firstItem(); item; item = item->nextItem())
     {
-        CameraIconViewItem* viewItem = static_cast<CameraIconViewItem*>(item);
+        if (item->isSelected())
+        {
+            hasSelection = true;
+            break;
+        }
+    }
 
-        QString downloadName;
+    emit signalNewSelection(hasSelection);
 
-        if (!useDefault)
-            downloadName = getTemplatedName( nameTemplate, viewItem->itemInfo(), 
-                                             d->groupItem->index(viewItem) );
-        else
-            downloadName = getCasedName( d->renamer->changeCase(), viewItem->itemInfo() );
+    if (hasSelection)
+    {
+        // Camera items selection.
+    
+        for (IconItem* item = firstItem(); item; item = item->nextItem())
+        {
+            QString downloadName;
+            CameraIconViewItem* viewItem = static_cast<CameraIconViewItem*>(item);
+            if (viewItem->isSelected())
+            {
+                if (!useDefault)
+                    downloadName = getTemplatedName( nameTemplate, viewItem->itemInfo(), index );
+                else
+                    downloadName = getCasedName( d->renamer->changeCase(), viewItem->itemInfo() );
 
-        viewItem->setDownloadName( downloadName );
+                index++;
+            }
+            else 
+                downloadName = getCasedName( d->renamer->changeCase(), viewItem->itemInfo() );
+    
+            viewItem->setDownloadName( downloadName );
+        }
     }
+    else
+    {
+        // No camera item selection.
+    
+        for (IconItem* item = firstItem(); item; item = item->nextItem())
+        {
+            QString downloadName;
+            CameraIconViewItem* viewItem = static_cast<CameraIconViewItem*>(item);
+    
+            if (!useDefault)
+                downloadName = getTemplatedName( nameTemplate, viewItem->itemInfo(), 
+                                                d->groupItem->index(viewItem) );
+            else
+                downloadName = getCasedName( d->renamer->changeCase(), viewItem->itemInfo() );
+    
+            viewItem->setDownloadName( downloadName );
+        }
+    }
 
     rearrangeItems();
     viewport()->setUpdatesEnabled(true);
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.h #564658:564659
@@ -73,6 +73,7 @@
 
     void signalDownload();
     void signalDelete();
+    void signalNewSelection(bool);
     
 public slots:
 
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #564658:564659
@@ -222,9 +222,9 @@
     QWhatsThis::add( d->setCredits, i18n("<p>Toogle on this option to store default credit and copyright information "
                                          "into IPTC tags using main digiKam metadata settings."));
     QWhatsThis::add( d->fixDateTimeCheck, i18n("<p>Toogle on this option to set date and time metadata "
-                                               "tags to the right values if your camera don't set "
-                                               "properly these tags when pictures are taken. The values will"
-                                               "be saved in the DateTimeDigitized and DateTimeCreated EXIF/IPTC fields."));
+                    "tags to the right values if your camera don't set "
+                    "properly these tags when pictures are taken. The values will"
+                    "be saved in the DateTimeDigitized and DateTimeCreated EXIF/IPTC fields."));
                                                
     grid->addMultiCellWidget(d->renameCustomizer, 0, 0, 0, 1);
     grid->addMultiCellWidget(exifBox, 1, 1, 0, 1);
@@ -328,6 +328,9 @@
     connect(d->view, SIGNAL(signalDelete()),
             this, SLOT(slotDeleteSelected()));
 
+    connect(d->view, SIGNAL(signalNewSelection(bool)),
+            this, SLOT(slotNewSelection(bool)));
+
     // -------------------------------------------------------------------------
     
     connect(d->rightSidebar, SIGNAL(signalFirstItem()),
@@ -914,6 +917,15 @@
     d->rightSidebar->itemChanged(item->itemInfo(), url, exifData, d->view, item);
 }
 
+void CameraUI::slotNewSelection(bool hasSelection)
+{
+    if (!d->renameCustomizer->useDefault())
+    {
+        d->downloadMenu->setItemEnabled(0, hasSelection);
+        d->downloadMenu->setItemEnabled(1, !hasSelection);
+    }
+}
+
 void CameraUI::slotItemsSelected(CameraIconViewItem* item, bool selected)
 {
     d->downloadMenu->setItemEnabled(0, selected);
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.h #564658:564659
@@ -102,6 +102,7 @@
     void slotSkipped(const QString&, const QString&);
     void slotDeleted(const QString&, const QString&);
     
+    void slotNewSelection(bool);
     void slotItemsSelected(CameraIconViewItem* item, bool selected);
     
     void slotExifFromFile(const QString& folder, const QString& file);
Comment 2 sero4linux 2006-07-25 11:06:05 UTC
Sorry Gilles for my late reply - I have been on vacations. The improvements to cameragui are great and the selection issue is fixed for me.

However there is a little new problem that arises from the new implementation:
Once an image is selected in cameragui thumbs area the download > download all option is grayed out. One has to do a select>select none to get the download all function back. I'd like better to have the downlaod all option never grayed out ...

If you want me to fill a seperate B.K.O. for this let me know - it's just here because it's very related.