diff --git a/core/app/main/digikamapp_tools.cpp b/core/app/main/digikamapp_tools.cpp index d6447f5b40..d3cb846707 100644 --- a/core/app/main/digikamapp_tools.cpp +++ b/core/app/main/digikamapp_tools.cpp @@ -1,227 +1,227 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2002-16-10 * Description : main digiKam interface implementation - Extra 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::setupSelectToolsAction() { // Create action model ActionItemModel* const actionModel = new ActionItemModel(this); actionModel->setMode(ActionItemModel::ToplevelMenuCategory | ActionItemModel::SortCategoriesByInsertionOrder); // Builtin actions QString mainCategory = i18nc("@title Main Tools", "Main Tools"); actionModel->addAction(d->ieAction, mainCategory); actionModel->addAction(d->openTagMngrAction, mainCategory); actionModel->addAction(d->bqmAction, mainCategory); actionModel->addAction(d->maintenanceAction, mainCategory); actionModel->addAction(d->ltAction, mainCategory); actionModel->addAction(d->advSearchAction, mainCategory); QString postCategory = i18nc("@title Post Processing Tools", "Post-Processing"); actionModel->addAction(m_expoBlendingAction, postCategory); actionModel->addAction(m_calendarAction, postCategory); actionModel->addAction(m_metadataEditAction, postCategory); actionModel->addAction(m_presentationAction, postCategory); actionModel->addAction(m_sendByMailAction, postCategory); actionModel->addAction(m_printCreatorAction, postCategory); actionModel->addAction(m_mediaServerAction, postCategory); #ifdef HAVE_PANORAMA actionModel->addAction(m_panoramaAction, postCategory); #endif #ifdef HAVE_MEDIAPLAYER actionModel->addAction(m_videoslideshowAction, postCategory); #endif #ifdef HAVE_HTMLGALLERY actionModel->addAction(m_htmlGalleryAction, postCategory); #endif #ifdef HAVE_MARBLE actionModel->addAction(m_geolocationEditAction, postCategory); #endif QString exportCategory = i18nc("@title Export Tools", "Export"); - foreach(QAction* const ac, exportActions()) + foreach (QAction* const ac, exportActions()) { actionModel->addAction(ac, exportCategory); } QString importCategory = i18nc("@title Import Tools", "Import"); - foreach(QAction* const ac, importActions()) + foreach (QAction* const ac, importActions()) { actionModel->addAction(ac, importCategory); } #ifdef HAVE_KSANE actionModel->addAction(m_ksaneAction, importCategory); #endif // setup categorized view DCategorizedSortFilterProxyModel* const filterModel = actionModel->createFilterModel(); ActionCategorizedView* const selectToolsActionView = new ActionCategorizedView; selectToolsActionView->setupIconMode(); selectToolsActionView->setModel(filterModel); selectToolsActionView->adjustGridSize(); connect(selectToolsActionView, SIGNAL(clicked(QModelIndex)), actionModel, SLOT(trigger(QModelIndex))); d->view->setToolsIconView(selectToolsActionView); } void DigikamApp::slotMaintenance() { MaintenanceDlg* const dlg = new MaintenanceDlg(this); if (dlg->exec() == QDialog::Accepted) { d->maintenanceAction->setEnabled(false); MaintenanceMngr* const mngr = new MaintenanceMngr(this); connect(mngr, SIGNAL(signalComplete()), this, SLOT(slotMaintenanceDone())); mngr->setSettings(dlg->settings()); } } void DigikamApp::slotMaintenanceDone() { d->maintenanceAction->setEnabled(true); d->view->refreshView(); if (LightTableWindow::lightTableWindowCreated()) { LightTableWindow::lightTableWindow()->refreshView(); } if (QueueMgrWindow::queueManagerWindowCreated()) { QueueMgrWindow::queueManagerWindow()->refreshView(); } } void DigikamApp::slotDatabaseMigration() { DatabaseMigrationDialog dlg(this); dlg.exec(); } void DigikamApp::slotTimeAdjust() { QList urls = view()->selectedUrls(ApplicationSettings::Metadata); if (urls.isEmpty()) return; QPointer dialog = new TimeAdjustDialog(this, new DBInfoIface(this, urls, ApplicationSettings::Metadata)); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. CollectionScanner scanner; - foreach(const QUrl& url, urls) + foreach (const QUrl& url, urls) { scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); ImageAttributesWatch::instance()->fileMetadataChanged(url); } } void DigikamApp::slotEditMetadata() { QList urls = view()->selectedUrls(ApplicationSettings::Metadata); if (urls.isEmpty()) return; - QPointer dialog = new MetadataEditDialog(QApplication::activeWindow(), urls); + QPointer dialog = new MetadataEditDialog(this, urls); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. CollectionScanner scanner; - foreach(const QUrl& url, urls) + foreach (const QUrl& url, urls) { scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); ImageAttributesWatch::instance()->fileMetadataChanged(url); } } void DigikamApp::slotEditGeolocation() { #ifdef HAVE_MARBLE ImageInfoList infos = d->view->selectedInfoList(ApplicationSettings::Metadata); if (infos.isEmpty()) return; TagModel* const tagModel = new TagModel(AbstractAlbumModel::IgnoreRootAlbum, this); TagPropertiesFilterModel* const filterModel = new TagPropertiesFilterModel(this); filterModel->setSourceAlbumModel(tagModel); filterModel->sort(0); QPointer dialog = new GeolocationEdit(filterModel, new DBInfoIface(this, QList(), ApplicationSettings::Tools), - QApplication::activeWindow()); + this); dialog->setItems(ImageGPS::infosToItems(infos)); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. foreach(const ImageInfo& inf, infos) { ScanController::instance()->scannedInfo(inf.fileUrl().toLocalFile()); } #endif } void DigikamApp::slotPresentation() { d->view->presentation(); } void DigikamApp::slotPrintCreator() { QPointer w = new AdvPrintWizard(this, new DBInfoIface(this, QList(), ApplicationSettings::Tools)); w->exec(); delete w; } } // namespace Digikam diff --git a/core/showfoto/main/showfoto.h b/core/showfoto/main/showfoto.h index 2661481132..7f04df2558 100644 --- a/core/showfoto/main/showfoto.h +++ b/core/showfoto/main/showfoto.h @@ -1,193 +1,194 @@ /* ============================================================ * * 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) 2009-2011 by Andi Clemens * Copyright (C) 2004-2005 by Renchi Raju * Copyright (C) 2005-2006 by Tom Albers * * 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_H #define SHOW_FOTO_H // Qt includes #include // Local includes #include "editorwindow.h" #include "showfotoiteminfo.h" namespace ShowFoto { class ShowFoto : public Digikam::EditorWindow { Q_OBJECT public: explicit ShowFoto(const QList& urlList); ~ShowFoto(); virtual void show(); private: bool queryClose(); bool save(); bool saveAs(); void moveFile(); void finishSaving(bool success); QUrl saveDestinationUrl(); bool saveNewVersion(); bool saveCurrentVersion(); bool saveNewVersionAs(); bool saveNewVersionInFormat(const QString&); void saveIsComplete(); void saveAsIsComplete(); void saveVersionIsComplete(); void openFolder(const QUrl& url); void openUrls(const QList& urls); Digikam::ThumbBarDock* thumbBar() const; Digikam::Sidebar* rightSideBar() const; private Q_SLOTS: void slotForward(); void slotBackward(); void slotLast(); void slotFirst(); void slotFileWithDefaultApplication(); void slotOpenWith(QAction* action=0); void slotShowfotoItemInfoActivated(const ShowfotoItemInfo& info); void slotOpenFile(); void slotOpenUrl(const ShowfotoItemInfo& info); void slotOpenFolder(const QUrl&); void slotOpenFilesInFolder(); void slotDroppedUrls(const QList& droppedUrls); void slotDeleteCurrentItem(); void slotChanged(); void slotUpdateItemInfo(); void slotPrepareToLoad(); void slotLoadingStarted(const QString& filename); void slotLoadingFinished(const QString& filename, bool success); void slotSavingStarted(const QString& filename); void slotRevert(); void slotAddedDropedItems(QDropEvent*); Q_SIGNALS: void signalLoadCurrentItem(const QList& urlList); void signalOpenFolder(const QUrl&); void signalOpenFile(const QList& urls); void signalInfoList(ShowfotoItemInfoList&); // -- Internal setup methods implemented in showfoto_config.cpp ---------------------------------------- public Q_SLOTS: void slotSetup(); void slotSetupICC(); private: bool setup(bool iccSetupPage=false); void applySettings(); void readSettings(); void saveSettings(); private Q_SLOTS: void slotSetupMetadataFilters(int); // -- Internal setup methods implemented in showfoto_setup.cpp ---------------------------------------- private: void setupActions(); void setupConnections(); void setupUserArea(); void toggleActions(bool val); void toggleNavigation(int index); void addServicesMenu(); private Q_SLOTS: void slotContextMenu(); // -- Extra tool methods implemented in showfoto_tools.cpp ---------------------------------------- private Q_SLOTS: + void slotTimeAdjust(); void slotEditMetadata(); void slotEditGeolocation(); void slotFilePrint(); void slotPrintCreator(); void slotPresentation(); private: void slideShow(Digikam::SlideShowSettings& settings); // -- Export tools methods implemented in showfoto_export.cpp ------------------------------------- private Q_SLOTS: void slotHtmlGallery(); void slotCalendar(); void slotExpoBlending(); void slotPanorama(); void slotVideoSlideshow(); void slotSendByMail(); void slotMediaServer(); void slotExportTool(); // -- Import tools methods implemented in showfoto_import.cpp ------------------------------------- private Q_SLOTS: void slotImportFromScanner(); void slotImportedImagefromScanner(const QUrl& url); void slotImportTool(); // -- Internal private container -------------------------------------------------------------------- private: class Private; Private* const d; }; } // namespace ShowFoto #endif // SHOW_FOTO_H diff --git a/core/showfoto/main/showfoto_p.h b/core/showfoto/main/showfoto_p.h index 649a7047a3..f6d4f4c016 100644 --- a/core/showfoto/main/showfoto_p.h +++ b/core/showfoto/main/showfoto_p.h @@ -1,185 +1,186 @@ /* ============================================================ * * 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 "timeadjustdialog.h" #include "wsstarter.h" #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 diff --git a/core/showfoto/main/showfoto_tools.cpp b/core/showfoto/main/showfoto_tools.cpp index 0a227f8a72..7b7d501fb9 100644 --- a/core/showfoto/main/showfoto_tools.cpp +++ b/core/showfoto/main/showfoto_tools.cpp @@ -1,154 +1,164 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-11-22 * Description : stand alone digiKam image editor - extra 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::slideShow(Digikam::SlideShowSettings& settings) { if (!d->thumbBar->showfotoItemInfos().size()) { return; } settings.exifRotate = Digikam::MetadataSettings::instance()->settings().exifRotate; settings.fileList = d->thumbBar->urls(); int i = 0; float cnt = settings.fileList.count(); m_cancelSlideShow = false; Digikam::DMetadata meta; m_nameLabel->setProgressBarMode(Digikam::StatusProgressBar::CancelProgressBarMode, i18n("Preparing slideshow. Please wait...")); for (QList::ConstIterator it = settings.fileList.constBegin() ; !m_cancelSlideShow && (it != settings.fileList.constEnd()) ; ++it) { Digikam::SlidePictureInfo pictInfo; meta.load((*it).toLocalFile()); pictInfo.comment = meta.getImageComments()[QLatin1String("x-default")].caption; pictInfo.photoInfo = meta.getPhotographInformation(); settings.pictInfoMap.insert(*it, pictInfo); m_nameLabel->setProgressValue((int)((i++/cnt)*100.0f)); qApp->processEvents(); } m_nameLabel->setProgressBarMode(Digikam::StatusProgressBar::TextMode, QString()); if (!m_cancelSlideShow) { QPointer slide = new Digikam::SlideShow(settings); if (settings.startWithCurrent) { slide->setCurrentItem(d->thumbBar->currentUrl()); } slide->show(); } } void ShowFoto::slotPresentation() { QPointer mngr = new Digikam::PresentationMngr(this); Digikam::DMetadata meta; QList urlList = d->thumbBar->urls(); int i = 0; float cnt = urlList.count(); m_cancelSlideShow = false; m_nameLabel->setProgressBarMode(Digikam::StatusProgressBar::CancelProgressBarMode, i18n("Preparing presentation. Please wait...")); for (QList::ConstIterator it = urlList.constBegin() ; !m_cancelSlideShow && (it != urlList.constEnd()) ; ++it) { meta.load((*it).toLocalFile()); mngr->addFile(*it, meta.getImageComments()[QLatin1String("x-default")].caption); m_nameLabel->setProgressValue((int)((i++/cnt)*100.0f)); qApp->processEvents(); } m_nameLabel->setProgressBarMode(Digikam::StatusProgressBar::TextMode, QString()); mngr->showConfigDialog(); } void ShowFoto::slotFilePrint() { printImage(d->thumbBar->currentUrl()); } void ShowFoto::slotEditGeolocation() { #ifdef HAVE_MARBLE QList infos = d->thumbBar->urls(); if (infos.isEmpty()) { return; } - QPointer dialog = new GeolocationEdit(0, - new DMetaInfoIface(this, d->thumbBar->urls()), - QApplication::activeWindow()); + QPointer dialog = new GeolocationEdit(0, new DMetaInfoIface(this, d->thumbBar->urls()), this); dialog->setImages(infos); dialog->exec(); delete dialog; // Update image information everywhere. slotChanged(); #endif } +void ShowFoto::slotTimeAdjust() +{ + QList urls = d->thumbBar->urls(); + + if (urls.isEmpty()) + return; + + QPointer dialog = new TimeAdjustDialog(this, new DMetaInfoIface(this, urls)); + dialog->exec(); + + delete dialog; +} + void ShowFoto::slotEditMetadata() { if (d->thumbBar->currentInfo().isNull()) { return; } - QPointer dialog = new MetadataEditDialog(QApplication::activeWindow(), - QList() << d->thumbBar->currentInfo().url); + QPointer dialog = new MetadataEditDialog(this, QList() << d->thumbBar->currentInfo().url); dialog->exec(); delete dialog; // Update image information everywhere. slotChanged(); } void ShowFoto::slotPrintCreator() { QPointer w = new AdvPrintWizard(this, new DMetaInfoIface(this, d->thumbBar->urls())); w->exec(); delete w; } } // namespace ShowFoto diff --git a/core/showfoto/main/showfotoui5.rc b/core/showfoto/main/showfotoui5.rc index 88f8af8a3b..50b35305b7 100644 --- a/core/showfoto/main/showfotoui5.rc +++ b/core/showfoto/main/showfotoui5.rc @@ -1,229 +1,230 @@ - + &File &Edit &View &Color &Depth Enh&ance &Lens Tra&nsform &Decorate Effec&ts &Tools + I&mport &Export &Settings &Help Main Toolbar diff --git a/core/utilities/imageeditor/main/imagewindow_tools.cpp b/core/utilities/imageeditor/main/imagewindow_tools.cpp index 959c935de8..84818816c5 100644 --- a/core/utilities/imageeditor/main/imagewindow_tools.cpp +++ b/core/utilities/imageeditor/main/imagewindow_tools.cpp @@ -1,212 +1,211 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-11-22 * Description : digiKam image editor - extra 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::slotTimeAdjust() { QList urls = d->thumbBar->allUrls(); if (urls.isEmpty()) return; - QPointer dialog = new TimeAdjustDialog(this, new DBInfoIface(this, urls, ApplicationSettings::Metadata)); + QPointer dialog = new TimeAdjustDialog(this, new DBInfoIface(this, urls)); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. CollectionScanner scanner; - foreach(const QUrl& url, urls) + foreach (const QUrl& url, urls) { scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); } } void ImageWindow::slotEditMetadata() { if (d->currentImageInfo.isNull()) return; QUrl url = d->currentImageInfo.fileUrl(); - QPointer dialog = new MetadataEditDialog(QApplication::activeWindow(), - QList() << url); + QPointer dialog = new MetadataEditDialog(this, QList() << url); dialog->exec(); delete dialog; // Refresh Database with new metadata from file. CollectionScanner scanner; scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); } void ImageWindow::slotEditGeolocation() { #ifdef HAVE_MARBLE ImageInfoList infos = d->thumbBar->allImageInfos(); if (infos.isEmpty()) { return; } TagModel* const tagModel = new TagModel(AbstractAlbumModel::IgnoreRootAlbum, this); TagPropertiesFilterModel* const filterModel = new TagPropertiesFilterModel(this); filterModel->setSourceAlbumModel(tagModel); filterModel->sort(0); QPointer dialog = new GeolocationEdit(filterModel, new DBInfoIface(this, d->thumbBar->allUrls()), - QApplication::activeWindow()); + this); dialog->setItems(ImageGPS::infosToItems(infos)); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. - foreach(const ImageInfo& inf, infos) + foreach (const ImageInfo& inf, infos) { ScanController::instance()->scannedInfo(inf.fileUrl().toLocalFile()); } #endif } void ImageWindow::slotFilePrint() { printImage(d->currentUrl()); } void ImageWindow::slotPrintCreator() { QPointer w = new AdvPrintWizard(this, new DBInfoIface(this, d->thumbBar->allUrls())); w->exec(); delete w; } void ImageWindow::slotPresentation() { QPointer mngr = new PresentationMngr(this); - foreach(const ImageInfo& info, d->imageInfoModel->imageInfos()) + foreach (const ImageInfo& info, d->imageInfoModel->imageInfos()) { mngr->addFile(info.fileUrl(), info.comment()); qApp->processEvents(); } mngr->showConfigDialog(); } void ImageWindow::slideShow(SlideShowSettings& settings) { m_cancelSlideShow = false; settings.exifRotate = MetadataSettings::instance()->settings().exifRotate; if (!d->imageInfoModel->isEmpty()) { // We have started image editor from Album GUI. we get picture comments from database. m_nameLabel->setProgressBarMode(StatusProgressBar::CancelProgressBarMode, i18n("Preparing slideshow. Please wait...")); float cnt = (float)d->imageInfoModel->rowCount(); int i = 0; - foreach(const ImageInfo& info, d->imageInfoModel->imageInfos()) + foreach (const ImageInfo& info, d->imageInfoModel->imageInfos()) { SlidePictureInfo pictInfo; pictInfo.comment = info.comment(); pictInfo.rating = info.rating(); pictInfo.colorLabel = info.colorLabel(); pictInfo.pickLabel = info.pickLabel(); pictInfo.photoInfo = info.photoInfoContainer(); settings.pictInfoMap.insert(info.fileUrl(), pictInfo); settings.fileList << info.fileUrl(); m_nameLabel->setProgressValue((int)((i++ / cnt) * 100.0)); qApp->processEvents(); } } /* else { // We have started image editor from Camera GUI. we get picture comments from metadata. m_nameLabel->setProgressBarMode(StatusProgressBar::CancelProgressBarMode, i18n("Preparing slideshow. Please wait...")); cnt = (float)d->urlList.count(); DMetadata meta; settings.fileList = d->urlList; for (QList::Iterator it = d->urlList.begin() ; !m_cancelSlideShow && (it != d->urlList.end()) ; ++it) { SlidePictureInfo pictInfo; meta.load((*it).toLocalFile()); pictInfo.comment = meta.getImageComments()[QString("x-default")].caption; pictInfo.photoInfo = meta.getPhotographInformation(); settings.pictInfoMap.insert(*it, pictInfo); m_nameLabel->setProgressValue((int)((i++/cnt)*100.0)); qApp->processEvents(); } } */ m_nameLabel->setProgressBarMode(StatusProgressBar::TextMode, QString()); if (!m_cancelSlideShow) { QPointer slide = new SlideShow(settings); TagsActionMngr::defaultManager()->registerActionsToWidget(slide); if (settings.startWithCurrent) { slide->setCurrentItem(d->currentUrl()); } connect(slide, SIGNAL(signalRatingChanged(QUrl,int)), this, SLOT(slotRatingChanged(QUrl,int))); connect(slide, SIGNAL(signalColorLabelChanged(QUrl,int)), this, SLOT(slotColorLabelChanged(QUrl,int))); connect(slide, SIGNAL(signalPickLabelChanged(QUrl,int)), this, SLOT(slotPickLabelChanged(QUrl,int))); connect(slide, SIGNAL(signalToggleTag(QUrl,int)), this, SLOT(slotToggleTag(QUrl,int))); slide->show(); } } } // namespace Digikam diff --git a/core/utilities/lighttable/lighttablewindow_tools.cpp b/core/utilities/lighttable/lighttablewindow_tools.cpp index b184d34311..e25a307650 100644 --- a/core/utilities/lighttable/lighttablewindow_tools.cpp +++ b/core/utilities/lighttable/lighttablewindow_tools.cpp @@ -1,239 +1,237 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-11-22 * Description : digiKam light table - Extra tools * * Copyright (C) 2007-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 "lighttablewindow.h" #include "lighttablewindow_p.h" namespace Digikam { void LightTableWindow::slotEditItem() { if (!d->thumbView->currentInfo().isNull()) { slotEditItem(d->thumbView->currentInfo()); } } void LightTableWindow::slotEditItem(const ImageInfo& info) { ImageWindow* const im = ImageWindow::imageWindow(); ImageInfoList list = d->thumbView->allImageInfos(); im->loadImageInfos(list, info, i18n("Light Table")); if (im->isHidden()) { im->show(); } else { im->raise(); } im->setFocus(); } void LightTableWindow::slotTimeAdjust() { QList urls = d->thumbView->allUrls(); if (urls.isEmpty()) return; - QPointer dialog = new TimeAdjustDialog(this, new DBInfoIface(this, urls, ApplicationSettings::Metadata)); + QPointer dialog = new TimeAdjustDialog(this, new DBInfoIface(this, urls)); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. CollectionScanner scanner; - foreach(const QUrl& url, urls) + foreach (const QUrl& url, urls) { scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); } } void LightTableWindow::slotEditMetadata() { if (d->thumbView->currentInfo().isNull()) { return; } QUrl url = d->thumbView->currentInfo().fileUrl(); - QPointer dialog = new MetadataEditDialog(QApplication::activeWindow(), - QList() << url); + QPointer dialog = new MetadataEditDialog(this, QList() << url); dialog->exec(); delete dialog; // Refresh Database with new metadata from file. CollectionScanner scanner; scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); } void LightTableWindow::slotEditGeolocation() { #ifdef HAVE_MARBLE ImageInfoList infos = d->thumbView->allImageInfos(); if (infos.isEmpty()) { return; } TagModel* const tagModel = new TagModel(AbstractAlbumModel::IgnoreRootAlbum, this); TagPropertiesFilterModel* const filterModel = new TagPropertiesFilterModel(this); filterModel->setSourceAlbumModel(tagModel); filterModel->sort(0); QPointer dialog = new GeolocationEdit(filterModel, - new DBInfoIface(this, d->thumbView->allUrls()), - QApplication::activeWindow()); + new DBInfoIface(this, d->thumbView->allUrls()), this); dialog->setItems(ImageGPS::infosToItems(infos)); dialog->exec(); delete dialog; // Refresh Database with new metadata from files. - foreach(const ImageInfo& inf, infos) + foreach (const ImageInfo& inf, infos) { ScanController::instance()->scannedInfo(inf.fileUrl().toLocalFile()); } #endif } void LightTableWindow::slotPrintCreator() { QPointer w = new AdvPrintWizard(this, new DBInfoIface(this, d->thumbView->allUrls())); w->exec(); delete w; } void LightTableWindow::slotPresentation() { QPointer mngr = new PresentationMngr(this); - foreach(const ImageInfo& info, d->thumbView->allImageInfos()) + foreach (const ImageInfo& info, d->thumbView->allImageInfos()) { mngr->addFile(info.fileUrl(), info.comment()); qApp->processEvents(); } mngr->showConfigDialog(); } void LightTableWindow::slotSlideShowAll() { SlideShowBuilder* const builder = new SlideShowBuilder(d->thumbView->allImageInfos()); d->statusProgressBar->setProgressBarMode(StatusProgressBar::TextMode, i18n("Preparing slideshow. Please wait...")); connect(builder, SIGNAL(signalComplete(SlideShowSettings)), this, SLOT(slotSlideShowBuilderComplete(SlideShowSettings))); builder->run(); } void LightTableWindow::slotLeftSlideShowManualFromCurrent() { slotSlideShowManualFrom(d->previewView->leftImageInfo()); d->fromLeftPreview = true; } void LightTableWindow::slotRightSlideShowManualFromCurrent() { slotSlideShowManualFrom(d->previewView->rightImageInfo()); d->fromLeftPreview = false; } void LightTableWindow::slotSlideShowManualFrom(const ImageInfo& info) { SlideShowBuilder* const builder = new SlideShowBuilder(d->thumbView->allImageInfos()); builder->setOverrideStartFrom(info); builder->setAutoPlayEnabled(false); d->statusProgressBar->setProgressBarMode(StatusProgressBar::TextMode, i18n("Preparing slideshow. Please wait...")); connect(builder, SIGNAL(signalComplete(SlideShowSettings)), this, SLOT(slotSlideShowBuilderComplete(SlideShowSettings))); builder->run(); } void LightTableWindow::slotSlideShowBuilderComplete(const SlideShowSettings& settings) { QPointer slide = new SlideShow(settings); TagsActionMngr::defaultManager()->registerActionsToWidget(slide); d->statusProgressBar->setProgressBarMode(StatusProgressBar::TextMode, QString()); slotRefreshStatusBar(); if (settings.imageUrl.isValid()) { slide->setCurrentItem(settings.imageUrl); } else if (settings.startWithCurrent) { slide->setCurrentItem(d->thumbView->currentInfo().fileUrl()); } connect(slide, SIGNAL(signalRatingChanged(QUrl,int)), d->thumbView, SLOT(slotRatingChanged(QUrl,int))); connect(slide, SIGNAL(signalColorLabelChanged(QUrl,int)), d->thumbView, SLOT(slotColorLabelChanged(QUrl,int))); connect(slide, SIGNAL(signalPickLabelChanged(QUrl,int)), d->thumbView, SLOT(slotPickLabelChanged(QUrl,int))); connect(slide, SIGNAL(signalToggleTag(QUrl,int)), d->thumbView, SLOT(slotToggleTag(QUrl,int))); connect(slide, SIGNAL(signalLastItemUrl(QUrl)), this, SLOT(slotSlideShowLastItemUrl(QUrl))); slide->show(); } void LightTableWindow::slotSlideShowLastItemUrl(const QUrl& url) { if (d->fromLeftPreview && !d->navigateByPairAction->isChecked()) { d->thumbView->blockSignals(true); d->thumbView->setCurrentUrl(url); d->thumbView->blockSignals(false); slotSetItemLeft(); } else { d->thumbView->setCurrentUrl(url); } } } // namespace Digikam