2013-06-19 15:15:25 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
2013-06-19 15:15:25 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2013-06-19 15:15:25 +01:00
|
|
|
*/
|
|
|
|
|
2023-07-26 10:51:45 +01:00
|
|
|
#pragma once
|
2013-06-19 15:15:25 +01:00
|
|
|
|
2015-03-02 04:16:07 +00:00
|
|
|
#include <KCModule>
|
2013-06-25 17:08:34 +01:00
|
|
|
#include <QStandardItemModel>
|
2023-04-17 18:10:08 +01:00
|
|
|
#include <kconfigwidgets_version.h>
|
2013-06-25 17:08:34 +01:00
|
|
|
|
2023-07-26 10:51:45 +01:00
|
|
|
#include "ui_kcm.h"
|
2023-06-01 01:25:37 +01:00
|
|
|
#include <core/pairstate.h>
|
|
|
|
|
2013-06-19 15:15:25 +01:00
|
|
|
class QModelIndex;
|
2013-08-13 04:07:32 +01:00
|
|
|
class DeviceDbusInterface;
|
2015-03-02 05:23:05 +00:00
|
|
|
class DaemonDbusInterface;
|
2014-04-12 21:05:16 +01:00
|
|
|
class DevicesModel;
|
2013-08-15 23:25:13 +01:00
|
|
|
class DevicesSortProxyModel;
|
2013-06-25 17:08:34 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
class KdeConnectKcm : public KCModule
|
2013-06-19 15:15:25 +01:00
|
|
|
{
|
2013-06-27 01:13:16 +01:00
|
|
|
Q_OBJECT
|
2013-06-19 15:15:25 +01:00
|
|
|
public:
|
2024-03-05 18:43:31 +00:00
|
|
|
KdeConnectKcm(QObject *parent, const KPluginMetaData &md, const QVariantList &args);
|
2016-06-20 08:05:02 +01:00
|
|
|
~KdeConnectKcm() override;
|
2013-06-19 15:15:25 +01:00
|
|
|
|
2013-08-13 04:07:32 +01:00
|
|
|
private:
|
2016-06-20 08:05:02 +01:00
|
|
|
void save() override;
|
2013-08-13 04:07:32 +01:00
|
|
|
|
2013-06-19 15:15:25 +01:00
|
|
|
private Q_SLOTS:
|
2024-10-06 22:40:39 +01:00
|
|
|
void deviceSelected(const QString &deviceId);
|
2023-06-01 01:25:37 +01:00
|
|
|
void requestPairing();
|
2023-06-24 18:45:48 +01:00
|
|
|
void pluginsConfigChanged(bool changed);
|
2013-07-03 02:52:44 +01:00
|
|
|
void sendPing();
|
2022-09-10 22:23:52 +01:00
|
|
|
void pairingFailed(const QString &error);
|
2014-08-11 17:56:11 +01:00
|
|
|
void refresh();
|
2015-03-02 05:23:05 +00:00
|
|
|
void renameShow();
|
|
|
|
void renameDone();
|
|
|
|
void setRenameMode(bool b);
|
2015-09-08 19:03:44 +01:00
|
|
|
void resetCurrentDevice();
|
2023-06-01 01:25:37 +01:00
|
|
|
void setCurrentDevicePairState(int pairStateAsInt);
|
2017-02-20 20:00:26 +00:00
|
|
|
void acceptPairing();
|
2023-06-01 01:25:37 +01:00
|
|
|
void cancelPairing();
|
|
|
|
|
2013-06-19 15:15:25 +01:00
|
|
|
private:
|
2015-09-12 18:43:15 +01:00
|
|
|
void resetDeviceView();
|
|
|
|
|
2023-07-26 10:51:45 +01:00
|
|
|
Ui::KdeConnectKcmUi kcmUi;
|
2022-09-10 22:23:52 +01:00
|
|
|
DaemonDbusInterface *daemon;
|
|
|
|
DevicesModel *devicesModel;
|
|
|
|
DevicesSortProxyModel *sortProxyModel;
|
|
|
|
DeviceDbusInterface *currentDevice;
|
2016-07-06 16:37:22 +01:00
|
|
|
QStringList m_oldSupportedPluginNames;
|
2013-09-04 18:37:58 +01:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
2013-08-30 18:10:43 +01:00
|
|
|
void unpair();
|
2013-06-19 15:15:25 +01:00
|
|
|
};
|