diff --git a/core/app/main/digikamapp_export.cpp b/core/app/main/digikamapp_export.cpp index c3121be56d..0d4b723652 100644 --- a/core/app/main/digikamapp_export.cpp +++ b/core/app/main/digikamapp_export.cpp @@ -1,100 +1,101 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2002-16-10 * Description : main digiKam interface implementation - Export tools * * Copyright (C) 2002-2018 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "digikamapp.h" #include "digikamapp_p.h" namespace Digikam { void DigikamApp::slotExpoBlending() { ExpoBlendingManager::instance()->checkBinaries(); ExpoBlendingManager::instance()->setItemsList(view()->selectedUrls(ApplicationSettings::Tools)); ExpoBlendingManager::instance()->run(); } void DigikamApp::slotPanorama() { #ifdef HAVE_PANORAMA PanoManager::instance()->checkBinaries(); PanoManager::instance()->setItemsList(view()->selectedUrls(ApplicationSettings::Tools)); PanoManager::instance()->run(); #endif } void DigikamApp::slotVideoSlideshow() { #ifdef HAVE_MEDIAPLAYER QPointer w = new VidSlideWizard(this, new DBInfoIface(this, QList(), ApplicationSettings::Tools)); w->exec(); delete w; #endif } void DigikamApp::slotSendByMail() { QPointer w = new MailWizard(this, new DBInfoIface(this, QList(), ApplicationSettings::Tools)); w->exec(); delete w; } void DigikamApp::slotHtmlGallery() { #ifdef HAVE_HTMLGALLERY QPointer w = new HTMLWizard(this, new DBInfoIface(this, QList(), ApplicationSettings::Tools)); w->exec(); delete w; #endif } void DigikamApp::slotCalendar() { QPointer w = new CalWizard(view()->selectedUrls(ApplicationSettings::Tools), this); w->exec(); delete w; } void DigikamApp::slotMediaServer() { DBInfoIface* const iface = new DBInfoIface(this, QList(), ApplicationSettings::Tools); // NOTE: We overwrite the default albums chooser object name for load save check items state between sessions. // The goal is not mix these settings with other export tools. iface->setObjectName(QLatin1String("SetupMediaServerIface")); QPointer w = new DMediaServerDlg(this, iface); w->exec(); delete w; } void DigikamApp::slotExportTool() { QAction* const action = dynamic_cast(sender()); int tool = actionToWebService(action); if (tool != WSStarter::Unknown) { - WSStarter::exportToWebService(tool, new DBInfoIface(this, QList(), ApplicationSettings::ImportExport), this); + WSStarter::exportToWebService(tool, new DBInfoIface(this, QList(), + ApplicationSettings::ImportExport), this); } } } // namespace Digikam diff --git a/core/utilities/imageeditor/main/imagewindow_export.cpp b/core/utilities/imageeditor/main/imagewindow_export.cpp index 813b094d30..b7231e8810 100644 --- a/core/utilities/imageeditor/main/imagewindow_export.cpp +++ b/core/utilities/imageeditor/main/imagewindow_export.cpp @@ -1,222 +1,103 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-11-22 * Description : digiKam image editor - Export tools * * Copyright (C) 2004-2018 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "imagewindow.h" #include "imagewindow_p.h" namespace Digikam { void ImageWindow::slotHtmlGallery() { #ifdef HAVE_HTMLGALLERY QPointer w = new HTMLWizard(this, new DBInfoIface(this, d->thumbBar->allUrls())); w->exec(); delete w; #endif } void ImageWindow::slotCalendar() { QPointer w = new CalWizard(d->thumbBar->allUrls(), this); w->exec(); delete w; } void ImageWindow::slotPanorama() { #ifdef HAVE_PANORAMA PanoManager::instance()->checkBinaries(); PanoManager::instance()->setItemsList(d->thumbBar->allUrls()); PanoManager::instance()->run(); #endif } void ImageWindow::slotVideoSlideshow() { #ifdef HAVE_MEDIAPLAYER QPointer w = new VidSlideWizard(this, new DBInfoIface(this, d->thumbBar->allUrls())); w->exec(); delete w; #endif } void ImageWindow::slotExpoBlending() { ExpoBlendingManager::instance()->checkBinaries(); ExpoBlendingManager::instance()->setItemsList(d->thumbBar->allUrls()); ExpoBlendingManager::instance()->run(); } void ImageWindow::slotSendByMail() { QPointer w = new MailWizard(this, new DBInfoIface(this, d->thumbBar->allUrls())); w->exec(); delete w; } void ImageWindow::slotMediaServer() { DBInfoIface* const iface = new DBInfoIface(this, QList(), ApplicationSettings::Tools); // NOTE: We overwrite the default albums chooser object name for load save check items state between sessions. // The goal is not mix these settings with other export tools. iface->setObjectName(QLatin1String("SetupMediaServerIface")); QPointer w = new DMediaServerDlg(this, iface); w->exec(); delete w; } void ImageWindow::slotExportTool() { - QAction* const tool = dynamic_cast(sender()); + QAction* const action = dynamic_cast(sender()); + int tool = actionToWebService(action); - if (tool == m_exportDropboxAction) + if (tool != WSStarter::Unknown) { - QPointer w = new DBWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; + WSStarter::exportToWebService(tool, new DBInfoIface(this, QList(), + ApplicationSettings::ImportExport), this); } - if (tool == m_exportOnedriveAction) - { - QPointer w = new ODWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - if (tool == m_exportPinterestAction) - { - QPointer w = new PWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - if (tool == m_exportBoxAction) - { - QPointer w = new BOXWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportFacebookAction) - { - QPointer w = new FbWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportFlickrAction) - { - WSStarter::exportToWebService(WSStarter::Flickr, new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - } - else if (tool == m_exportGdriveAction) - { - QPointer w = new GSWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), - this, QLatin1String("googledriveexport")); - w->exec(); - delete w; - } - else if (tool == m_exportGphotoAction) - { - QPointer w = new GSWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), - this, QLatin1String("googlephotoexport")); - w->exec(); - delete w; - } - else if (tool == m_exportImageshackAction) - { - QPointer w = new ImageShackWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportImgurAction) - { - QPointer w = new ImgurWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportPiwigoAction) - { - QPointer w = new PiwigoWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportRajceAction) - { - QPointer w = new RajceWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportSmugmugAction) - { - QPointer w = new SmugWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportYandexfotkiAction) - { - QPointer w = new YFWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - else if (tool == m_exportMediawikiAction) - { - QPointer w = new MediaWikiWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } - -#ifdef HAVE_VKONTAKTE - else if (tool == m_exportVkontakteAction) - { - QPointer w = new VKWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } -#endif - -#ifdef HAVE_KIO - else if (tool == m_exportFileTransferAction) - { - QPointer w = new FTExportWindow(new DBInfoIface(this, d->thumbBar->allUrls(), - ApplicationSettings::ImportExport), this); - w->exec(); - delete w; - } -#endif } } // namespace Digikam diff --git a/core/utilities/imageeditor/main/imagewindow_p.h b/core/utilities/imageeditor/main/imagewindow_p.h index a458cb5213..e90d200f50 100644 --- a/core/utilities/imageeditor/main/imagewindow_p.h +++ b/core/utilities/imageeditor/main/imagewindow_p.h @@ -1,320 +1,304 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-02-12 * Description : digiKam image editor GUI * * Copyright (C) 2004-2005 by Renchi Raju * Copyright (C) 2004-2018 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_IMAGE_WINDOW_PRIVATE_H #define DIGIKAM_IMAGE_WINDOW_PRIVATE_H // C++ includes #include #include #include // Qt includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // KDE includes #include #include #include // Local includes #include "versionmanager.h" #include "dlayoutbox.h" #include "album.h" #include "coredb.h" #include "albummanager.h" #include "albummodel.h" #include "albumfiltermodel.h" #include "applicationsettings.h" #include "canvas.h" #include "collectionlocation.h" #include "collectionmanager.h" #include "collectionscanner.h" #include "componentsinfo.h" #include "coredbaccess.h" #include "coredbwatch.h" #include "coredbchangesets.h" #include "ddragobjects.h" #include "deletedialog.h" #include "dimg.h" #include "editorcore.h" #include "dimagehistory.h" #include "digikamapp.h" #include "dio.h" #include "dmetadata.h" #include "editorstackview.h" #include "fileactionmngr.h" #include "dfileoperations.h" #include "digikam_globals.h" #include "digikam_debug.h" #include "iccsettingscontainer.h" #include "imageattributeswatch.h" #include "imagefiltermodel.h" #include "imagedragdrop.h" #include "imagedescedittab.h" #include "imageinfo.h" #include "imagegps.h" #include "imagelistmodel.h" #include "imagepropertiessidebardb.h" #include "imagepropertiesversionstab.h" #include "imagescanner.h" #include "imagethumbnailbar.h" #include "iofilesettings.h" #include "dnotificationwrapper.h" #include "loadingcacheinterface.h" #include "metadatahub.h" #include "metadatasettings.h" #include "metadataedit.h" #include "colorlabelwidget.h" #include "picklabelwidget.h" #include "presentationmngr.h" #include "ratingwidget.h" #include "savingcontext.h" #include "scancontroller.h" #include "setup.h" #include "slideshow.h" #include "statusprogressbar.h" #include "syncjob.h" #include "tagsactionmngr.h" #include "tagscache.h" #include "tagspopupmenu.h" #include "tagregion.h" #include "thememanager.h" #include "thumbbardock.h" #include "thumbnailloadthread.h" #include "undostate.h" #include "dexpanderbox.h" #include "dbinfoiface.h" #include "calwizard.h" #include "expoblendingmanager.h" #include "mailwizard.h" #include "advprintwizard.h" #include "dmediaserverdlg.h" #include "facetagseditor.h" -#include "dbwindow.h" -#include "odwindow.h" -#include "pwindow.h" -#include "boxwindow.h" -#include "fbwindow.h" #include "wsstarter.h" #include "gswindow.h" -#include "imageshackwindow.h" -#include "imgurwindow.h" -#include "piwigowindow.h" -#include "rajcewindow.h" #include "smugwindow.h" -#include "yfwindow.h" -#include "mediawikiwindow.h" - -#ifdef HAVE_VKONTAKTE -# include "vkwindow.h" -#endif #ifdef HAVE_KIO -# include "ftexportwindow.h" # include "ftimportwindow.h" #endif #ifdef HAVE_MARBLE # include "geolocationedit.h" #endif #ifdef HAVE_HTMLGALLERY # include "htmlwizard.h" #endif #ifdef HAVE_PANORAMA # include "panomanager.h" #endif #ifdef HAVE_MEDIAPLAYER # include "vidslidewizard.h" #endif namespace Digikam { class Q_DECL_HIDDEN DatabaseVersionManager : public VersionManager { public: virtual QString toplevelDirectory(const QString& path) { CollectionLocation loc = CollectionManager::instance()->locationForPath(path); if (!loc.isNull()) { return loc.albumRootPath(); } return QLatin1String("/"); } }; // ----------------------------------------------------------------------------------------- class Q_DECL_HIDDEN ImageWindow::Private { public: Private() : configShowThumbbarEntry(QLatin1String("Show Thumbbar")), configHorizontalThumbbarEntry(QLatin1String("HorizontalThumbbar")), viewContainer(0), toMainWindowAction(0), fileDeletePermanentlyAction(0), fileDeletePermanentlyDirectlyAction(0), fileTrashDirectlyAction(0), imageInfoModel(0), imageFilterModel(0), dragDropHandler(0), thumbBar(0), thumbBarDock(0), rightSideBar(0) { } QModelIndex currentIndex() const { return imageFilterModel->indexForImageInfo(currentImageInfo); } QModelIndex currentSourceIndex() const { return imageInfoModel->indexForImageInfo(currentImageInfo); } bool currentIsValid() const { return !currentImageInfo.isNull(); } QUrl currentUrl() const { return currentImageInfo.fileUrl(); } QModelIndex nextIndex() const { return imageFilterModel->index(currentIndex().row() + 1, 0); } QModelIndex previousIndex() const { return imageFilterModel->index(currentIndex().row() - 1, 0); } QModelIndex firstIndex() const { return imageFilterModel->index(0, 0); } QModelIndex lastIndex() const { return imageFilterModel->index(imageFilterModel->rowCount() - 1, 0); } ImageInfo imageInfo(const QModelIndex& index) const { return imageFilterModel->imageInfo(index); } void setThumbBarToCurrent() { QModelIndex index = imageFilterModel->indexForImageInfo(currentImageInfo); if (index.isValid()) { thumbBar->setCurrentIndex(index); } else { thumbBar->setCurrentWhenAvailable(currentImageInfo.id()); } } void ensureModelContains(const ImageInfo& info) { if (!imageInfoModel->hasImage(info)) { imageInfoModel->addImageInfoSynchronously(info); imageFilterModel->sort(imageFilterModel->sortColumn()); } } public: const QString configShowThumbbarEntry; const QString configHorizontalThumbbarEntry; KMainWindow* viewContainer; QAction* toMainWindowAction; // Delete actions QAction* fileDeletePermanentlyAction; QAction* fileDeletePermanentlyDirectlyAction; QAction* fileTrashDirectlyAction; ImageInfo currentImageInfo; ImageListModel* imageInfoModel; ImageFilterModel* imageFilterModel; ImageDragDropHandler* dragDropHandler; ImageThumbnailBar* thumbBar; ThumbBarDock* thumbBarDock; ImagePropertiesSideBarDB* rightSideBar; DatabaseVersionManager versionManager; QMultiMap newFaceTags; }; } // namespace Digikam #endif // DIGIKAM_IMAGE_WINDOW_PRIVATE_H