2021-01-04 15:34:46 -05:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 11:37:58 +02:00
|
|
|
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.controls 1.0
|
2021-01-04 15:34:46 -05:00
|
|
|
|
2021-10-06 11:16:39 +02:00
|
|
|
// TODO: replace with StatusModal
|
2021-01-04 15:34:46 -05:00
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
|
|
|
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Homepage"
|
|
|
|
title: qsTrId("homepage")
|
2021-01-04 15:34:46 -05:00
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
2021-03-19 11:25:29 +01:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
|
|
|
|
spacing: Style.current.padding
|
2021-01-04 15:34:46 -05:00
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: homepageGroup
|
|
|
|
}
|
|
|
|
|
2021-10-27 11:37:58 +02:00
|
|
|
RadioButtonSelector {
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Default"
|
2021-10-27 11:37:58 +02:00
|
|
|
title: qsTrId("default")
|
2021-03-19 11:25:29 +01:00
|
|
|
buttonGroup: homepageGroup
|
2021-10-20 11:50:50 +02:00
|
|
|
checked: localAccountSensitiveSettings.browserHomepage === ""
|
2021-10-27 11:37:58 +02:00
|
|
|
onCheckedChanged: {
|
2021-01-04 15:34:46 -05:00
|
|
|
if (checked) {
|
2021-10-20 11:50:50 +02:00
|
|
|
localAccountSensitiveSettings.browserHomepage = ""
|
2021-01-04 15:34:46 -05:00
|
|
|
customUrl.visible = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-27 11:37:58 +02:00
|
|
|
RadioButtonSelector {
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Custom..."
|
2021-10-27 11:37:58 +02:00
|
|
|
title: qsTrId("custom---")
|
2021-03-19 11:25:29 +01:00
|
|
|
buttonGroup: homepageGroup
|
2021-10-20 11:50:50 +02:00
|
|
|
checked: localAccountSensitiveSettings.browserHomepage !== "" || customUrl.visible
|
2021-10-27 11:37:58 +02:00
|
|
|
onCheckedChanged: {
|
2021-03-19 11:25:29 +01:00
|
|
|
if (checked) {
|
|
|
|
customUrl.visible = true
|
|
|
|
}
|
2021-01-04 15:34:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Input {
|
|
|
|
id: customUrl
|
2021-10-20 11:50:50 +02:00
|
|
|
visible: localAccountSensitiveSettings.browserHomepage !== ""
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Paste URL"
|
|
|
|
placeholderText: qsTrId("paste-url")
|
2021-10-20 11:50:50 +02:00
|
|
|
text: localAccountSensitiveSettings.browserHomepage
|
2021-01-04 15:34:46 -05:00
|
|
|
pasteFromClipboard: true
|
|
|
|
textField.onTextChanged: {
|
2021-10-20 11:50:50 +02:00
|
|
|
localAccountSensitiveSettings.browserHomepage = customUrl.text
|
2021-01-04 15:34:46 -05:00
|
|
|
}
|
2021-03-19 11:25:29 +01:00
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.rightMargin: 0
|
2021-01-04 15:34:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|