2020-12-29 20:33:54 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.3
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-12-29 20:33:54 +00:00
|
|
|
|
2021-10-20 08:26:29 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
StatusModal {
|
2020-12-29 20:33:54 +00:00
|
|
|
property string link
|
|
|
|
|
|
|
|
id: popup
|
2021-11-02 10:58:41 +00:00
|
|
|
anchors.centerIn: parent
|
2020-12-29 20:33:54 +00:00
|
|
|
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Choose browser"
|
2021-10-20 08:26:29 +00:00
|
|
|
header.title: qsTrId("choose-browser")
|
2020-12-29 20:33:54 +00:00
|
|
|
width: 440
|
|
|
|
|
2021-10-20 08:26:29 +00:00
|
|
|
contentItem: Column {
|
2021-11-02 10:58:41 +00:00
|
|
|
width: popup.width - 32
|
2020-12-29 20:33:54 +00:00
|
|
|
spacing: 20
|
2021-11-02 10:58:41 +00:00
|
|
|
anchors.horizontalCenter: popup.horizontalCenter
|
2020-12-29 20:33:54 +00:00
|
|
|
|
|
|
|
Image {
|
2022-04-01 20:53:57 +00:00
|
|
|
source: Style.png("browser/chooseBrowserImage")
|
2020-12-29 20:33:54 +00:00
|
|
|
width: 240
|
|
|
|
height: 148
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Open in Status"
|
|
|
|
text: qsTrId("browsing-open-in-status")
|
2020-12-29 20:33:54 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
onClicked: {
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.showBrowserSelector = !rememberChoiceCheckBox.checked
|
2021-08-05 13:15:55 +00:00
|
|
|
if (rememberChoiceCheckBox.checked) {
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.openLinksInStatus = true
|
2021-08-05 13:15:55 +00:00
|
|
|
}
|
2021-12-06 21:10:54 +00:00
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.browser)
|
2020-12-29 20:33:54 +00:00
|
|
|
browserLayoutContainer.item.openUrlInNewTab(popup.link)
|
|
|
|
popup.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-20 08:26:29 +00:00
|
|
|
StatusFlatButton {
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Open in my default browser"
|
|
|
|
text: qsTrId("open-in-my-default-browser")
|
2020-12-29 20:33:54 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
onClicked: {
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.showBrowserSelector = !rememberChoiceCheckBox.checked
|
2021-08-05 13:15:55 +00:00
|
|
|
if (rememberChoiceCheckBox.checked) {
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.openLinksInStatus = false
|
2021-08-05 13:15:55 +00:00
|
|
|
}
|
2020-12-29 20:33:54 +00:00
|
|
|
Qt.openUrlExternally(popup.link)
|
2021-08-05 13:15:55 +00:00
|
|
|
popup.close()
|
2020-12-29 20:33:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
StatusCheckBox {
|
|
|
|
id: rememberChoiceCheckBox
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Remember my choice. To override it, go to settings."
|
|
|
|
text: qsTrId("remember-my-choice--to-override-it--go-to-settings-")
|
2020-12-29 20:33:54 +00:00
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|