File indexing completed on 2025-01-19 03:52:56

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2019-03-27
0007  * Description : a tool to export items to a local storage
0008  *
0009  * SPDX-FileCopyrightText: 2006-2009 by Johannes Wienke <languitar at semipol dot de>
0010  * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  * SPDX-FileCopyrightText: 2019-2020 by Maik Qualmann <metzpinguin at gmail dot com>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #ifndef DIGIKAM_FC_EXPORT_WINDOW_H
0018 #define DIGIKAM_FC_EXPORT_WINDOW_H
0019 
0020 // Qt includes
0021 
0022 #include <QUrl>
0023 
0024 // Local includes
0025 
0026 #include "wstooldialog.h"
0027 #include "dinfointerface.h"
0028 
0029 using namespace Digikam;
0030 
0031 namespace DigikamGenericFileCopyPlugin
0032 {
0033 
0034 class FCExportWidget;
0035 
0036 /**
0037  * Main window of the FileCopyExport tool.
0038  */
0039 
0040 class FCExportWindow: public WSToolDialog
0041 {
0042     Q_OBJECT
0043 
0044 public:
0045 
0046     /**
0047      * Constructor.
0048      *
0049      * @param parent the parent QWidget
0050      */
0051     explicit FCExportWindow(DInfoInterface* const iface, QWidget* const parent);
0052 
0053     /**
0054      * Destructor.
0055      */
0056     ~FCExportWindow() override;
0057 
0058     /**
0059      * Use this method to (re-)activate the dialog after it has been created
0060      * to display it. This also loads the currently selected images.
0061      */
0062     void reactivate();
0063 
0064 private Q_SLOTS:
0065 
0066     /**
0067      * Processes changes on the image list.
0068      */
0069     void slotImageListChanged();
0070 
0071     /**
0072      * Starts copy the selected images.
0073      */
0074     void slotCopy();
0075 
0076     /**
0077      * Processes changes in the target url.
0078      */
0079     void slotTargetUrlChanged(const QUrl& target);
0080 
0081     /**
0082      * Removes the copied image from the image list.
0083      */
0084     void slotCopyingDone(const QUrl& from, const QUrl& to);
0085 
0086     /**
0087      * Re-enables the dialog after the job finished and displays a warning if
0088      * something didn't work.
0089      */
0090     void slotCopyingFinished();
0091 
0092     void slotFinished();
0093 
0094 protected:
0095 
0096     /**
0097      * Handle Close event from dialog title bar.
0098      */
0099     void closeEvent(QCloseEvent* e) override;
0100 
0101     /**
0102      * Refresh status (enabled / disabled) of the upload button according to
0103      * contents of the image list and the specified target.
0104      */
0105     void updateUploadButton();
0106 
0107     /**
0108      * Restores settings.
0109      */
0110     void restoreSettings();
0111 
0112     /**
0113      * Saves settings.
0114      */
0115     void saveSettings();
0116 
0117 private:
0118 
0119     class Private;
0120     Private* const d;
0121 };
0122 
0123 } // namespace DigikamGenericFileCopyPlugin
0124 
0125 #endif // DIGIKAM_FC_EXPORT_WINDOW_H