From f77cf7c1aaf1b2261a132a96d6f063210133bbd2 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Wed, 21 Oct 2015 13:29:06 +0300 Subject: [PATCH] update contributing.md fix #69 by adding special patches --- CONTRIBUTING.md | 2 + packages/qt5.4-replace-qml-dialogs.patch | 85 ++++++++++++++++++++ packages/qt5.5-qstringlist-declaration.patch | 12 +++ 3 files changed, 99 insertions(+) create mode 100644 packages/qt5.4-replace-qml-dialogs.patch create mode 100644 packages/qt5.5-qstringlist-declaration.patch diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cebc934..66fb446 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,6 +128,8 @@ HIG --- The recommended HIG is [KDE one](https://techbase.kde.org/Projects/Usability/HIG). +Avoid to paint interfaces inside plugin because QML and C++ parts may have different +theming. Licensing --------- diff --git a/packages/qt5.4-replace-qml-dialogs.patch b/packages/qt5.4-replace-qml-dialogs.patch new file mode 100644 index 0000000..ffcf260 --- /dev/null +++ b/packages/qt5.4-replace-qml-dialogs.patch @@ -0,0 +1,85 @@ +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 += "
" +- message += i18n("Value: %1", awKeys.valueByKey(tag)) +- message += "
" +- 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 += "
" ++ message += i18n("Value: %1", awKeys.valueByKey(tag)) ++ message += "
" ++ 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/packages/qt5.5-qstringlist-declaration.patch b/packages/qt5.5-qstringlist-declaration.patch new file mode 100644 index 0000000..695d3dd --- /dev/null +++ b/packages/qt5.5-qstringlist-declaration.patch @@ -0,0 +1,12 @@ +diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h +index f808d03..a056b3f 100644 +--- a/sources/awesome-widget/plugin/awkeysaggregator.h ++++ b/sources/awesome-widget/plugin/awkeysaggregator.h +@@ -21,6 +21,7 @@ + + #include + #include ++#include + + #include "version.h" +