mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 05:45:49 +00:00
Release pytextmonitor 1.5.2
+ added time formats * fixed definition of conf file for dataengine
This commit is contained in:
6
PKGBUILD
6
PKGBUILD
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
pkgname=kdeplasma-applets-pytextmonitor
|
pkgname=kdeplasma-applets-pytextmonitor
|
||||||
_pkgname=py-text-monitor
|
_pkgname=py-text-monitor
|
||||||
pkgver=1.5.1
|
pkgver=1.5.2
|
||||||
pkgrel=2
|
pkgrel=2
|
||||||
_dtengine=ext-sysmon
|
_dtengine=ext-sysmon
|
||||||
_dtver=1.5
|
_dtver=1.5
|
||||||
@ -22,8 +22,8 @@ makedepends=('automoc4' 'cmake')
|
|||||||
source=(https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_pkgname}-${pkgver}.plasmoid
|
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)
|
https://github.com/arcan1s/pytextmonitor/releases/download/V.${pkgver}/${_dtengine}-${_dtver}.zip)
|
||||||
install=${pkgname}.install
|
install=${pkgname}.install
|
||||||
md5sums=('3e128738a0fcb90f41c57bd6cc4a249c'
|
md5sums=('62a83e665d5a60e40891357a237cea1c'
|
||||||
'ff3144a9f0d74f80a5ab6bf2f3bdf9a1')
|
'e8c0e40298facf6f515f3c72c66b2aa0')
|
||||||
backup=('usr/share/config/extsysmon.conf')
|
backup=('usr/share/config/extsysmon.conf')
|
||||||
|
|
||||||
build ()
|
build ()
|
||||||
|
Binary file not shown.
@ -23,6 +23,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
|
ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
|
||||||
@ -31,7 +32,7 @@ ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
|
|||||||
Q_UNUSED(args)
|
Q_UNUSED(args)
|
||||||
|
|
||||||
setMinimumPollingInterval(333);
|
setMinimumPollingInterval(333);
|
||||||
readConfiguration(QString("/usr/share/config/extsysmon.conf"));
|
readConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ExtendedSysMon::sources() const
|
QStringList ExtendedSysMon::sources() const
|
||||||
@ -44,7 +45,7 @@ QStringList ExtendedSysMon::sources() const
|
|||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExtendedSysMon::readConfiguration(const QString confFileName)
|
bool ExtendedSysMon::readConfiguration()
|
||||||
{
|
{
|
||||||
// pre-setup
|
// pre-setup
|
||||||
FILE *f_out;
|
FILE *f_out;
|
||||||
@ -74,10 +75,18 @@ bool ExtendedSysMon::readConfiguration(const QString confFileName)
|
|||||||
mpdPort = QString("6600");
|
mpdPort = QString("6600");
|
||||||
|
|
||||||
QString fileStr;
|
QString fileStr;
|
||||||
|
// FIXME: define configuration file
|
||||||
|
QString confFileName = QString(getenv("HOME")) + QString("/.kde4/share/config/extsysmon.conf");
|
||||||
QFile confFile(confFileName);
|
QFile confFile(confFileName);
|
||||||
bool exists = confFile.open(QIODevice::ReadOnly);
|
bool exists = confFile.open(QIODevice::ReadOnly);
|
||||||
if (!exists)
|
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)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool sourceRequestEvent(const QString &name);
|
bool sourceRequestEvent(const QString &name);
|
||||||
bool updateSourceEvent(const QString &source);
|
bool updateSourceEvent(const QString &source);
|
||||||
bool readConfiguration(const QString confFileName);
|
bool readConfiguration();
|
||||||
QStringList sources() const;
|
QStringList sources() const;
|
||||||
// main configuration
|
// main configuration
|
||||||
QStringList hdddev;
|
QStringList hdddev;
|
||||||
|
Binary file not shown.
@ -275,9 +275,18 @@ class DataEngine:
|
|||||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||||
self.parent.label_player.setText(text)
|
self.parent.label_player.setText(text)
|
||||||
elif (sourceName == "Local"):
|
elif (sourceName == "Local"):
|
||||||
value = str(data[QString(u'DateTime')].toString().toUtf8())
|
|
||||||
if (self.parent.timeFormat.split('$time')[0] != self.parent.timeFormat):
|
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]
|
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:
|
else:
|
||||||
line = self.parent.timeFormat
|
line = self.parent.timeFormat
|
||||||
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1]
|
||||||
|
@ -63,7 +63,10 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit_time">
|
<widget class="QLineEdit" name="lineEdit_time">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string notr="true">$time - time</string>
|
<string notr="true">$time - time in default format
|
||||||
|
$isotime - time in ISO format
|
||||||
|
$shorttime - time in short format
|
||||||
|
$longtime - time in log format</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
@ -12,7 +12,7 @@ X-Plasma-RequiredExtensions=LaunchApp,LocalIO,FileDialog
|
|||||||
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis
|
||||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||||
X-KDE-PluginInfo-Name=py-text-monitor
|
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-Website=http://kde-look.org/
|
||||||
X-KDE-PluginInfo-Category=System Information
|
X-KDE-PluginInfo-Category=System Information
|
||||||
X-KDE-PluginInfo-Depends=
|
X-KDE-PluginInfo-Depends=
|
||||||
|
Reference in New Issue
Block a user