[Digikam-devel] [Bug 144431] Add option in Camera Download Dialog

Gilles Caulier caulier.gilles at gmail.com
Mon Aug 27 04:43:37 BST 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=144431         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From caulier.gilles gmail com  2007-08-27 05:43 -------
SVN commit 705060 by cgilles:

digiKam from trunk (KDE4) : Camera Gui improvements : New options to Download pictures and Delete it from camera at the same time.
2 options have been added : "Download/Delete Selected" and "Download/Delete All".
BUG: 144431


 M  +7 -3      cameraiconview.cpp  
 M  +1 -0      cameraiconview.h  
 M  +80 -44    cameraui.cpp  
 M  +3 -1      cameraui.h  


--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.cpp #705059:705060
 @ -43,7 +43,6  @
 // KDE includes.
 
 #include <k3urldrag.h>
-#include <kmenu.h>
 #include <kmimetype.h>
 #include <klocale.h>
 #include <kiconloader.h>
 @ -58,6 +57,7  @
 #include "gpiteminfo.h"
 #include "renamecustomizer.h"
 #include "icongroupitem.h"
+#include "dpopupmenu.h"
 #include "cameraui.h"
 #include "cameradragobject.h"
 #include "cameraiconitem.h"
 @ -433,11 +433,11  @
 
     CameraIconViewItem* camItem = static_cast<CameraIconViewItem*>(item);
 
-    KMenu menu(this);
-    menu.addTitle(SmallIcon("digikam"), d->cameraUI->cameraTitle());
+    DPopupMenu menu(this);
     QAction *viewAction      = menu.addAction(SmallIcon("editimage"), i18n("&View"));
     menu.addSeparator();
     QAction *downAction      = menu.addAction(SmallIcon("down"),i18n("Download"));
+    QAction *downDelAction   = menu.addAction(SmallIcon("down"),i18n("Download && Delete"));
     QAction *encryptedAction = menu.addAction(SmallIcon("encrypted"), i18n("Toggle lock"));
     menu.addSeparator();
     QAction *deleteAction    = menu.addAction(SmallIcon("edit-delete"), i18n("Delete"));
 @ -462,6 +462,10  @
         {
             emit signalToggleLock();
         }
+        else if (choice == downDelAction)
+        {
+            emit signalDownloadAndDelete();
+        }
     }
 }
 
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraiconview.h #705059:705060
 @ -93,6 +93,7  @
 
     void signalUpload(const KUrl::List&);
     void signalDownload();
+    void signalDownloadAndDelete();
     void signalDelete();
     void signalToggleLock();
     void signalNewSelection(bool);
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #705059:705060
 @ -134,41 +134,43  @
 
     CameraUIPriv()
     {
-        busy               = false;
-        closed             = false;
-        helpMenu           = 0;
-        advBox             = 0;
-        downloadMenu       = 0;
-        deleteMenu         = 0;
-        imageMenu          = 0;
-        cancelBtn          = 0;
-        splitter           = 0;
-        rightSidebar       = 0;
-        fixDateTimeCheck   = 0;
-        autoRotateCheck    = 0;
-        autoAlbumDateCheck = 0;
-        autoAlbumExtCheck  = 0;
-        status             = 0;
-        progress           = 0;
-        controller         = 0;
-        view               = 0;
-        renameCustomizer   = 0;
-        anim               = 0;
-        dateTimeEdit       = 0;
-        setPhotographerId  = 0;
-        setCredits         = 0;
-        losslessFormat     = 0;
-        convertJpegCheck   = 0;
-        formatLabel        = 0;
-        folderDateLabel    = 0;
-        folderDateFormat   = 0;
-        increaseThumbsAction   = 0;
-        decreaseThumbsAction   = 0;
-        downloadSelectedAction = 0;
-        downloadAllAction      = 0;
-        deleteSelectedAction   = 0;
-        deleteAllAction        = 0;
-        cameraInfoAction       = 0;
+        busy                      = false;
+        closed                    = false;
+        helpMenu                  = 0;
+        advBox                    = 0;
+        downloadMenu              = 0;
+        deleteMenu                = 0;
+        imageMenu                 = 0;
+        cancelBtn                 = 0;
+        splitter                  = 0;
+        rightSidebar              = 0;
+        fixDateTimeCheck          = 0;
+        autoRotateCheck           = 0;
+        autoAlbumDateCheck        = 0;
+        autoAlbumExtCheck         = 0;
+        status                    = 0;
+        progress                  = 0;
+        controller                = 0;
+        view                      = 0;
+        renameCustomizer          = 0;
+        anim                      = 0;
+        dateTimeEdit              = 0;
+        setPhotographerId         = 0;
+        setCredits                = 0;
+        losslessFormat            = 0;
+        convertJpegCheck          = 0;
+        formatLabel               = 0;
+        folderDateLabel           = 0;
+        folderDateFormat          = 0;
+        increaseThumbsAction      = 0;
+        decreaseThumbsAction      = 0;
+        downloadSelectedAction    = 0;
+        downloadDelSelectedAction = 0;
+        downloadAllAction         = 0;
+        downloadDelAllAction      = 0;
+        deleteSelectedAction      = 0;
+        deleteAllAction           = 0;
+        cameraInfoAction          = 0;
     }
 
     bool                          busy;
 @ -187,7 +189,9  @
     QAction                      *increaseThumbsAction;
     QAction                      *decreaseThumbsAction;
     QAction                      *downloadSelectedAction;
