2022-08-31 08:30:27 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
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
|
2022-08-31 08:30:27 +00:00
|
|
|
import StatusQ.Popups.Dialog 0.1
|
2021-10-20 08:26:29 +00:00
|
|
|
|
2022-08-31 08:30:27 +00:00
|
|
|
StatusDialog {
|
|
|
|
id: root
|
2020-12-29 20:33:54 +00:00
|
|
|
|
2022-08-31 08:30:27 +00:00
|
|
|
property string link
|
2020-12-29 20:33:54 +00:00
|
|
|
|
2022-08-31 08:30:27 +00:00
|
|
|
title: qsTr("Choose browser")
|
|
|
|
width: 400
|
|
|
|
footer: null
|
2020-12-29 20:33:54 +00:00
|
|
|
|
2022-08-31 08:30:27 +00:00
|
|
|
contentItem: ColumnLayout {
|
2020-12-29 20:33:54 +00:00
|
|
|
spacing: 20
|
|
|
|
|
|
|
|
Image {
|
2022-08-31 08:30:27 +00:00
|
|
|
source: Style.png("browser/chooseBrowserImage@2x")
|
|
|
|
Layout.preferredWidth: 240
|
|
|
|
Layout.preferredHeight: 148
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2020-12-29 20:33:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
2022-08-31 08:30:27 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Open in Status")
|
2022-08-31 08:30:27 +00:00
|
|
|
font.weight: Font.Medium
|
2020-12-29 20:33:54 +00:00
|
|
|
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)
|
2022-08-31 08:30:27 +00:00
|
|
|
Global.openLinkInBrowser(root.link)
|
|
|
|
root.close()
|
2020-12-29 20:33:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-20 08:26:29 +00:00
|
|
|
StatusFlatButton {
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Open in my default browser")
|
2022-08-31 08:30:27 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
font.weight: Font.Medium
|
2020-12-29 20:33:54 +00:00
|
|
|
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
|
|
|
}
|
2022-08-31 08:30:27 +00:00
|
|
|
Qt.openUrlExternally(root.link)
|
|
|
|
root.close()
|
2020-12-29 20:33:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusCheckBox {
|
2022-08-31 08:30:27 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.bottomMargin: Style.current.smallPadding
|
2020-12-29 20:33:54 +00:00
|
|
|
id: rememberChoiceCheckBox
|
2022-08-31 08:30:27 +00:00
|
|
|
font.pixelSize: 13
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Remember my choice. To override it, go to settings.")
|
2020-12-29 20:33:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|