File indexing completed on 2024-12-01 13:40:29
0001 /* 0002 SPDX-FileCopyrightText: 2009 Andrey Batyiev <batyiev@gmail.com> 0003 SPDX-FileCopyrightText: 2015 Jan Grulich <jgrulich@redhat.com> 0004 0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #ifndef PLASMA_NM_EDIT_LIST_DIALOG_H 0009 #define PLASMA_NM_EDIT_LIST_DIALOG_H 0010 0011 #include <KEditListWidget> 0012 #include <QDialog> 0013 0014 class QValidator; 0015 0016 class EditListDialog : public QDialog 0017 { 0018 Q_OBJECT 0019 public: 0020 explicit EditListDialog(QWidget *parent = nullptr); 0021 ~EditListDialog() override; 0022 0023 void setItems(const QStringList &items); 0024 QStringList items() const; 0025 0026 void setValidator(const QValidator *validator); 0027 const QValidator *validator() const; 0028 0029 void setToolTip(const QString &toolTip); 0030 0031 Q_SIGNALS: 0032 void itemsEdited(const QStringList &items); 0033 0034 protected Q_SLOTS: 0035 void dialogAccepted(); 0036 0037 private: 0038 KEditListWidget *const editListWidget; 0039 0040 void removeEmptyItems(QStringList &list); 0041 }; 0042 0043 #endif // PLASMA_NM_EDIT_LIST_DIALOG_H