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
|
|
|
*/
|
|
|
|
|
2018-10-26 22:29:28 +01:00
|
|
|
#ifndef RUNCOMMAND_CONFIG_H
|
|
|
|
#define RUNCOMMAND_CONFIG_H
|
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-04-17 18:10:08 +01:00
|
|
|
RunCommandConfig(QObject *parent, 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
|
|
|
};
|
|
|
|
|
2018-10-26 22:29:28 +01:00
|
|
|
#endif // RUNCOMMAND_CONFIG_H
|