+    QAction                      *downloadDelSelectedAction;
     QAction                      *downloadAllAction;
+    QAction                      *downloadDelAllAction;
     QAction                      *deleteSelectedAction;
     QAction                      *deleteAllAction;
     QAction                      *cameraInfoAction;
 @ -449,14 +453,20  @
 
     // -------------------------------------------------------------------------
 
-    d->downloadMenu = new QMenu(this);
-    d->downloadSelectedAction =
-        d->downloadMenu->addAction(i18n("Download Selected"), this, SLOT(slotDownloadSelected()));
-    d->downloadAllAction =
-        d->downloadMenu->addAction(i18n("Download All"),      this, SLOT(slotDownloadAll()));
+    d->downloadMenu              = new QMenu(this);
+    d->downloadSelectedAction    = d->downloadMenu->addAction(i18n("Download Selected"), 
+                                                              this, SLOT(slotDownloadSelected()));
+    d->downloadAllAction         = d->downloadMenu->addAction(i18n("Download All"),
+                                                              this, SLOT(slotDownloadAll()));
     d->downloadMenu->addSeparator();
-    d->downloadMenu->addAction(i18n("Upload..."),         this, SLOT(slotUpload()));
+    d->downloadDelSelectedAction = d->downloadMenu->addAction(i18n("Download/Delete Selected"),
+                                                              this, SLOT(slotDownloadAndDeleteSelected()));
+    d->downloadDelAllAction      = d->downloadMenu->addAction(i18n("Download/Delete All"),
+                                                              this, SLOT(slotDownloadAll()));
+    d->downloadMenu->addSeparator();
+    d->downloadMenu->addAction(i18n("Upload..."),             this, SLOT(slotUpload()));
     d->downloadSelectedAction->setEnabled(false);
+    d->downloadDelSelectedAction->setEnabled(false);
     button(User2)->setMenu(d->downloadMenu);
 
     // -------------------------------------------------------------------------
 @ -511,6 +521,9  @
     connect(d->view, SIGNAL(signalDownload()),
             this, SLOT(slotDownloadSelected()));
 
+    connect(d->view, SIGNAL(signalDownloadAndDelete()),
+            this, SLOT(slotDownloadAndDeleteSelected()));
+
     connect(d->view, SIGNAL(signalDelete()),
             this, SLOT(slotDeleteSelected()));
 
 @ -1082,16 +1095,26  @
 
 void CameraUI::slotDownloadSelected()
 {
-    slotDownload(true);
+    slotDownload(true, false);
 }
 
+void CameraUI::slotDownloadAndDeleteSelected()
+{
+    slotDownload(true, true);
+}
+
 void CameraUI::slotDownloadAll()
 {
-    slotDownload(false);
+    slotDownload(false, false);
 }
 
-void CameraUI::slotDownload(bool onlySelected)
+void CameraUI::slotDownloadAndDeleteAll()
 {
+    slotDownload(false, true);
+}
+
+void CameraUI::slotDownload(bool onlySelected, bool deleteAfter)
+{
     // -- Get the destination album from digiKam library ---------------
 
     AlbumManager* man = AlbumManager::componentData();
 @ -1264,6 +1287,14  @
     // disable settings tab here instead of slotBusy:
     // Only needs to be disabled while downloading
     d->advBox->setEnabled(false);
+
+    if (deleteAfter)
+    {
+        if (onlySelected)
+            slotDeleteSelected();
+        else
+            slotDeleteAll();
+    }
 }
 
 void CameraUI::slotDownloaded(const QString& folder, const QString& file, int status)
 @ -1548,6 +1579,8  @
         // So do not allow Download All if there is a selection!
         d->downloadSelectedAction->setEnabled(hasSelection);
         d->downloadAllAction->setEnabled(!hasSelection);
+        d->downloadDelSelectedAction->setEnabled(hasSelection);
+        d->downloadDelAllAction->setEnabled(!hasSelection);
     }
     else
     {
 @ -1556,12 +1589,15  @
         // This is the easiest default for new users
         d->downloadSelectedAction->setEnabled(hasSelection);
         d->downloadAllAction->setEnabled(true);
+        d->downloadDelSelectedAction->setEnabled(hasSelection);
+        d->downloadDelAllAction->setEnabled(true);
     }
 }
 
 void CameraUI::slotItemsSelected(CameraIconViewItem* item, bool selected)
 {
     d->downloadSelectedAction->setEnabled(selected);
+    d->downloadDelSelectedAction->setEnabled(selected);
     d->deleteSelectedAction->setEnabled(selected);
 
     if (selected)
--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.h #705059:705060
 @ -112,8 +112,10  @
     void slotUploadItems(const KUrl::List&);
     void slotDownloadSelected();
     void slotDownloadAll();
-    void slotDownload(bool onlySelected);
+    void slotDownloadAndDeleteAll();
+    void slotDownload(bool onlySelected, bool deleteAfter);
     void slotDeleteSelected();
+    void slotDownloadAndDeleteSelected();
     void slotDeleteAll();
     void slotToggleLock();



More information about the Digikam-devel mailing list