mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
update patches
Since now Qt5.4 version support is officially dropped. It means that widgets now require ubuntu>=16.04 debian>8 opensuse>=42.1
This commit is contained in:
parent
05aafc43e7
commit
ff2032cca1
@ -1,427 +0,0 @@
|
|||||||
diff --git a/sources/awesome-widget/package/contents/ui/advanced.qml b/sources/awesome-widget/package/contents/ui/advanced.qml
|
|
||||||
index 01bcd58..1ec7ba6 100644
|
|
||||||
--- a/sources/awesome-widget/package/contents/ui/advanced.qml
|
|
||||||
+++ b/sources/awesome-widget/package/contents/ui/advanced.qml
|
|
||||||
@@ -17,7 +17,6 @@
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.3 as QtControls
|
|
||||||
-import QtQuick.Dialogs 1.2 as QtDialogs
|
|
||||||
|
|
||||||
import org.kde.plasma.private.awesomewidget 1.0
|
|
||||||
|
|
||||||
@@ -372,32 +371,7 @@ Item {
|
|
||||||
QtControls.Button {
|
|
||||||
width: parent.width * 3 / 5
|
|
||||||
text: i18n("Export configuration")
|
|
||||||
- onClicked: saveConfigAs.open()
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- QtDialogs.FileDialog {
|
|
||||||
- id: saveConfigAs
|
|
||||||
- selectExisting: false
|
|
||||||
- title: i18n("Export")
|
|
||||||
- folder: awConfig.configurationDirectory()
|
|
||||||
- onAccepted: {
|
|
||||||
- var status = awConfig.exportConfiguration(
|
|
||||||
- plasmoid.configuration,
|
|
||||||
- saveConfigAs.fileUrl.toString().replace("file://", ""))
|
|
||||||
- if (status) {
|
|
||||||
- messageDialog.title = i18n("Success")
|
|
||||||
- messageDialog.text = i18n("Please note that binary files were not copied")
|
|
||||||
- } else {
|
|
||||||
- messageDialog.title = i18n("Ooops...")
|
|
||||||
- messageDialog.text = i18n("Could not save configuration file")
|
|
||||||
- }
|
|
||||||
- messageDialog.open()
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- QtDialogs.MessageDialog {
|
|
||||||
- id: messageDialog
|
|
||||||
- standardButtons: QtDialogs.StandardButton.Ok
|
|
||||||
+ onClicked: awConfig.exportConfiguration(plasmoid.configuration)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -410,42 +385,9 @@ Item {
|
|
||||||
QtControls.Button {
|
|
||||||
width: parent.width * 3 / 5
|
|
||||||
text: i18n("Import configuration")
|
|
||||||
- onClicked: openConfig.open()
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- QtDialogs.FileDialog {
|
|
||||||
- id: openConfig
|
|
||||||
- title: i18n("Import")
|
|
||||||
- folder: awConfig.configurationDirectory()
|
|
||||||
- onAccepted: importSelection.open()
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- QtDialogs.Dialog {
|
|
||||||
- id: importSelection
|
|
||||||
-
|
|
||||||
- Column {
|
|
||||||
- QtControls.CheckBox {
|
|
||||||
- id: importPlasmoid
|
|
||||||
- text: i18n("Import plasmoid settings")
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- QtControls.CheckBox {
|
|
||||||
- id: importExtensions
|
|
||||||
- text: i18n("Import extensions")
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- QtControls.CheckBox {
|
|
||||||
- id: importAdds
|
|
||||||
- text: i18n("Import additional files")
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- onAccepted: {
|
|
||||||
+ onClicked: {
|
|
||||||
if (debug) console.debug()
|
|
||||||
- var importConfig = awConfig.importConfiguration(
|
|
||||||
- openConfig.fileUrl.toString().replace("file://", ""),
|
|
||||||
- importPlasmoid.checked, importExtensions.checked,
|
|
||||||
- importAdds.checked)
|
|
||||||
+ var importConfig = awConfig.importConfiguration()
|
|
||||||
for (var key in importConfig)
|
|
||||||
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 41abc9a..966cc43 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
|
|
||||||
@@ -36,9 +35,6 @@ Item {
|
|
||||||
AWActions {
|
|
||||||
id: awActions
|
|
||||||
}
|
|
||||||
- BugReport {
|
|
||||||
- id: bugReport
|
|
||||||
- }
|
|
||||||
|
|
||||||
property bool debug: awActions.isDebugEnabled()
|
|
||||||
property variant tooltipSettings: {
|
|
||||||
@@ -113,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()
|
|
||||||
@@ -222,14 +197,18 @@ Item {
|
|
||||||
function action_reportBug() {
|
|
||||||
if (debug) console.debug()
|
|
||||||
|
|
||||||
- bugReport.reset()
|
|
||||||
- bugReport.open()
|
|
||||||
+ awActions.showLegacyInfo()
|
|
||||||
}
|
|
||||||
|
|
||||||
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/package/contents/ui/qmldir b/sources/awesome-widget/package/contents/ui/qmldir
|
|
||||||
index b31d53f..c5315a3 100644
|
|
||||||
--- a/sources/awesome-widget/package/contents/ui/qmldir
|
|
||||||
+++ b/sources/awesome-widget/package/contents/ui/qmldir
|
|
||||||
@@ -1,2 +1 @@
|
|
||||||
singleton general 1.0 general.qml
|
|
||||||
-BugReport ./BugReport.qml
|
|
||||||
diff --git a/sources/awesome-widget/plugin/awconfighelper.cpp b/sources/awesome-widget/plugin/awconfighelper.cpp
|
|
||||||
index 6263b30..5f61d2a 100644
|
|
||||||
--- a/sources/awesome-widget/plugin/awconfighelper.cpp
|
|
||||||
+++ b/sources/awesome-widget/plugin/awconfighelper.cpp
|
|
||||||
@@ -19,10 +19,15 @@
|
|
||||||
|
|
||||||
#include <KI18n/KLocalizedString>
|
|
||||||
|
|
||||||
+#include <QCheckBox>
|
|
||||||
+#include <QDialogButtonBox>
|
|
||||||
#include <QDir>
|
|
||||||
+#include <QFileDialog>
|
|
||||||
+#include <QMessageBox>
|
|
||||||
#include <QQmlPropertyMap>
|
|
||||||
#include <QSettings>
|
|
||||||
#include <QTextCodec>
|
|
||||||
+#include <QVBoxLayout>
|
|
||||||
|
|
||||||
#include "awdebug.h"
|
|
||||||
|
|
||||||
@@ -50,11 +55,13 @@ bool AWConfigHelper::dropCache() const
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-bool AWConfigHelper::exportConfiguration(const QObject *nativeConfig,
|
|
||||||
- const QString fileName) const
|
|
||||||
+void AWConfigHelper::exportConfiguration(const QObject *nativeConfig) const
|
|
||||||
{
|
|
||||||
- qCDebug(LOG_AW) << "Selected filename" << fileName;
|
|
||||||
-
|
|
||||||
+ // get file path and init settings object
|
|
||||||
+ QString fileName = QFileDialog::getSaveFileName(nullptr, i18n("Export"));
|
|
||||||
+ if (fileName.isEmpty())
|
|
||||||
+ return;
|
|
||||||
+ qCInfo(LOG_AW) << "Selected filename" << fileName;
|
|
||||||
QSettings settings(fileName, QSettings::IniFormat);
|
|
||||||
|
|
||||||
// plasmoid configuration
|
|
||||||
@@ -96,22 +103,33 @@ bool AWConfigHelper::exportConfiguration(QObject *nativeConfig,
|
|
||||||
// sync settings
|
|
||||||
settings.sync();
|
|
||||||
// show additional message
|
|
||||||
- return settings.status() == QSettings::NoError;
|
|
||||||
+ switch (settings.status()) {
|
|
||||||
+ case QSettings::NoError:
|
|
||||||
+ QMessageBox::information(
|
|
||||||
+ nullptr, i18n("Success"),
|
|
||||||
+ i18n("Please note that binary files were not copied"));
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ QMessageBox::critical(nullptr, i18n("Ooops..."),
|
|
||||||
+ i18n("Could not save configuration file"));
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
|
||||||
- const bool importPlasmoid,
|
|
||||||
- const bool importExtensions,
|
|
||||||
- const bool importAdds) const
|
|
||||||
+QVariantMap AWConfigHelper::importConfiguration() const
|
|
||||||
{
|
|
||||||
- qCDebug(LOG_AW) << "Selected filename" << fileName;
|
|
||||||
-
|
|
||||||
QVariantMap configuration;
|
|
||||||
+ // get file path and init settings object
|
|
||||||
+ QString fileName = QFileDialog::getOpenFileName(nullptr, i18n("Import"));
|
|
||||||
+ if (fileName.isEmpty())
|
|
||||||
+ return configuration;
|
|
||||||
+ qCInfo(LOG_AW) << "Selected filename" << fileName;
|
|
||||||
QSettings settings(fileName, QSettings::IniFormat);
|
|
||||||
+ QHash<QString, bool> selection = selectImport();
|
|
||||||
|
|
||||||
// extensions
|
|
||||||
- if (importExtensions) {
|
|
||||||
+ if (selection[QString("extensions")]) {
|
|
||||||
for (auto item : m_dirs) {
|
|
||||||
settings.beginGroup(item);
|
|
||||||
for (auto it : settings.childGroups())
|
|
||||||
@@ -121,7 +139,7 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
|
||||||
}
|
|
||||||
|
|
||||||
// additional files
|
|
||||||
- if (importAdds) {
|
|
||||||
+ if (selection[QString("adds")]) {
|
|
||||||
settings.beginGroup(QString("json"));
|
|
||||||
// script filters
|
|
||||||
writeFile(settings, QString("filters"),
|
|
||||||
@@ -135,7 +153,7 @@ QVariantMap AWConfigHelper::importConfiguration(const QString fileName,
|
|
||||||
}
|
|
||||||
|
|
||||||
// plasmoid configuration
|
|
||||||
- if (importPlasmoid) {
|
|
||||||
+ if (selection[QString("plasmoid")]) {
|
|
||||||
settings.beginGroup(QString("plasmoid"));
|
|
||||||
for (auto key : settings.childKeys())
|
|
||||||
configuration[key] = settings.value(key);
|
|
||||||
@@ -261,6 +279,50 @@ void AWConfigHelper::readFile(QSettings &settings, const QString key,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+QHash<QString, bool> AWConfigHelper::selectImport() const
|
|
||||||
+{
|
|
||||||
+ QDialog *dialog = new QDialog(nullptr);
|
|
||||||
+ QCheckBox *importPlasmoidSettings
|
|
||||||
+ = new QCheckBox(i18n("Import plasmoid settings"), dialog);
|
|
||||||
+ importPlasmoidSettings->setChecked(true);
|
|
||||||
+ QCheckBox *importExtensionsSettings
|
|
||||||
+ = new QCheckBox(i18n("Import extensions"), dialog);
|
|
||||||
+ importExtensionsSettings->setChecked(true);
|
|
||||||
+ QCheckBox *importAddsSettings
|
|
||||||
+ = new QCheckBox(i18n("Import additional files"), dialog);
|
|
||||||
+ importAddsSettings->setChecked(true);
|
|
||||||
+ QDialogButtonBox *dialogButtons
|
|
||||||
+ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
|
|
||||||
+ Qt::Horizontal, dialog);
|
|
||||||
+ QVBoxLayout *layout = new QVBoxLayout(dialog);
|
|
||||||
+ layout->addWidget(importPlasmoidSettings);
|
|
||||||
+ layout->addWidget(importExtensionsSettings);
|
|
||||||
+ layout->addWidget(importAddsSettings);
|
|
||||||
+ layout->addWidget(dialogButtons);
|
|
||||||
+ connect(dialogButtons, SIGNAL(accepted()), dialog, SLOT(accept()));
|
|
||||||
+ connect(dialogButtons, SIGNAL(rejected()), dialog, SLOT(reject()));
|
|
||||||
+
|
|
||||||
+ // get parameters
|
|
||||||
+ QHash<QString, bool> import;
|
|
||||||
+ import[QString("plasmoid")] = false;
|
|
||||||
+ import[QString("extensions")] = false;
|
|
||||||
+ import[QString("adds")] = false;
|
|
||||||
+ switch (dialog->exec()) {
|
|
||||||
+ case QDialog::Accepted:
|
|
||||||
+ import[QString("plasmoid")] = importPlasmoidSettings->isChecked();
|
|
||||||
+ import[QString("extensions")] = importExtensionsSettings->isChecked();
|
|
||||||
+ import[QString("adds")] = importAddsSettings->isChecked();
|
|
||||||
+ break;
|
|
||||||
+ case QDialog::Rejected:
|
|
||||||
+ default:
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ dialog->deleteLater();
|
|
||||||
+
|
|
||||||
+ return import;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
void AWConfigHelper::writeFile(QSettings &settings, const QString key,
|
|
||||||
const QString fileName) const
|
|
||||||
{
|
|
||||||
diff --git a/sources/awesome-widget/plugin/awconfighelper.h b/sources/awesome-widget/plugin/awconfighelper.h
|
|
||||||
index 912ac3d..dc51dfb 100644
|
|
||||||
--- a/sources/awesome-widget/plugin/awconfighelper.h
|
|
||||||
+++ b/sources/awesome-widget/plugin/awconfighelper.h
|
|
||||||
@@ -33,13 +33,9 @@ public:
|
|
||||||
explicit AWConfigHelper(QObject *parent = nullptr);
|
|
||||||
virtual ~AWConfigHelper();
|
|
||||||
Q_INVOKABLE QString configurationDirectory() const;
|
|
||||||
Q_INVOKABLE bool dropCache() const;
|
|
||||||
- Q_INVOKABLE bool exportConfiguration(const QObject *nativeConfig,
|
|
||||||
- const QString fileName) const;
|
|
||||||
- Q_INVOKABLE QVariantMap importConfiguration(const QString fileName,
|
|
||||||
- const bool importPlasmoid,
|
|
||||||
- const bool importExtensions,
|
|
||||||
- const bool importAdds) const;
|
|
||||||
+ Q_INVOKABLE void exportConfiguration(const QObject *nativeConfig) const;
|
|
||||||
+ Q_INVOKABLE QVariantMap importConfiguration() const;
|
|
||||||
// dataengine
|
|
||||||
Q_INVOKABLE QVariantMap readDataEngineConfiguration() const;
|
|
||||||
Q_INVOKABLE bool
|
|
||||||
@@ -51,6 +47,7 @@ private:
|
|
||||||
void copySettings(QSettings &from, QSettings &to) const;
|
|
||||||
void readFile(QSettings &settings, const QString key,
|
|
||||||
const QString fileName) const;
|
|
||||||
+ QHash<QString, bool> selectImport() const;
|
|
||||||
void writeFile(QSettings &settings, const QString key,
|
|
||||||
const QString fileName) const;
|
|
||||||
// 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,14 @@ QStringList AWKeys::getHddDevices() const
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+#include <QInputDialog>
|
|
||||||
+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 info for 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/awdebug.cpp b/sources/awdebug.cpp
|
|
||||||
index eee61e1..9da8dad 100644
|
|
||||||
--- a/sources/awdebug.cpp
|
|
||||||
+++ b/sources/awdebug.cpp
|
|
||||||
@@ -20,15 +20,11 @@
|
|
||||||
#include "awdebug.h"
|
|
||||||
|
|
||||||
|
|
||||||
-Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget",
|
|
||||||
- QtMsgType::QtWarningMsg)
|
|
||||||
-Q_LOGGING_CATEGORY(LOG_DP, "org.kde.plasma.desktoppanel",
|
|
||||||
- QtMsgType::QtWarningMsg)
|
|
||||||
-Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmon", QtMsgType::QtWarningMsg)
|
|
||||||
-Q_LOGGING_CATEGORY(LOG_ESS, "org.kde.plasma.extsysmonsources",
|
|
||||||
- QtMsgType::QtWarningMsg)
|
|
||||||
-Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets",
|
|
||||||
- QtMsgType::QtWarningMsg)
|
|
||||||
+Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget")
|
|
||||||
+Q_LOGGING_CATEGORY(LOG_DP, "org.kde.plasma.desktoppanel")
|
|
||||||
+Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmon")
|
|
||||||
+Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmonsources")
|
|
||||||
+Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets")
|
|
||||||
|
|
||||||
|
|
||||||
const QStringList getBuildData()
|
|
||||||
diff --git a/sources/awesome-widget/plugin/awkeys.cpp b/sources/awesome-widget/plugin/awkeys.cpp
|
|
||||||
index e5b9861..eb73073 100644
|
|
||||||
--- a/sources/awesome-widget/plugin/awkeys.cpp
|
|
||||||
+++ b/sources/awesome-widget/plugin/awkeys.cpp
|
|
||||||
@@ -439,4 +439,4 @@ void AWKeys::dataUpdated(const QString &sourceName,
|
|
||||||
{
|
|
||||||
// run concurrent data update
|
|
||||||
- QtConcurrent::run(m_threadPool, this, &AWKeys::setDataBySource, sourceName,
|
|
||||||
+ QtConcurrent::run(this, &AWKeys::setDataBySource, sourceName,
|
|
||||||
data);
|
|
||||||
diff --git a/sources/libraries.cmake b/sources/libraries.cmake
|
|
||||||
index 33192f7..46e2b1e 100644
|
|
||||||
--- a/sources/libraries.cmake
|
|
||||||
+++ b/sources/libraries.cmake
|
|
||||||
@@ -2,7 +2,7 @@
|
|
||||||
find_package(Gettext REQUIRED)
|
|
||||||
|
|
||||||
# main qt libraries
|
|
||||||
-find_package(Qt5 5.4.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets)
|
|
||||||
+find_package(Qt5 5.3.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets)
|
|
||||||
add_definitions(
|
|
||||||
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Network_DEFINITIONS}
|
|
||||||
${Qt5Qml_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}
|
|
@ -1,5 +1,25 @@
|
|||||||
|
diff --git a/sources/awdebug.h b/sources/awdebug.h
|
||||||
|
index 8447c65..9f8e298 100644
|
||||||
|
--- a/sources/awdebug.h
|
||||||
|
+++ b/sources/awdebug.h
|
||||||
|
@@ -23,10 +23,14 @@
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
+#ifndef qCInfo
|
||||||
|
+#define qCInfo qCDebug
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
namespace AWDebug
|
||||||
|
{
|
||||||
|
const char LOG_FORMAT[] = "[%{time "
|
||||||
|
- "process}][%{if-debug}DD%{endif}%{if-info}II%{endif}%"
|
||||||
|
+ "process}][%{if-debug}DD%{endif}%"
|
||||||
|
"{if-warning}WW%{endif}%{if-critical}CC%{endif}%{if-"
|
||||||
|
"fatal}FF%{endif}][%{category}][%{function}] "
|
||||||
|
"%{message}";
|
||||||
diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h
|
diff --git a/sources/awesome-widget/plugin/awkeysaggregator.h b/sources/awesome-widget/plugin/awkeysaggregator.h
|
||||||
index f808d03..a056b3f 100644
|
index d29672e..f15a729 100644
|
||||||
--- a/sources/awesome-widget/plugin/awkeysaggregator.h
|
--- a/sources/awesome-widget/plugin/awkeysaggregator.h
|
||||||
+++ b/sources/awesome-widget/plugin/awkeysaggregator.h
|
+++ b/sources/awesome-widget/plugin/awkeysaggregator.h
|
||||||
@@ -21,6 +21,7 @@
|
@@ -21,6 +21,7 @@
|
||||||
@ -10,22 +30,3 @@ index f808d03..a056b3f 100644
|
|||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
diff --git a/sources/awdebug.h b/sources/awdebug.h
|
|
||||||
index 43944ce..c679281 100644
|
|
||||||
--- a/sources/awdebug.h
|
|
||||||
+++ b/sources/awdebug.h
|
|
||||||
@@ -21,9 +21,13 @@
|
|
||||||
|
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
+#ifndef qCInfo
|
|
||||||
+#define qCInfo qCDebug
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#ifndef LOG_FORMAT
|
|
||||||
#define LOG_FORMAT \
|
|
||||||
- "[%{time process}][%{if-debug}DD%{endif}%{if-info}II%{endif}%{if-" \
|
|
||||||
+ "[%{time process}][%{if-debug}DD%{endif}%{if-" \
|
|
||||||
"warning}WW%{endif}%{if-critical}CC%{endif}%{if-fatal}FF%{endif}][%{" \
|
|
||||||
"category}][%{function}] %{message}"
|
|
||||||
#endif /* LOG_FORMAT */
|
|
||||||
|
@ -1,69 +1,60 @@
|
|||||||
diff --git a/sources/awesome-widget/plugin/awupdatehelper.cpp b/sources/awesome-widget/plugin/awupdatehelper.cpp
|
diff --git a/sources/awesome-widget/plugin/awupdatehelper.cpp b/sources/awesome-widget/plugin/awupdatehelper.cpp
|
||||||
index 3698602..42871c8 100644
|
index f6b5338..b5a3163 100644
|
||||||
--- a/sources/awesome-widget/plugin/awupdatehelper.cpp
|
--- a/sources/awesome-widget/plugin/awupdatehelper.cpp
|
||||||
+++ b/sources/awesome-widget/plugin/awupdatehelper.cpp
|
+++ b/sources/awesome-widget/plugin/awupdatehelper.cpp
|
||||||
@@ -37,7 +37,7 @@ AWUpdateHelper::AWUpdateHelper(QObject *parent)
|
@@ -35,7 +35,7 @@ AWUpdateHelper::AWUpdateHelper(QObject *_parent)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_AW) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
- m_foundVersion = QVersionNumber::fromString(VERSION);
|
- m_foundVersion = QVersionNumber::fromString(VERSION);
|
||||||
+ m_foundVersion = QString(VERSION);
|
+ m_foundVersion = VERSION;
|
||||||
m_genericConfig = QString("%1/awesomewidgets/general.ini")
|
m_genericConfig = QString("%1/awesomewidgets/general.ini")
|
||||||
.arg(QStandardPaths::writableLocation(
|
.arg(QStandardPaths::writableLocation(
|
||||||
QStandardPaths::GenericDataLocation));
|
QStandardPaths::GenericDataLocation));
|
||||||
@@ -69,15 +69,15 @@ void AWUpdateHelper::checkUpdates(const bool showAnyway)
|
@@ -67,8 +67,7 @@ void AWUpdateHelper::checkUpdates(const bool _showAnyway)
|
||||||
bool AWUpdateHelper::checkVersion()
|
bool AWUpdateHelper::checkVersion()
|
||||||
{
|
{
|
||||||
QSettings settings(m_genericConfig, QSettings::IniFormat);
|
QSettings settings(m_genericConfig, QSettings::IniFormat);
|
||||||
- QVersionNumber version = QVersionNumber::fromString(
|
- QVersionNumber version = QVersionNumber::fromString(
|
||||||
- settings.value(QString("Version"), QString(VERSION)).toString());
|
- settings.value("Version", QString(VERSION)).toString());
|
||||||
+ QString version
|
+ QString version = settings.value("Version", VERSION).toString();
|
||||||
+ = settings.value(QString("Version"), QString(VERSION)).toString();
|
|
||||||
// update version
|
// update version
|
||||||
settings.setValue(QString("Version"), QString(VERSION));
|
settings.setValue("Version", QString(VERSION));
|
||||||
settings.sync();
|
settings.sync();
|
||||||
qCInfo(LOG_AW) << "Found version" << version << "actual one is"
|
@@ -91,12 +90,11 @@ bool AWUpdateHelper::checkVersion()
|
||||||
<< m_foundVersion;
|
|
||||||
|
|
||||||
- if ((version != m_foundVersion) && (!QString(CHANGELOG).isEmpty())) {
|
|
||||||
+ if ((version != QString(VERSION)) && (!QString(CHANGELOG).isEmpty())) {
|
|
||||||
genMessageBox(i18n("Changelog of %1", QString(VERSION)),
|
|
||||||
QString(CHANGELOG).replace(QChar('@'), QChar('\n')),
|
|
||||||
QMessageBox::Ok)
|
|
||||||
@@ -90,12 +90,11 @@ bool AWUpdateHelper::checkVersion()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-void AWUpdateHelper::showInfo(const QVersionNumber version)
|
-void AWUpdateHelper::showInfo(const QVersionNumber &_version)
|
||||||
+void AWUpdateHelper::showInfo(const QString version)
|
+void AWUpdateHelper::showInfo(const QString &_version)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Version" << version;
|
qCDebug(LOG_AW) << "Version" << _version;
|
||||||
|
|
||||||
- QString text
|
- QString text
|
||||||
- = i18n("You are using the actual version %1", version.toString());
|
- = i18n("You are using the actual version %1", _version.toString());
|
||||||
+ QString text = i18n("You are using the actual version %1", version);
|
+ QString text = i18n("You are using the actual version %1", _version);
|
||||||
if (!QString(COMMIT_SHA).isEmpty())
|
if (!QString(COMMIT_SHA).isEmpty())
|
||||||
text += QString(" (%1)").arg(QString(COMMIT_SHA));
|
text += QString(" (%1)").arg(QString(COMMIT_SHA));
|
||||||
return genMessageBox(i18n("No new version found"), text, QMessageBox::Ok)
|
return genMessageBox(i18n("No new version found"), text, QMessageBox::Ok)
|
||||||
@@ -103,7 +102,7 @@ void AWUpdateHelper::showInfo(const QVersionNumber version)
|
@@ -104,7 +102,7 @@ void AWUpdateHelper::showInfo(const QVersionNumber &_version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-void AWUpdateHelper::showUpdates(const QVersionNumber version)
|
-void AWUpdateHelper::showUpdates(const QVersionNumber &_version)
|
||||||
+void AWUpdateHelper::showUpdates(const QString version)
|
+void AWUpdateHelper::showUpdates(const QString &_version)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Version" << version;
|
qCDebug(LOG_AW) << "Version" << _version;
|
||||||
|
|
||||||
@@ -112,7 +111,7 @@ void AWUpdateHelper::showUpdates(const QVersionNumber version)
|
@@ -113,7 +111,7 @@ void AWUpdateHelper::showUpdates(const QVersionNumber &_version)
|
||||||
text += QString(COMMIT_SHA).isEmpty()
|
text += QString(COMMIT_SHA).isEmpty()
|
||||||
? QString("\n")
|
? "\n"
|
||||||
: QString(" (%1)\n").arg(QString(COMMIT_SHA));
|
: QString(" (%1)\n").arg(QString(COMMIT_SHA));
|
||||||
- text += i18n("New version : %1", version.toString()) + QString("\n\n");
|
- text += i18n("New version : %1", _version.toString()) + "\n\n";
|
||||||
+ text += i18n("New version : %1", version) + QString("\n\n");
|
+ text += i18n("New version : %1", _version) + "\n\n";
|
||||||
text += i18n("Click \"Ok\" to download");
|
text += i18n("Click \"Ok\" to download");
|
||||||
|
|
||||||
genMessageBox(i18n("There are updates"), text,
|
genMessageBox(i18n("There are updates"), text,
|
||||||
@@ -128,8 +127,7 @@ void AWUpdateHelper::userReplyOnUpdates(QAbstractButton *button)
|
@@ -130,8 +128,7 @@ void AWUpdateHelper::userReplyOnUpdates(QAbstractButton *_button)
|
||||||
|
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case QMessageBox::AcceptRole:
|
case QMessageBox::AcceptRole:
|
||||||
@ -73,10 +64,10 @@ index 3698602..42871c8 100644
|
|||||||
break;
|
break;
|
||||||
case QMessageBox::RejectRole:
|
case QMessageBox::RejectRole:
|
||||||
default:
|
default:
|
||||||
@@ -157,14 +155,23 @@ void AWUpdateHelper::versionReplyRecieved(QNetworkReply *reply,
|
@@ -162,14 +159,23 @@ void AWUpdateHelper::versionReplyRecieved(QNetworkReply *_reply,
|
||||||
QVariantMap firstRelease = jsonDoc.toVariant().toList().first().toMap();
|
QVariantMap firstRelease = jsonDoc.toVariant().toList().first().toMap();
|
||||||
QString version = firstRelease[QString("tag_name")].toString();
|
QString version = firstRelease["tag_name"].toString();
|
||||||
version.remove(QString("V."));
|
version.remove("V.");
|
||||||
- m_foundVersion = QVersionNumber::fromString(version);
|
- m_foundVersion = QVersionNumber::fromString(version);
|
||||||
+ m_foundVersion = version;
|
+ m_foundVersion = version;
|
||||||
qCInfo(LOG_AW) << "Update found version to" << m_foundVersion;
|
qCInfo(LOG_AW) << "Update found version to" << m_foundVersion;
|
||||||
@ -96,14 +87,14 @@ index 3698602..42871c8 100644
|
|||||||
+ || ((old_major == new_major) && (old_minor == new_minor)
|
+ || ((old_major == new_major) && (old_minor == new_minor)
|
||||||
+ && (old_patch < new_patch)))
|
+ && (old_patch < new_patch)))
|
||||||
+ return showUpdates(version);
|
+ return showUpdates(version);
|
||||||
else if (showAnyway)
|
else if (_showAnyway)
|
||||||
- return showInfo(m_foundVersion);
|
- return showInfo(m_foundVersion);
|
||||||
+ return showInfo(version);
|
+ return showInfo(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
diff --git a/sources/awesome-widget/plugin/awupdatehelper.h b/sources/awesome-widget/plugin/awupdatehelper.h
|
diff --git a/sources/awesome-widget/plugin/awupdatehelper.h b/sources/awesome-widget/plugin/awupdatehelper.h
|
||||||
index 359cdb2..9c6a42d 100644
|
index cfd26e7..b311be2 100644
|
||||||
--- a/sources/awesome-widget/plugin/awupdatehelper.h
|
--- a/sources/awesome-widget/plugin/awupdatehelper.h
|
||||||
+++ b/sources/awesome-widget/plugin/awupdatehelper.h
|
+++ b/sources/awesome-widget/plugin/awupdatehelper.h
|
||||||
@@ -21,7 +21,6 @@
|
@@ -21,7 +21,6 @@
|
||||||
@ -118,23 +109,23 @@ index 359cdb2..9c6a42d 100644
|
|||||||
bool checkVersion();
|
bool checkVersion();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
- void showInfo(const QVersionNumber version);
|
- void showInfo(const QVersionNumber &_version);
|
||||||
- void showUpdates(const QVersionNumber version);
|
- void showUpdates(const QVersionNumber &_version);
|
||||||
+ void showInfo(const QString version);
|
+ void showInfo(const QString &_version);
|
||||||
+ void showUpdates(const QString version);
|
+ void showUpdates(const QString &_version);
|
||||||
void userReplyOnUpdates(QAbstractButton *button);
|
void userReplyOnUpdates(QAbstractButton *_button);
|
||||||
void versionReplyRecieved(QNetworkReply *reply, const bool showAnyway);
|
void versionReplyRecieved(QNetworkReply *_reply, const bool _showAnyway);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMessageBox *genMessageBox(const QString title, const QString body,
|
QMessageBox *genMessageBox(const QString &_title, const QString &_body,
|
||||||
const QMessageBox::StandardButtons buttons);
|
const QMessageBox::StandardButtons _buttons);
|
||||||
- QVersionNumber m_foundVersion;
|
- QVersionNumber m_foundVersion;
|
||||||
+ QString m_foundVersion;
|
+ QString m_foundVersion;
|
||||||
QString m_genericConfig;
|
QString m_genericConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
diff --git a/sources/libraries.cmake b/sources/libraries.cmake
|
diff --git a/sources/libraries.cmake b/sources/libraries.cmake
|
||||||
index 33192f7..339bb58 100644
|
index 6f171a6..004b39f 100644
|
||||||
--- a/sources/libraries.cmake
|
--- a/sources/libraries.cmake
|
||||||
+++ b/sources/libraries.cmake
|
+++ b/sources/libraries.cmake
|
||||||
@@ -2,7 +2,7 @@
|
@@ -2,7 +2,7 @@
|
||||||
@ -142,7 +133,7 @@ index 33192f7..339bb58 100644
|
|||||||
|
|
||||||
# main qt libraries
|
# main qt libraries
|
||||||
-find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets)
|
-find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets)
|
||||||
+find_package(Qt5 5.4.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets)
|
+find_package(Qt5 5.5.0 REQUIRED COMPONENTS Core DBus Network Qml Test Widgets)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Network_DEFINITIONS}
|
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Network_DEFINITIONS}
|
||||||
${Qt5Qml_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}
|
${Qt5Qml_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}
|
||||||
|
Loading…
Reference in New Issue
Block a user