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

Gilles Caulier caulier.gilles at gmail.com
Sun Aug 26 21:31:05 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         




------- Additional Comments From caulier.gilles gmail com  2007-08-26 22:31 -------
SVN commit 704994 by cgilles:

digiKam from KDE3 branch : 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".
CCBUGS: 144431


 M  +8 -3      cameraiconview.cpp  
 M  +1 -0      cameraiconview.h  
 M  +41 -6     cameraui.cpp  
 M  +3 -1      cameraui.h  


--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraiconview.cpp #704993:704994
 @ -40,7 +40,6  @
 
 // KDE includes.
 
-#include <kpopupmenu.h>
 #include <kurldrag.h>
 #include <kmimetype.h>
 #include <klocale.h>
 @ -56,6 +55,7  @
 #include "gpiteminfo.h"
 #include "renamecustomizer.h"
 #include "icongroupitem.h"
+#include "dpopupmenu.h"
 #include "cameraui.h"
 #include "cameradragobject.h"
 #include "cameraiconitem.h"
 @ -428,11 +428,11  @
 
     CameraIconViewItem* camItem = static_cast<CameraIconViewItem*>(item);
     
-    KPopupMenu menu(this);
-    menu.insertTitle(SmallIcon("digikam"), d->cameraUI->cameraTitle());
+    DPopupMenu menu(this);
     menu.insertItem(SmallIcon("editimage"), i18n("&View"), 0);
     menu.insertSeparator(-1);
     menu.insertItem(SmallIcon("down"),i18n("Download"), 1);
+    menu.insertItem(SmallIcon("down"),i18n("Download && Delete"), 4);
     menu.insertItem(SmallIcon("encrypted"), i18n("Toggle lock"), 3);
     menu.insertSeparator(-1);
     menu.insertItem(SmallIcon("editdelete"), i18n("Delete"), 2);
 @ -461,6 +461,11  @
             emit signalToggleLock();
             break;
         }
+        case(4):
+        {
+            emit signalDownloadAndDelete();
+            break;
+        }
         default:
             break;
     }
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraiconview.h #704993:704994
 @ -92,6 +92,7  @
 
     void signalUpload(const KURL::List&);
     void signalDownload();
+    void signalDownloadAndDelete();
     void signalDelete();
     void signalToggleLock();
     void signalNewSelection(bool);
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraui.cpp #704993:704994
 @ -418,11 +418,20  @
     // -------------------------------------------------------------------------
 
     d->downloadMenu = new QPopupMenu(this);
-    d->downloadMenu->insertItem(i18n("Download Selected"), this, SLOT(slotDownloadSelected()), 0, 0);
-    d->downloadMenu->insertItem(i18n("Download All"),      this, SLOT(slotDownloadAll()), 0, 1);
+    d->downloadMenu->insertItem(i18n("Download Selected"), 
+                                this, SLOT(slotDownloadSelected()), 0, 0);
+    d->downloadMenu->insertItem(i18n("Download All"),      
+                                this, SLOT(slotDownloadAll()), 0, 1);
     d->downloadMenu->insertSeparator();
-    d->downloadMenu->insertItem(i18n("Upload..."),         this, SLOT(slotUpload()), 0, 2);
+    d->downloadMenu->insertItem(i18n("Download/Delete Selected"), 
+                                this, SLOT(slotDownloadAndDeleteSelected()), 0, 2);
+    d->downloadMenu->insertItem(i18n("Download/Delete All"),      
+                                this, SLOT(slotDownloadAll()), 0, 3);
+    d->downloadMenu->insertSeparator();
+    d->downloadMenu->insertItem(i18n("Upload..."),         
+                                this, SLOT(slotUpload()), 0, 4);
     d->downloadMenu->setItemEnabled(0, false);
+    d->downloadMenu->setItemEnabled(2, false);
     actionButton(User2)->setPopup(d->downloadMenu);
 
     // -------------------------------------------------------------------------
 @ -478,6 +487,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()));
 
 @ -1049,16 +1061,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::instance();
 @ -1231,6 +1253,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)
 @ -1514,6 +1544,8  @
         // So do not allow Download All if there is a selection!
         d->downloadMenu->setItemEnabled(0, hasSelection);
         d->downloadMenu->setItemEnabled(1, !hasSelection);
+        d->downloadMenu->setItemEnabled(2, hasSelection);
+        d->downloadMenu->setItemEnabled(3, !hasSelection);
     }
     else
     {
 @ -1522,12 +1554,15  @
         // This is the easiest default for new users
         d->downloadMenu->setItemEnabled(0, hasSelection);
         d->downloadMenu->setItemEnabled(1, true);
+        d->downloadMenu->setItemEnabled(2, hasSelection);
+        d->downloadMenu->setItemEnabled(3, true);
     }
 }
 
 void CameraUI::slotItemsSelected(CameraIconViewItem* item, bool selected)
 {
     d->downloadMenu->setItemEnabled(0, selected);
+    d->downloadMenu->setItemEnabled(2, selected);
     d->deleteMenu->setItemEnabled(0, selected);
 
     if (selected)
--- branches/extragear/kde3/graphics/digikam/utilities/cameragui/cameraui.h #704993:704994
 @ -109,9 +109,11  @
     void slotUploadItems(const KURL::List&);
     void slotDownloadSelected();
     void slotDownloadAll();
-    void slotDownload(bool onlySelected);
+    void slotDownload(bool onlySelected, bool deleteAfter);
     void slotDeleteSelected();
+    void slotDownloadAndDeleteSelected();
     void slotDeleteAll();
+    void slotDownloadAndDeleteAll();
     void slotToggleLock();
 
     void slotFileView(CameraIconViewItem* item);



More information about the Digikam-devel mailing list