mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-05-04 12:23:49 +00:00
Compare commits
2 Commits
0aec0f30f0
...
e6aecaf685
Author | SHA1 | Date | |
---|---|---|---|
e6aecaf685 | |||
423597dbd9 |
@ -21,7 +21,7 @@ import org.kde.plasma.private.awesomewidget 1.0
|
|||||||
import "."
|
import "."
|
||||||
|
|
||||||
|
|
||||||
PlasmoidItem {
|
Item {
|
||||||
id: appearancePage
|
id: appearancePage
|
||||||
// backend
|
// backend
|
||||||
AWActions {
|
AWActions {
|
||||||
|
@ -16,13 +16,12 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 1.3 as QtControls
|
import QtQuick.Controls
|
||||||
import QtQuick.Dialogs 1.1 as QtDialogs
|
|
||||||
|
|
||||||
import org.kde.plasma.private.awesomewidget 1.0
|
import org.kde.plasma.private.awesomewidget 1.0
|
||||||
|
|
||||||
|
|
||||||
PlasmoidItem {
|
Item {
|
||||||
id: dataenginePage
|
id: dataenginePage
|
||||||
// backend
|
// backend
|
||||||
AWKeys {
|
AWKeys {
|
||||||
@ -48,7 +47,7 @@ PlasmoidItem {
|
|||||||
Column {
|
Column {
|
||||||
id: pageColumn
|
id: pageColumn
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
QtControls.GroupBox {
|
GroupBox {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("ACPI")
|
title: i18n("ACPI")
|
||||||
@ -59,7 +58,7 @@ PlasmoidItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtControls.GroupBox {
|
GroupBox {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("GPU")
|
title: i18n("GPU")
|
||||||
@ -88,7 +87,7 @@ PlasmoidItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtControls.GroupBox {
|
GroupBox {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("HDD temperature")
|
title: i18n("HDD temperature")
|
||||||
@ -110,7 +109,7 @@ PlasmoidItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtControls.GroupBox {
|
GroupBox {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("Player")
|
title: i18n("Player")
|
||||||
@ -208,7 +207,7 @@ PlasmoidItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtControls.GroupBox {
|
GroupBox {
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
title: i18n("Extensions")
|
title: i18n("Extensions")
|
||||||
|
@ -12,15 +12,10 @@ include_directories(
|
|||||||
${Kf6_INCLUDE}
|
${Kf6_INCLUDE}
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
|
||||||
file(RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
|
|
||||||
file(GLOB SUBPROJECT_SOURCE *.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
|
file(GLOB SUBPROJECT_SOURCE *.cpp ${CMAKE_SOURCE_DIR}/*.cpp)
|
||||||
file(GLOB SUBPROJECT_HEADER *.h)
|
file(GLOB SUBPROJECT_HEADER *.h)
|
||||||
file(GLOB SUBPROJECT_CONF *.conf)
|
file(GLOB SUBPROJECT_CONF *.conf)
|
||||||
|
|
||||||
# prepare
|
|
||||||
configure_file(${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
|
|
||||||
|
|
||||||
# make
|
# make
|
||||||
add_library(${SUBPROJECT} MODULE ${SUBPROJECT_SOURCE} ${SUBPROJECT_HEADER})
|
add_library(${SUBPROJECT} MODULE ${SUBPROJECT_SOURCE} ${SUBPROJECT_HEADER})
|
||||||
target_link_libraries(${SUBPROJECT}
|
target_link_libraries(${SUBPROJECT}
|
||||||
@ -28,6 +23,5 @@ target_link_libraries(${SUBPROJECT}
|
|||||||
${Qt_LIBRARIES} ${Kf6_LIBRARIES})
|
${Qt_LIBRARIES} ${Kf6_LIBRARIES})
|
||||||
|
|
||||||
# install
|
# install
|
||||||
install(TARGETS ${SUBPROJECT} DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine)
|
install(TARGETS ${SUBPROJECT} DESTINATION ${KDE_INSTALL_PLUGINDIR}/ksystemstats)
|
||||||
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
|
|
||||||
install(FILES ${SUBPROJECT_CONF} DESTINATION ${KDE_INSTALL_CONFDIR})
|
install(FILES ${SUBPROJECT_CONF} DESTINATION ${KDE_INSTALL_CONFDIR})
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "extsysmon.h"
|
#include "extsysmon.h"
|
||||||
|
|
||||||
|
#include <KPluginFactory>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
@ -29,21 +30,17 @@
|
|||||||
|
|
||||||
|
|
||||||
ExtendedSysMon::ExtendedSysMon(QObject *_parent, const QVariantList &_args)
|
ExtendedSysMon::ExtendedSysMon(QObject *_parent, const QVariantList &_args)
|
||||||
: Plasma::DataEngine(_parent, _args)
|
: KSysGuard::SensorPlugin(_parent, _args)
|
||||||
{
|
{
|
||||||
Q_UNUSED(_args)
|
|
||||||
qSetMessagePattern(AWDebug::LOG_FORMAT);
|
qSetMessagePattern(AWDebug::LOG_FORMAT);
|
||||||
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
|
||||||
for (auto &metadata : AWDebug::getBuildData())
|
for (auto &metadata : AWDebug::getBuildData())
|
||||||
qCDebug(LOG_ESM) << metadata;
|
qCDebug(LOG_ESM) << metadata;
|
||||||
|
|
||||||
setMinimumPollingInterval(333);
|
|
||||||
readConfiguration();
|
readConfiguration();
|
||||||
|
|
||||||
// init aggregator
|
// init aggregator
|
||||||
m_aggregator = new ExtSysMonAggregator(this, m_configuration);
|
m_aggregator = new ExtSysMonAggregator("extsysmon", "extsysmon", this, m_configuration);
|
||||||
for (auto &source : m_aggregator->sources())
|
|
||||||
setData(source, m_aggregator->initialData(source));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -53,35 +50,9 @@ ExtendedSysMon::~ExtendedSysMon()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList ExtendedSysMon::sources() const
|
void ExtendedSysMon::update()
|
||||||
{
|
{
|
||||||
return m_aggregator->sources();
|
// m_aggregator->update();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool ExtendedSysMon::sourceRequestEvent(const QString &_source)
|
|
||||||
{
|
|
||||||
qCDebug(LOG_ESM) << "Source" << _source;
|
|
||||||
|
|
||||||
return updateSourceEvent(_source);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool ExtendedSysMon::updateSourceEvent(const QString &_source)
|
|
||||||
{
|
|
||||||
qCDebug(LOG_ESM) << "Source" << _source;
|
|
||||||
|
|
||||||
if (m_aggregator->hasSource(_source)) {
|
|
||||||
QVariant data = m_aggregator->data(_source);
|
|
||||||
if (data.isNull())
|
|
||||||
return false;
|
|
||||||
setData(_source, "value", data);
|
|
||||||
} else {
|
|
||||||
qCWarning(LOG_ESM) << "Unknown source" << _source;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -150,6 +121,6 @@ QHash<QString, QString> ExtendedSysMon::updateConfiguration(QHash<QString, QStri
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(extsysmon, ExtendedSysMon, "plasma-dataengine-extsysmon.json")
|
K_PLUGIN_CLASS_WITH_JSON(ExtendedSysMon, "metadata.json")
|
||||||
|
|
||||||
#include "extsysmon.moc"
|
#include "extsysmon.moc"
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
#ifndef EXTSYSMON_H
|
#ifndef EXTSYSMON_H
|
||||||
#define EXTSYSMON_H
|
#define EXTSYSMON_H
|
||||||
|
|
||||||
#include <Plasma/Plasma/DataEngine>
|
#include <ksysguard/systemstats/SensorPlugin.h>
|
||||||
|
|
||||||
|
|
||||||
class ExtSysMonAggregator;
|
class ExtSysMonAggregator;
|
||||||
|
|
||||||
class ExtendedSysMon : public Plasma::DataEngine
|
class ExtendedSysMon : public KSysGuard::SensorPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -31,10 +31,12 @@ public:
|
|||||||
explicit ExtendedSysMon(QObject *_parent, const QVariantList &_args);
|
explicit ExtendedSysMon(QObject *_parent, const QVariantList &_args);
|
||||||
~ExtendedSysMon() override;
|
~ExtendedSysMon() override;
|
||||||
|
|
||||||
protected:
|
[[nodiscard]] QString providerName() const override
|
||||||
[[nodiscard]] QStringList sources() const override;
|
{
|
||||||
bool sourceRequestEvent(const QString &_source) override;
|
return QStringLiteral("extsysmon");
|
||||||
bool updateSourceEvent(const QString &_source) override;
|
}
|
||||||
|
|
||||||
|
void update() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// configuration
|
// configuration
|
||||||
|
@ -35,8 +35,12 @@
|
|||||||
#include "weathersource.h"
|
#include "weathersource.h"
|
||||||
|
|
||||||
|
|
||||||
ExtSysMonAggregator::ExtSysMonAggregator(QObject *_parent, const QHash<QString, QString> &_config)
|
ExtSysMonAggregator::ExtSysMonAggregator(
|
||||||
: QObject(_parent)
|
const QString &_id,
|
||||||
|
const QString &_name,
|
||||||
|
KSysGuard::SensorContainer *_parent,
|
||||||
|
const QHash<QString, QString> &_config)
|
||||||
|
: KSysGuard::SensorObject(_id, _name, _parent)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_ESM) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
|
@ -19,16 +19,16 @@
|
|||||||
#define EXTSYSMONAGGREGATOR_H
|
#define EXTSYSMONAGGREGATOR_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <ksysguard/systemstats/SensorObject.h>
|
||||||
|
|
||||||
#include "abstractextsysmonsource.h"
|
#include "abstractextsysmonsource.h"
|
||||||
|
|
||||||
|
class ExtSysMonAggregator : public KSysGuard::SensorObject
|
||||||
class ExtSysMonAggregator : public QObject
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ExtSysMonAggregator(QObject *_parent, const QHash<QString, QString> &_config);
|
explicit ExtSysMonAggregator(const QString &_id, const QString &_name, KSysGuard::SensorContainer *_parent, const QHash<QString, QString> &_config);
|
||||||
~ExtSysMonAggregator() override;
|
~ExtSysMonAggregator() override;
|
||||||
[[nodiscard]] QVariant data(const QString &_source) const;
|
[[nodiscard]] QVariant data(const QString &_source) const;
|
||||||
[[nodiscard]] bool hasSource(const QString &_source) const;
|
[[nodiscard]] bool hasSource(const QString &_source) const;
|
||||||
|
3
sources/extsysmon/metadata.json
Normal file
3
sources/extsysmon/metadata.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"providerName": "extsysmon"
|
||||||
|
}
|
@ -1,16 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Encoding=UTF-8
|
|
||||||
Name=Extended SystemMonitor
|
|
||||||
Comment=Adds some additional functions to System DataEngine
|
|
||||||
ServiceTypes=Plasma/DataEngine
|
|
||||||
Type=Service
|
|
||||||
Icon=utilities-system-monitor
|
|
||||||
|
|
||||||
X-KDE-Library=plasma_dataengine_extsysmon
|
|
||||||
|
|
||||||
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
|
||||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
|
||||||
X-KDE-PluginInfo-Name=extsysmon
|
|
||||||
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
|
|
||||||
X-KDE-PluginInfo-Category=System Information
|
|
||||||
X-KDE-PluginInfo-License=GPL3
|
|
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"KPlugin": {
|
|
||||||
"Authors": [
|
|
||||||
{
|
|
||||||
"Email": "esalexeev@gmail.com",
|
|
||||||
"Name": "Evgeniy Alekseev aka arcanis"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Category": "System Information",
|
|
||||||
"Description": "Adds some additional functions to System DataEngine",
|
|
||||||
"Icon": "utilities-system-monitor",
|
|
||||||
"Id": "extsysmon",
|
|
||||||
"License": "GPL3",
|
|
||||||
"Name": "Extended SystemMonitor",
|
|
||||||
"ServiceTypes": [
|
|
||||||
"Plasma/DataEngine"
|
|
||||||
],
|
|
||||||
"Version": "@PROJECT_VERSION@"
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,4 +27,4 @@ include(KDEInstallDirs)
|
|||||||
include(KDECMakeSettings)
|
include(KDECMakeSettings)
|
||||||
include(KDECompilerSettings)
|
include(KDECompilerSettings)
|
||||||
set(Kf6_INCLUDE ${KDE_INSTALL_FULL_INCLUDEDIR_KF})
|
set(Kf6_INCLUDE ${KDE_INSTALL_FULL_INCLUDEDIR_KF})
|
||||||
set(Kf6_LIBRARIES KF6::I18n KF6::Notifications KF6::WindowSystem KSysGuard::Sensors KSysGuard::SensorFaces KSysGuard::SystemStats PW::LibTaskManager)
|
set(Kf6_LIBRARIES KF6::CoreAddons KF6::I18n KF6::Notifications KF6::WindowSystem KSysGuard::Sensors KSysGuard::SensorFaces KSysGuard::SystemStats PW::LibTaskManager)
|
||||||
|
@ -41,9 +41,9 @@ Row {
|
|||||||
|
|
||||||
signal setFont
|
signal setFont
|
||||||
|
|
||||||
onAccepted: value = fontDialog.font.family
|
onAccepted: value = selectedFont.family
|
||||||
onSetFont: {
|
onSetFont: {
|
||||||
fontDialog.font = Qt.font({
|
selectedFont = Qt.font({
|
||||||
family: value,
|
family: value,
|
||||||
pointSize: 12,
|
pointSize: 12,
|
||||||
italic: false,
|
italic: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user