Git commit e038804efb44bde6aef2f9c612e208f1afbe95de by Islam Wazery. Committed on 01/08/2012 at 00:43. Pushed by wazery into branch 'development/3.0.0'. Use the new model/view classes in import tool and compile new code M +31 -10 utilities/cameragui/CMakeLists.txt M +6 -32 utilities/cameragui/controller/cameracontroller.cpp M +0 -3 utilities/cameragui/controller/cameracontroller.h M +1247 -1194 utilities/cameragui/main/cameraui.cpp M +12 -3 utilities/cameragui/main/cameraui.h M +10 -2 utilities/cameragui/main/cameraui.rc M +11 -1 utilities/cameragui/main/cameraui_p.h http://commits.kde.org/digikam/e038804efb44bde6aef2f9c612e208f1afbe95de diff --git a/utilities/cameragui/CMakeLists.txt b/utilities/cameragui/CMake= Lists.txt index 056f0b1..6427fef 100644 --- a/utilities/cameragui/CMakeLists.txt +++ b/utilities/cameragui/CMakeLists.txt @@ -1,6 +1,7 @@ SET(libcameragui_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/main/cameraui.cpp ${CMAKE_CURRENT_SOURCE_DIR}/controller/cameracontroller.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/controller/camerathumbsctrl.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/controller/camerathumbsctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/controller/camerahistoryupdater.cpp ${CMAKE_CURRENT_SOURCE_DIR}/devices/dkcamera.cpp ${CMAKE_CURRENT_SOURCE_DIR}/devices/gpcamera.cpp @@ -10,11 +11,11 @@ SET(libcameragui_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/camerainfodialog.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/capturedlg.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/cameramessagebox.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/items/camerafolderitem.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/items/cameraiconitem.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/views/camerafolderview.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/views/cameraiconview.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/views/cameraiconviewtooltip.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/items/camerafolderitem.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/items/cameraiconitem.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/views/camerafolderview.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/views/cameraiconview.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/views/cameraiconviewtooltip.cpp ${CMAKE_CURRENT_SOURCE_DIR}/views/cameranamehelper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/views/freespacetooltip.cpp ${CMAKE_CURRENT_SOURCE_DIR}/widgets/capturewidget.cpp @@ -24,11 +25,31 @@ SET(libcameragui_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/widgets/advancedsettings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/widgets/scriptingsettings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/widgets/filtercombo.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/main/cameraui.cpp = - ${CMAKE_CURRENT_SOURCE_DIR}/q3support/icongroupitem.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/q3support/iconitem.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/q3support/iconview.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/models/importimagemodel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/models/importthumbnailmodel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/models/importfiltermodel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/models/importmodel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/models/camitemsortsettings.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/items/itemviewimportdelegate.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/items/importcategorydrawer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/items/importdelegate.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/views/importsettings.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/views/importkcategorizedview.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/views/icategorizedview.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importcategorizedview.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importthumbnailbar.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importpreviewview.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importiconview.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importiconview_p.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importstackedview.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/views/importview.cpp + + #${CMAKE_CURRENT_SOURCE_DIR}/q3support/icongroupitem.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/q3support/iconitem.cpp + #${CMAKE_CURRENT_SOURCE_DIR}/q3support/iconview.cpp ) = KDE4_ADD_LIBRARY(cameragui STATIC ${libcameragui_SRCS}) diff --git a/utilities/cameragui/controller/cameracontroller.cpp b/utilitie= s/cameragui/controller/cameracontroller.cpp index 806849a..76cc7e0 100644 --- a/utilities/cameragui/controller/cameracontroller.cpp +++ b/utilities/cameragui/controller/cameracontroller.cpp @@ -139,11 +139,6 @@ public: QMutex mutex; QWaitCondition condVar; = - QFutureWatcher* rotateFutureWatcher; - - QString tmpFolder; - QString tmpFile; - QList commands; }; = @@ -190,8 +185,6 @@ CameraController::CameraController(QWidget* const paren= t, } } = - d->rotateFutureWatcher =3D new QFutureWatcher(); // to watch the= autorotate thread - // setup inter-thread signals = qRegisterMetaType("CamItemInfo"); @@ -220,9 +213,6 @@ CameraController::CameraController(QWidget* const paren= t, connect(this, SIGNAL(signalInternalOpen(QString,QString,QString)), this, SLOT(slotOpen(QString,QString,QString))); = - connect(d->rotateFutureWatcher, SIGNAL(finished()), - this, SLOT(slotAutoRotateThreadFinished())); - d->running =3D true; start(); } @@ -240,7 +230,6 @@ CameraController::~CameraController() } wait(); = - delete d->rotateFutureWatcher; delete d->camera; delete d; } @@ -524,6 +513,7 @@ void CameraController::executeCommand(CameraCommand* co= nst cmd) { numberOfItems++; info.id +=3D numberOfItems; + qDebug() << QString::number(info.id); //TODO: Remove this = line. } = if (!itemsList.isEmpty()) @@ -625,11 +615,11 @@ void CameraController::executeCommand(CameraCommand* = const cmd) = if(autoRotate) { - QFuture future =3D QtConcurrent::run(runAutoRota= teThread, this, tempURL, folder, file); - d->rotateFutureWatcher->setFuture(future); - - d->tmpFolder =3D folder; - d->tmpFile =3D file; + kDebug() << "Exif autorotate: " << file << " using (" = << tempURL << ")"; + sendLogMsg(i18n("EXIF rotating file %1...", file), DHi= storyView::StartingEntry, folder, file); +// JpegRotator rotator(tempURL.toLocalFile()); +// rotator.setDocumentName(file); +// rotator.autoExifTransform(); } = if (!templateTitle.isNull() || fixDateTime) @@ -804,22 +794,6 @@ void CameraController::executeCommand(CameraCommand* c= onst cmd) } } = -void CameraController::runAutoRotateThread(CameraController* cont, KUrl& t= empURL, QString& folder, QString& file) -{ - kDebug() << "Exif autorotate: " << file << " using (" << tempURL <= < ")"; - cont->sendLogMsg(i18n("EXIF rotating file %1...", file), DHistoryV= iew::StartingEntry, folder, file); - JPEGUtils::JpegRotator rotator(tempURL.toLocalFile()); - rotator.setDocumentName(file); - rotator.autoExifTransform(); -} - -void CameraController::slotAutoRotateThreadFinished() -{ - kDebug() << "Exif autorotated: " << "file"; - sendLogMsg(i18n("EXIF rotated file %1...", d->tmpFile), DHistoryView::= StartingEntry, d->tmpFolder, d->tmpFile); - emit signalFinished(); -} - void CameraController::sendLogMsg(const QString& msg, DHistoryView::EntryT= ype type, const QString& folder, const QString& fi= le) { diff --git a/utilities/cameragui/controller/cameracontroller.h b/utilities/= cameragui/controller/cameracontroller.h index 7fa793a..9e80fe3 100644 --- a/utilities/cameragui/controller/cameracontroller.h +++ b/utilities/cameragui/controller/cameracontroller.h @@ -147,15 +147,12 @@ private Q_SLOTS: void slotDeleteFailed(const QString& folder, const QString& file); void slotLockFailed(const QString& folder, const QString& file); void slotOpen(const QString& folder, const QString& file, const QStrin= g& dest); - void slotAutoRotateThreadFinished(); = private: = void sendLogMsg(const QString& msg, DHistoryView::EntryType type=3DDHi= storyView::StartingEntry, const QString& folder=3DQString(), const QString& file= =3DQString()); = - static void runAutoRotateThread(CameraController* cont, KUrl& tempURL,= QString& folder, QString& file); - void addCommand(CameraCommand* const cmd); bool queueIsEmpty() const; = diff --git a/utilities/cameragui/main/cameraui.cpp b/utilities/cameragui/ma= in/cameraui.cpp index 168a09b..caa2e85 100644 --- a/utilities/cameragui/main/cameraui.cpp +++ b/utilities/cameragui/main/cameraui.cpp @@ -25,6 +25,7 @@ * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ = #include "cameraui.moc" +#include "cameraui.h" #include "cameraui_p.h" = // Qt includes @@ -125,6 +126,9 @@ #include "knotificationwrapper.h" #include "newitemsfinder.h" = +#include "importview.h" +#include "models/importmodel.h" + using namespace KDcrawIface; = namespace Digikam @@ -162,11 +166,17 @@ CameraUI::CameraUI(QWidget* const parent, const QStri= ng& cameraTitle, connect(d->refreshIconViewTimer, SIGNAL(timeout()), this, SLOT(slotRefreshIconViewTimer())); = - // ------------------------------------------------------------------- + setupStatusBar(); + + // -- Init. camera controller ---------------------------------------- + + setupCameraController(model, port, path); + //d->controller->slotConnect(); + QTimer::singleShot(0, d->controller, SLOT(slotConnect())); + // -------------------------------------------------------- = setupUserArea(); setupActions(); - setupStatusBar(); setupAccelerators(); = // -- Make signals/slots connections --------------------------------- @@ -179,11 +189,7 @@ CameraUI::CameraUI(QWidget* const parent, const QStrin= g& cameraTitle, readSettings(); setAutoSaveSettings("Camera Settings", true); = - // -- Init. camera controller ---------------------------------------- - - setupCameraController(model, port, path); - - // -------------------------------------------------------- + // ------------------------------------------------------------------- = d->historyUpdater =3D new CameraHistoryUpdater(this); = @@ -196,8 +202,8 @@ CameraUI::CameraUI(QWidget* const parent, const QString= & cameraTitle, // -------------------------------------------------------- = d->renameCustomizer->setStartIndex(startIndex); - d->view->setFocus(); - QTimer::singleShot(0, d->controller, SLOT(slotConnect())); + //d->view->setFocus(); + //QTimer::singleShot(0, d->controller, SLOT(slotConnect())); } = CameraUI::~CameraUI() @@ -214,7 +220,7 @@ void CameraUI::setupUserArea() KHBox* widget =3D new KHBox(this); d->splitter =3D new SidebarSplitter(widget); KVBox* vbox =3D new KVBox(d->splitter); - d->view =3D new CameraIconView(this, vbox); + d->view =3D new ImportView(this, vbox); d->historyView =3D new DHistoryView(vbox); d->rightSideBar =3D new ImagePropertiesSideBarCamGui(widget, d->splitt= er, KMultiTabBar::Right, true); d->rightSideBar->setObjectName("CameraGui Sidebar Right"); @@ -236,7 +242,7 @@ void CameraUI::setupUserArea() = d->renameCustomizer =3D new RenameCustomizer(d->advBox, d->cameraTitle= ); d->renameCustomizer->setWhatsThis(i18n("Set how digiKam will rename fi= les as they are downloaded.")); - d->view->setRenameCustomizer(d->renameCustomizer); + //d->view->setRenameCustomizer(d->renameCustomizer); d->advBox->addItem(d->renameCustomizer, SmallIcon("insert-image"), i18= n("File Renaming Options"), QString("RenameCustomizer"), true); = @@ -329,30 +335,33 @@ void CameraUI::setupActions() = // -- Image menu --------------------------------------------- = - d->imageViewAction =3D new KAction(KIcon("editimage"), i18nc("View the= selected image", "View"), this); + d->imageViewAction =3D new KAction(KIcon("editimage"), i18nc("View the= selected image", "View Image"), this); connect(d->imageViewAction, SIGNAL(triggered()), this, SLOT(slotFileVi= ew())); actionCollection()->addAction("cameraui_imageview", d->imageViewAction= ); d->imageViewAction->setEnabled(false); = - // ----------------------------------------------------------------- + // --- Download actions ----------------------------------------------= ------ + + d->downloadAction =3D new KActionMenu(KIcon("get-hot-new-stuff"), i18n= ("Download"), this); + d->downloadAction->setDelayed(false); + actionCollection()->addAction("cameraui_imagedownload", d->downloadAct= ion); = d->downloadNewAction =3D new KAction(KIcon("get-hot-new-stuff"), i18n(= "Download New"), this); d->downloadNewAction->setShortcut(KShortcut(Qt::CTRL + Qt::Key_N)); connect(d->downloadNewAction, SIGNAL(triggered()), this, SLOT(slotDown= loadNew())); actionCollection()->addAction("cameraui_imagedownloadnew", d->download= NewAction); - - // ----------------------------------------------------------------- + d->downloadAction->addAction(d->downloadNewAction); = d->downloadSelectedAction =3D new KAction(i18n("Download Selected"), t= his); connect(d->downloadSelectedAction, SIGNAL(triggered()), this, SLOT(slo= tDownloadSelected())); actionCollection()->addAction("cameraui_imagedownloadselected", d->dow= nloadSelectedAction); d->downloadSelectedAction->setEnabled(false); - - // ----------------------------------------------------------------- + d->downloadAction->addAction(d->downloadSelectedAction); = d->downloadAllAction =3D new KAction(i18n("Download All"), this); connect(d->downloadAllAction, SIGNAL(triggered()), this, SLOT(slotDown= loadAll())); actionCollection()->addAction("cameraui_imagedownloadall", d->download= AllAction); + d->downloadAction->addAction(d->downloadAllAction); = // -------------------------------------------------------------------= ------ = @@ -394,25 +403,51 @@ void CameraUI::setupActions() connect(d->markAsDownloadedAction, SIGNAL(triggered()), this, SLOT(slo= tMarkAsDownloaded())); actionCollection()->addAction("cameraui_imagemarkasdownloaded", d->mar= kAsDownloadedAction); = - // -------------------------------------------------------------------= ------ + // --- Delete actions ------------------------------------------------= ------ + + d->deleteAction =3D new KActionMenu(KIcon("user-trash"), i18n("Delete"= ), this); + d->deleteAction->setDelayed(false); + actionCollection()->addAction("cameraui_delete", d->deleteAction); = d->deleteSelectedAction =3D new KAction(KIcon("edit-delete"), i18n("De= lete Selected"), this); connect(d->deleteSelectedAction, SIGNAL(triggered()), this, SLOT(slotD= eleteSelected())); actionCollection()->addAction("cameraui_imagedeleteselected", d->delet= eSelectedAction); d->deleteSelectedAction->setShortcut(KShortcut(Qt::Key_Delete)); d->deleteSelectedAction->setEnabled(false); + d->deleteAction->addAction(d->deleteSelectedAction); = - // -------------------------------------------------------------------= ------ - - d->deleteAllAction =3D new KAction(i18n("Delete All"), this); + d->deleteAllAction =3D new KAction(KIcon("edit-delete"), i18n("Delete = All"), this); connect(d->deleteAllAction, SIGNAL(triggered()), this, SLOT(slotDelete= All())); actionCollection()->addAction("cameraui_imagedeleteall", d->deleteAllA= ction); + d->deleteAction->addAction(d->deleteAllAction); = - // -------------------------------------------------------------------= ------ - - d->deleteNewAction =3D new KAction(i18n("Delete New"), this); + d->deleteNewAction =3D new KAction(KIcon("edit-delete"), i18n("Delete = New"), this); connect(d->deleteNewAction, SIGNAL(triggered()), this, SLOT(slotDelete= New())); actionCollection()->addAction("cameraui_imagedeletenew", d->deleteNewA= ction); + d->deleteAction->addAction(d->deleteNewAction); + + // --- Icon view, items preview, and map actions ---------------------= --------------------------------- + + d->imageViewSelectionAction =3D new KSelectAction(KIcon("viewimage"), = i18n("Views"), this); + actionCollection()->addAction("cameraui_view_selection", d->imageViewS= electionAction); + + d->iconViewAction =3D new KToggleAction(KIcon("view-list-icons"), + i18nc("@action Go to thumbn= ails (icon) view", "Thumbnails"), this); + actionCollection()->addAction("cameraui_icon_view", d->iconViewAction); + connect(d->iconViewAction, SIGNAL(triggered()), d->view, SLOT(slotIcon= View())); + d->imageViewSelectionAction->addAction(d->iconViewAction); + + d->camItemPreviewAction =3D new KToggleAction(KIcon("viewimage"), i18n= c("View the selected image", "Preview Item"), this); + d->camItemPreviewAction->setShortcut(KShortcut(Qt::Key_F3)); + actionCollection()->addAction("cameraui_item_view", d->camItemPreviewA= ction); + connect(d->camItemPreviewAction, SIGNAL(triggered()), d->view, SLOT(sl= otImagePreview())); + d->imageViewSelectionAction->addAction(d->camItemPreviewAction); + + d->mapViewAction =3D new KToggleAction(KIcon("applications-internet"), + i18nc("@action Switch to map= view", "Map"), this); + actionCollection()->addAction("cameraui_map_view", d->mapViewAction); + connect(d->mapViewAction, SIGNAL(triggered()), d->view, SLOT(slotMapWi= dgetView())); + d->imageViewSelectionAction->addAction(d->mapViewAction); = // -- Last Photo First menu actions ----------------------------------= ---------- = @@ -495,74 +530,80 @@ void CameraUI::setupActions() = void CameraUI::setupConnections() { - connect(d->advancedSettings, SIGNAL(signalDownloadNameChanged()), - d->view, SLOT(slotDownloadNameChanged())); + //connect(d->advancedSettings, SIGNAL(signalDownloadNameChanged()), + //d->view, SLOT(slotDownloadNameChanged())); = - connect(d->historyView, SIGNAL(signalEntryClicked(QVariant)), - this, SLOT(slotHistoryEntryClicked(QVariant))); + //connect(d->historyView, SIGNAL(signalEntryClicked(QVariant)), + //this, SLOT(slotHistoryEntryClicked(QVariant))); = // -------------------------------------------------------------------= ------ = connect(d->view, SIGNAL(signalSelected(CamItemInfo,bool)), this, SLOT(slotItemsSelected(CamItemInfo,bool))); = - connect(d->view, SIGNAL(signalFileView(CamItemInfo)), - this, SLOT(slotFileView(CamItemInfo))); +//Emitted from the context menu to view the item +//TODO: need to connect it with the context menu and view item action + //connect(d->view, SIGNAL(signalFileView(CamItemInfo)), + //this, SLOT(slotFileView(CamItemInfo))); = - connect(d->view, SIGNAL(signalUpload(KUrl::List)), - this, SLOT(slotUploadItems(KUrl::List))); + //connect(d->view, SIGNAL(signalUpload(KUrl::List)), + //this, SLOT(slotUploadItems(KUrl::List))); = - connect(d->view, SIGNAL(signalDownload()), - this, SLOT(slotDownloadSelected())); +//Emitted from the context menu to download the item +//TODO: need to connect it with the new context menu and download item act= ion + //connect(d->view, SIGNAL(signalDownload()), + //this, SLOT(slotDownloadSelected())); = - connect(d->view, SIGNAL(signalDownloadAndDelete()), - this, SLOT(slotDownloadAndDeleteSelected())); +//Emitted from the context menu to download and delete the item + //connect(d->view, SIGNAL(signalDownloadAndDelete()), + //this, SLOT(slotDownloadAndDeleteSelected())); = - connect(d->view, SIGNAL(signalDelete()), - this, SLOT(slotDeleteSelected())); + //connect(d->view, SIGNAL(signalDelete()), + //this, SLOT(slotDeleteSelected())); = - connect(d->view, SIGNAL(signalToggleLock()), - this, SLOT(slotToggleLock())); +//Emitted from the context menu to toogle lock the item +// connect(d->view, SIGNAL(signalToggleLock()), +// this, SLOT(slotToggleLock())); = - connect(d->view, SIGNAL(signalNewSelection(bool)), - this, SLOT(slotNewSelection(bool))); +// connect(d->view, SIGNAL(signalNewSelection(bool)), +// this, SLOT(slotNewSelection(bool))); = - connect(d->view, SIGNAL(signalZoomOut()), - this, SLOT(slotDecreaseThumbSize())); +// connect(d->view, SIGNAL(signalZoomOut()), +// this, SLOT(slotDecreaseThumbSize())); = - connect(d->view, SIGNAL(signalZoomIn()), - this, SLOT(slotIncreaseThumbSize())); +// connect(d->view, SIGNAL(signalZoomIn()), +// this, SLOT(slotIncreaseThumbSize())); = connect(d->view, SIGNAL(signalThumbSizeChanged(int)), this, SLOT(slotThumbSizeChanged(int))); = - connect(d->statusNavigateBar, SIGNAL(signalFirstItem()), - d->view, SLOT(slotFirstItem())); +// connect(d->statusNavigateBar, SIGNAL(signalFirstItem()), +// d->view, SLOT(slotFirstItem())); = - connect(d->statusNavigateBar, SIGNAL(signalNextItem()), - d->view, SLOT(slotNextItem())); +// connect(d->statusNavigateBar, SIGNAL(signalNextItem()), +// d->view, SLOT(slotNextItem())); = - connect(d->statusNavigateBar, SIGNAL(signalPrevItem()), - d->view, SLOT(slotPrevItem())); +// connect(d->statusNavigateBar, SIGNAL(signalPrevItem()), +// d->view, SLOT(slotPrevItem())); = - connect(d->statusNavigateBar, SIGNAL(signalLastItem()), - d->view, SLOT(slotLastItem())); +// connect(d->statusNavigateBar, SIGNAL(signalLastItem()), +// d->view, SLOT(slotLastItem())); = - // -------------------------------------------------------------------= ------ +// // -----------------------------------------------------------------= -------- = - connect(d->zoomBar, SIGNAL(signalZoomSliderChanged(int)), - this, SLOT(slotZoomSliderChanged(int))); +// connect(d->zoomBar, SIGNAL(signalZoomSliderChanged(int)), +// this, SLOT(slotZoomSliderChanged(int))); = - connect(this, SIGNAL(signalWindowHasMoved()), - d->zoomBar, SLOT(slotUpdateTrackerPos())); +// connect(this, SIGNAL(signalWindowHasMoved()), +// d->zoomBar, SLOT(slotUpdateTrackerPos())); = - // -------------------------------------------------------------------= ------ +// // -----------------------------------------------------------------= -------- = - connect(CollectionManager::instance(), SIGNAL(locationStatusChanged(Co= llectionLocation, int)), - this, SLOT(slotCollectionLocationStatusChanged(CollectionLocat= ion, int))); +// connect(CollectionManager::instance(), SIGNAL(locationStatusChanged(= CollectionLocation, int)), +// this, SLOT(slotCollectionLocationStatusChanged(CollectionLoc= ation, int))); = - connect(AlbumSettings::instance(), SIGNAL(setupChanged()), - this, SLOT(slotSidebarTabTitleStyleChanged())); +// connect(AlbumSettings::instance(), SIGNAL(setupChanged()), +// this, SLOT(slotSidebarTabTitleStyleChanged())); } = void CameraUI::setupStatusBar() @@ -639,13 +680,13 @@ void CameraUI::setupCameraController(const QString& m= odel, const QString& port, this, SLOT(slotFileList(CamItemInfoList))); = connect(d->controller, SIGNAL(signalDownloaded(QString,QString,int,boo= l)), - this, SLOT(slotDownloaded(QString,QString,int,bool))); + this, SLOT(slotDownloaded(QString,QString,int))); = connect(d->controller, SIGNAL(signalDownloadComplete(QString,QString,Q= String,QString)), this, SLOT(slotDownloadComplete(QString,QString,QString,QStrin= g))); = - connect(d->controller, SIGNAL(signalFinished()), - this, SLOT(slotFinished())); + //connect(d->controller, SIGNAL(signalFinished()), + // this, SLOT(slotFinished())); = connect(d->controller, SIGNAL(signalSkipped(QString,QString)), this, SLOT(slotSkipped(QString,QString))); @@ -662,10 +703,21 @@ void CameraUI::setupCameraController(const QString& m= odel, const QString& port, connect(d->controller, SIGNAL(signalUploaded(CamItemInfo)), this, SLOT(slotUploaded(CamItemInfo))); = + // --- Setup the models ----------------------------------------------= ---------------------- + + //ImportModel* importModel =3D new ImportModel(this); + //importModel->setCameraController(d->controller); + //d->view->installDefaultModels(importModel); + // Setup Thumbnails controller ---------------------------------------= ---------------- = - d->camThumbsCtrl =3D new CameraThumbsCtrl(d->controller, this); - d->view->setThumbControler(d->camThumbsCtrl); + //d->camThumbsCtrl =3D new CameraThumbsCtrl(d->controller, this); + //d->view->setThumbControler(d->camThumbsCtrl); +} + +CameraController* CameraUI::getCameraController() +{ + return d->controller; } = void CameraUI::setupAccelerators() @@ -677,22 +729,22 @@ void CameraUI::readSettings() KSharedConfig::Ptr config =3D KGlobal::config(); KConfigGroup group =3D config->group(d->configGroupName); = - d->view->setThumbnailSize(group.readEntry("ThumbnailSize", (int)Thumbn= ailSize::Large)); - d->showLogAction->setChecked(group.readEntry("ShowLog", = false)); - d->lastPhotoFirstAction->setChecked(group.readEntry("LastPhotoFirst", = true)); - d->albumCustomizer->readSettings(group); - d->advancedSettings->readSettings(group); - d->scriptingSettings->readSettings(group); + d->view->setThumbSize(group.readEntry("ThumbnailSize", (int)ThumbnailS= ize::Large)); +// d->showLogAction->setChecked(group.readEntry("ShowLog", = false)); +// d->lastPhotoFirstAction->setChecked(group.readEntry("LastPhotoFirst"= , true)); +// d->albumCustomizer->readSettings(group); +// d->advancedSettings->readSettings(group); +// d->scriptingSettings->readSettings(group); = -#if KDCRAW_VERSION >=3D 0x020000 - d->advBox->readSettings(group); -#else - d->advBox->readSettings(); -#endif +//#if KDCRAW_VERSION >=3D 0x020000 +// d->advBox->readSettings(group); +//#else +// d->advBox->readSettings(); +//#endif = - d->splitter->restoreState(group); +// d->splitter->restoreState(group); = - slotShowLog(); +// slotShowLog(); } = void CameraUI::saveSettings() @@ -700,28 +752,28 @@ void CameraUI::saveSettings() KSharedConfig::Ptr config =3D KGlobal::config(); KConfigGroup group =3D config->group(d->configGroupName); = - group.writeEntry("ThumbnailSize", d->view->thumbnailSize()); - group.writeEntry("ShowLog", d->showLogAction->isChecked()); - group.writeEntry("LastPhotoFirst", d->lastPhotoFirstAction->isChecked(= )); - d->albumCustomizer->saveSettings(group); - d->advancedSettings->saveSettings(group); - d->scriptingSettings->saveSettings(group); + group.writeEntry("ThumbnailSize", d->view->thumbnailSize().size()); +// group.writeEntry("ShowLog", d->showLogAction->isChecked()); +// group.writeEntry("LastPhotoFirst", d->lastPhotoFirstAction->isChecke= d()); +// d->albumCustomizer->saveSettings(group); +// d->advancedSettings->saveSettings(group); +// d->scriptingSettings->saveSettings(group); = -#if KDCRAW_VERSION >=3D 0x020000 - d->advBox->writeSettings(group); -#else - d->advBox->writeSettings(); -#endif +//#if KDCRAW_VERSION >=3D 0x020000 +// d->advBox->writeSettings(group); +//#else +// d->advBox->writeSettings(); +//#endif = - d->rightSideBar->saveState(); - d->splitter->saveState(group); - d->filterComboBox->saveSettings(); - config->sync(); +// d->rightSideBar->saveState(); +// d->splitter->saveState(group); +// d->filterComboBox->saveSettings(); +// config->sync(); } = void CameraUI::slotProcessUrl(const QString& url) { - KToolInvocation::invokeBrowser(url); +// KToolInvocation::invokeBrowser(url); } = bool CameraUI::isBusy() const @@ -748,42 +800,42 @@ DownloadSettings CameraUI::downloadSettings() const = void CameraUI::slotCancelButton() { - d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, - i18n("Canceling current operatio= n, please wait...")); - d->controller->slotCancel(); - d->historyUpdater->slotCancel(); - d->currentlyDeleting.clear(); - refreshFreeSpace(); +// d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, +// i18n("Canceling current operat= ion, please wait...")); +// d->controller->slotCancel(); +// d->historyUpdater->slotCancel(); +// d->currentlyDeleting.clear(); +// refreshFreeSpace(); } = void CameraUI::refreshFreeSpace() { - if (d->controller->cameraDriverType() =3D=3D DKCamera::GPhotoDriver) - { - d->controller->getFreeSpace(); - } - else - { - d->cameraFreeSpace->refresh(); - } +// if (d->controller->cameraDriverType() =3D=3D DKCamera::GPhotoDriver) +// { +// d->controller->getFreeSpace(); +// } +// else +// { +// d->cameraFreeSpace->refresh(); +// } } = void CameraUI::closeEvent(QCloseEvent* e) { - if (dialogClosed()) - { - e->accept(); - } - else - { - e->ignore(); - } +// if (dialogClosed()) +// { +// e->accept(); +// } +// else +// { +// e->ignore(); +// } } = void CameraUI::moveEvent(QMoveEvent* e) { - Q_UNUSED(e) - emit signalWindowHasMoved(); +// Q_UNUSED(e) +// emit signalWindowHasMoved(); } = void CameraUI::slotClose() @@ -796,39 +848,40 @@ void CameraUI::slotClose() = bool CameraUI::dialogClosed() { - if (d->closed) - { - return true; - } - - if (isBusy()) - { - if (KMessageBox::questionYesNo(this, - i18n("Do you want to close the dial= og " - "and cancel the current operat= ion?")) - =3D=3D KMessageBox::No) - { - return false; - } - } - - d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, - i18n("Disconnecting from camera,= please wait...")); - - if (isBusy()) - { - d->controller->slotCancel(); - // will be read in slotBusy later and finishDialog - // will be called only when everything is finished - d->closed =3D true; - } - else - { - d->closed =3D true; - finishDialog(); - } - - return true; + return false; //FIXME: Remove this line. +// if (d->closed) +// { +// return true; +// } + +// if (isBusy()) +// { +// if (KMessageBox::questionYesNo(this, +// i18n("Do you want to close the di= alog " +// "and cancel the current oper= ation?")) +// =3D=3D KMessageBox::No) +// { +// return false; +// } +// } + +// d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, +// i18n("Disconnecting from camer= a, please wait...")); + +// if (isBusy()) +// { +// d->controller->slotCancel(); +// // will be read in slotBusy later and finishDialog +// // will be called only when everything is finished +// d->closed =3D true; +// } +// else +// { +// d->closed =3D true; +// finishDialog(); +// } + +// return true; } = void CameraUI::finishDialog() @@ -836,162 +889,162 @@ void CameraUI::finishDialog() // Look if an item have been downloaded to computer during camera GUI = session. // If yes, update the starting number value used to rename camera item= s from camera list. = - if (d->view->itemsDownloaded() > 0) - { - CameraList* clist =3D CameraList::defaultList(); +// if (d->view->itemsDownloaded() > 0) +// { +// CameraList* clist =3D CameraList::defaultList(); = - if (clist) - { - clist->changeCameraStartIndex(d->cameraTitle, d->renameCustomi= zer->startIndex()); - } - } +// if (clist) +// { +// clist->changeCameraStartIndex(d->cameraTitle, d->renameCusto= mizer->startIndex()); +// } +// } = - // When a directory is created, a watch is put on it to spot new files - // but it can occur that the file is copied there before the watch is - // completely setup. That is why as an extra safeguard run CollectionS= canner - // over the folders we used. Bug: 119201 +// // When a directory is created, a watch is put on it to spot new fil= es +// // but it can occur that the file is copied there before the watch is +// // completely setup. That is why as an extra safeguard run Collectio= nScanner +// // over the folders we used. Bug: 119201 = - d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, - i18n("Scanning for new files, pl= ease wait...")); +// d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, +// i18n("Scanning for new files, = please wait...")); = - NewItemsFinder* tool =3D new NewItemsFinder(NewItemsFinder::ScheduleCo= llectionScan, d->foldersToScan.toList()); - tool->start(); +// NewItemsFinder* tool =3D new NewItemsFinder(NewItemsFinder::Schedule= CollectionScan, d->foldersToScan.toList()); +// tool->start(); = - d->foldersToScan.clear(); +// d->foldersToScan.clear(); = - deleteLater(); +// deleteLater(); = - if (!d->lastDestURL.isEmpty()) - { - emit signalLastDestination(d->lastDestURL); - } +// if (!d->lastDestURL.isEmpty()) +// { +// emit signalLastDestination(d->lastDestURL); +// } = - saveSettings(); +// saveSettings(); } = void CameraUI::slotBusy(bool val) { - if (!val) // Camera is available for actions. - { - if (!d->busy) - { - return; - } - - d->busy =3D false; - d->cameraCancelAction->setEnabled(false); - d->view->viewport()->setEnabled(true); - - d->advBox->setEnabled(true); - // B.K.O #127614: The Focus need to be restored in custom prefix w= idget. - // commenting this out again: If we do not disable, no need to res= tore focus - // d->renameCustomizer->restoreFocus(); - - d->uploadAction->setEnabled(d->controller->cameraUploadSupport()); - - d->downloadSelectedAction->setEnabled(true); - d->downloadDelSelectedAction->setEnabled(d->controller->cameraDele= teSupport()); - d->downloadNewAction->setEnabled(true); - d->downloadAllAction->setEnabled(true); - d->downloadDelAllAction->setEnabled(d->controller->cameraDeleteSup= port()); - d->downloadDelNewAction->setEnabled(d->controller->cameraDeleteSup= port()); - - d->deleteNewAction->setEnabled(d->controller->cameraDeleteSupport(= )); - d->deleteSelectedAction->setEnabled(d->controller->cameraDeleteSup= port()); - d->deleteAllAction->setEnabled(d->controller->cameraDeleteSupport(= )); - - d->selectNewItemsAction->setEnabled(true); - d->selectAllAction->setEnabled(true); - d->selectInvertAction->setEnabled(true); - d->selectLockedItemsAction->setEnabled(true); - d->selectNoneAction->setEnabled(true); - - d->lockAction->setEnabled(true); - d->markAsDownloadedAction->setEnabled(true); - d->cameraInfoAction->setEnabled(true); - d->cameraCaptureAction->setEnabled(d->controller->cameraCaptureIma= geSupport()); - d->imageViewAction->setEnabled(true); - d->filterComboBox->setEnabled(true); - - // selection-dependent update of lockAction, markAsDownloadedActio= n, - // downloadSelectedAction, downloadDelSelectedAction, deleteSelect= edAction - slotNewSelection(d->view->countSelected() > 0); - - d->anim->stop(); - d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode,= i18n("Ready")); - d->statusProgressBar->setNotify(false); - - // like WDestructiveClose, but after camera controller operation h= as safely finished - if (d->closed) - { - finishDialog(); - } - } - else // Camera is busy. - { - if (d->busy) - { - return; - } - - if (!d->anim->running()) - { - d->anim->start(); - } - - d->busy =3D true; - - // Has camera icon view item selection is used to control download= post processing, - // all selection actions are disable when camera interface is busy. - d->view->viewport()->setEnabled(false); - - // Settings tab is disabled in slotDownload, selectively when down= loading - // Fast dis/enabling would create the impression of flicker, e.g. = when retrieving EXIF from camera - //d->advBox->setEnabled(false); - - d->uploadAction->setEnabled(false); - - d->downloadSelectedAction->setEnabled(false); - d->downloadDelSelectedAction->setEnabled(false); - d->downloadNewAction->setEnabled(false); - d->downloadAllAction->setEnabled(false); - d->downloadDelAllAction->setEnabled(false); - d->downloadDelNewAction->setEnabled(false); - - d->deleteNewAction->setEnabled(false); - d->deleteSelectedAction->setEnabled(false); - d->deleteAllAction->setEnabled(false); - - d->selectNewItemsAction->setEnabled(false); - d->selectAllAction->setEnabled(false); - d->selectInvertAction->setEnabled(false); - d->selectLockedItemsAction->setEnabled(false); - d->selectNoneAction->setEnabled(false); - - d->lockAction->setEnabled(false); - d->markAsDownloadedAction->setEnabled(false); - d->cameraInfoAction->setEnabled(false); - d->cameraCaptureAction->setEnabled(false); - d->imageViewAction->setEnabled(false); - d->filterComboBox->setEnabled(false); - } +// if (!val) // Camera is available for actions. +// { +// if (!d->busy) +// { +// return; +// } + +// d->busy =3D false; +// d->cameraCancelAction->setEnabled(false); +// d->view->viewport()->setEnabled(true); + +// d->advBox->setEnabled(true); +// // B.K.O #127614: The Focus need to be restored in custom prefix= widget. +// // commenting this out again: If we do not disable, no need to r= estore focus +// // d->renameCustomizer->restoreFocus(); + +// d->uploadAction->setEnabled(d->controller->cameraUploadSupport()= ); + +// d->downloadSelectedAction->setEnabled(true); +// d->downloadDelSelectedAction->setEnabled(d->controller->cameraDe= leteSupport()); +// d->downloadNewAction->setEnabled(true); +// d->downloadAllAction->setEnabled(true); +// d->downloadDelAllAction->setEnabled(d->controller->cameraDeleteS= upport()); +// d->downloadDelNewAction->setEnabled(d->controller->cameraDeleteS= upport()); + +// d->deleteNewAction->setEnabled(d->controller->cameraDeleteSuppor= t()); +// d->deleteSelectedAction->setEnabled(d->controller->cameraDeleteS= upport()); +// d->deleteAllAction->setEnabled(d->controller->cameraDeleteSuppor= t()); + +// d->selectNewItemsAction->setEnabled(true); +// d->selectAllAction->setEnabled(true); +// d->selectInvertAction->setEnabled(true); +// d->selectLockedItemsAction->setEnabled(true); +// d->selectNoneAction->setEnabled(true); + +// d->lockAction->setEnabled(true); +// d->markAsDownloadedAction->setEnabled(true); +// d->cameraInfoAction->setEnabled(true); +// d->cameraCaptureAction->setEnabled(d->controller->cameraCaptureI= mageSupport()); +// d->imageViewAction->setEnabled(true); +// d->filterComboBox->setEnabled(true); + +// // selection-dependent update of lockAction, markAsDownloadedAct= ion, +// // downloadSelectedAction, downloadDelSelectedAction, deleteSele= ctedAction +// slotNewSelection(d->view->countSelected() > 0); + +// d->anim->stop(); +// d->statusProgressBar->progressBarMode(StatusProgressBar::TextMod= e, i18n("Ready")); +// d->statusProgressBar->setNotify(false); + +// // like WDestructiveClose, but after camera controller operation= has safely finished +// if (d->closed) +// { +// finishDialog(); +// } +// } +// else // Camera is busy. +// { +// if (d->busy) +// { +// return; +// } + +// if (!d->anim->running()) +// { +// d->anim->start(); +// } + +// d->busy =3D true; + +// // Has camera icon view item selection is used to control downlo= ad post processing, +// // all selection actions are disable when camera interface is bu= sy. +// d->view->viewport()->setEnabled(false); + +// // Settings tab is disabled in slotDownload, selectively when do= wnloading +// // Fast dis/enabling would create the impression of flicker, e.g= . when retrieving EXIF from camera +// //d->advBox->setEnabled(false); + +// d->uploadAction->setEnabled(false); + +// d->downloadSelectedAction->setEnabled(false); +// d->downloadDelSelectedAction->setEnabled(false); +// d->downloadNewAction->setEnabled(false); +// d->downloadAllAction->setEnabled(false); +// d->downloadDelAllAction->setEnabled(false); +// d->downloadDelNewAction->setEnabled(false); + +// d->deleteNewAction->setEnabled(false); +// d->deleteSelectedAction->setEnabled(false); +// d->deleteAllAction->setEnabled(false); + +// d->selectNewItemsAction->setEnabled(false); +// d->selectAllAction->setEnabled(false); +// d->selectInvertAction->setEnabled(false); +// d->selectLockedItemsAction->setEnabled(false); +// d->selectNoneAction->setEnabled(false); + +// d->lockAction->setEnabled(false); +// d->markAsDownloadedAction->setEnabled(false); +// d->cameraInfoAction->setEnabled(false); +// d->cameraCaptureAction->setEnabled(false); +// d->imageViewAction->setEnabled(false); +// d->filterComboBox->setEnabled(false); +// } } = void CameraUI::slotIncreaseThumbSize() { - int thumbSize =3D d->view->thumbnailSize() + ThumbnailSize::Step; - d->view->setThumbnailSize(thumbSize); + int thumbSize =3D d->view->thumbnailSize().size() + ThumbnailSize::Ste= p; + d->view->setThumbSize(thumbSize); } = void CameraUI::slotDecreaseThumbSize() { - int thumbSize =3D d->view->thumbnailSize() - ThumbnailSize::Step; - d->view->setThumbnailSize(thumbSize); + int thumbSize =3D d->view->thumbnailSize().size() - ThumbnailSize::Ste= p; + d->view->setThumbSize(thumbSize); } = void CameraUI::slotZoomSliderChanged(int size) { - d->view->setThumbnailSize(size); + d->view->setThumbSize(size); } = void CameraUI::slotThumbSizeChanged(int size) @@ -1079,67 +1132,67 @@ void CameraUI::slotFileList(const CamItemInfoList& = fileList) = void CameraUI::slotRefreshIconViewTimer() { - if (d->busy) - { - d->refreshIconViewTimer->start(); - return; - } +// if (d->busy) +// { +// d->refreshIconViewTimer->start(); +// return; +// } = - if (d->filesToBeAdded.isEmpty()) - { - return; - } +// if (d->filesToBeAdded.isEmpty()) +// { +// return; +// } = - AlbumSettings* settings =3D AlbumSettings::instance(); +// AlbumSettings* settings =3D AlbumSettings::instance(); = - if (!settings) - { - return; - } +// if (!settings) +// { +// return; +// } = - // We sort the map by time stamp - // and we remove internal camera files which are not image/video/sound= s. - KSharedConfig::Ptr config =3D KGlobal::config(); - KConfigGroup group =3D config->group(d->importFiltersConfigGroupName); - QStringList fileNames =3D group.readEntry("IgnoreNames", - FilterComboBox::defaultIgnoreN= ames).toLower().split(' '); - QStringList fileExts =3D group.readEntry("IgnoreExtensions", - FilterComboBox::defaultIgnoreEx= tensions).toLower().split(' '); - QFileInfo fi; +// // We sort the map by time stamp +// // and we remove internal camera files which are not image/video/sou= nds. +// KSharedConfig::Ptr config =3D KGlobal::config(); +// KConfigGroup group =3D config->group(d->importFiltersConfigGroupName= ); +// QStringList fileNames =3D group.readEntry("IgnoreNames", +// FilterComboBox::defaultIgnor= eNames).toLower().split(' '); +// QStringList fileExts =3D group.readEntry("IgnoreExtensions", +// FilterComboBox::defaultIgnore= Extensions).toLower().split(' '); +// QFileInfo fi; = - // NOTE: see B.K.O #181726: list of accepted file extensions from Albu= m Settings. - QStringList list =3D settings->getAllFileFilter().toLower().split(' '); +// // NOTE: see B.K.O #181726: list of accepted file extensions from Al= bum Settings. +// QStringList list =3D settings->getAllFileFilter().toLower().split(' = '); = - CHUpdateItemMap map; - CamItemInfoList items =3D d->view->allItems(); +// CHUpdateItemMap map; +// CamItemInfoList items =3D d->view->allItems(); = - foreach(CamItemInfo info, items) - { - map.insertMulti(info.mtime, info); - } +// foreach(CamItemInfo info, items) +// { +// map.insertMulti(info.mtime, info); +// } = - foreach(CamItemInfo info, d->filesToBeAdded) - { - fi.setFile(info.name); +// foreach(CamItemInfo info, d->filesToBeAdded) +// { +// fi.setFile(info.name); = - if (!fileNames.contains(fi.fileName().toLower()) && - !fileExts.contains(fi.suffix().toLower()) && - list.contains(QString("*.%1").arg(fi.suffix().toLower()))) - { - map.insertMulti(info.mtime, info); - } - } +// if (!fileNames.contains(fi.fileName().toLower()) && +// !fileExts.contains(fi.suffix().toLower()) && +// list.contains(QString("*.%1").arg(fi.suffix().toLower()))) +// { +// map.insertMulti(info.mtime, info); +// } +// } = - d->filesToBeAdded.clear(); +// d->filesToBeAdded.clear(); = - items =3D d->view->allItems(); +// items =3D d->view->allItems(); = - foreach(CamItemInfo info, items) - { - d->view->removeItem(info); - } +// foreach(CamItemInfo info, items) +// { +// d->view->removeItem(info); +// } = - d->historyUpdater->addItems(d->controller->cameraMD5ID(), map); +// d->historyUpdater->addItems(d->controller->cameraMD5ID(), map); } = void CameraUI::slotRefreshIconView(const CHUpdateItemMap& map) @@ -1162,7 +1215,7 @@ void CameraUI::slotRefreshIconView(const CHUpdateItem= Map& map) = if (d->filterComboBox->matchesCurrentFilter(*it)) { - d->view->addItem(*it); + //d->view->addItem(*it); } = if (!lastPhotoFirst) @@ -1176,1131 +1229,1131 @@ void CameraUI::slotRefreshIconView(const CHUpda= teItemMap& map) = void CameraUI::slotlastPhotoFirst() { - saveSettings(); +// saveSettings(); = - slotFilterChanged(); +// slotFilterChanged(); } = void CameraUI::slotFilterChanged() { - CamItemInfoList items =3D d->view->allItems(); +// CamItemInfoList items =3D d->view->allItems(); = - foreach(CamItemInfo info, items) - { - d->view->removeItem(info); - } - d->historyUpdater->addItems(d->controller->cameraMD5ID(), d->map); +// foreach(CamItemInfo info, items) +// { +// d->view->removeItem(info); +// } +// d->historyUpdater->addItems(d->controller->cameraMD5ID(), d->map); } = void CameraUI::slotCapture() { - if (d->busy) - { - return; - } +// if (d->busy) +// { +// return; +// } = - CaptureDlg* captureDlg =3D new CaptureDlg(this, d->controller, d->came= raTitle); - captureDlg->show(); +// CaptureDlg* captureDlg =3D new CaptureDlg(this, d->controller, d->ca= meraTitle); +// captureDlg->show(); } = void CameraUI::slotInformation() { - if (d->busy) - { - return; - } +// if (d->busy) +// { +// return; +// } = - d->controller->getCameraInformation(); +// d->controller->getCameraInformation(); } = void CameraUI::slotCameraInformation(const QString& summary, const QString= & manual, const QString& about) { - CameraInfoDialog* infoDlg =3D new CameraInfoDialog(this, summary, manu= al, about); - infoDlg->show(); +// CameraInfoDialog* infoDlg =3D new CameraInfoDialog(this, summary, ma= nual, about); +// infoDlg->show(); } = void CameraUI::slotUpload() { - if (d->busy) - { - return; - } +// if (d->busy) +// { +// return; +// } = - QString fileformats; +// QString fileformats; = - QStringList patternList =3D KImageIO::pattern(KImageIO::Reading).split= ('\n'); +// QStringList patternList =3D KImageIO::pattern(KImageIO::Reading).spl= it('\n'); = - // All Images from list must been always the first entry given by KDE = API - QString allPictures =3D patternList.at(0); +// // All Images from list must been always the first entry given by KD= E API +// QString allPictures =3D patternList.at(0); = - // Add RAW file format to All Images" type mime and replace current. - allPictures.insert(allPictures.indexOf("|"), QString(KDcrawIface::KDcr= aw::rawFiles())); - patternList.removeAll(patternList.at(0)); - patternList.prepend(allPictures); +// // Add RAW file format to All Images" type mime and replace current. +// allPictures.insert(allPictures.indexOf("|"), QString(KDcrawIface::KD= craw::rawFiles())); +// patternList.removeAll(patternList.at(0)); +// patternList.prepend(allPictures); = - // Added RAW file formats supported by dcraw program like a type mime. - // Note: we cannot use here "image/x-raw" type mime from KDE because i= t incomplete - // or unavailable(dcraw_0)(see file #121242 in B.K.O). - patternList.append(QString("\n%1|Camera RAW files").arg(QString(KDcraw= Iface::KDcraw::rawFiles()))); - fileformats =3D patternList.join("\n"); +// // Added RAW file formats supported by dcraw program like a type mim= e. +// // Note: we cannot use here "image/x-raw" type mime from KDE because= it incomplete +// // or unavailable(dcraw_0)(see file #121242 in B.K.O). +// patternList.append(QString("\n%1|Camera RAW files").arg(QString(KDcr= awIface::KDcraw::rawFiles()))); +// fileformats =3D patternList.join("\n"); = - kDebug() << "fileformats=3D" << fileformats; +// kDebug() << "fileformats=3D" << fileformats; = - KUrl::List urls =3D KFileDialog::getOpenUrls(CollectionManager::instan= ce()->oneAlbumRootPath(), - fileformats, this, i18n("Se= lect Image to Upload")); +// KUrl::List urls =3D KFileDialog::getOpenUrls(CollectionManager::inst= ance()->oneAlbumRootPath(), +// fileformats, this, i18n("= Select Image to Upload")); = - if (!urls.isEmpty()) - { - slotUploadItems(urls); - } +// if (!urls.isEmpty()) +// { +// slotUploadItems(urls); +// } } = void CameraUI::slotUploadItems(const KUrl::List& urls) { - if (d->busy) - { - return; - } - - if (urls.isEmpty()) - { - return; - } - - if (d->cameraFreeSpace->isValid()) - { - // Check if space require to upload new items in camera is enough. - quint64 totalKbSize =3D 0; - - for (KUrl::List::const_iterator it =3D urls.constBegin() ; it !=3D= urls.constEnd() ; ++it) - { - QFileInfo fi((*it).toLocalFile()); - totalKbSize +=3D fi.size() / 1024; - } - - if (totalKbSize >=3D d->cameraFreeSpace->kBAvail()) - { - KMessageBox::error(this, i18n("There is not enough free space = on the Camera Medium " - "to upload pictures.\n\n" - "Space require: %1\n" - "Available free space: %2", - KIO::convertSizeFromKiB(totalKbS= ize), - KIO::convertSizeFromKiB(d->camer= aFreeSpace->kBAvail()))); - return; - } - } - - QMap map =3D d->view->countItemsByFolders(); - QPointer dlg =3D new CameraFolderDialog(this, map,= d->controller->cameraTitle(), - d->controlle= r->cameraPath()); - - if (dlg->exec() !=3D QDialog::Accepted) - { - delete dlg; - return; - } - - // since we access members here, check if the pointer is still valid - if (!dlg) - { - return; - } - - QString cameraFolder =3D dlg->selectedFolderPath(); - - for (KUrl::List::const_iterator it =3D urls.constBegin(); it !=3D urls= .constEnd(); ++it) - { - QFileInfo fi((*it).toLocalFile()); - - if (!fi.exists()) - { - continue; - } - - if (fi.isDir()) - { - continue; - } - - QString ext =3D QString(".") + fi.completeSuffix(); - QString name =3D fi.fileName(); - name.truncate(fi.fileName().length() - ext.length()); - - bool ok; - - while (!d->view->findItemInfo(cameraFolder, name + ext).isNull()) - { - QString msg(i18n("Camera Folder %1 already contains the= item %2.
" - "Please enter a new filename (without extensi= on):", - cameraFolder, fi.fileName())); - name =3D KInputDialog::getText(i18n("File already exists"), ms= g, name, &ok, this); - - if (!ok) - { - return; - } - } - - d->controller->upload(fi, name + ext, cameraFolder); - } - - delete dlg; +// if (d->busy) +// { +// return; +// } + +// if (urls.isEmpty()) +// { +// return; +// } + +// if (d->cameraFreeSpace->isValid()) +// { +// // Check if space require to upload new items in camera is enoug= h. +// quint64 totalKbSize =3D 0; + +// for (KUrl::List::const_iterator it =3D urls.constBegin() ; it != =3D urls.constEnd() ; ++it) +// { +// QFileInfo fi((*it).toLocalFile()); +// totalKbSize +=3D fi.size() / 1024; +// } + +// if (totalKbSize >=3D d->cameraFreeSpace->kBAvail()) +// { +// KMessageBox::error(this, i18n("There is not enough free spac= e on the Camera Medium " +// "to upload pictures.\n\n" +// "Space require: %1\n" +// "Available free space: %2", +// KIO::convertSizeFromKiB(totalK= bSize), +// KIO::convertSizeFromKiB(d->cam= eraFreeSpace->kBAvail()))); +// return; +// } +// } + +// QMap map =3D d->view->countItemsByFolders(); +// QPointer dlg =3D new CameraFolderDialog(this, ma= p, d->controller->cameraTitle(), +// d->control= ler->cameraPath()); + +// if (dlg->exec() !=3D QDialog::Accepted) +// { +// delete dlg; +// return; +// } + +// // since we access members here, check if the pointer is still valid +// if (!dlg) +// { +// return; +// } + +// QString cameraFolder =3D dlg->selectedFolderPath(); + +// for (KUrl::List::const_iterator it =3D urls.constBegin(); it !=3D ur= ls.constEnd(); ++it) +// { +// QFileInfo fi((*it).toLocalFile()); + +// if (!fi.exists()) +// { +// continue; +// } + +// if (fi.isDir()) +// { +// continue; +// } + +// QString ext =3D QString(".") + fi.completeSuffix(); +// QString name =3D fi.fileName(); +// name.truncate(fi.fileName().length() - ext.length()); + +// bool ok; + +// while (!d->view->findItemInfo(cameraFolder, name + ext).isNull()) +// { +// QString msg(i18n("Camera Folder %1 already contains t= he item %2.
" +// "Please enter a new filename (without exten= sion):", +// cameraFolder, fi.fileName())); +// name =3D KInputDialog::getText(i18n("File already exists"), = msg, name, &ok, this); + +// if (!ok) +// { +// return; +// } +// } + +// d->controller->upload(fi, name + ext, cameraFolder); +// } + +// delete dlg; } = void CameraUI::slotUploaded(const CamItemInfo& itemInfo) { - if (d->closed) - { - return; - } +// if (d->closed) +// { +// return; +// } = - d->view->addItem(itemInfo); - refreshFreeSpace(); +// d->view->addItem(itemInfo); +// refreshFreeSpace(); } = void CameraUI::slotDownloadNew() { - d->view->slotSelectNew(); - QTimer::singleShot(0, this, SLOT(slotDownloadSelected())); +// d->view->slotSelectNew(); +// QTimer::singleShot(0, this, SLOT(slotDownloadSelected())); } = void CameraUI::slotDownloadAndDeleteNew() { - d->view->slotSelectNew(); - QTimer::singleShot(0, this, SLOT(slotDownloadAndDeleteSelected())); +// d->view->slotSelectNew(); +// QTimer::singleShot(0, this, SLOT(slotDownloadAndDeleteSelected())); } = void CameraUI::slotDownloadSelected() { - slotDownload(true, false); +// slotDownload(true, false); } = void CameraUI::slotDownloadAndDeleteSelected() { - slotDownload(true, true); +// slotDownload(true, true); } = void CameraUI::slotDownloadAll() { - slotDownload(false, false); +// slotDownload(false, false); } = void CameraUI::slotDownloadAndDeleteAll() { - slotDownload(false, true); +// slotDownload(false, true); } = void CameraUI::slotDownload(bool onlySelected, bool deleteAfter, Album* al= bum) { - if (d->albumCustomizer->folderDateFormat() =3D=3D AlbumCustomizer::Cus= tomDateFormat && - !d->albumCustomizer->customDateFormatIsValid()) - { - KMessageBox::information(this, i18n("Your custom target album date= format is not valid. Please check your settings...")); - return; - } - - // See B.K.O #143934: force to select all items to prevent problem - // when !renameCustomizer->useDefault() =3D=3D> iconItem->getDownloadN= ame() - // can return an empty string in this case because it depends on selec= tion. - if (!onlySelected) - { - d->view->slotSelectAll(); - } - - // -- Get the destination album from digiKam library --------------- - - PAlbum* pAlbum =3D 0; - - if (!album) - { - AlbumManager* man =3D AlbumManager::instance(); - - // Check if default target album option is enabled. - - KSharedConfig::Ptr config =3D KGlobal::config(); - KConfigGroup group =3D config->group(d->configGroupName); - bool useDefaultTarget =3D group.readEntry(d->configUseDefaultT= argetAlbum, false); - - if (useDefaultTarget) - { - PAlbum* pa =3D man->findPAlbum(group.readEntry(d->configDefaul= tTargetAlbumId, 0)); - - if (pa) - { - CollectionLocation cl =3D CollectionManager::instance()->l= ocationForAlbumRootId(pa->albumRootId()); - - if (!cl.isAvailable() || cl.isNull()) - { - KMessageBox::information(this, i18n("Collection which = host your default target album set to process " - "download from cam= era device is not available. Please select another one from " - "camera configurat= ion dialog.")); - return; - } - } - else - { - KMessageBox::information(this, i18n("Your default target a= lbum set to process download " - "from camera device is= not available. Please select another one from " - "camera configuration = dialog.")); - return; - } - - pAlbum =3D pa; - } - else - { - album =3D man->currentAlbum(); - - if (album && album->type() !=3D Album::PHYSICAL) - { - album =3D 0; - } - - QString header(i18n("

