File indexing completed on 2024-07-21 07:58:07

0001 /*
0002     SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef PLASMA_NM_HWADDRCOMBOBOX_H
0008 #define PLASMA_NM_HWADDRCOMBOBOX_H
0009 
0010 #include "plasmanm_editor_export.h"
0011 
0012 #include <QComboBox>
0013 
0014 #include <NetworkManagerQt/Device>
0015 
0016 class PLASMANM_EDITOR_EXPORT HwAddrComboBox : public QComboBox
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit HwAddrComboBox(QWidget *parent = nullptr);
0021 
0022     void init(NetworkManager::Device::Type deviceType, const QString &address);
0023 
0024     bool isValid() const;
0025     QString hwAddress() const;
0026 
0027 Q_SIGNALS:
0028     void hwAddressChanged();
0029 
0030 private:
0031     void slotEditTextChanged(const QString &);
0032     void slotCurrentIndexChanged(int);
0033     void addAddressToCombo(const NetworkManager::Device::Ptr &device);
0034     QVariant hwAddressFromDevice(const NetworkManager::Device::Ptr &device);
0035     QString m_initialAddress;
0036     bool m_dirty = false;
0037 };
0038 
0039 #endif // PLASMA_NM_HWADDRCOMBOBOX_H