2021-01-04 20:34:46 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-01-04 20:34:46 +00:00
|
|
|
import "../../../../../shared"
|
|
|
|
import "../../../../../shared/status"
|
|
|
|
|
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
|
|
|
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Homepage"
|
|
|
|
title: qsTrId("homepage")
|
2021-01-04 20:34:46 +00:00
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
2021-03-19 10:25:29 +00: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 20:34:46 +00:00
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: homepageGroup
|
|
|
|
}
|
|
|
|
|
2021-03-19 10:25:29 +00:00
|
|
|
StatusRadioButtonRow {
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Default"
|
|
|
|
text: qsTrId("default")
|
2021-03-19 10:25:29 +00:00
|
|
|
buttonGroup: homepageGroup
|
2021-01-04 20:34:46 +00:00
|
|
|
checked: appSettings.browserHomepage === ""
|
2021-03-19 10:25:29 +00:00
|
|
|
onRadioCheckedChanged: {
|
2021-01-04 20:34:46 +00:00
|
|
|
if (checked) {
|
|
|
|
appSettings.browserHomepage = ""
|
|
|
|
customUrl.visible = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-19 10:25:29 +00:00
|
|
|
StatusRadioButtonRow {
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Custom..."
|
|
|
|
text: qsTrId("custom---")
|
2021-03-19 10:25:29 +00:00
|
|
|
buttonGroup: homepageGroup
|
2021-01-04 20:34:46 +00:00
|
|
|
checked: appSettings.browserHomepage !== "" || customUrl.visible
|
2021-03-19 10:25:29 +00:00
|
|
|
onRadioCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
customUrl.visible = true
|
|
|
|
}
|
2021-01-04 20:34:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Input {
|
|
|
|
id: customUrl
|
|
|
|
visible: appSettings.browserHomepage !== ""
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Paste URL"
|
|
|
|
placeholderText: qsTrId("paste-url")
|
2021-01-04 21:05:41 +00:00
|
|
|
text: appSettings.browserHomepage
|
2021-01-04 20:34:46 +00:00
|
|
|
pasteFromClipboard: true
|
|
|
|
textField.onTextChanged: {
|
|
|
|
appSettings.browserHomepage = customUrl.text
|
|
|
|
}
|
2021-03-19 10:25:29 +00:00
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.rightMargin: 0
|
2021-01-04 20:34:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|