initial plasma6 support

This commit is contained in:
2024-03-07 12:09:46 +02:00
parent eecb128865
commit 4d01b87088
176 changed files with 2569 additions and 3795 deletions

View File

@ -15,9 +15,9 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs
import QtQuick 2.15
import QtQuick.Controls
import QtQuick.Dialogs
import org.kde.plasma.private.awesomewidget 1.0
@ -40,25 +40,25 @@ Row {
signal unlock
signal showMessage(string message)
QtControls.Button {
Button {
width: parent.width * 3 / 15
text: i18n("Edit bars")
onClicked: backend.editItem("graphicalitem")
}
QtControls.Button {
Button {
width: parent.width * 3 / 15
text: i18n("Formatters")
onClicked: awPairConfig.showFormatterDialog(backend.dictKeys(true))
}
QtControls.Button {
Button {
width: parent.width * 3 / 15
text: i18n("User keys")
onClicked: awPairConfig.showKeysDialog(backend.dictKeys(true))
}
QtControls.Button {
Button {
width: parent.width * 5 / 15
text: i18n("Preview")
onClicked: {
@ -68,30 +68,35 @@ Row {
}
}
QtControls.Button {
Button {
width: parent.width / 15
iconName: "view-history"
menu: QtControls.Menu {
icon.name: "view-history"
onClicked: historyConfig.open()
Menu {
id: historyConfig
Instantiator {
model: awTelemetryHandler.get("awwidgetconfig")
QtControls.MenuItem {
delegate: MenuItem {
text: modelData
onTriggered: textArea.text = modelData
}
onObjectAdded: historyConfig.insertItem(index, object)
onObjectRemoved: historyConfig.removeItem(object)
onObjectAdded: (index, object) => historyConfig.insertItem(index, object)
onObjectRemoved: (index, object) => historyConfig.removeItem(object)
}
}
}
QtDialogs.MessageDialog {
MessageDialog {
id: compiledText
modality: Qt.NonModal
title: i18n("Preview")
}
onShowMessage: {
onShowMessage: message => {
compiledText.text = message.split(" ").join(" ") // replaceAll lols
compiledText.open()
}

View File

@ -15,15 +15,17 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
QtControls.Label {
Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Detailed information may be found on <a href=\"https://arcanis.me/projects/awesome-widgets/\">project homepage</a>")
onLinkActivated: Qt.openUrlExternally(link)
}

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Row {
@ -30,7 +30,7 @@ Row {
property var textArea
property alias groups: tagGroups.model
QtControls.ComboBox {
ComboBox {
id: tagGroups
width: parent.width * 2 / 5
textRole: "label"
@ -41,12 +41,12 @@ Row {
}
}
QtControls.ComboBox {
ComboBox {
id: tags
width: parent.width * 1 / 5
}
QtControls.Button {
Button {
width: parent.width * 1 / 5
text: i18n("Add")
@ -57,7 +57,7 @@ Row {
}
}
QtControls.Button {
Button {
width: parent.width * 1 / 5
text: i18n("Show value")

View File

@ -15,20 +15,19 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Item {
ScrollView {
width: parent.width
height: parent.height * 4 / 5
property var backend
property alias text: textArea.text
QtControls.TextArea {
TextArea {
id: textArea
anchors.fill: parent
textFormat: TextEdit.PlainText
Column {
@ -50,9 +49,9 @@ Item {
}
onTextChanged: {
var currentTag = getLastTag()
let currentTag = getLastTag()
// exit if there are spaces or empty
if ((currentTag.indexOf(" ") != -1) || (currentTag.length == 0)) {
if ((currentTag.indexOf(" ") !== -1) || (currentTag.length === 0)) {
tooltip.visible = false
return
}
@ -63,7 +62,7 @@ Item {
// show tooltip if found more than 1 or current text does not match
// tag found
tooltip.visible = ((tags.count > 1)
|| ((tags.count == 1) && (tags.model[0] != tooltip.substring)))
|| ((tags.count === 1) && (tags.model[0] !== tooltip.substring)))
}
}
@ -78,10 +77,10 @@ Item {
function getLastTag() {
// get substring to analyze
var substring = textArea.getText(0, textArea.cursorPosition)
const substring = textArea.getText(0, textArea.cursorPosition)
// find last position of index in the given substring
var signIndex = substring.lastIndexOf('$') + 1
if ((signIndex == 0) || (signIndex == textArea.cursorPosition))
const signIndex = substring.lastIndexOf("$") + 1
if ((signIndex === 0) || (signIndex === textArea.cursorPosition))
return ""
// get current tag text
return substring.substr(signIndex)

View File

@ -15,77 +15,79 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Layouts 1.0 as QtLayouts
import QtQuick 2.15
import QtQuick.Controls
import QtQuick.Layouts
Column {
ColumnLayout {
anchors.fill: parent
property var textProvider
QtControls.TabView {
height: parent.height
TabBar {
id: bar
width: parent.width
TabButton {
text: i18n("About")
}
TabButton {
text: i18n("Acknowledgment")
}
}
QtControls.Tab {
anchors.margins: 10.0
title: i18n("About")
StackLayout {
width: parent.width
currentIndex: bar.currentIndex
QtLayouts.ColumnLayout {
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: textProvider.getAboutText("header")
}
ColumnLayout {
Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: textProvider.getAboutText("header")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: textProvider.getAboutText("version")
}
Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: textProvider.getAboutText("version")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
text: textProvider.getAboutText("description")
}
Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
text: textProvider.getAboutText("description")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
textFormat: Text.RichText
text: textProvider.getAboutText("links")
onLinkActivated: Qt.openUrlExternally(link)
}
Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
textFormat: Text.RichText
text: textProvider.getAboutText("links")
onLinkActivated: Qt.openUrlExternally(link)
}
QtControls.Label {
QtLayouts.Layout.fillHeight: true
QtLayouts.Layout.fillWidth: true
font.capitalization: Font.SmallCaps
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
textFormat: Text.RichText
text: textProvider.getAboutText("copy")
}
Label {
Layout.fillHeight: true
Layout.fillWidth: true
font.capitalization: Font.SmallCaps
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
textFormat: Text.RichText
text: textProvider.getAboutText("copy")
}
}
QtControls.Tab {
anchors.margins: 10.0
title: i18n("Acknowledgment")
QtLayouts.ColumnLayout {
QtControls.Label {
QtLayouts.Layout.fillWidth: true
ColumnLayout {
Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignJustify
text: textProvider.getAboutText("translators")
}
QtControls.Label {
QtLayouts.Layout.fillWidth: true
Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignJustify
textFormat: Text.RichText
@ -93,9 +95,9 @@ Column {
onLinkActivated: Qt.openUrlExternally(link)
}
QtControls.Label {
QtLayouts.Layout.fillHeight: true
QtLayouts.Layout.fillWidth: true
Label {
Layout.fillHeight: true
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignJustify
verticalAlignment: Text.AlignTop
@ -104,6 +106,5 @@ Column {
onLinkActivated: Qt.openUrlExternally(link)
}
}
}
}
}

View File

@ -15,15 +15,15 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs
import QtQuick.Layouts 1.2 as QtLayouts
import QtQuick 2.15
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
import org.kde.plasma.private.awesomewidget 1.0
QtDialogs.Dialog {
Dialog {
id: reportDialog
AWActions {
id: awActions
@ -34,89 +34,100 @@ QtDialogs.Dialog {
width: 640
height: 480
property bool debug: awActions.isDebugEnabled()
title: i18n("Report a bug")
standardButtons: QtDialogs.StandardButton.Ok | QtDialogs.StandardButton.Cancel | QtDialogs.StandardButton.Reset
standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel | DialogButtonBox.Reset
QtLayouts.ColumnLayout {
ColumnLayout {
anchors.fill: parent
QtControls.TextField {
TextField {
id: title
QtLayouts.Layout.fillWidth: true
Layout.fillWidth: true
placeholderText: i18n("Report subject")
}
QtLayouts.ColumnLayout {
QtLayouts.Layout.fillWidth: true
QtControls.GroupBox {
QtLayouts.Layout.fillWidth: true
ColumnLayout {
Layout.fillWidth: true
GroupBox {
Layout.fillWidth: true
height: parent.height / 5
title: i18n("Description")
QtControls.TextArea {
TextArea {
id: description
anchors.fill: parent
textFormat: TextEdit.PlainText
}
}
QtControls.GroupBox {
QtLayouts.Layout.fillWidth: true
GroupBox {
Layout.fillWidth: true
height: parent.height / 5
title: i18n("Steps to reproduce")
QtControls.TextArea {
TextArea {
id: reproduce
anchors.fill: parent
textFormat: TextEdit.PlainText
}
}
QtControls.GroupBox {
QtLayouts.Layout.fillWidth: true
GroupBox {
Layout.fillWidth: true
height: parent.height / 5
title: i18n("Expected result")
QtControls.TextArea {
TextArea {
id: expected
anchors.fill: parent
textFormat: TextEdit.PlainText
}
}
QtControls.GroupBox {
QtLayouts.Layout.fillWidth: true
QtLayouts.Layout.alignment: Qt.AlignBottom
GroupBox {
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
title: i18n("Logs")
QtLayouts.ColumnLayout {
ColumnLayout {
anchors.fill: parent
QtLayouts.Layout.fillWidth: true
Layout.fillWidth: true
Row {
QtLayouts.Layout.fillWidth: true
QtControls.Label {
Layout.fillWidth: true
Label {
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignJustify
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Use command")
}
QtControls.TextField {
TextField {
width: parent.width * 3 / 5
readOnly: true
text: "QT_LOGGING_RULES=*=true plasmawindowed org.kde.plasma.awesomewidget"
}
}
QtControls.Button {
QtLayouts.Layout.fillWidth: true
Button {
Layout.fillWidth: true
text: i18n("Load log file")
onClicked: logPath.open()
}
QtControls.TextArea {
TextArea {
id: logBody
QtLayouts.Layout.fillWidth: true
QtLayouts.Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
textFormat: TextEdit.PlainText
}
}
QtDialogs.FileDialog {
FileDialog {
id: logPath
title: i18n("Open log file")
onAccepted:
@ -127,16 +138,11 @@ QtDialogs.Dialog {
}
onAccepted: {
if (debug) console.debug()
var text = awBugReporter.generateText(description.text, reproduce.text,
expected.text, logBody.text)
const text = awBugReporter.generateText(description.text, reproduce.text, expected.text, logBody.text)
awBugReporter.sendBugReport(title.text, text)
}
onReset: {
if (debug) console.debug()
title.text = ""
description.text = ""
reproduce.text = ""
@ -144,8 +150,6 @@ QtDialogs.Dialog {
}
Component.onCompleted: {
if (debug) console.debug()
awBugReporter.doConnect()
}
}

View File

@ -15,28 +15,29 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Row {
height: implicitHeight
width: parent.width
property alias text: label.text
property alias value: button.text
property alias style: button.style
property alias background: button.background
signal buttonActivated
QtControls.Label {
Label {
id: label
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
QtControls.Button {
Button {
id: button
width: parent.width * 3 / 5
onClicked: buttonActivated()

View File

@ -9,4 +9,4 @@ configure_file(${SUBPROJECT_QMLDIR_IN} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-wi
configure_file(${SUBPROJECT_QMLDIR_IN} ${CMAKE_CURRENT_SOURCE_DIR}/../desktop-panel/package/contents/ui/qmldir)
# install
install(FILES ${SUBPROJECT_SOURCE} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/qml)
install(FILES ${SUBPROJECT_SOURCE} DESTINATION ${KDE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/qml)

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Row {
@ -26,11 +26,12 @@ Row {
property alias text: checkBox.text
property alias checked: checkBox.checked
QtControls.Label {
Label {
height: parent.heigth
width: parent.width * 2 / 5
}
QtControls.CheckBox {
CheckBox {
id: checkBox
width: parent.width * 3 / 5
}

View File

@ -15,32 +15,23 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls.Styles 1.3 as QtStyles
import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick 2.15
import QtQuick.Dialogs
Row {
height: implicitHeight
width: parent.width
property alias text: selector.text
property alias value: selector.value
ButtonSelector {
id: selector
style: QtStyles.ButtonStyle {
background: Rectangle {
color: value
}
}
onButtonActivated: colorDialog.visible = true
ButtonSelector {
background: Rectangle {
implicitWidth: 100
implicitHeight: 25
color: value
}
QtDialogs.ColorDialog {
onButtonActivated: colorDialog.visible = true
ColorDialog {
id: colorDialog
title: i18n("Select a color")
color: value
onAccepted: value = colorDialog.color
selectedColor: value
onAccepted: value = selectedColor
}
}

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Row {
@ -32,22 +32,24 @@ Row {
signal valueEdited(string newValue)
QtControls.Label {
Label {
id: label
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
QtControls.ComboBox {
ComboBox {
id: comboBox
width: parent.width * 3 / 5
textRole: 'label'
onCurrentIndexChanged: valueEdited(comboBox.model[comboBox.currentIndex]['name'])
textRole: "label"
onCurrentIndexChanged: valueEdited(comboBox.model[comboBox.currentIndex]["name"])
Component.onCompleted: {
var total = comboBox.model.length
for (var i = 0; i < total; i++) {
if (comboBox.model[i]["name"] == value)
const total = comboBox.model.length
for (let i = 0; i < total; i++) {
if (comboBox.model[i]["name"] === value)
comboBox.currentIndex = i
}
}

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Dialogs 1.2 as QtDialogs
import QtQuick 2.15
import QtQuick.Dialogs
import org.kde.plasma.private.awesomewidget 1.0
@ -28,18 +28,18 @@ Item {
id: awConfig
}
QtDialogs.MessageDialog {
MessageDialog {
id: messageDialog
standardButtons: QtDialogs.StandardButton.Ok
}
QtDialogs.FileDialog {
FileDialog {
id: fileDialog
selectExisting: false
fileMode: FileDialog.SaveFile
title: i18n("Export")
folder: awConfig.configurationDirectory()
currentFolder: awConfig.configurationDirectory()
onAccepted: {
var status = awConfig.exportConfiguration(
const status = awConfig.exportConfiguration(
configuration,
fileDialog.fileUrl.toString().replace("file://", ""))
if (status) {
@ -52,7 +52,6 @@ Item {
messageDialog.open()
}
}
function open() {
return fileDialog.open()
}

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick 2.15
import QtQuick.Dialogs
Row {
@ -35,15 +35,15 @@ Row {
}
}
QtDialogs.FontDialog {
FontDialog {
id: fontDialog
title: i18n("Select a font")
signal setFont
onAccepted: value = fontDialog.font.family
onAccepted: value = selectedFont.family
onSetFont: {
fontDialog.font = Qt.font({
selectedFont = Qt.font({
family: value,
pointSize: 12,
italic: false,

View File

@ -16,7 +16,10 @@
***************************************************************************/
pragma Singleton
import QtQuick 2.0
import QtQuick 2.15
// required by i18n functions
import org.kde.plasma.core as PlasmaCore
QtObject {

View File

@ -15,7 +15,7 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick 2.15
Row {
@ -30,6 +30,7 @@ Row {
text: i18n("Bgcolor")
textField: textArea
}
HtmlEditorFont {
width: parent.width * 3 / 15
textField: textArea
@ -41,35 +42,39 @@ Row {
// new line
HtmlEditorButton {
width: parent.width / 15
iconName: "format-indent-more"
icon.name: "format-indent-more"
textField: textArea
end: "<br>\n"
}
// font properties
HtmlEditorButton {
width: parent.width / 15
iconName: "format-text-bold"
icon.name: "format-text-bold"
textField: textArea
start: "<b>"
end: "</b>"
}
HtmlEditorButton {
width: parent.width / 15
iconName: "format-text-italic"
icon.name: "format-text-italic"
textField: textArea
start: "<i>"
end: "</i>"
}
HtmlEditorButton {
width: parent.width / 15
iconName: "format-text-underline"
icon.name: "format-text-underline"
textField: textArea
start: "<u>"
end: "</u>"
}
HtmlEditorButton {
width: parent.width / 15
iconName: "format-text-strikethrough"
icon.name: "format-text-strikethrough"
textField: textArea
start: "<s>"
end: "</s>"
@ -78,28 +83,31 @@ Row {
// indentation
HtmlEditorButton {
width: parent.width / 15
iconName: "format-justify-left"
icon.name: "format-justify-left"
textField: textArea
start: "<p align=\"left\">"
end: "</p>"
}
HtmlEditorButton {
width: parent.width / 15
iconName: "format-justify-center"
icon.name: "format-justify-center"
textField: textArea
start: "<p align=\"center\">"
end: "</p>"
}
HtmlEditorButton {
width: parent.width / 15
iconName: "format-justify-right"
icon.name: "format-justify-right"
textField: textArea
start: "<p align=\"right\">"
end: "</p>"
}
HtmlEditorButton {
width: parent.width / 15
iconName: "format-justify-fill"
icon.name: "format-justify-fill"
textField: textArea
start: "<p align=\"justify\">"
end: "</p>"

View File

@ -15,11 +15,11 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
QtControls.Button {
Button {
// parent object in which text will be replaced
property var textField
// start and end tags
@ -31,7 +31,7 @@ QtControls.Button {
function updateText() {
// get selected text
var selected = textField.selectedText()
const selected = textField.selectedText()
// remove it from widget
textField.removeSelection()
// insert edited text

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick 2.15
import QtQuick.Dialogs
HtmlEditorButton {
@ -24,7 +24,7 @@ HtmlEditorButton {
clickedEvent: function() { return colorDialog.open() }
QtDialogs.ColorDialog {
ColorDialog {
id: colorDialog
title: i18n("Select a color")

View File

@ -15,14 +15,14 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.2
import QtQuick 2.15
import org.kde.plasma.private.awesomewidget 1.0
HtmlEditorButton {
end: "</span>"
iconName: "font"
icon.name: "font"
text: i18n("Font")
// backend
@ -36,13 +36,13 @@ HtmlEditorButton {
clickedEvent: function() {
// get new font
var defaultFont = {
const defaultFont = {
"color": defaultFontColor,
"family": defaultFontFamily,
"size": defaultFontSize
}
// we are using custom selector as soon as we need to select color as well
var font = awActions.getFont(defaultFont)
const font = awActions.getFont(defaultFont)
// check status
if (!font.applied)

View File

@ -15,9 +15,9 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs
import QtQuick 2.15
import QtQuick.Controls
import QtQuick.Dialogs
import org.kde.plasma.private.awesomewidget 1.0
@ -29,42 +29,41 @@ Item {
signal configurationReceived(var configuration)
QtDialogs.FileDialog {
FileDialog {
id: fileDialog
title: i18n("Import")
folder: awConfig.configurationDirectory()
currentFolder: awConfig.configurationDirectory()
onAccepted: importSelection.open()
}
QtDialogs.Dialog {
Dialog {
id: importSelection
Column {
QtControls.CheckBox {
CheckBox {
id: importPlasmoid
text: i18n("Import plasmoid settings")
}
QtControls.CheckBox {
CheckBox {
id: importExtensions
text: i18n("Import extensions")
}
QtControls.CheckBox {
CheckBox {
id: importAdds
text: i18n("Import additional files")
}
}
onAccepted: {
var importConfig = awConfig.importConfiguration(
const importConfig = awConfig.importConfiguration(
fileDialog.fileUrl.toString().replace("file://", ""),
importPlasmoid.checked, importExtensions.checked,
importAdds.checked)
configurationReceived(importConfig)
}
}
function open() {
return fileDialog.open()
}

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Row {
@ -26,22 +26,23 @@ Row {
property alias text: label.text
property alias value: spinBox.value
property alias maximumValue: spinBox.maximumValue
property alias minimumValue: spinBox.minimumValue
property alias maximumValue: spinBox.to
property alias minimumValue: spinBox.from
property alias stepSize: spinBox.stepSize
signal valueEdited(int newValue)
QtControls.Label {
Label {
id: label
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
QtControls.SpinBox {
SpinBox {
id: spinBox
width: parent.width * 3 / 5
onEditingFinished: valueEdited(spinBox.value)
onValueModified: valueEdited(spinBox.value)
}
}

View File

@ -15,8 +15,8 @@
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls
import QtQuick 2.15
import QtQuick.Controls
Row {
@ -28,14 +28,15 @@ Row {
signal valueEdited(string newValue)
QtControls.Label {
Label {
id: label
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
QtControls.TextField {
TextField {
id: textField
width: parent.width * 3 / 5
onEditingFinished: valueEdited(textField.text)

View File

@ -3,25 +3,25 @@
# common QML constants
singleton General 1.0 file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/General.qml
singleton General 1.0 file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/General.qml
# 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
AWTextEditor file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AWTextEditor.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
CheckBoxSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/CheckBoxSelector.qml
ColorSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/ColorSelector.qml
ComboBoxSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/ComboBoxSelector.qml
ExportDialog file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/ExportDialog.qml
FontSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/FontSelector.qml
HtmlDefaultFunctionsBar file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/HtmlDefaultFunctionsBar.qml
HtmlEditorButton file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/HtmlEditorButton.qml
HtmlEditorColor file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/HtmlEditorColor.qml
HtmlEditorFont file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/HtmlEditorFont.qml
ImportDialog file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/ImportDialog.qml
IntegerSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/IntegerSelector.qml
LineSelector file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/LineSelector.qml
AboutTab file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AboutTab.qml
AWExtensions file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWExtensions.qml
AWInfoLabel file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWInfoLabel.qml
AWTagSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWTagSelector.qml
AWTextEditor file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/AWTextEditor.qml
BugReport file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/BugReport.qml
ButtonSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ButtonSelector.qml
CheckBoxSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/CheckBoxSelector.qml
ColorSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ColorSelector.qml
ComboBoxSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ComboBoxSelector.qml
ExportDialog file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ExportDialog.qml
FontSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/FontSelector.qml
HtmlDefaultFunctionsBar file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlDefaultFunctionsBar.qml
HtmlEditorButton file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlEditorButton.qml
HtmlEditorColor file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlEditorColor.qml
HtmlEditorFont file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/HtmlEditorFont.qml
ImportDialog file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/ImportDialog.qml
IntegerSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/IntegerSelector.qml
LineSelector file://@KDE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@/qml/LineSelector.qml