mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-10 04:15:51 +00:00
qml improvements
* move functions to plugin part * move model to general.qml
This commit is contained in:
@ -20,6 +20,7 @@ import QtQuick.Controls 1.3 as QtControls
|
||||
import QtQuick.Dialogs 1.2 as QtDialogs
|
||||
|
||||
import org.kde.plasma.private.awesomewidget 1.0
|
||||
import "."
|
||||
|
||||
|
||||
Item {
|
||||
@ -72,64 +73,7 @@ Item {
|
||||
backend: awKeys
|
||||
notifyBackend: awActions
|
||||
textArea: textPattern
|
||||
groups: [
|
||||
{
|
||||
'label': i18n("AC"),
|
||||
'regexp': "^(ac|bat).*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Bars"),
|
||||
'regexp': "^bar.*"
|
||||
},
|
||||
{
|
||||
'label': i18n("CPU"),
|
||||
'regexp': "^(cpu|gpu|la|ps|temp(?!erature)).*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Desktops"),
|
||||
'regexp': "^(n|t)?desktop(s)?"
|
||||
},
|
||||
{
|
||||
'label': i18n("HDD"),
|
||||
'regexp': "^hdd.*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Memory"),
|
||||
'regexp': "^(mem|swap).*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Network"),
|
||||
'regexp': "^(netdev|(down|up(?!time)).*)"
|
||||
},
|
||||
{
|
||||
'label': i18n("Music player"),
|
||||
'regexp': "(^|d|s)(album|artist|duration|progress|title)"
|
||||
},
|
||||
{
|
||||
'label': i18n("Scripts"),
|
||||
'regexp': "^custom.*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Time"),
|
||||
'regexp': ".*time$"
|
||||
},
|
||||
{
|
||||
'label': i18n("Quotes"),
|
||||
'regexp': "^(perc)?(ask|bid|price)(chg)?.*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Upgrades"),
|
||||
'regexp': "^pkgcount.*"
|
||||
},
|
||||
{
|
||||
'label': i18n("Weathers"),
|
||||
'regexp': "^(weather(Id)?|humidity|pressure|temperature|timestamp)"
|
||||
},
|
||||
{
|
||||
'label': i18n("Functions"),
|
||||
'regexp': "functions"
|
||||
}
|
||||
]
|
||||
groups: general.awTagRegexp
|
||||
}
|
||||
|
||||
Row {
|
||||
|
@ -144,6 +144,10 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
|
||||
qCDebug(LOG_AW) << "Should be sorted" << sorted << "and filter applied"
|
||||
<< regexp;
|
||||
|
||||
// check if functions asked
|
||||
if (regexp == QString("functions"))
|
||||
return QString(STATIC_FUNCTIONS).split(QChar(','));
|
||||
|
||||
QStringList allKeys = m_keyOperator->dictKeys();
|
||||
// sort if required
|
||||
if (sorted)
|
||||
|
Reference in New Issue
Block a user