File indexing completed on 2024-04-28 05:02:04

0001 /*
0002  *  Dialog to choose a user for a 'homes' share
0003  *
0004  *  SPDX-FileCopyrightText: 2023 Alexander Reinholdt <alexander.reinholdt@kdemail.net>
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef SMB4KHOMESUSERDIALOG_H
0009 #define SMB4KHOMESUSERDIALOG_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 <KComboBox>
0021 
0022 class Q_DECL_EXPORT Smb4KHomesUserDialog : public QDialog
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     /**
0028      * Constructor
0029      */
0030     explicit Smb4KHomesUserDialog(QWidget *parent = nullptr);
0031 
0032     /**
0033      * Destructor
0034      */
0035     virtual ~Smb4KHomesUserDialog();
0036 
0037     /**
0038      * Set the 'homes' share. If the share is not a 'homes' share,
0039      * this function returns FALSE.
0040      *
0041      * @param homesShare         The 'homes' share
0042      */
0043     bool setShare(SharePtr homesShare);
0044 
0045 protected Q_SLOTS:
0046     void slotHomesUserNameEntered();
0047     void slotHomesUserNameChanged(const QString &text);
0048     void slotOkClicked();
0049 
0050 private:
0051     QLabel *m_descriptionText;
0052     SharePtr m_share;
0053     KComboBox *m_userNameInput;
0054     QPushButton *m_okButton;
0055     QPushButton *m_cancelButton;
0056 };
0057 
0058 #endif