File indexing completed on 2024-10-06 04:35:39

0001 /*
0002  *  Mount 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 SMB4KMOUNTDIALOG_H
0009 #define SMB4KMOUNTDIALOG_H
0010 
0011 // Qt includes
0012 #include <QCheckBox>
0013 #include <QDialog>
0014 #include <QPushButton>
0015 #include <QResizeEvent>
0016 #include <QSize>
0017 
0018 // KDE includes
0019 #include <KComboBox>
0020 #include <KLineEdit>
0021 
0022 class Q_DECL_EXPORT Smb4KMountDialog : public QDialog
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     /**
0028      * Constructor
0029      */
0030     explicit Smb4KMountDialog(QWidget *parent = nullptr);
0031 
0032     /**
0033      * Destructor
0034      */
0035     virtual ~Smb4KMountDialog();
0036 
0037 protected Q_SLOTS:
0038     void slotEnableButtons(const QString &text);
0039     void slotBookmarkButtonClicked();
0040     void slotEnableBookmarkInputWidget();
0041     void slotLocationEntered();
0042     void slotIpAddressEntered();
0043     void slotWorkgroupEntered();
0044     void slotLabelEntered();
0045     void slotCategoryEntered();
0046     void slotAccepted();
0047     void slotRejected();
0048 
0049 private:
0050     bool isValidLocation(const QString &text);
0051     void adjustDialogSize();
0052     KLineEdit *m_locationInput;
0053     KLineEdit *m_ipAddressInput;
0054     KLineEdit *m_workgroupInput;
0055     QPushButton *m_okButton;
0056     QPushButton *m_cancelButton;
0057     QPushButton *m_bookmarkButton;
0058     QWidget *m_bookmarkWidget;
0059     QCheckBox *m_bookmarkShare;
0060     QWidget *m_bookmarkInputWidget;
0061     KLineEdit *m_bookmarkLabelInput;
0062     KComboBox *m_bookmarkCategoryInput;
0063 };
0064 
0065 #endif