add configuration interface slots

This commit is contained in:
arcan1s
2014-09-02 01:10:27 +04:00
parent a65f4cb02f
commit c69957e905
4 changed files with 169 additions and 69 deletions

View File

@ -144,6 +144,7 @@ void AwesomeWidget::init()
// dataengines
extsysmonEngine = dataEngine(QString("ext-sysmon"));
sysmonEngine = dataEngine(QString("systemmonitor"));
connect(sysmonEngine, SIGNAL(sourceAdded(QString)), this, SLOT(addDiskDevice(QString)));
timeEngine = dataEngine(QString("time"));
// tooltip
@ -175,6 +176,19 @@ void AwesomeWidget::init()
}
void AwesomeWidget::addDiskDevice(const QString source)
{
if (debug) qDebug() << PDEBUG;
QRegExp diskRegexp = QRegExp(QString("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)"));
if (diskRegexp.indexIn(source) > -1) {
QStringList splitSource = source.split(QChar('/'));
QString device = splitSource[0] + QString("/") + splitSource[1];
diskDevices.append(device);
}
}
QStringList AwesomeWidget::findKeys()
{
if (debug) qDebug() << PDEBUG;
@ -284,37 +298,4 @@ QStringList AwesomeWidget::getKeys()
}
//QString DesktopPanel::parsePattern(const QString rawLine, const int num)
//{
// if (debug) qDebug() << PDEBUG;
// if (debug) qDebug() << PDEBUG << ":" << "Run function with raw line" << rawLine;
// if (debug) qDebug() << PDEBUG << ":" << "Run function with number" << num;
// QString line, mark;
// line = rawLine;
// if (currentDesktop == num + 1)
// mark = configuration[QString("mark")];
// else
// mark = QString("");
// if (line.split(QString("$mark"))[0] != line) {
// if (debug) qDebug() << PDEBUG << ":" << "Found mark";
// line = line.split(QString("$mark"))[0] + mark + line.split(QString("$mark"))[1];
// }
// if (line.split(QString("$name"))[0] != line) {
// if (debug) qDebug() << PDEBUG << ":" << "Found name";
// line = line.split(QString("$name"))[0] + desktopNames[num] + line.split(QString("$name"))[1];
// }
// if (line.split(QString("$number"))[0] != line) {
// if (debug) qDebug() << PDEBUG << ":" << "Found number";
// line = line.split(QString("$number"))[0] + QString::number(num + 1) + line.split(QString("$number"))[1];
// }
// if (line.split(QString("$total"))[0] != line) {
// if (debug) qDebug() << PDEBUG << ":" << "Found total";
// line = line.split(QString("$total"))[0] + QString::number(desktopNames.count()) + line.split(QString("$total"))[1];
// }
// return line;
//}
K_EXPORT_PLASMA_APPLET(ptm-awesome-widget, AwesomeWidget)