Kstars

profilescriptdialog.h
1/*
2 SPDX-FileCopyrightText: 2022 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QDialog>
10#include <QJsonArray>
11#include <QList>
12
13class ProfileScript;
14class QVBoxLayout;
16
17class ProfileScriptDialog : public QDialog
18{
20
21
22 public:
23 explicit ProfileScriptDialog(const QStringList &drivers, const QByteArray &settings, QWidget *parent = nullptr);
24 const QJsonArray &jsonSettings() const
25 {
26 return m_ProfileScripts;
27 }
28
29 protected:
30
31 QJsonArray m_ProfileScripts;
32 QList<ProfileScript *> m_ProfileScriptWidgets;
33
34 void addRule();
35 void addJSONRule(QJsonObject settings);
36 void removeRule();
37 void generateSettings();
38 void parseSettings(const QByteArray &settings);
39
40 private:
41 QVBoxLayout *m_MainLayout {nullptr};
42 QDialogButtonBox *m_ButtonBox {nullptr};
43 QPushButton *m_AddRuleB {nullptr}, *m_RemoveRuleB {nullptr};
44 QStringList m_DriversList;
45
46};
47
48
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:26 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.