Please select the destination album fr= om the digiKam library to " - "import the camera pictures into.

")); - - album =3D AlbumSelectDialog::selectAlbum(this, (PAlbum*)album,= header); - - if (!album) - { - return; - } - - pAlbum =3D dynamic_cast(album); - } - } - else - { - pAlbum =3D dynamic_cast(album); - } - - if (!pAlbum) - { - kDebug() << "Destination Album is null"; - return; - } - - // -- Check disk space ------------------------ - - // See B.K.O #139519: Always check free space available before to - // download items selection from camera. - unsigned long fSize =3D 0; - unsigned long dSize =3D 0; - d->view->itemsSelectionSizeInfo(fSize, dSize); - QString albumRootPath =3D pAlbum->albumRootPath(); - unsigned long kBAvail =3D d->albumLibraryFreeSpace->kBAvail(albumRootP= ath); - - if (dSize >=3D kBAvail) - { - KGuiItem cont =3D KStandardGuiItem::cont(); - cont.setText(i18n("Try Anyway")); - KGuiItem cancel =3D KStandardGuiItem::cancel(); - cancel.setText(i18n("Cancel Download")); - int result =3D - KMessageBox::warningYesNo(this, - i18n("There is not enough free space= on the disk of the album you selected " - "to download and process the se= lected pictures from the camera.\n\n" - "Estimated space required: %1\n" - "Available free space: %2", - KIO::convertSizeFromKiB(dSize), - KIO::convertSizeFromKiB(kBAvail= )), - i18n("Insufficient Disk Space"), - cont, cancel); - - if (result =3D=3D KMessageBox::No) - { - return; - } - } - - // -- Prepare downloading of camera items ------------------------ - - KUrl url =3D pAlbum->fileUrl(); - - d->controller->downloadPrep(); - - QString downloadName; - QDateTime dateTime; - DownloadSettingsList allItems; - DownloadSettings settings =3D downloadSettings(); - int total =3D 0; - - // -- Download camera items ------------------------------- - // Since we show camera items in reverse order, downloading need to be= done also in reverse order. - - QSet usedDownloadPaths; - CamItemInfoList list =3D d->view->allItems(d->lastPhotoFirstAction->is= Checked()); - - foreach(CamItemInfo info, list) - { - if (onlySelected && !(d->view->isSelected(info))) - { - continue; - } - - settings.folder =3D info.folder; - settings.file =3D info.name; - downloadName =3D info.downloadName; - dateTime =3D info.mtime; - - KUrl downloadUrl(url); - QString errMsg; - - // Auto sub-albums creation based on file date. - - if (d->albumCustomizer->autoAlbumDateEnabled()) - { - QString dirName; - - switch (d->albumCustomizer->folderDateFormat()) - { - case AlbumCustomizer::TextDateFormat: - dirName =3D dateTime.date().toString(Qt::TextDate); - break; - - case AlbumCustomizer::LocalDateFormat: - dirName =3D dateTime.date().toString(Qt::LocalDate); - break; - - case AlbumCustomizer::IsoDateFormat: - dirName =3D dateTime.date().toString(Qt::ISODate); - break; - - default: // Custom - dirName =3D dateTime.date().toString(d->albumCustomize= r->customDateFormat()); - break; - } - - // See B.K.O #136927 : we need to support file system which do= not - // handle upper case properly. - dirName =3D dirName.toLower(); - - if (!createAutoAlbum(downloadUrl, dirName, dateTime.date(), er= rMsg)) - { - KMessageBox::error(this, errMsg); - return; - } - - downloadUrl.addPath(dirName); - } - - // Auto sub-albums creation based on file extensions. - - if (d->albumCustomizer->autoAlbumExtEnabled()) - { - // We use the target file name to compute sub-albums name to t= ake a care about - // conversion on the fly option. - QFileInfo fi(downloadName); - - QString subAlbum =3D fi.suffix().toUpper(); - - if (fi.suffix().toUpper() =3D=3D QString("JPEG") || - fi.suffix().toUpper() =3D=3D QString("JPE")) - { - subAlbum =3D QString("JPG"); - } - - if (fi.suffix().toUpper() =3D=3D QString("TIFF")) - { - subAlbum =3D QString("TIF"); - } - - if (fi.suffix().toUpper() =3D=3D QString("MPEG") || - fi.suffix().toUpper() =3D=3D QString("MPE") || - fi.suffix().toUpper() =3D=3D QString("MPO")) - { - subAlbum =3D QString("MPG"); - } - - // See B.K.O #136927 : we need to support file system which do= not - // handle upper case properly. - subAlbum =3D subAlbum.toLower(); - - if (!createAutoAlbum(downloadUrl, subAlbum, dateTime.date(), e= rrMsg)) - { - KMessageBox::error(this, errMsg); - return; - } - - downloadUrl.addPath(subAlbum); - } - - d->foldersToScan << downloadUrl.toLocalFile(); - - if (downloadName.isEmpty()) - { - downloadUrl.addPath(settings.file); - } - else - { - // when using custom renaming (e.g. by date, see bug 179902) - // make sure that we create unique names - downloadUrl.addPath(downloadName); - QString suggestedPath =3D downloadUrl.toLocalFile(); - - if (usedDownloadPaths.contains(suggestedPath)) - { - QFileInfo fi(downloadName); - QString suffix =3D '.' + fi.suffix(); - QString pathWithoutSuffix(suggestedPath); - pathWithoutSuffix.chop(suffix.length()); - QString currentVariant; - int counter =3D 1; - - do - { - currentVariant =3D pathWithoutSuffix + '-' + QString::= number(counter++) + suffix; - } - while (usedDownloadPaths.contains(currentVariant)); - - usedDownloadPaths << currentVariant; - downloadUrl =3D KUrl(currentVariant); - } - else - { - usedDownloadPaths << suggestedPath; - } - } - - settings.dest =3D downloadUrl.toLocalFile(); - allItems.append(settings); - - ++total; - } - - if (total <=3D 0) - { - return; - } - - d->lastDestURL =3D url; - d->statusProgressBar->setNotify(true); - d->statusProgressBar->setProgressValue(0); - d->statusProgressBar->setProgressTotalSteps(total); - d->statusProgressBar->progressBarMode(StatusProgressBar::ProgressBarMo= de); - - // disable settings tab here instead of slotBusy: - // Only needs to be disabled while downloading - d->advBox->setEnabled(false); - - d->deleteAfter =3D deleteAfter; - - d->controller->download(allItems); -} - -void CameraUI::slotFinished() -{ - d->progressValue +=3D 0.5; -} - -void CameraUI::slotDownloaded(const QString& folder, const QString& file, = int status, bool autoRotate) -{ - CamItemInfo info =3D d->view->findItemInfo(folder, file); - - if (!info.isNull()) - { - d->view->setDownloaded(info, status); - - d->progressValue +=3D 0.5; - - if (d->rightSideBar->url() =3D=3D info.url()) - { - slotItemsSelected(d->view->findItemInfo(folder, file), true); - } - - if (autoRotate) - { - if (status =3D=3D CamItemInfo::DownloadedYes && d->progressVal= ue =3D=3D 1) - { - int curr =3D d->statusProgressBar->progressValue(); - d->statusProgressBar->setProgressValue(curr + 1); - d->progressValue =3D 0; // reset progress - } - } - else if (status =3D=3D CamItemInfo::DownloadedYes) - { - int curr =3D d->statusProgressBar->progressValue(); - d->statusProgressBar->setProgressValue(curr + 1); - } - - d->renameCustomizer->setStartIndex(d->renameCustomizer->startIndex= () + 1); - - DownloadHistory::setDownloaded(d->controller->cameraMD5ID(), - info.name, - info.size, - info.mtime); - } - - // Download all items is complete ? - if (d->statusProgressBar->progressValue() =3D=3D d->statusProgressBar-= >progressTotalSteps()) - { - if (d->deleteAfter) - { - // No need passive pop-up here, because wil ask to confirm ite= ms deletion with dialog. - deleteItems(true, true); - } - else - { - // Pop-up a message to bring user when all is done. - KNotificationWrapper("cameradownloaded", i18n("Download is com= pleted..."), this, windowTitle()); - } - } +// if (d->albumCustomizer->folderDateFormat() =3D=3D AlbumCustomizer::C= ustomDateFormat && +// !d->albumCustomizer->customDateFormatIsValid()) +// { +// KMessageBox::information(this, i18n("Your custom target album da= te format is not valid. Please check your settings...")); +// return; +// } + +// // See B.K.O #143934: force to select all items to prevent problem +// // when !renameCustomizer->useDefault() =3D=3D> iconItem->getDownloa= dName() +// // can return an empty string in this case because it depends on sel= ection. +// if (!onlySelected) +// { +// d->view->slotSelectAll(); +// } + +// // -- Get the destination album from digiKam library --------------- + +// PAlbum* pAlbum =3D 0; + +// if (!album) +// { +// AlbumManager* man =3D AlbumManager::instance(); + +// // Check if default target album option is enabled. + +// KSharedConfig::Ptr config =3D KGlobal::config(); +// KConfigGroup group =3D config->group(d->configGroupName); +// bool useDefaultTarget =3D group.readEntry(d->configUseDefaul= tTargetAlbum, false); + +// if (useDefaultTarget) +// { +// PAlbum* pa =3D man->findPAlbum(group.readEntry(d->configDefa= ultTargetAlbumId, 0)); + +// if (pa) +// { +// CollectionLocation cl =3D CollectionManager::instance()-= >locationForAlbumRootId(pa->albumRootId()); + +// if (!cl.isAvailable() || cl.isNull()) +// { +// KMessageBox::information(this, i18n("Collection whic= h host your default target album set to process " +// "download from c= amera device is not available. Please select another one from " +// "camera configur= ation dialog.")); +// return; +// } +// } +// else +// { +// KMessageBox::information(this, i18n("Your default target= album set to process download " +// "from camera device = is not available. Please select another one from " +// "camera configuratio= n dialog.")); +// return; +// } + +// pAlbum =3D pa; +// } +// else +// { +// album =3D man->currentAlbum(); + +// if (album && album->type() !=3D Album::PHYSICAL) +// { +// album =3D 0; +// } + +// QString header(i18n("

