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