mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 22:35:49 +00:00
edit supported information
update desktop panel to tag changes
This commit is contained in:
@ -6,8 +6,8 @@ cmake_policy (SET CMP0011 NEW)
|
||||
cmake_policy (SET CMP0015 NEW)
|
||||
|
||||
project (pytextmonitor)
|
||||
set (PROJECT_VERSION_MAJOR 1)
|
||||
set (PROJECT_VERSION_MINOR 11)
|
||||
set (PROJECT_VERSION_MAJOR 2)
|
||||
set (PROJECT_VERSION_MINOR 0)
|
||||
set (PROJECT_VERSION_PATCH 0)
|
||||
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
||||
set (PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
|
||||
|
@ -47,7 +47,7 @@ QMap<QString, QString> AwesomeWidget::readDataEngineConfiguration()
|
||||
rawConfig[QString("PKGNULL")] = QString("0");
|
||||
rawConfig[QString("PLAYER")] = QString("mpris");
|
||||
|
||||
QString fileName = KGlobal::dirs()->findResource("config", "ext-sysmon.conf");
|
||||
QString fileName = KGlobal::dirs()->findResource("config", "extsysmon.conf");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
|
||||
QFile configFile(fileName);
|
||||
if (!configFile.open(QIODevice::ReadOnly))
|
||||
@ -78,7 +78,7 @@ void AwesomeWidget::writeDataEngineConfiguration(const QMap<QString, QString> se
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
QMap<QString, QString> config = updateDataEngineConfiguration(settings);
|
||||
QString fileName = KGlobal::dirs()->locateLocal("config", "ext-sysmon.conf");
|
||||
QString fileName = KGlobal::dirs()->locateLocal("config", "extsysmon.conf");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName;
|
||||
QFile configFile(fileName);
|
||||
if (!configFile.open(QIODevice::WriteOnly)) return;
|
||||
@ -126,6 +126,7 @@ void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
QString cmd, qoutput;
|
||||
QStringList headerList;
|
||||
TaskResult process;
|
||||
|
||||
QWidget *advWidget = new QWidget;
|
||||
uiAdvancedConfig.setupUi(advWidget);
|
||||
@ -165,11 +166,11 @@ void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
|
||||
Qt::MatchFixedString));
|
||||
cmd = QString("sensors");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
|
||||
TaskResult sensorsProcess = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << sensorsProcess.exitCode;
|
||||
if (sensorsProcess.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << sensorsProcess.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(sensorsProcess.output);
|
||||
process = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
|
||||
if (process.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output);
|
||||
uiAdvancedConfig.listWidget_tempDevice->clear();
|
||||
for (int i=0; i<qoutput.split(QString("\n\n")).count(); i++) {
|
||||
QString sensor = qoutput.split(QString("\n\n"))[i];
|
||||
@ -191,11 +192,11 @@ void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
|
||||
}
|
||||
cmd = QString("mount");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
|
||||
TaskResult mountProcess = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << mountProcess.exitCode;
|
||||
if (mountProcess.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << mountProcess.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(mountProcess.output);
|
||||
process = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
|
||||
if (process.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output);
|
||||
uiAdvancedConfig.listWidget_mount->clear();
|
||||
for (int i=0; i<qoutput.split(QChar('\n')).count(); i++) {
|
||||
QString mountPoint = qoutput.split(QChar('\n'))[i].split(QString(" on "))[1].split(QString(" type "))[0];
|
||||
@ -223,11 +224,11 @@ void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
|
||||
}
|
||||
cmd = QString("find /dev -name [hms]d[a-z]");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
|
||||
TaskResult findProcess = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << findProcess.exitCode;
|
||||
if (findProcess.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << findProcess.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(findProcess.output).trimmed();
|
||||
process = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
|
||||
if (process.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
|
||||
uiAdvancedConfig.listWidget_hddDevice->clear();
|
||||
for (int i=0; i<qoutput.split(QChar('\n')).count(); i++) {
|
||||
QListWidgetItem *item = new QListWidgetItem(qoutput.split(QChar('\n'))[i]);
|
||||
@ -325,11 +326,11 @@ void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
|
||||
uiDEConfig.comboBox_gpudev->findText(deSettings[QString("GPUDEV")], Qt::MatchFixedString));
|
||||
cmd = QString("find /dev -name [hms]d[a-z]");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
|
||||
TaskResult hddProcess = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << hddProcess.exitCode;
|
||||
if (hddProcess.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << hddProcess.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(hddProcess.output).trimmed();
|
||||
process = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
|
||||
if (process.exitCode != 0)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(process.output).trimmed();
|
||||
uiDEConfig.comboBox_hdddev->clear();
|
||||
uiDEConfig.comboBox_hdddev->addItem(QString("all"));
|
||||
uiDEConfig.comboBox_hdddev->addItem(QString("disable"));
|
||||
|
@ -167,21 +167,21 @@ QString DesktopPanel::parsePattern(const QString rawLine, const int num)
|
||||
mark = configuration[QString("mark")];
|
||||
else
|
||||
mark = QString("");
|
||||
if (line.split(QString("$mark"))[0] != line) {
|
||||
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];
|
||||
line = line.split(QString("$mark$"))[0] + mark + line.split(QString("$mark$"))[1];
|
||||
}
|
||||
if (line.split(QString("$name"))[0] != line) {
|
||||
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];
|
||||
line = line.split(QString("$name$"))[0] + desktopNames[num] + line.split(QString("$name$"))[1];
|
||||
}
|
||||
if (line.split(QString("$number"))[0] != line) {
|
||||
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];
|
||||
line = line.split(QString("$number$"))[0] + QString::number(num + 1) + line.split(QString("$number$"))[1];
|
||||
}
|
||||
if (line.split(QString("$total"))[0] != line) {
|
||||
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];
|
||||
line = line.split(QString("$total$"))[0] + QString::number(desktopNames.count()) + line.split(QString("$total$"))[1];
|
||||
}
|
||||
|
||||
return line;
|
||||
@ -443,13 +443,13 @@ void DesktopPanel::configChanged()
|
||||
KConfigGroup cg = config();
|
||||
|
||||
configuration[QString("background")] = cg.readEntry("background", "2");
|
||||
configuration[QString("desktopcmd")] = cg.readEntry("desktopcmd", "qdbus org.kde.kwin /KWin setCurrentDesktop $number");
|
||||
configuration[QString("desktopcmd")] = cg.readEntry("desktopcmd", "qdbus org.kde.kwin /KWin setCurrentDesktop $number$");
|
||||
configuration[QString("interval")] = cg.readEntry("interval", "1000");
|
||||
configuration[QString("layout")] = cg.readEntry("layout", "0");
|
||||
configuration[QString("leftStretch")] = cg.readEntry("leftStretch", "2");
|
||||
configuration[QString("mark")] = cg.readEntry("mark", "¤");
|
||||
configuration[QString("panels")] = cg.readEntry("panels", "-1");
|
||||
configuration[QString("pattern")] = cg.readEntry("pattern", "[$mark$number/$total: $name]");
|
||||
configuration[QString("pattern")] = cg.readEntry("pattern", "[$mark$$number$/$total$: $name$]");
|
||||
configuration[QString("rightStretch")] = cg.readEntry("rightStretch", "2");
|
||||
|
||||
extsysmonEngine->connectSource(QString("desktop"), this, configuration[QString("interval")].toInt());
|
||||
|
@ -233,10 +233,10 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_pattern">
|
||||
<property name="toolTip">
|
||||
<string>$mark - show mark if the current desktop is active
|
||||
$name - desktop name
|
||||
$number - desktop number
|
||||
$total - total number of desktops</string>
|
||||
<string>$mark$ - show mark if the current desktop is active
|
||||
$name$ - desktop name
|
||||
$number$ - desktop number
|
||||
$total$ - total number of desktops</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Reference in New Issue
Block a user