mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
update patch...again
This commit is contained in:
parent
99e38118a4
commit
2d9ca281a9
@ -1,88 +1,3 @@
|
|||||||
diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml
|
|
||||||
index 23e9690..ec83b91 100644
|
|
||||||
--- a/sources/awesome-widget/package/contents/ui/main.qml
|
|
||||||
+++ b/sources/awesome-widget/package/contents/ui/main.qml
|
|
||||||
@@ -17,7 +17,6 @@
|
|
||||||
|
|
||||||
import QtQuick 2.4
|
|
||||||
import QtQuick.Controls 1.3 as QtControls
|
|
||||||
-import QtQuick.Dialogs 1.2 as QtDialogs
|
|
||||||
import QtQuick.Layouts 1.1
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
@@ -110,27 +109,6 @@ Item {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- QtDialogs.Dialog {
|
|
||||||
- id: tagSelector
|
|
||||||
- title: i18n("Select tag")
|
|
||||||
-
|
|
||||||
- QtControls.ComboBox {
|
|
||||||
- id: tagSelectorBox
|
|
||||||
- width: parent.width
|
|
||||||
- editable: true
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- onAccepted: {
|
|
||||||
- var tag = tagSelectorBox.editText
|
|
||||||
- var message = i18n("Tag: %1", tag)
|
|
||||||
- message += "<br>"
|
|
||||||
- message += i18n("Value: %1", awKeys.valueByKey(tag))
|
|
||||||
- message += "<br>"
|
|
||||||
- message += i18n("Info: %1", awKeys.infoByKey(tag))
|
|
||||||
- awActions.sendNotification("tag", message)
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (debug) console.debug()
|
|
||||||
@@ -216,7 +194,12 @@ Item {
|
|
||||||
function action_requestKey() {
|
|
||||||
if (debug) console.debug()
|
|
||||||
|
|
||||||
- tagSelectorBox.model = awKeys.dictKeys(true)
|
|
||||||
- return tagSelector.open()
|
|
||||||
+ var tag = awKeys.graphicalKey()
|
|
||||||
+ var message = i18n("Tag: %1", tag)
|
|
||||||
+ message += "<br>"
|
|
||||||
+ message += i18n("Value: %1", awKeys.valueByKey(tag))
|
|
||||||
+ message += "<br>"
|
|
||||||
+ message += i18n("Info: %1", awKeys.infoByKey(tag))
|
|
||||||
+ awActions.sendNotification("tag", message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp
|
|
||||||
index e5b9861..039d24e 100644
|
|
||||||
--- a/sources/awesome-widget/plugin/awkeys.cpp
|
|
||||||
+++ b/sources/awesome-widget/plugin/awkeys.cpp
|
|
||||||
@@ -324,6 +324,13 @@ QStringList AWKeys::getHddDevices() const
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+QString AWKeys::graphicalKey() const
|
|
||||||
+{
|
|
||||||
+ return QInputDialog::getItem(nullptr, i18n("Select tag"), QString(),
|
|
||||||
+ dictKeys(true), 0, true);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
QString AWKeys::infoByKey(QString key) const
|
|
||||||
{
|
|
||||||
qCDebug(LOG_AW) << "Requested key" << key;
|
|
||||||
diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h
|
|
||||||
index a8300f1..8edc3bd 100644
|
|
||||||
--- a/sources/awesome-widget/plugin/awkeys.h
|
|
||||||
+++ b/sources/awesome-widget/plugin/awkeys.h
|
|
||||||
@@ -55,6 +55,7 @@ public:
|
|
||||||
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
|
|
||||||
const QString regexp = QString()) const;
|
|
||||||
Q_INVOKABLE QStringList getHddDevices() const;
|
|
||||||
+ Q_INVOKABLE QString graphicalKey() const;
|
|
||||||
// values
|
|
||||||
Q_INVOKABLE QString infoByKey(QString key) const;
|
|
||||||
Q_INVOKABLE QString valueByKey(QString key) const;
|
|
||||||
diff --git a/sources/awesome-widget/package/contents/ui/advanced.qml b/sources/awesome-widget/package/contents/ui/advanced.qml
|
diff --git a/sources/awesome-widget/package/contents/ui/advanced.qml b/sources/awesome-widget/package/contents/ui/advanced.qml
|
||||||
index 01bcd58..1ec7ba6 100644
|
index 01bcd58..1ec7ba6 100644
|
||||||
--- a/sources/awesome-widget/package/contents/ui/advanced.qml
|
--- a/sources/awesome-widget/package/contents/ui/advanced.qml
|
||||||
@ -172,11 +87,66 @@ index 01bcd58..1ec7ba6 100644
|
|||||||
for (var key in importConfig)
|
for (var key in importConfig)
|
||||||
plasmoid.configuration[key] = importConfig[key]
|
plasmoid.configuration[key] = importConfig[key]
|
||||||
}
|
}
|
||||||
|
diff --git a/sources/awesome-widget/package/contents/ui/main.qml b/sources/awesome-widget/package/contents/ui/main.qml
|
||||||
|
index 23e9690..ec83b91 100644
|
||||||
|
--- a/sources/awesome-widget/package/contents/ui/main.qml
|
||||||
|
+++ b/sources/awesome-widget/package/contents/ui/main.qml
|
||||||
|
@@ -17,7 +17,6 @@
|
||||||
|
|
||||||
|
import QtQuick 2.4
|
||||||
|
import QtQuick.Controls 1.3 as QtControls
|
||||||
|
-import QtQuick.Dialogs 1.2 as QtDialogs
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
import org.kde.plasma.plasmoid 2.0
|
||||||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
@@ -110,27 +109,6 @@ Item {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- QtDialogs.Dialog {
|
||||||
|
- id: tagSelector
|
||||||
|
- title: i18n("Select tag")
|
||||||
|
-
|
||||||
|
- QtControls.ComboBox {
|
||||||
|
- id: tagSelectorBox
|
||||||
|
- width: parent.width
|
||||||
|
- editable: true
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- onAccepted: {
|
||||||
|
- var tag = tagSelectorBox.editText
|
||||||
|
- var message = i18n("Tag: %1", tag)
|
||||||
|
- message += "<br>"
|
||||||
|
- message += i18n("Value: %1", awKeys.valueByKey(tag))
|
||||||
|
- message += "<br>"
|
||||||
|
- message += i18n("Info: %1", awKeys.infoByKey(tag))
|
||||||
|
- awActions.sendNotification("tag", message)
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (debug) console.debug()
|
||||||
|
@@ -216,7 +194,12 @@ Item {
|
||||||
|
function action_requestKey() {
|
||||||
|
if (debug) console.debug()
|
||||||
|
|
||||||
|
- tagSelectorBox.model = awKeys.dictKeys(true)
|
||||||
|
- return tagSelector.open()
|
||||||
|
+ var tag = awKeys.graphicalKey()
|
||||||
|
+ var message = i18n("Tag: %1", tag)
|
||||||
|
+ message += "<br>"
|
||||||
|
+ message += i18n("Value: %1", awKeys.valueByKey(tag))
|
||||||
|
+ message += "<br>"
|
||||||
|
+ message += i18n("Info: %1", awKeys.infoByKey(tag))
|
||||||
|
+ awActions.sendNotification("tag", message)
|
||||||
|
}
|
||||||
|
}
|
||||||
diff --git a/sources/awesome-widget/plugin/awconfighelper.cpp b/sources/awesome-widget/plugin/awconfighelper.cpp
|
diff --git a/sources/awesome-widget/plugin/awconfighelper.cpp b/sources/awesome-widget/plugin/awconfighelper.cpp
|
||||||
index 5901fc8..5f61d2a 100644
|
index 6263b30..5f61d2a 100644
|
||||||
--- a/sources/awesome-widget/plugin/awconfighelper.cpp
|
--- a/sources/awesome-widget/plugin/awconfighelper.cpp
|
||||||
+++ b/sources/awesome-widget/plugin/awconfighelper.cpp
|
+++ b/sources/awesome-widget/plugin/awconfighelper.cpp
|
||||||
@@ -19,11 +19,15 @@
|
@@ -19,10 +19,15 @@
|
||||||
|
|
||||||
#include <KI18n/KLocalizedString>
|
#include <KI18n/KLocalizedString>
|
||||||
|
|
||||||
@ -184,7 +154,7 @@ index 5901fc8..5f61d2a 100644
|
|||||||
+#include <QDialogButtonBox>
|
+#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
+#include <QFileDialog>
|
+#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
+#include <QMessageBox>
|
||||||
#include <QQmlPropertyMap>
|
#include <QQmlPropertyMap>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
@ -192,7 +162,7 @@ index 5901fc8..5f61d2a 100644
|
|||||||
|
|
||||||
#include "awdebug.h"
|
#include "awdebug.h"
|
||||||
|
|
||||||
@@ -51,11 +55,13 @@ bool AWConfigHelper::dropCache() const
|
@@ -50,11 +55,13 @@ bool AWConfigHelper::dropCache() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -210,7 +180,7 @@ index 5901fc8..5f61d2a 100644
|
|||||||
QSettings settings(fileName, QSettings::IniFormat);
|
QSettings settings(fileName, QSettings::IniFormat);
|
||||||
|
|
||||||
// plasmoid configuration
|
// plasmoid configuration
|
||||||
@@ -97,22 +103,33 @@ bool AWConfigHelper::exportConfiguration(QObject *nativeConfig,
|
@@ -96,22 +103,33 @@ bool AWConfigHelper::exportConfiguration(QObject *nativeConfig,
|
||||||
// sync settings
|
// sync settings
|
||||||
settings.sync();
|
settings.sync();
|
||||||
// show additional message
|
// show additional message
|
||||||
@ -252,7 +222,7 @@ index 5901fc8..5f61d2a 100644
|
|||||||
foreach (QString item, m_dirs) {
|
foreach (QString item, m_dirs) {
|
||||||
settings.beginGroup(item);
|
settings.beginGroup(item);
|
||||||
foreach (QString it, settings.childGroups())
|
foreach (QString it, settings.childGroups())
|
||||||
@@ -122,7 +139,7 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
@@ -121,7 +139,7 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
||||||
}
|
}
|
||||||
|
|
||||||
// additional files
|
// additional files
|
||||||
@ -261,7 +231,7 @@ index 5901fc8..5f61d2a 100644
|
|||||||
settings.beginGroup(QString("json"));
|
settings.beginGroup(QString("json"));
|
||||||
// script filters
|
// script filters
|
||||||
writeFile(settings, QString("filters"),
|
writeFile(settings, QString("filters"),
|
||||||
@@ -136,7 +153,7 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
@@ -135,7 +153,7 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
||||||
}
|
}
|
||||||
|
|
||||||
// plasmoid configuration
|
// plasmoid configuration
|
||||||
@ -270,7 +240,7 @@ index 5901fc8..5f61d2a 100644
|
|||||||
settings.beginGroup(QString("plasmoid"));
|
settings.beginGroup(QString("plasmoid"));
|
||||||
foreach (QString key, settings.childKeys())
|
foreach (QString key, settings.childKeys())
|
||||||
configuration[key] = settings.value(key);
|
configuration[key] = settings.value(key);
|
||||||
@@ -262,6 +279,50 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key,
|
@@ -261,6 +279,50 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -348,3 +318,33 @@ index 912ac3d..dc51dfb 100644
|
|||||||
void writeFile(QSettings &settings, const QString key,
|
void writeFile(QSettings &settings, const QString key,
|
||||||
const QString fileName) const;
|
const QString fileName) const;
|
||||||
// properties
|
// properties
|
||||||
|
diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp
|
||||||
|
index e5b9861..039d24e 100644
|
||||||
|
--- a/sources/awesome-widget/plugin/awkeys.cpp
|
||||||
|
+++ b/sources/awesome-widget/plugin/awkeys.cpp
|
||||||
|
@@ -324,6 +324,13 @@ QStringList AWKeys::getHddDevices() const
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+QString AWKeys::graphicalKey() const
|
||||||
|
+{
|
||||||
|
+ return QInputDialog::getItem(nullptr, i18n("Select tag"), QString(),
|
||||||
|
+ dictKeys(true), 0, true);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
QString AWKeys::infoByKey(QString key) const
|
||||||
|
{
|
||||||
|
qCDebug(LOG_AW) << "Requested key" << key;
|
||||||
|
diff --git a/sources/awesome-widget/plugin/awkeys.h b/sources/awesome-widget/plugin/awkeys.h
|
||||||
|
index a8300f1..8edc3bd 100644
|
||||||
|
--- a/sources/awesome-widget/plugin/awkeys.h
|
||||||
|
+++ b/sources/awesome-widget/plugin/awkeys.h
|
||||||
|
@@ -55,6 +55,7 @@ public:
|
||||||
|
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
|
||||||
|
const QString regexp = QString()) const;
|
||||||
|
Q_INVOKABLE QStringList getHddDevices() const;
|
||||||
|
+ Q_INVOKABLE QString graphicalKey() const;
|
||||||
|
// values
|
||||||
|
Q_INVOKABLE QString infoByKey(QString key) const;
|
||||||
|
Q_INVOKABLE QString valueByKey(QString key) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user