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;
|
|
|
|
|
|
|
|
class RunCommandConfig
|
|
|
|
: public KdeConnectPluginKcm
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-09-03 20:39:44 +01:00
|
|
|
RunCommandConfig(QWidget* parent, const QVariantList&);
|
2016-06-20 08:05:02 +01:00
|
|
|
~RunCommandConfig() override;
|
2015-09-12 11:38:44 +01:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
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
|
|
|
|
|
|
|
private Q_SLOTS:
|
2017-09-03 20:39:44 +01:00
|
|
|
void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
2015-09-12 11:38:44 +01:00
|
|
|
private:
|
2018-03-24 18:57:40 +00:00
|
|
|
void addSuggestedCommand(QMenu* menu, const QString &name, const QString &command);
|
|
|
|
void insertRow(int i, const QString &name, const QString &command);
|
2015-09-12 11:38:44 +01:00
|
|
|
void insertEmptyRow();
|
|
|
|
|
2017-09-03 20:39:44 +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
|