2023-03-14 01:45:47 +00:00
|
|
|
/*
|
|
|
|
|
SPDX-FileCopyrightText: 2019 Jonah Brüchert <jbb@kaidan.im>
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "distroinfo.h"
|
|
|
|
|
#include "hardwareinfo.h"
|
|
|
|
|
#include "softwareinfo.h"
|
2023-03-18 17:53:52 +00:00
|
|
|
#include <KQuickConfigModule>
|
2023-03-14 01:45:47 +00:00
|
|
|
|
[info kcm]: add vendorinfo card
This change adds a card to the Information KCM which can be used to
display vendor-specific information (think of product info, serial or
model number, support info, etc.).
The information is read from a json file in /etc/vendorinfo.json, format
as follows:
'''
{
"Title" : "Vendor Information",
"Content" : [
{
"Key": "Model Number",
"Value": "24ABC-13N4"
},
{
"Key": "Serial Number",
"Value": "778899223344"
},
{
"Key": "Support Phone",
"Value": "+31 6 48370928"
}
]
}
'''
Title is the card header, each Key/Value block adds a TextDelegate. This
block is only displayed if the file actually exists and has a Title set.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2025-01-14 15:46:12 +00:00
|
|
|
#include <QJsonDocument>
|
|
|
|
|
|
2023-03-14 01:45:47 +00:00
|
|
|
#ifndef INFO_H
|
|
|
|
|
#define INFO_H
|
|
|
|
|
|
2023-03-18 17:53:52 +00:00
|
|
|
class Info : public KQuickConfigModule
|
2023-03-14 01:45:47 +00:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
Q_PROPERTY(DistroInfo *distroInfo READ distroInfo NOTIFY distroInfoChanged)
|
|
|
|
|
Q_PROPERTY(SoftwareInfo *softwareInfo READ softwareInfo NOTIFY softwareInfoChanged)
|
|
|
|
|
Q_PROPERTY(HardwareInfo *hardwareInfo READ hardwareInfo NOTIFY hardwareInfoChanged)
|
[info kcm]: add vendorinfo card
This change adds a card to the Information KCM which can be used to
display vendor-specific information (think of product info, serial or
model number, support info, etc.).
The information is read from a json file in /etc/vendorinfo.json, format
as follows:
'''
{
"Title" : "Vendor Information",
"Content" : [
{
"Key": "Model Number",
"Value": "24ABC-13N4"
},
{
"Key": "Serial Number",
"Value": "778899223344"
},
{
"Key": "Support Phone",
"Value": "+31 6 48370928"
}
]
}
'''
Title is the card header, each Key/Value block adds a TextDelegate. This
block is only displayed if the file actually exists and has a Title set.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2025-01-14 15:46:12 +00:00
|
|
|
Q_PROPERTY(QVariantList vendorInfo READ vendorInfo CONSTANT)
|
|
|
|
|
Q_PROPERTY(QString vendorInfoTitle READ vendorInfoTitle CONSTANT)
|
|
|
|
|
|
2023-03-14 01:45:47 +00:00
|
|
|
DistroInfo *distroInfo() const;
|
|
|
|
|
SoftwareInfo *softwareInfo() const;
|
|
|
|
|
HardwareInfo *hardwareInfo() const;
|
|
|
|
|
|
[info kcm]: add vendorinfo card
This change adds a card to the Information KCM which can be used to
display vendor-specific information (think of product info, serial or
model number, support info, etc.).
The information is read from a json file in /etc/vendorinfo.json, format
as follows:
'''
{
"Title" : "Vendor Information",
"Content" : [
{
"Key": "Model Number",
"Value": "24ABC-13N4"
},
{
"Key": "Serial Number",
"Value": "778899223344"
},
{
"Key": "Support Phone",
"Value": "+31 6 48370928"
}
]
}
'''
Title is the card header, each Key/Value block adds a TextDelegate. This
block is only displayed if the file actually exists and has a Title set.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2025-01-14 15:46:12 +00:00
|
|
|
QVariantList vendorInfo() const;
|
|
|
|
|
QString vendorInfoTitle() const;
|
|
|
|
|
|
2023-03-14 01:45:47 +00:00
|
|
|
public:
|
2023-06-10 08:50:37 +00:00
|
|
|
Info(QObject *parent, const KPluginMetaData &metaData);
|
2023-03-14 01:45:47 +00:00
|
|
|
|
|
|
|
|
Q_INVOKABLE void copyInfoToClipboard() const;
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
void distroInfoChanged();
|
|
|
|
|
void softwareInfoChanged();
|
|
|
|
|
void hardwareInfoChanged();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DistroInfo *m_distroInfo;
|
|
|
|
|
SoftwareInfo *m_softwareInfo;
|
|
|
|
|
HardwareInfo *m_hardwareInfo;
|
[info kcm]: add vendorinfo card
This change adds a card to the Information KCM which can be used to
display vendor-specific information (think of product info, serial or
model number, support info, etc.).
The information is read from a json file in /etc/vendorinfo.json, format
as follows:
'''
{
"Title" : "Vendor Information",
"Content" : [
{
"Key": "Model Number",
"Value": "24ABC-13N4"
},
{
"Key": "Serial Number",
"Value": "778899223344"
},
{
"Key": "Support Phone",
"Value": "+31 6 48370928"
}
]
}
'''
Title is the card header, each Key/Value block adds a TextDelegate. This
block is only displayed if the file actually exists and has a Title set.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2025-01-14 15:46:12 +00:00
|
|
|
QJsonDocument m_vendorInfo;
|
2023-03-14 01:45:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // INFO_H
|