diff --git a/PKGBUILD b/PKGBUILD index b9c868b..755d2bd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgname=kdeplasma-applets-pytextmonitor _pkgname=py-text-monitor -pkgver=1.5.1 +pkgver=1.5.2 pkgrel=2 _dtengine=ext-sysmon _dtver=1.5 @@ -22,8 +22,8 @@ makedepends=('automoc4' 'cmake') source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}.plasmoid https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_dtengine}-${_dtver}.zip) install=${pkgname}.install -md5sums=('3e128738a0fcb90f41c57bd6cc4a249c' - 'ff3144a9f0d74f80a5ab6bf2f3bdf9a1') +md5sums=('62a83e665d5a60e40891357a237cea1c' + 'e8c0e40298facf6f515f3c72c66b2aa0') backup=('usr/share/config/extsysmon.conf') build () diff --git a/ext-sysmon-1.5.zip b/ext-sysmon-1.5.zip index 14e1296..c9e4c03 100644 Binary files a/ext-sysmon-1.5.zip and b/ext-sysmon-1.5.zip differ diff --git a/ext-sysmon/extsysmon.cpp b/ext-sysmon/extsysmon.cpp index 42f1efc..5af776d 100644 --- a/ext-sysmon/extsysmon.cpp +++ b/ext-sysmon/extsysmon.cpp @@ -23,6 +23,7 @@ #include #include +#include ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args) @@ -31,7 +32,7 @@ ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args) Q_UNUSED(args) setMinimumPollingInterval(333); - readConfiguration(QString("/usr/share/config/extsysmon.conf")); + readConfiguration(); } QStringList ExtendedSysMon::sources() const @@ -44,7 +45,7 @@ QStringList ExtendedSysMon::sources() const return source; } -bool ExtendedSysMon::readConfiguration(const QString confFileName) +bool ExtendedSysMon::readConfiguration() { // pre-setup FILE *f_out; @@ -74,10 +75,18 @@ bool ExtendedSysMon::readConfiguration(const QString confFileName) mpdPort = QString("6600"); QString fileStr; + // FIXME: define configuration file + QString confFileName = QString(getenv("HOME")) + QString("/.kde4/share/config/extsysmon.conf"); QFile confFile(confFileName); bool exists = confFile.open(QIODevice::ReadOnly); if (!exists) - return false; + { + confFileName = QString("/usr/share/config/extsysmon.conf"); + confFile.setFileName(confFileName); + exists = confFile.open(QIODevice::ReadOnly); + if (!exists) + return false; + } while (true) { diff --git a/ext-sysmon/extsysmon.h b/ext-sysmon/extsysmon.h index dc3c459..83cca29 100644 --- a/ext-sysmon/extsysmon.h +++ b/ext-sysmon/extsysmon.h @@ -32,7 +32,7 @@ public: protected: bool sourceRequestEvent(const QString &name); bool updateSourceEvent(const QString &source); - bool readConfiguration(const QString confFileName); + bool readConfiguration(); QStringList sources() const; // main configuration QStringList hdddev; diff --git a/py-text-monitor-1.5.1.plasmoid b/py-text-monitor-1.5.2.plasmoid similarity index 68% rename from py-text-monitor-1.5.1.plasmoid rename to py-text-monitor-1.5.2.plasmoid index 784c867..a75a79a 100644 Binary files a/py-text-monitor-1.5.1.plasmoid and b/py-text-monitor-1.5.2.plasmoid differ diff --git a/sources/contents/code/dataengine.py b/sources/contents/code/dataengine.py index ff18acc..5718c06 100644 --- a/sources/contents/code/dataengine.py +++ b/sources/contents/code/dataengine.py @@ -275,9 +275,18 @@ class DataEngine: text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1] self.parent.label_player.setText(text) elif (sourceName == "Local"): - value = str(data[QString(u'DateTime')].toString().toUtf8()) if (self.parent.timeFormat.split('$time')[0] != self.parent.timeFormat): + value = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8()) line = self.parent.timeFormat.split('$time')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$time')[1] + elif (self.parent.timeFormat.split('$isotime')[0] != self.parent.timeFormat): + value = str(data[QString(u'DateTime')].toString(Qt.ISODate).toUtf8()) + line = self.parent.timeFormat.split('$isotime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$isotime')[1] + elif (self.parent.timeFormat.split('$shorttime')[0] != self.parent.timeFormat): + value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleShortDate).toUtf8()) + line = self.parent.timeFormat.split('$shorttime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$shorttime')[1] + elif (self.parent.timeFormat.split('$longtime')[0] != self.parent.timeFormat): + value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleLongDate).toUtf8()) + line = self.parent.timeFormat.split('$longtime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$longtime')[1] else: line = self.parent.timeFormat text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1] diff --git a/sources/contents/ui/configwindow.ui b/sources/contents/ui/configwindow.ui index f30b213..1712806 100644 --- a/sources/contents/ui/configwindow.ui +++ b/sources/contents/ui/configwindow.ui @@ -63,7 +63,10 @@ - $time - time + $time - time in default format +$isotime - time in ISO format +$shorttime - time in short format +$longtime - time in log format Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/sources/metadata.desktop b/sources/metadata.desktop index 27ed95a..556f145 100644 --- a/sources/metadata.desktop +++ b/sources/metadata.desktop @@ -12,7 +12,7 @@ X-Plasma-RequiredExtensions=LaunchApp,LocalIO,FileDialog X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=py-text-monitor -X-KDE-PluginInfo-Version=1.5.1 +X-KDE-PluginInfo-Version=1.5.2 X-KDE-PluginInfo-Website=http://kde-look.org/ X-KDE-PluginInfo-Category=System Information X-KDE-PluginInfo-Depends=