diff --git a/core/showfoto/main/showfoto_export.cpp b/core/showfoto/main/showfoto_export.cpp index 2e5782af94..97f0782cc2 100644 --- a/core/showfoto/main/showfoto_export.cpp +++ b/core/showfoto/main/showfoto_export.cpp @@ -1,199 +1,96 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-11-22 * Description : stand alone 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 "showfoto.h" #include "showfoto_p.h" namespace ShowFoto { void ShowFoto::slotHtmlGallery() { #ifdef HAVE_HTMLGALLERY QPointer w = new HTMLWizard(this, new DMetaInfoIface(this, d->thumbBar->urls())); w->exec(); delete w; #endif } void ShowFoto::slotCalendar() { QPointer w = new CalWizard(d->thumbBar->urls(), this); w->exec(); delete w; } void ShowFoto::slotPanorama() { #ifdef HAVE_PANORAMA PanoManager::instance()->checkBinaries(); PanoManager::instance()->setItemsList(d->thumbBar->urls()); PanoManager::instance()->run(); #endif } void ShowFoto::slotExpoBlending() { ExpoBlendingManager::instance()->checkBinaries(); ExpoBlendingManager::instance()->setItemsList(d->thumbBar->urls()); ExpoBlendingManager::instance()->run(); } void ShowFoto::slotVideoSlideshow() { #ifdef HAVE_MEDIAPLAYER QPointer w = new VidSlideWizard(this, new DMetaInfoIface(this, d->thumbBar->urls())); w->exec(); delete w; #endif } void ShowFoto::slotSendByMail() { QPointer w = new MailWizard(this, new DMetaInfoIface(this, d->thumbBar->urls())); w->exec(); delete w; } void ShowFoto::slotMediaServer() { QPointer w = new DMediaServerDlg(this, new DMetaInfoIface(this, d->thumbBar->urls())); w->exec(); delete w; } void ShowFoto::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 DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; + WSStarter::exportToWebService(tool, new DMetaInfoIface(this, d->thumbBar->urls()), this); } - if (tool == m_exportOnedriveAction) - { - QPointer w = new ODWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - if (tool == m_exportPinterestAction) - { - QPointer w = new PWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - if (tool == m_exportBoxAction) - { - QPointer w = new BOXWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportFacebookAction) - { - QPointer w = new FbWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportFlickrAction) - { - WSStarter::exportToWebService(WSStarter::Flickr, new DMetaInfoIface(this, d->thumbBar->urls()), this); - } - else if (tool == m_exportGdriveAction) - { - QPointer w = new GSWindow(new DMetaInfoIface(this, d->thumbBar->urls()), - this, QLatin1String("googledriveexport")); - w->exec(); - delete w; - } - else if (tool == m_exportGphotoAction) - { - QPointer w = new GSWindow(new DMetaInfoIface(this, d->thumbBar->urls()), - this, QLatin1String("googlephotoexport")); - w->exec(); - delete w; - } - else if (tool == m_exportImageshackAction) - { - QPointer w = new ImageShackWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportImgurAction) - { - QPointer w = new ImgurWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportPiwigoAction) - { - QPointer w = new PiwigoWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportRajceAction) - { - QPointer w = new RajceWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportSmugmugAction) - { - QPointer w = new SmugWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportYandexfotkiAction) - { - QPointer w = new YFWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - else if (tool == m_exportMediawikiAction) - { - QPointer w = new MediaWikiWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } - -#ifdef HAVE_VKONTAKTE - else if (tool == m_exportVkontakteAction) - { - QPointer w = new VKWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } -#endif - -#ifdef HAVE_KIO - else if (tool == m_exportFileTransferAction) - { - QPointer w = new FTExportWindow(new DMetaInfoIface(this, d->thumbBar->urls()), this); - w->exec(); - delete w; - } -#endif } } // namespace ShowFoto diff --git a/core/showfoto/main/showfoto_p.h b/core/showfoto/main/showfoto_p.h index b8816ce098..bc47c7888c 100644 --- a/core/showfoto/main/showfoto_p.h +++ b/core/showfoto/main/showfoto_p.h @@ -1,207 +1,191 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-11-22 * Description : stand alone digiKam image editor GUI * * Copyright (C) 2004-2018 by Gilles Caulier * Copyright (C) 2006-2012 by Marcel Wiesweg * Copyright (C) 2013 by Mohamed_Anwer * * 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 SHOW_FOTO_PRIVATE_H #define SHOW_FOTO_PRIVATE_H // Qt includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // KDE includes #include #include // Local includes #include "showfoto.h" #include "showfotoiteminfo.h" #include "showfotothumbnailbar.h" #include "dsplashscreen.h" #include "imagepropertiessidebar.h" #include "showfotodragdrophandler.h" #include "thumbnailloadthread.h" #include "drawdecoder.h" #include "digikam_globals.h" #include "digikam_debug.h" #include "canvas.h" #include "editorcore.h" #include "dmetadata.h" #include "editorstackview.h" #include "dfileoperations.h" #include "iccsettingscontainer.h" #include "imagedialog.h" #include "iofilesettings.h" #include "loadingcache.h" #include "loadingcacheinterface.h" #include "metadatasettings.h" #include "metadataedit.h" #include "presentationmngr.h" #include "savingcontext.h" #include "showfotosetup.h" #include "showfotosetupmisc.h" #include "setupicc.h" #include "slideshow.h" #include "statusprogressbar.h" #include "thememanager.h" #include "thumbnailsize.h" #include "dnotificationwrapper.h" #include "showfotodelegate.h" #include "showfotothumbnailmodel.h" #include "showfotocategorizedview.h" #include "showfotosettings.h" #include "dmetainfoiface.h" #include "dexpanderbox.h" #include "dfiledialog.h" #include "calwizard.h" #include "expoblendingmanager.h" #include "mailwizard.h" #include "advprintwizard.h" #include "dmediaservermngr.h" #include "dmediaserverdlg.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 ShowFoto { class Q_DECL_HIDDEN ShowFoto::Private { public: explicit Private() : validIccPath(true), droppedUrls(false), itemsNb(0), vSplitter(0), fileOpenAction(0), openFilesInFolderAction(0), mediaServerAction(0), first(0), model(0), dDHandler(0), filterModel(0), thumbLoadThread(0), thumbBar(0), thumbBarDock(0), normalDelegate(0), rightSideBar(0), splash(0), settings(0) { } bool validIccPath; bool droppedUrls; int itemsNb; QSplitter* vSplitter; QAction* fileOpenAction; QUrl currentLoadedUrl; QUrl lastOpenedDirectory; QAction* openFilesInFolderAction; QAction* mediaServerAction; QAction* first; ShowfotoItemInfoList infoList; ShowfotoThumbnailModel* model; ShowfotoDragDropHandler* dDHandler; ShowfotoFilterModel* filterModel; Digikam::ThumbnailLoadThread* thumbLoadThread; ShowfotoThumbnailBar* thumbBar; Digikam::ThumbBarDock* thumbBarDock; ShowfotoNormalDelegate* normalDelegate; Digikam::ImagePropertiesSideBar* rightSideBar; Digikam::DSplashScreen* splash; ShowfotoSettings* settings; }; } // namespace Showfoto #endif // SHOW_FOTO_PRIVATE_H