2015-09-12 11:38:44 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2015 David Edmundson <davidedmundson@kde.org>
|
2015-09-12 11:38:44 +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
|
2015-09-12 11:38:44 +01:00
|
|
|
*/
|
|
|
|
|
2023-07-21 19:22:59 +01:00
|
|
|
#pragma once
|
2015-09-12 11:38:44 +01:00
|
|
|
|
|
|
|
#include "kcmplugin/kdeconnectpluginkcm.h"
|
|
|
|
|
2018-03-24 18:57:40 +00:00
|
|
|
class QMenu;
|
2015-09-12 11:38:44 +01:00
|
|
|
class QStandardItemModel;
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
class RunCommandConfig : public KdeConnectPluginKcm
|
2015-09-12 11:38:44 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-07-21 11:26:19 +01:00
|
|
|
RunCommandConfig(QObject *parent, const KPluginMetaData &data, const QVariantList &);
|
2015-09-12 11:38:44 +01:00
|
|
|
|
2016-06-20 08:05:02 +01:00
|
|
|
void save() override;
|
|
|
|
void load() override;
|
|
|
|
void defaults() override;
|
2015-09-12 11:38:44 +01:00
|
|
|
|
2023-07-20 15:22:29 +01:00
|
|
|
private:
|
2022-09-10 22:23:52 +01:00
|
|
|
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
2023-03-30 00:08:03 +01:00
|
|
|
void exportCommands();
|
|
|
|
void importCommands();
|
2022-09-10 22:23:52 +01:00
|
|
|
|
|
|
|
void addSuggestedCommand(QMenu *menu, const QString &name, const QString &command);
|
2018-03-24 18:57:40 +00:00
|
|
|
void insertRow(int i, const QString &name, const QString &command);
|
2015-09-12 11:38:44 +01:00
|
|
|
void insertEmptyRow();
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
QStandardItemModel *m_entriesModel;
|
2015-09-12 11:38:44 +01:00
|
|
|
};
|