From 43efbbba72b9a4019500f3fe13eaea9be9eb1046 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 23 Jan 2015 08:36:27 +0300 Subject: [PATCH] minor changes --- sources/.kdev4/sources.kdev4 | 2 +- .../package/contents/ui/main.qml | 27 ++++++++++++++++--- sources/ext-sysmon/CMakeLists.txt | 5 ++-- sources/ext-sysmon/extsysmon.cpp | 22 +++++++++++++++ sources/ext-sysmon/extsysmon.h | 1 + 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/sources/.kdev4/sources.kdev4 b/sources/.kdev4/sources.kdev4 index 69e987e..b97529b 100644 --- a/sources/.kdev4/sources.kdev4 +++ b/sources/.kdev4/sources.kdev4 @@ -12,7 +12,7 @@ Build Type=Debug CMake Binary=file:///usr/bin/cmake Environment Profile= Extra Arguments= -Install Directory= +Install Directory=file:///usr [Defines And Includes][Compiler] Name=GCC diff --git a/sources/awesome-widget-kf5/package/contents/ui/main.qml b/sources/awesome-widget-kf5/package/contents/ui/main.qml index 35c9653..168da28 100644 --- a/sources/awesome-widget-kf5/package/contents/ui/main.qml +++ b/sources/awesome-widget-kf5/package/contents/ui/main.qml @@ -59,8 +59,12 @@ Item { PlasmaCore.DataSource { id: systemmonitorDE engine: "systemmonitor" - connectedSources: ["active", "current", "extip4", "extip6", "interfaces", "intip4", "intip6", "profiles", "status"] - interval: plasmoid.configuration.interval + + Component.onCompleted: { + if (debug) console.log("[main::onCompleted] : Connect sources to systemmonitor") + + systemmonitorDE.connectAllSources(main, plasmoid.configuration.interval) + } onNewData: { if (debug) console.log("[main::onNewData] : Update source " + sourceName) @@ -74,8 +78,12 @@ Item { PlasmaCore.DataSource { id: extsysmonDE engine: "ext-sysmon" - connectedSources: ["update"] - interval: plasmoid.configuration.interval + + Component.onCompleted: { + if (debug) console.log("[main::onCompleted] : Connect sources to ext-sysmon") + + extsysmonDE.connectAllSources(main, plasmoid.configuration.interval) + } onNewData: { if (debug) console.log("[main::onNewData] : Update source " + sourceName) @@ -84,6 +92,17 @@ Item { } } + PlasmaCore.DataSource { + id: timeDE + engine: "time" + connectedSources: ["Local"] + interval: plasmoid.configuration.autoUpdateInterval + + onNewData: { + if (debug) console.log("[main::onNewData] : Update source " + sourceName) + } + } + // ui Grid { id: mainGrid diff --git a/sources/ext-sysmon/CMakeLists.txt b/sources/ext-sysmon/CMakeLists.txt index a29ec8b..10137e4 100644 --- a/sources/ext-sysmon/CMakeLists.txt +++ b/sources/ext-sysmon/CMakeLists.txt @@ -20,8 +20,9 @@ else () include (KDECMakeSettings) include (KDECompilerSettings) - add_definitions (${Qt5Core_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) + add_definitions (${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) set (KDE_INCLUDE ${Plasma_INCLUDE_DIR}) endif () @@ -55,7 +56,7 @@ else () qt5_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER}) qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI}) add_library (${PLUGIN_NAME} MODULE ${SUBPROJECT_SOURCE} ${SUBPROJECT_UI_HEADER} ${TASK_MOC_SOURCE}) - target_link_libraries (${PLUGIN_NAME} ${Plasma_LIBRARIES} KF5::WindowSystem ${Qt5Widgets_LIBRARIES}) + target_link_libraries (${PLUGIN_NAME} ${Plasma_LIBRARIES} KF5::WindowSystem ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) kcoreaddons_desktop_to_json (${PLUGIN_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP}) endif () diff --git a/sources/ext-sysmon/extsysmon.cpp b/sources/ext-sysmon/extsysmon.cpp index 6789bdb..fc133e8 100644 --- a/sources/ext-sysmon/extsysmon.cpp +++ b/sources/ext-sysmon/extsysmon.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -168,6 +169,7 @@ QStringList ExtendedSysMon::sources() const source.append(QString("battery")); source.append(QString("custom")); source.append(QString("desktop")); + source.append(QString("netdev")); source.append(QString("gpu")); source.append(QString("gputemp")); source.append(QString("hddtemp")); @@ -422,6 +424,24 @@ float ExtendedSysMon::getHddTemp(const QString cmd, const QString device) } +QString ExtendedSysMon::getNetworkDevice() +{ + if (debug) qDebug() << PDEBUG; + + QString device = QString("lo"); + QList rawInterfaceList = QNetworkInterface::allInterfaces(); + for (int i=0; i ExtendedSysMon::getPlayerInfo(const QString playerName, const QString mpdAddress, const QString mpdPort, @@ -587,6 +607,8 @@ bool ExtendedSysMon::updateSourceEvent(const QString &source) for (int i=0; i getPlayerInfo(const QString playerName, const QString mpdAddress = 0, const QString mpdPort = 0,