File indexing completed on 2025-03-09 03:58:46

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2004-11-22
0007  * Description : digiKam light table - Extra tools
0008  *
0009  * SPDX-FileCopyrightText: 2007-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #include "lighttablewindow_p.h"
0016 
0017 namespace Digikam
0018 {
0019 
0020 void LightTableWindow::slotEditItem()
0021 {
0022     if (!d->thumbView->currentInfo().isNull())
0023     {
0024         slotEditItem(d->thumbView->currentInfo());
0025     }
0026 }
0027 
0028 void LightTableWindow::slotEditItem(const ItemInfo& info)
0029 {
0030     ImageWindow* const im = ImageWindow::imageWindow();
0031     ItemInfoList list     = d->thumbView->allItemInfos();
0032 
0033     im->loadItemInfos(list, info, i18n("Light Table"));
0034 
0035     if (im->isHidden())
0036     {
0037         im->show();
0038     }
0039     else
0040     {
0041         im->raise();
0042     }
0043 
0044     im->setFocus();
0045 }
0046 
0047 //FIXME
0048 void LightTableWindow::slotLeftSlideShowManualFromCurrent()
0049 {
0050     QList<DPluginAction*> actions = DPluginLoader::instance()->
0051                                         pluginActions(QLatin1String("org.kde.digikam.plugin.generic.SlideShow"), this);
0052 
0053     if (actions.isEmpty())
0054     {
0055         return;
0056     }
0057 
0058     // set current image to SlideShow Plugin
0059 
0060     actions[0]->setData(d->previewView->leftItemInfo().fileUrl());
0061 
0062     actions[0]->trigger();
0063 
0064     d->fromLeftPreview = true;
0065 }
0066 
0067 void LightTableWindow::slotRightSlideShowManualFromCurrent()
0068 {
0069     QList<DPluginAction*> actions = DPluginLoader::instance()->
0070                                        pluginActions(QLatin1String("org.kde.digikam.plugin.generic.SlideShow"), this);
0071 
0072     if (actions.isEmpty())
0073     {
0074         return;
0075     }
0076 
0077     // set current image to SlideShow Plugin
0078 
0079     actions[0]->setData(d->previewView->rightItemInfo().fileUrl());
0080     actions[0]->trigger();
0081 
0082     d->fromLeftPreview = false;
0083 }
0084 
0085 void LightTableWindow::slotSlideShowLastItemUrl()
0086 {
0087     QList<DPluginAction*> actions = DPluginLoader::instance()->
0088                                        pluginActions(QLatin1String("org.kde.digikam.plugin.generic.SlideShow"), this);
0089 
0090     if (actions.isEmpty())
0091     {
0092         return;
0093     }
0094 
0095     // get last image to SlideShow Plugin
0096 
0097     QUrl url = actions[0]->data().toUrl();
0098 
0099     if (d->fromLeftPreview && !d->navigateByPairAction->isChecked())
0100     {
0101         d->thumbView->blockSignals(true);
0102         d->thumbView->setCurrentUrl(url);
0103         d->thumbView->blockSignals(false);
0104         slotSetItemLeft();
0105     }
0106     else
0107     {
0108         d->thumbView->setCurrentUrl(url);
0109     }
0110 }
0111 
0112 } // namespace Digikam