mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
added support alternative time schemes (#8)
This commit is contained in:
parent
1b5e2c7fea
commit
65a60de9a5
@ -301,6 +301,16 @@ class DataEngine:
|
|||||||
elif (self.parent.timeFormat.split('$longtime')[0] != self.parent.timeFormat):
|
elif (self.parent.timeFormat.split('$longtime')[0] != self.parent.timeFormat):
|
||||||
value = str(data[QString(u'DateTime')].toString(Qt.SystemLocaleLongDate).toUtf8())
|
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]
|
line = self.parent.timeFormat.split('$longtime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$longtime')[1]
|
||||||
|
elif (self.parent.timeFormat.split('$snsntime')[0] != self.parent.timeFormat):
|
||||||
|
rawDate = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8())
|
||||||
|
value = rawDate.split()[0] + " " + rawDate.split()[2] + " " + \
|
||||||
|
rawDate.split()[1] + " " + ':'.join(rawDate.split()[3].split(':')[0:2])
|
||||||
|
line = self.parent.timeFormat.split('$snsntime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$snsntime')[1]
|
||||||
|
elif (self.parent.timeFormat.split('$nsnstime')[0] != self.parent.timeFormat):
|
||||||
|
rawDate = str(data[QString(u'DateTime')].toString(Qt.TextDate).toUtf8())
|
||||||
|
value = ':'.join(rawDate.split()[3].split(':')[0:2]) + " " + rawDate.split()[0] + " " + \
|
||||||
|
rawDate.split()[2] + " " + rawDate.split()[1]
|
||||||
|
line = self.parent.timeFormat.split('$nsnstime')[0] + value.decode("utf-8") + self.parent.timeFormat.split('$nsnstime')[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]
|
||||||
|
@ -66,7 +66,9 @@
|
|||||||
<string notr="true">$time - time in default format
|
<string notr="true">$time - time in default format
|
||||||
$isotime - time in ISO format
|
$isotime - time in ISO format
|
||||||
$shorttime - time in short format
|
$shorttime - time in short format
|
||||||
$longtime - time in log format</string>
|
$longtime - time in log format
|
||||||
|
$snsntime - time in format 'string number string number'
|
||||||
|
$nsnstime - time in format 'number string number string'</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>
|
||||||
|
Loading…
Reference in New Issue
Block a user