Please select the destination album = from the digiKam library to " +// "import the camera pictures into.

")); + +// album =3D AlbumSelectDialog::selectAlbum(this, (PAlbum*)albu= m, header); + +// if (!album) +// { +// return; +// } + +// pAlbum =3D dynamic_cast(album); +// } +// } +// else +// { +// pAlbum =3D dynamic_cast(album); +// } + +// if (!pAlbum) +// { +// kDebug() << "Destination Album is null"; +// return; +// } + +// // -- Check disk space ------------------------ + +// // See B.K.O #139519: Always check free space available before to +// // download items selection from camera. +// unsigned long fSize =3D 0; +// unsigned long dSize =3D 0; +// d->view->itemsSelectionSizeInfo(fSize, dSize); +// QString albumRootPath =3D pAlbum->albumRootPath(); +// unsigned long kBAvail =3D d->albumLibraryFreeSpace->kBAvail(albumRoo= tPath); + +// if (dSize >=3D kBAvail) +// { +// KGuiItem cont =3D KStandardGuiItem::cont(); +// cont.setText(i18n("Try Anyway")); +// KGuiItem cancel =3D KStandardGuiItem::cancel(); +// cancel.setText(i18n("Cancel Download")); +// int result =3D +// KMessageBox::warningYesNo(this, +// i18n("There is not enough free spa= ce on the disk of the album you selected " +// "to download and process the = selected pictures from the camera.\n\n" +// "Estimated space required: %1= \n" +// "Available free space: %2", +// KIO::convertSizeFromKiB(dSize= ), +// KIO::convertSizeFromKiB(kBAva= il)), +// i18n("Insufficient Disk Space"), +// cont, cancel); + +// if (result =3D=3D KMessageBox::No) +// { +// return; +// } +// } + +// // -- Prepare downloading of camera items ------------------------ + +// KUrl url =3D pAlbum->fileUrl(); + +// d->controller->downloadPrep(); + +// QString downloadName; +// QDateTime dateTime; +// DownloadSettingsList allItems; +// DownloadSettings settings =3D downloadSettings(); +// int total =3D 0; + +// // -- Download camera items ------------------------------- +// // Since we show camera items in reverse order, downloading need to = be done also in reverse order. + +// QSet usedDownloadPaths; +// CamItemInfoList list =3D d->view->allItems(d->lastPhotoFirstAction->= isChecked()); + +// foreach(CamItemInfo info, list) +// { +// if (onlySelected && !(d->view->isSelected(info))) +// { +// continue; +// } + +// settings.folder =3D info.folder; +// settings.file =3D info.name; +// downloadName =3D info.downloadName; +// dateTime =3D info.mtime; + +// KUrl downloadUrl(url); +// QString errMsg; + +// // Auto sub-albums creation based on file date. + +// if (d->albumCustomizer->autoAlbumDateEnabled()) +// { +// QString dirName; + +// switch (d->albumCustomizer->folderDateFormat()) +// { +// case AlbumCustomizer::TextDateFormat: +// dirName =3D dateTime.date().toString(Qt::TextDate); +// break; + +// case AlbumCustomizer::LocalDateFormat: +// dirName =3D dateTime.date().toString(Qt::LocalDate); +// break; + +// case AlbumCustomizer::IsoDateFormat: +// dirName =3D dateTime.date().toString(Qt::ISODate); +// break; + +// default: // Custom +// dirName =3D dateTime.date().toString(d->albumCustomi= zer->customDateFormat()); +// break; +// } + +// // See B.K.O #136927 : we need to support file system which = do not +// // handle upper case properly. +// dirName =3D dirName.toLower(); + +// if (!createAutoAlbum(downloadUrl, dirName, dateTime.date(), = errMsg)) +// { +// KMessageBox::error(this, errMsg); +// return; +// } + +// downloadUrl.addPath(dirName); +// } + +// // Auto sub-albums creation based on file extensions. + +// if (d->albumCustomizer->autoAlbumExtEnabled()) +// { +// // We use the target file name to compute sub-albums name to= take a care about +// // conversion on the fly option. +// QFileInfo fi(downloadName); + +// QString subAlbum =3D fi.suffix().toUpper(); + +// if (fi.suffix().toUpper() =3D=3D QString("JPEG") || +// fi.suffix().toUpper() =3D=3D QString("JPE")) +// { +// subAlbum =3D QString("JPG"); +// } + +// if (fi.suffix().toUpper() =3D=3D QString("TIFF")) +// { +// subAlbum =3D QString("TIF"); +// } + +// if (fi.suffix().toUpper() =3D=3D QString("MPEG") || +// fi.suffix().toUpper() =3D=3D QString("MPE") || +// fi.suffix().toUpper() =3D=3D QString("MPO")) +// { +// subAlbum =3D QString("MPG"); +// } + +// // See B.K.O #136927 : we need to support file system which = do not +// // handle upper case properly. +// subAlbum =3D subAlbum.toLower(); + +// if (!createAutoAlbum(downloadUrl, subAlbum, dateTime.date(),= errMsg)) +// { +// KMessageBox::error(this, errMsg); +// return; +// } + +// downloadUrl.addPath(subAlbum); +// } + +// d->foldersToScan << downloadUrl.toLocalFile(); + +// if (downloadName.isEmpty()) +// { +// downloadUrl.addPath(settings.file); +// } +// else +// { +// // when using custom renaming (e.g. by date, see bug 179902) +// // make sure that we create unique names +// downloadUrl.addPath(downloadName); +// QString suggestedPath =3D downloadUrl.toLocalFile(); + +// if (usedDownloadPaths.contains(suggestedPath)) +// { +// QFileInfo fi(downloadName); +// QString suffix =3D '.' + fi.suffix(); +// QString pathWithoutSuffix(suggestedPath); +// pathWithoutSuffix.chop(suffix.length()); +// QString currentVariant; +// int counter =3D 1; + +// do +// { +// currentVariant =3D pathWithoutSuffix + '-' + QString= ::number(counter++) + suffix; +// } +// while (usedDownloadPaths.contains(currentVariant)); + +// usedDownloadPaths << currentVariant; +// downloadUrl =3D KUrl(currentVariant); +// } +// else +// { +// usedDownloadPaths << suggestedPath; +// } +// } + +// settings.dest =3D downloadUrl.toLocalFile(); +// allItems.append(settings); + +// ++total; +// } + +// if (total <=3D 0) +// { +// return; +// } + +// d->lastDestURL =3D url; +// d->statusProgressBar->setNotify(true); +// d->statusProgressBar->setProgressValue(0); +// d->statusProgressBar->setProgressTotalSteps(total); +// d->statusProgressBar->progressBarMode(StatusProgressBar::ProgressBar= Mode); + +// // disable settings tab here instead of slotBusy: +// // Only needs to be disabled while downloading +// d->advBox->setEnabled(false); + +// d->deleteAfter =3D deleteAfter; + +// d->controller->download(allItems); +} + +void CameraUI::slotDownloaded(const QString& folder, const QString& file, = int status) +{ +// CamItemInfo info =3D d->view->findItemInfo(folder, file); + +// if (!info.isNull()) +// { +// d->view->setDownloaded(info, status); + +// if (d->rightSideBar->url() =3D=3D info.url()) +// { +// slotItemsSelected(d->view->findItemInfo(folder, file), true); +// } + +// if (status =3D=3D CamItemInfo::DownloadedYes) +// { +// int curr =3D d->statusProgressBar->progressValue(); +// d->statusProgressBar->setProgressValue(curr + 1); + +// d->renameCustomizer->setStartIndex(d->renameCustomizer->startInd= ex() + 1); + +// DownloadHistory::setDownloaded(d->controller->cameraMD5ID(), +// info.name, +// info.size, +// info.mtime); +// } +// } + +// // Download all items is complete ? +// if (d->statusProgressBar->progressValue() =3D=3D d->statusProgressBa= r->progressTotalSteps()) +// { +// if (d->deleteAfter) +// { +// // No need passive pop-up here, because wil ask to confirm i= tems deletion with dialog. +// deleteItems(true, true); +// } +// else +// { +// // Pop-up a message to bring user when all is done. +// KNotificationWrapper("cameradownloaded", i18n("Download is c= ompleted..."), this, windowTitle()); +// } +// } } = void CameraUI::slotDownloadComplete(const QString&, const QString&, const QString& destFolder, const QStri= ng&) { - ScanController::instance()->scheduleCollectionScanRelaxed(destFolder); +// ScanController::instance()->scheduleCollectionScanRelaxed(destFolder= ); } = void CameraUI::slotSkipped(const QString& folder, const QString& file) { - CamItemInfo info =3D d->view->findItemInfo(folder, file); +// CamItemInfo info =3D d->view->findItemInfo(folder, file); = - if (!info.isNull()) - { - d->view->setDownloaded(info, CamItemInfo::DownloadedNo); - } +// if (!info.isNull()) +// { +// d->view->setDownloaded(info, CamItemInfo::DownloadedNo); +// } = - int curr =3D d->statusProgressBar->progressValue(); - d->statusProgressBar->setProgressValue(curr + 1); +// int curr =3D d->statusProgressBar->progressValue(); +// d->statusProgressBar->setProgressValue(curr + 1); } = void CameraUI::slotMarkAsDownloaded() { - CamItemInfoList list =3D d->view->selectedItems(); +// CamItemInfoList list =3D d->view->selectedItems(); = - foreach(CamItemInfo info, list) - { - d->view->setDownloaded(info, CamItemInfo::DownloadedYes); +// foreach(CamItemInfo info, list) +// { +// d->view->setDownloaded(info, CamItemInfo::DownloadedYes); = - DownloadHistory::setDownloaded(d->controller->cameraMD5ID(), - info.name, - info.size, - info.mtime); - } +// DownloadHistory::setDownloaded(d->controller->cameraMD5ID(), +// info.name, +// info.size, +// info.mtime); +// } } = void CameraUI::slotToggleLock() { - CamItemInfoList list =3D d->view->selectedItems(); - int count =3D list.count(); +// CamItemInfoList list =3D d->view->selectedItems(); +// int count =3D list.count(); = - if (count > 0) - { - d->statusProgressBar->setProgressValue(0); - d->statusProgressBar->setProgressTotalSteps(count); - d->statusProgressBar->progressBarMode(StatusProgressBar::ProgressB= arMode); - } +// if (count > 0) +// { +// d->statusProgressBar->setProgressValue(0); +// d->statusProgressBar->setProgressTotalSteps(count); +// d->statusProgressBar->progressBarMode(StatusProgressBar::Progres= sBarMode); +// } = - foreach(CamItemInfo info, list) - { - QString folder =3D info.folder; - QString file =3D info.name; - int writePerm =3D info.writePermissions; - bool lock =3D true; +// foreach(CamItemInfo info, list) +// { +// QString folder =3D info.folder; +// QString file =3D info.name; +// int writePerm =3D info.writePermissions; +// bool lock =3D true; = - // If item is currently locked, unlock it. - if (writePerm =3D=3D 0) - { - lock =3D false; - } +// // If item is currently locked, unlock it. +// if (writePerm =3D=3D 0) +// { +// lock =3D false; +// } = - d->controller->lockFile(folder, file, lock); - } +// d->controller->lockFile(folder, file, lock); +// } } = void CameraUI::slotLocked(const QString& folder, const QString& file, bool= status) { - if (status) - { - CamItemInfo info =3D d->view->findItemInfo(folder, file); +// if (status) +// { +// CamItemInfo info =3D d->view->findItemInfo(folder, file); = - if (!info.isNull()) - { - d->view->toggleLock(info); +// if (!info.isNull()) +// { +// d->view->toggleLock(info); = - if (d->rightSideBar->url() =3D=3D info.url()) - { - slotItemsSelected(d->view->findItemInfo(folder, file), tru= e); - } - } - } +// if (d->rightSideBar->url() =3D=3D info.url()) +// { +// slotItemsSelected(d->view->findItemInfo(folder, file), t= rue); +// } +// } +// } = - int curr =3D d->statusProgressBar->progressValue(); - d->statusProgressBar->setProgressValue(curr + 1); +// int curr =3D d->statusProgressBar->progressValue(); +// d->statusProgressBar->setProgressValue(curr + 1); } = = void CameraUI::checkItem4Deletion(const CamItemInfo& info, QStringList& fo= lders, QStringList& files, CamItemInfoList& deleteList, CamItemInfo= List& lockedList) { - if (info.writePermissions !=3D 0) // Item not locked ? - { - QString folder =3D info.folder; - QString file =3D info.name; - folders.append(folder); - files.append(file); - deleteList.append(info); - } - else - { - lockedList.append(info); - } +// if (info.writePermissions !=3D 0) // Item not locked ? +// { +// QString folder =3D info.folder; +// QString file =3D info.name; +// folders.append(folder); +// files.append(file); +// deleteList.append(info); +// } +// else +// { +// lockedList.append(info); +// } } = void CameraUI::deleteItems(bool onlySelected, bool onlyDownloaded) { - QStringList folders; - QStringList files; - CamItemInfoList deleteList; - CamItemInfoList lockedList; - CamItemInfoList list =3D onlySelected ? d->view->selectedItems() : d->= view->allItems(); - - foreach(CamItemInfo info, list) - { - if (onlyDownloaded) - { - if (d->view->isDownloaded(info)) - { - checkItem4Deletion(info, folders, files, deleteList, locke= dList); - } - } - else - { - checkItem4Deletion(info, folders, files, deleteList, lockedLis= t); - } - } - - // If we want to delete some locked files, just give a feedback to use= r. - if (!lockedList.isEmpty()) - { - QString infoMsg(i18n("The items listed below are locked by camera = (read-only). " - "These items will not be deleted. If you real= ly want to delete these items, " - "please unlock them and try again.")); - CameraMessageBox::informationList(d->camThumbsCtrl, this, infoMsg,= lockedList, i18n("Information")); - } - - if (folders.isEmpty()) - { - return; - } - - QString warnMsg(i18np("About to delete this image. " - "Deleted file is unrecoverable. " - "Are you sure?", - "About to delete these %1 images. " - "Deleted files are unrecoverable. " - "Are you sure?", - deleteList.count())); - - if (CameraMessageBox::warningContinueCancelList(d->camThumbsCtrl, - this, - warnMsg, - deleteList, - i18n("Warning"), - KGuiItem(i18n("Delete"= )), - KStandardGuiItem::canc= el(), - QString("DontAskAgainT= oDeleteItemsFromCamera")) - =3D=3D KMessageBox::Continue) - { - QStringList::const_iterator itFolder =3D folders.constBegin(); - QStringList::const_iterator itFile =3D files.constBegin(); - - d->statusProgressBar->setProgressValue(0); - d->statusProgressBar->setProgressTotalSteps(deleteList.count()); - d->statusProgressBar->progressBarMode(StatusProgressBar::ProgressB= arMode); - - for (; itFolder !=3D folders.constEnd(); ++itFolder, ++itFile) - { - d->controller->deleteFile(*itFolder, *itFile); - // the currentlyDeleting list is used to prevent loading items= which - // will immanently be deleted into the sidebar and wasting time - d->currentlyDeleting.append(*itFolder + *itFile); - } - } +// QStringList folders; +// QStringList files; +// CamItemInfoList deleteList; +// CamItemInfoList lockedList; +// CamItemInfoList list =3D onlySelected ? d->view->selectedItems() : d= ->view->allItems(); + +// foreach(CamItemInfo info, list) +// { +// if (onlyDownloaded) +// { +// if (d->view->isDownloaded(info)) +// { +// checkItem4Deletion(info, folders, files, deleteList, loc= kedList); +// } +// } +// else +// { +// checkItem4Deletion(info, folders, files, deleteList, lockedL= ist); +// } +// } + +// // If we want to delete some locked files, just give a feedback to u= ser. +// if (!lockedList.isEmpty()) +// { +// QString infoMsg(i18n("The items listed below are locked by camer= a (read-only). " +// "These items will not be deleted. If you re= ally want to delete these items, " +// "please unlock them and try again.")); +// CameraMessageBox::informationList(d->camThumbsCtrl, this, infoMs= g, lockedList, i18n("Information")); +// } + +// if (folders.isEmpty()) +// { +// return; +// } + +// QString warnMsg(i18np("About to delete this image. " +// "Deleted file is unrecoverable. " +// "Are you sure?", +// "About to delete these %1 images. " +// "Deleted files are unrecoverable. " +// "Are you sure?", +// deleteList.count())); + +// if (CameraMessageBox::warningContinueCancelList(d->camThumbsCtrl, +// this, +// warnMsg, +// deleteList, +// i18n("Warning"), +// KGuiItem(i18n("Delet= e")), +// KStandardGuiItem::ca= ncel(), +// QString("DontAskAgai= nToDeleteItemsFromCamera")) +// =3D=3D KMessageBox::Continue) +// { +// QStringList::const_iterator itFolder =3D folders.constBegin(); +// QStringList::const_iterator itFile =3D files.constBegin(); + +// d->statusProgressBar->setProgressValue(0); +// d->statusProgressBar->setProgressTotalSteps(deleteList.count()); +// d->statusProgressBar->progressBarMode(StatusProgressBar::Progres= sBarMode); + +// for (; itFolder !=3D folders.constEnd(); ++itFolder, ++itFile) +// { +// d->controller->deleteFile(*itFolder, *itFile); +// // the currentlyDeleting list is used to prevent loading ite= ms which +// // will immanently be deleted into the sidebar and wasting t= ime +// d->currentlyDeleting.append(*itFolder + *itFile); +// } +// } } = void CameraUI::slotDeleteNew() { - d->view->slotSelectNew(); - QTimer::singleShot(0, this, SLOT(slotDeleteSelected())); +// d->view->slotSelectNew(); +// QTimer::singleShot(0, this, SLOT(slotDeleteSelected())); } = void CameraUI::slotDeleteSelected() { - deleteItems(true, false); +// deleteItems(true, false); } = void CameraUI::slotDeleteAll() { - deleteItems(false, false); +// deleteItems(false, false); } = void CameraUI::slotDeleted(const QString& folder, const QString& file, boo= l status) { - if (status) - { - d->view->removeItem(d->view->findItemInfo(folder, file)); - // do this after removeItem, which will signal to slotItemsSelecte= d, which checks for the list - d->currentlyDeleting.removeAll(folder + file); - } +// if (status) +// { +// d->view->removeItem(d->view->findItemInfo(folder, file)); +// // do this after removeItem, which will signal to slotItemsSelec= ted, which checks for the list +// d->currentlyDeleting.removeAll(folder + file); +// } = - int curr =3D d->statusProgressBar->progressValue(); - d->statusProgressBar->setProgressTotalSteps(curr + 1); - refreshFreeSpace(); +// int curr =3D d->statusProgressBar->progressValue(); +// d->statusProgressBar->setProgressTotalSteps(curr + 1); +// refreshFreeSpace(); } = void CameraUI::slotFileView() { - CamItemInfo info =3D d->view->firstItemSelected(); +// CamItemInfo info =3D d->view->firstItemSelected(); = - if (!info.isNull()) - { - slotFileView(info); - } +// if (!info.isNull()) +// { +// slotFileView(info); +// } } = void CameraUI::slotFileView(const CamItemInfo& info) { - d->controller->openFile(info.folder, info.name); +// d->controller->openFile(info.folder, info.name); } = void CameraUI::slotMetadata(const QString& folder, const QString& file, co= nst DMetadata& meta) { - CamItemInfo info =3D d->view->findItemInfo(folder, file); +// CamItemInfo info =3D d->view->findItemInfo(folder, file); = - if (!info.isNull()) - { - d->rightSideBar->itemChanged(info, meta); - } +// if (!info.isNull()) +// { +// d->rightSideBar->itemChanged(info, meta); +// } } = void CameraUI::slotNewSelection(bool hasSelection) { - if (!d->controller) - { - return; - } +// if (!d->controller) +// { +// return; +// } = - d->downloadSelectedAction->setEnabled(hasSelection); - d->downloadDelSelectedAction->setEnabled(hasSelection && d->controller= ->cameraDeleteSupport()); - d->deleteSelectedAction->setEnabled(hasSelection && d->controller->cam= eraDeleteSupport()); - d->imageViewAction->setEnabled(hasSelection); - d->lockAction->setEnabled(hasSelection); +// d->downloadSelectedAction->setEnabled(hasSelection); +// d->downloadDelSelectedAction->setEnabled(hasSelection && d->controll= er->cameraDeleteSupport()); +// d->deleteSelectedAction->setEnabled(hasSelection && d->controller->c= ameraDeleteSupport()); +// d->imageViewAction->setEnabled(hasSelection); +// d->lockAction->setEnabled(hasSelection); = - if (hasSelection) - { - // only enable "Mark as downloaded" if at least one - // selected image has not been downloaded - bool haveNotDownloadedItem =3D false; +// if (hasSelection) +// { +// // only enable "Mark as downloaded" if at least one +// // selected image has not been downloaded +// bool haveNotDownloadedItem =3D false; = - CamItemInfoList list =3D d->view->selectedItems(); +// CamItemInfoList list =3D d->view->selectedItems(); = - foreach(CamItemInfo info, list) - { - haveNotDownloadedItem =3D !d->view->isDownloaded(info); +// foreach(CamItemInfo info, list) +// { +// haveNotDownloadedItem =3D !d->view->isDownloaded(info); = - if (haveNotDownloadedItem) - { - break; - } - } +// if (haveNotDownloadedItem) +// { +// break; +// } +// } = - d->markAsDownloadedAction->setEnabled(haveNotDownloadedItem); - } - else - { - d->markAsDownloadedAction->setEnabled(false); - } +// d->markAsDownloadedAction->setEnabled(haveNotDownloadedItem); +// } +// else +// { +// d->markAsDownloadedAction->setEnabled(false); +// } = - unsigned long fSize =3D 0; - unsigned long dSize =3D 0; - d->view->itemsSelectionSizeInfo(fSize, dSize); - d->albumLibraryFreeSpace->setEstimatedDSizeKb(dSize); +// unsigned long fSize =3D 0; +// unsigned long dSize =3D 0; +// d->view->itemsSelectionSizeInfo(fSize, dSize); +// d->albumLibraryFreeSpace->setEstimatedDSizeKb(dSize); } = void CameraUI::slotItemsSelected(const CamItemInfo& info, bool selected) { - if (!d->controller) - { - return; - } - - if (selected) - { - // if selected item is in the list of item which will be deleted, = set no current item - if (!d->currentlyDeleting.contains(info.folder + info.name)) - { - d->rightSideBar->itemChanged(info, DMetadata()); - d->controller->getMetadata(info.folder, info.name); - } - else - { - d->rightSideBar->slotNoCurrentItem(); - } - } - else - { - d->rightSideBar->slotNoCurrentItem(); - } - - // update availability of actions - slotNewSelection(d->view->countSelected() > 0); +// if (!d->controller) +// { +// return; +// } + +// if (selected) +// { +// // if selected item is in the list of item which will be deleted= , set no current item +// if (!d->currentlyDeleting.contains(info.folder + info.name)) +// { +// d->rightSideBar->itemChanged(info, DMetadata()); +// d->controller->getMetadata(info.folder, info.name); +// } +// else +// { +// d->rightSideBar->slotNoCurrentItem(); +// } +// } +// else +// { +// d->rightSideBar->slotNoCurrentItem(); +// } + +// // update availability of actions +// slotNewSelection(d->view->countSelected() > 0); } = bool CameraUI::createAutoAlbum(const KUrl& parentURL, const QString& sub, const QDate& date, QString& errMsg) const { - KUrl u(parentURL); - u.addPath(sub); + return false; //FIXME: Remove this line. +// KUrl u(parentURL); +// u.addPath(sub); = - // first stat to see if the album exists - QFileInfo info(u.toLocalFile()); +// // first stat to see if the album exists +// QFileInfo info(u.toLocalFile()); = - if (info.exists()) - { - // now check if its really a directory - if (info.isDir()) - { - return true; - } - else - { - errMsg =3D i18n("A file with the same name (%1) already exists= in folder %2.", - sub, parentURL.toLocalFile()); - return false; - } - } +// if (info.exists()) +// { +// // now check if its really a directory +// if (info.isDir()) +// { +// return true; +// } +// else +// { +// errMsg =3D i18n("A file with the same name (%1) already exis= ts in folder %2.", +// sub, parentURL.toLocalFile()); +// return false; +// } +// } = - // looks like the directory does not exist, try to create it +// // looks like the directory does not exist, try to create it = - PAlbum* parent =3D AlbumManager::instance()->findPAlbum(parentURL); +// PAlbum* parent =3D AlbumManager::instance()->findPAlbum(parentURL); = - if (!parent) - { - errMsg =3D i18n("Failed to find Album for path '%1'.", parentURL.t= oLocalFile()); - return false; - } +// if (!parent) +// { +// errMsg =3D i18n("Failed to find Album for path '%1'.", parentURL= .toLocalFile()); +// return false; +// } = - return AlbumManager::instance()->createPAlbum(parent, sub, QString(), = date, QString(), errMsg); +// return AlbumManager::instance()->createPAlbum(parent, sub, QString()= , date, QString(), errMsg); } = void CameraUI::slotEditKeys() { - KShortcutsDialog dialog(KShortcutsEditor::AllActions, - KShortcutsEditor::LetterShortcutsAllowed, this= ); - dialog.addCollection(actionCollection(), i18n("General")); - dialog.configure(); +// KShortcutsDialog dialog(KShortcutsEditor::AllActions, +// KShortcutsEditor::LetterShortcutsAllowed, th= is); +// dialog.addCollection(actionCollection(), i18n("General")); +// dialog.configure(); } = void CameraUI::slotConfToolbars() { - saveMainWindowSettings(KGlobal::config()->group("Camera Settings")); - KEditToolBar dlg(factory(), this); +// saveMainWindowSettings(KGlobal::config()->group("Camera Settings")); +// KEditToolBar dlg(factory(), this); = - connect(&dlg, SIGNAL(newToolbarConfig()), - this, SLOT(slotNewToolbarConfig())); +// connect(&dlg, SIGNAL(newToolbarConfig()), +// this, SLOT(slotNewToolbarConfig())); = - dlg.exec(); +// dlg.exec(); } = void CameraUI::slotConfNotifications() { - KNotifyConfigWidget::configure(this); +// KNotifyConfigWidget::configure(this); } = void CameraUI::slotNewToolbarConfig() { - applyMainWindowSettings(KGlobal::config()->group("Camera Settings")); +// applyMainWindowSettings(KGlobal::config()->group("Camera Settings")); } = void CameraUI::slotSetup() { - Setup::exec(this); +// Setup::exec(this); } = void CameraUI::slotToggleFullScreen() { - if (d->fullScreen) // out of fullscreen - { - setWindowState(windowState() & ~Qt::WindowFullScreen); // reset - - slotShowMenuBar(); - statusBar()->show(); - showToolBars(); - - if (d->removeFullScreenButton) - { - QList toolbars =3D toolBars(); - foreach(KToolBar* toolbar, toolbars) - { - // name is set in ui.rc XML file - if (toolbar->objectName() =3D=3D "ToolBar") - { - toolbar->removeAction(d->fullScreenAction); - break; - } - } - } - - d->rightSideBar->restore(); - - d->fullScreen =3D false; - } - else // go to fullscreen - { - // hide the menubar and the statusbar - menuBar()->hide(); - statusBar()->hide(); - - if (d->fullScreenHideToolBar) - { - hideToolBars(); - } - else - { - showToolBars(); - - QList toolbars =3D toolBars(); - KToolBar* mainToolbar =3D 0; - foreach(KToolBar * toolbar, toolbars) - { - if (toolbar->objectName() =3D=3D "ToolBar") - { - mainToolbar =3D toolbar; - break; - } - } - - // add fullscreen action if necessary - if (mainToolbar && !mainToolbar->actions().contains(d->fullScr= eenAction)) - { - mainToolbar->addAction(d->fullScreenAction); - d->removeFullScreenButton =3D true; - } - else - { - // If FullScreen button is enabled in toolbar settings, - // we shall not remove it when leaving of fullscreen mode. - d->removeFullScreenButton =3D false; - } - } - - d->rightSideBar->backup(); - - setWindowState(windowState() | Qt::WindowFullScreen); // set - d->fullScreen =3D true; - } +// if (d->fullScreen) // out of fullscreen +// { +// setWindowState(windowState() & ~Qt::WindowFullScreen); // reset + +// slotShowMenuBar(); +// statusBar()->show(); +// showToolBars(); + +// if (d->removeFullScreenButton) +// { +// QList toolbars =3D toolBars(); +// foreach(KToolBar* toolbar, toolbars) +// { +// // name is set in ui.rc XML file +// if (toolbar->objectName() =3D=3D "ToolBar") +// { +// toolbar->removeAction(d->fullScreenAction); +// break; +// } +// } +// } + +// d->rightSideBar->restore(); + +// d->fullScreen =3D false; +// } +// else // go to fullscreen +// { +// // hide the menubar and the statusbar +// menuBar()->hide(); +// statusBar()->hide(); + +// if (d->fullScreenHideToolBar) +// { +// hideToolBars(); +// } +// else +// { +// showToolBars(); + +// QList toolbars =3D toolBars(); +// KToolBar* mainToolbar =3D 0; +// foreach(KToolBar * toolbar, toolbars) +// { +// if (toolbar->objectName() =3D=3D "ToolBar") +// { +// mainToolbar =3D toolbar; +// break; +// } +// } + +// // add fullscreen action if necessary +// if (mainToolbar && !mainToolbar->actions().contains(d->fullS= creenAction)) +// { +// mainToolbar->addAction(d->fullScreenAction); +// d->removeFullScreenButton =3D true; +// } +// else +// { +// // If FullScreen button is enabled in toolbar settings, +// // we shall not remove it when leaving of fullscreen mod= e. +// d->removeFullScreenButton =3D false; +// } +// } + +// d->rightSideBar->backup(); + +// setWindowState(windowState() | Qt::WindowFullScreen); // set +// d->fullScreen =3D true; +// } } = void CameraUI::slotEscapePressed() { - if (d->fullScreen) - { - d->fullScreenAction->activate(QAction::Trigger); - } +// if (d->fullScreen) +// { +// d->fullScreenAction->activate(QAction::Trigger); +// } } = void CameraUI::showToolBars() { - QList toolbars =3D toolBars(); - foreach(KToolBar* toolbar, toolbars) - { - toolbar->show(); - } +// QList toolbars =3D toolBars(); +// foreach(KToolBar* toolbar, toolbars) +// { +// toolbar->show(); +// } } = void CameraUI::hideToolBars() { - QList toolbars =3D toolBars(); - foreach(KToolBar* toolbar, toolbars) - { - toolbar->hide(); - } +// QList toolbars =3D toolBars(); +// foreach(KToolBar* toolbar, toolbars) +// { +// toolbar->hide(); +// } } = void CameraUI::slotCameraFreeSpaceInfo(unsigned long kBSize, unsigned long= kBAvail) { - d->cameraFreeSpace->addInformation(kBSize, kBSize - kBAvail, kBAvail, = QString()); +// d->cameraFreeSpace->addInformation(kBSize, kBSize - kBAvail, kBAvail= , QString()); } = bool CameraUI::cameraDeleteSupport() const { - return d->controller->cameraDeleteSupport(); + return false; //FIXME: Remove this line. +// return d->controller->cameraDeleteSupport(); } = bool CameraUI::cameraUploadSupport() const { - return d->controller->cameraUploadSupport(); + return false; //FIXME: Remove this line. +// return d->controller->cameraUploadSupport(); } = bool CameraUI::cameraMkDirSupport() const { - return d->controller->cameraMkDirSupport(); + return false; //FIXME: Remove this line. +// return d->controller->cameraMkDirSupport(); } = bool CameraUI::cameraDelDirSupport() const { - return d->controller->cameraDelDirSupport(); + return false; //FIXME: Remove this line. +// return d->controller->cameraDelDirSupport(); +} + +void CameraUI::enableZoomPlusAction(bool val) +{ + d->increaseThumbsAction->setEnabled(val); +} + +void CameraUI::enableZoomMinusAction(bool val) +{ + d->decreaseThumbsAction->setEnabled(val); } = void CameraUI::slotComponentsInfo() { - showDigikamComponentsInfo(); +// showDigikamComponentsInfo(); } = void CameraUI::slotDBStat() { - showDigikamDatabaseStat(); +// showDigikamDatabaseStat(); } = void CameraUI::refreshCollectionFreeSpace() { - d->albumLibraryFreeSpace->setPaths(CollectionManager::instance()->allA= vailableAlbumRootPaths()); +// d->albumLibraryFreeSpace->setPaths(CollectionManager::instance()->al= lAvailableAlbumRootPaths()); } = void CameraUI::slotCollectionLocationStatusChanged(const CollectionLocatio= n&, int) { - refreshCollectionFreeSpace(); +// refreshCollectionFreeSpace(); } = void CameraUI::slotShowMenuBar() { - menuBar()->setVisible(d->showMenuBarAction->isChecked()); +// menuBar()->setVisible(d->showMenuBarAction->isChecked()); } = void CameraUI::slotSidebarTabTitleStyleChanged() { - d->rightSideBar->setStyle(AlbumSettings::instance()->getSidebarTitleSt= yle()); - d->rightSideBar->applySettings(); +// d->rightSideBar->setStyle(AlbumSettings::instance()->getSidebarTitle= Style()); +// d->rightSideBar->applySettings(); } = void CameraUI::slotLogMsg(const QString& msg, DHistoryView::EntryType type, const QString& folder, const QString& file) { - d->statusProgressBar->setProgressText(msg); - QStringList meta; - meta << folder << file; - d->historyView->addedEntry(msg, type, QVariant(meta)); +// d->statusProgressBar->setProgressText(msg); +// QStringList meta; +// meta << folder << file; +// d->historyView->addedEntry(msg, type, QVariant(meta)); } = void CameraUI::slotShowLog() { - d->showLogAction->isChecked() ? d->historyView->show() : d->historyVie= w->hide(); +// d->showLogAction->isChecked() ? d->historyView->show() : d->historyV= iew->hide(); } = void CameraUI::slotHistoryEntryClicked(const QVariant& metadata) { - QStringList meta =3D metadata.toStringList(); - QString folder =3D meta.at(0); - QString file =3D meta.at(1); - d->view->ensureItemVisible(folder, file); +// QStringList meta =3D metadata.toStringList(); +// QString folder =3D meta.at(0); +// QString file =3D meta.at(1); +// d->view->ensureItemVisible(folder, file); } = bool CameraUI::chronologicOrder() const { - return !d->lastPhotoFirstAction->isChecked(); + return false; //FIXME: Remove this line. +// return !d->lastPhotoFirstAction->isChecked(); } = } // namespace Digikam diff --git a/utilities/cameragui/main/cameraui.h b/utilities/cameragui/main= /cameraui.h index 70b995c..e8c066d 100644 --- a/utilities/cameragui/main/cameraui.h +++ b/utilities/cameragui/main/cameraui.h @@ -9,6 +9,7 @@ * Copyright (C) 2004-2005 by Renchi Raju * Copyright (C) 2006-2012 by Gilles Caulier * Copyright (C) 2006-2011 by Marcel Wiesweg + * Copyright (C) 2012 by Islam Wazery * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -47,6 +48,8 @@ #include "dmetadata.h" #include "camerahistoryupdater.h" #include "downloadsettings.h" +#include "importiconview.h" +#include "importview.h" = namespace Digikam { @@ -54,6 +57,8 @@ namespace Digikam class Album; class CollectionLocation; class CameraHistoryUpdater; +class ImportIconView; +//class ImportDelegate; = class CameraUI : public KXmlGuiWindow { @@ -75,12 +80,17 @@ public: bool cameraMkDirSupport() const; bool cameraDelDirSupport() const; = + void enableZoomPlusAction(bool val); + void enableZoomMinusAction(bool val); + bool chronologicOrder() const; = QString cameraTitle() const; = DownloadSettings downloadSettings() const; = + CameraController* getCameraController(); + Q_SIGNALS: = void signalLastDestination(const KUrl&); @@ -169,16 +179,15 @@ private Q_SLOTS: void slotFileView(const CamItemInfo&); = void slotUploaded(const CamItemInfo&); - void slotDownloaded(const QString&, const QString&, int, bool autoRota= te); + void slotDownloaded(const QString&, const QString&, int); void slotDownloadComplete(const QString& sourceFolder, const QString& = sourceFile, const QString& destFolder, const QString& de= stFile); - void slotFinished(); void slotSkipped(const QString&, const QString&); void slotDeleted(const QString&, const QString&, bool); void slotLocked(const QString&, const QString&, bool); = void slotNewSelection(bool); - void slotItemsSelected(const CamItemInfo&, bool selected); + void slotItemsSelected(const CamItemInfo&, bool); = void slotMetadata(const QString& folder, const QString& file, const DM= etadata& meta); = diff --git a/utilities/cameragui/main/cameraui.rc b/utilities/cameragui/mai= n/cameraui.rc index 2dc2b47..efb096c 100644 --- a/utilities/cameragui/main/cameraui.rc +++ b/utilities/cameragui/main/cameraui.rc @@ -1,5 +1,5 @@ - + = = @@ -44,6 +44,10 @@ = &View + + + + @@ -82,12 +86,16 @@ - + + + + + diff --git a/utilities/cameragui/main/cameraui_p.h b/utilities/cameragui/ma= in/cameraui_p.h index cb22bbe..8159e2b 100644 --- a/utilities/cameragui/main/cameraui_p.h +++ b/utilities/cameragui/main/cameraui_p.h @@ -37,6 +37,7 @@ #include #include #include +#include #include = // LibKDcraw includes @@ -61,6 +62,7 @@ #include "sidebar.h" #include "statusnavigatebar.h" #include "statusprogressbar.h" +#include "importview.h" = using namespace KDcrawIface; = @@ -164,9 +166,11 @@ public: KAction* cameraCaptureAction; KAction* cameraInfoAction; KAction* decreaseThumbsAction; + KActionMenu* deleteAction; KAction* deleteNewAction; KAction* deleteAllAction; KAction* deleteSelectedAction; + KActionMenu* downloadAction; KAction* downloadNewAction; KAction* downloadAllAction; KAction* downloadSelectedAction; @@ -186,9 +190,15 @@ public: KAction* selectNoneAction; KAction* uploadAction; KAction* markAsDownloadedAction; + KAction* resumeAction; + KAction* pauseAction; KToggleAction* lastPhotoFirstAction; KToggleAction* showMenuBarAction; KToggleAction* showLogAction; + KSelectAction* imageViewSelectionAction; + KToggleAction* iconViewAction; + KToggleAction* camItemPreviewAction; + KToggleAction* mapViewAction; = KUrl lastDestURL; = @@ -202,7 +212,7 @@ public: CameraController* controller; CameraHistoryUpdater* historyUpdater; = - CameraIconView* view; + ImportView* view; = RenameCustomizer* renameCustomizer; AlbumCustomizer* albumCustomizer;