File indexing completed on 2024-04-21 12:30:50

0001 /*
0002  *  Synchronization dialog
0003  *
0004  *  SPDX-FileCopyrightText: 2023 Alexander Reinholdt <alexander.reinholdt@kdemail.net>
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef SMB4KSYNCHRONIZATIONDIALOG_H
0009 #define SMB4KSYNCHRONIZATIONDIALOG_H
0010 
0011 // application specific includes
0012 #include "core/smb4kglobal.h"
0013 
0014 // Qt includes
0015 #include <QDialog>
0016 #include <QLabel>
0017 #include <QPushButton>
0018 
0019 // KDE includes
0020 #include <KUrlRequester>
0021 
0022 class Q_DECL_EXPORT Smb4KSynchronizationDialog : public QDialog
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     /**
0028      * Constructor
0029      */
0030     Smb4KSynchronizationDialog(QWidget *parent = nullptr);
0031 
0032     /**
0033      * Destructor
0034      */
0035     ~Smb4KSynchronizationDialog();
0036 
0037     /**
0038      * Set the share. Ideally, this function should be used before
0039      * the dialog is shown.
0040      *
0041      * @param share       The share for which the preview should be
0042      *                    acquired
0043      *
0044      * @returns TRUE if a share was set and false otherwise
0045      */
0046     bool setShare(const SharePtr &share);
0047 
0048 protected Q_SLOTS:
0049     void slotSourcePathChanged(const QString &path);
0050     void slotDestinationPathChanged(const QString &path);
0051     void slotSwapPaths();
0052     void slotSynchronize();
0053 
0054 private:
0055     QPushButton *m_synchronizeButton;
0056     QPushButton *m_swapButton;
0057     QPushButton *m_cancelButton;
0058     QLabel *m_descriptionText;
0059     KUrlRequester *m_sourceInput;
0060     KUrlRequester *m_destinationInput;
0061 };
0062 
0063 #endif