diff --git a/sources/awesome-widget/package/contents/ui/qmldir b/sources/awesome-widget/package/contents/ui/qmldir index 818951c..bfadc01 100644 --- a/sources/awesome-widget/package/contents/ui/qmldir +++ b/sources/awesome-widget/package/contents/ui/qmldir @@ -8,6 +8,7 @@ singleton general 1.0 file:///usr/share/awesomewidgets/qml/general.qml # custom QML UI classes AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml AWExtensions file:///usr/share/awesomewidgets/qml/AWExtensions.qml +AWInfoLabel file:///usr/share/awesomewidgets/qml/AWInfoLabel.qml AWTagSelector file:///usr/share/awesomewidgets/qml/AWTagSelector.qml BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml ButtonSelector file:///usr/share/awesomewidgets/qml/ButtonSelector.qml diff --git a/sources/awesome-widget/package/contents/ui/widget.qml b/sources/awesome-widget/package/contents/ui/widget.qml index e0f3086..9692e27 100644 --- a/sources/awesome-widget/package/contents/ui/widget.qml +++ b/sources/awesome-widget/package/contents/ui/widget.qml @@ -17,7 +17,6 @@ import QtQuick 2.2 import QtQuick.Controls 1.3 as QtControls -import QtQuick.Dialogs 1.2 as QtDialogs import org.kde.plasma.private.awesomewidget 1.0 import "." @@ -53,14 +52,7 @@ Item { id: pageColumn anchors.fill: parent - QtControls.Label { - width: parent.width - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - wrapMode: Text.WordWrap - text: i18n("Detailed information may be found on project homepage") - onLinkActivated: Qt.openUrlExternally(link) - } + AWInfoLabel {} HtmlDefaultFunctionsBar { textArea: textPattern @@ -74,6 +66,7 @@ Item { } AWExtensions { + id: extensions backend: awKeys textArea: textPattern onUnlock: lock = false @@ -88,12 +81,6 @@ Item { } } - QtDialogs.MessageDialog { - id: compiledText - modality: Qt.NonModal - title: i18n("Preview") - } - Component.onCompleted: { if (debug) console.debug() @@ -114,8 +101,7 @@ Item { if (lock) return if (debug) console.debug() - compiledText.text = newText.replace(" ", " ") - compiledText.open() + extensions.showMessage(newText) lock = true } } diff --git a/sources/desktop-panel/package/contents/ui/qmldir b/sources/desktop-panel/package/contents/ui/qmldir index 818951c..bfadc01 100644 --- a/sources/desktop-panel/package/contents/ui/qmldir +++ b/sources/desktop-panel/package/contents/ui/qmldir @@ -8,6 +8,7 @@ singleton general 1.0 file:///usr/share/awesomewidgets/qml/general.qml # custom QML UI classes AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml AWExtensions file:///usr/share/awesomewidgets/qml/AWExtensions.qml +AWInfoLabel file:///usr/share/awesomewidgets/qml/AWInfoLabel.qml AWTagSelector file:///usr/share/awesomewidgets/qml/AWTagSelector.qml BugReport file:///usr/share/awesomewidgets/qml/BugReport.qml ButtonSelector file:///usr/share/awesomewidgets/qml/ButtonSelector.qml diff --git a/sources/qml/AWExtensions.qml b/sources/qml/AWExtensions.qml index 1d8d477..29afbff 100644 --- a/sources/qml/AWExtensions.qml +++ b/sources/qml/AWExtensions.qml @@ -17,6 +17,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.3 as QtControls +import QtQuick.Dialogs 1.2 as QtDialogs import org.kde.plasma.private.awesomewidget 1.0 @@ -34,6 +35,7 @@ Row { property var textArea signal unlock + signal showMessage(string message) QtControls.Button { width: parent.width * 3 / 10 @@ -73,4 +75,15 @@ Row { } } } + + QtDialogs.MessageDialog { + id: compiledText + modality: Qt.NonModal + title: i18n("Preview") + } + + onShowMessage: { + compiledText.text = message.replace(" ", " ") + compiledText.open() + } } diff --git a/sources/qml/AWInfoLabel.qml b/sources/qml/AWInfoLabel.qml new file mode 100644 index 0000000..7e8d16e --- /dev/null +++ b/sources/qml/AWInfoLabel.qml @@ -0,0 +1,29 @@ +/*************************************************************************** + * This file is part of awesome-widgets * + * * + * awesome-widgets is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * awesome-widgets is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with awesome-widgets. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +import QtQuick 2.2 +import QtQuick.Controls 1.3 as QtControls + + +QtControls.Label { + width: parent.width + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + wrapMode: Text.WordWrap + text: i18n("Detailed information may be found on project homepage") + onLinkActivated: Qt.openUrlExternally(link) +} diff --git a/sources/qml/qmldir.in b/sources/qml/qmldir.in index f822584..bb26b2c 100644 --- a/sources/qml/qmldir.in +++ b/sources/qml/qmldir.in @@ -8,6 +8,7 @@ singleton general 1.0 file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_ # custom QML UI classes AboutTab file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AboutTab.qml AWExtensions file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AWExtensions.qml +AWInfoLabel file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AWInfoLabel.qml AWTagSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AWTagSelector.qml BugReport file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/BugReport.qml ButtonSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/ButtonSelector.qml