mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
add setKeys() function
This commit is contained in:
parent
afdf86f03a
commit
744f3bc04b
@ -43,6 +43,8 @@ ExtendedSysMon::ExtendedSysMon(QObject* parent, const QVariantList& args)
|
|||||||
|
|
||||||
setMinimumPollingInterval(333);
|
setMinimumPollingInterval(333);
|
||||||
readConfiguration();
|
readConfiguration();
|
||||||
|
setProcesses();
|
||||||
|
setKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -142,7 +144,6 @@ void ExtendedSysMon::readConfiguration()
|
|||||||
}
|
}
|
||||||
confFile.close();
|
confFile.close();
|
||||||
configuration = updateConfiguration(rawConfig);
|
configuration = updateConfiguration(rawConfig);
|
||||||
setProcesses();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,6 +190,58 @@ void ExtendedSysMon::setProcesses()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ExtendedSysMon::setKeys()
|
||||||
|
{
|
||||||
|
QString key, source;
|
||||||
|
// custom
|
||||||
|
source = QString("custom");
|
||||||
|
for (int i=0; i<configuration[QString("CUSTOM")].split(QString("@@"), QString::SkipEmptyParts).count(); i++) {
|
||||||
|
key = QString("custom") + QString::number(i);
|
||||||
|
setData(source, key, QString(""));
|
||||||
|
}
|
||||||
|
// gpu
|
||||||
|
source = QString("gpu");
|
||||||
|
key = QString("GPU");
|
||||||
|
setData(source, key, float(0.0));
|
||||||
|
// gputemp
|
||||||
|
source = QString("gputemp");
|
||||||
|
key = QString("GPUTemp");
|
||||||
|
setData(source, key, float(0.0));
|
||||||
|
// hddtemp
|
||||||
|
source = QString("hddtemp");
|
||||||
|
for (int i=0; i<configuration[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts).count(); i++) {
|
||||||
|
key = configuration[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts)[i];
|
||||||
|
setData(source, key, float(0.0));
|
||||||
|
}
|
||||||
|
// pkg
|
||||||
|
source = QString("pkg");
|
||||||
|
for (int i=0; i<configuration[QString("PKGCMD")].split(QString(","), QString::SkipEmptyParts).count(); i++) {
|
||||||
|
key = QString("pkgCount") + QString::number(i);
|
||||||
|
setData(source, key, 0);
|
||||||
|
}
|
||||||
|
// player
|
||||||
|
source = QString("player");
|
||||||
|
key = QString("album");
|
||||||
|
setData(source, key, QString("unknown"));
|
||||||
|
key = QString("artist");
|
||||||
|
setData(source, key, QString("unknown"));
|
||||||
|
key = QString("duration");
|
||||||
|
setData(source, key, QString("0"));
|
||||||
|
key = QString("progress");
|
||||||
|
setData(source, key, QString("0"));
|
||||||
|
key = QString("title");
|
||||||
|
setData(source, key, QString("unknown"));
|
||||||
|
// ps
|
||||||
|
source = QString("ps");
|
||||||
|
key = QString("psCount");
|
||||||
|
setData(source, key, QString("0"));
|
||||||
|
key = QString("ps");
|
||||||
|
setData(source, key, QString(""));
|
||||||
|
key = QString("psTotal");
|
||||||
|
setData(source, key, QString("0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QMap<QString, QString> ExtendedSysMon::updateConfiguration(const QMap<QString, QString> rawConfig)
|
QMap<QString, QString> ExtendedSysMon::updateConfiguration(const QMap<QString, QString> rawConfig)
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << "[DE]" << "[updateConfiguration]";
|
if (debug) qDebug() << "[DE]" << "[updateConfiguration]";
|
||||||
|
@ -65,6 +65,7 @@ private:
|
|||||||
QString getAllHdd();
|
QString getAllHdd();
|
||||||
QString getAutoGpu();
|
QString getAutoGpu();
|
||||||
void readConfiguration();
|
void readConfiguration();
|
||||||
|
void setKeys();
|
||||||
void setProcesses();
|
void setProcesses();
|
||||||
QMap<QString, QString> updateConfiguration(const QMap<QString, QString> rawConfig);
|
QMap<QString, QString> updateConfiguration(const QMap<QString, QString> rawConfig);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user