status-desktop/ui/app/AppLayouts/Profile/Sections/BrowserContainer.qml

133 lines
4.7 KiB
QML
Raw Normal View History

import QtQuick 2.13
import QtQuick.Layouts 1.13
import "../../../../imports"
import "../../../../shared"
import "../../../../shared/status"
import "Privileges/"
import "BrowserModals"
Item {
id: root
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property Component dappListPopup: DappList {
onClosed: destroy()
}
property Component homePagePopup: HomepageModal {}
property Component searchEngineModal: SearchEngineModal {}
property Component ethereumExplorerModal: EthereumExplorerModal {}
2021-01-19 20:26:01 +00:00
Item {
anchors.top: parent.top
anchors.topMargin: topMargin
2021-01-19 20:26:01 +00:00
anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
2021-01-19 20:26:01 +00:00
Column {
id: generalColumn
width: parent.width
2021-01-19 20:26:01 +00:00
StatusSectionHeadline {
2021-02-18 16:36:05 +00:00
//% "General"
text: qsTrId("general")
2021-01-19 20:26:01 +00:00
bottomPadding: Style.current.bigPadding
}
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Homepage"
text: qsTrId("homepage")
//% "Default"
currentValue: appSettings.browserHomepage === "" ? qsTrId("default") : appSettings.browserHomepage
2021-01-19 20:26:01 +00:00
onClicked: homePagePopup.createObject(root).open()
}
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Show favorites bar"
text: qsTrId("show-favorites-bar")
2021-01-19 20:26:01 +00:00
isSwitch: true
2021-03-16 16:13:25 +00:00
switchChecked: appSettings.shouldShowFavoritesBar
2021-01-19 20:26:01 +00:00
onClicked: function (checked) {
2021-03-16 16:13:25 +00:00
appSettings.shouldShowFavoritesBar = checked
}
}
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Search engine used in the address bar"
text: qsTrId("search-engine-used-in-the-address-bar")
2021-01-19 20:26:01 +00:00
currentValue: {
2021-03-16 16:24:35 +00:00
switch (appSettings.shouldShowBrowserSearchEngine) {
2021-01-19 20:26:01 +00:00
case Constants.browserSearchEngineGoogle: return "Google"
case Constants.browserSearchEngineYahoo: return "Yahoo!"
case Constants.browserSearchEngineDuckDuckGo: return "DuckDuckGo"
case Constants.browserSearchEngineNone:
2021-02-18 16:36:05 +00:00
//% "None"
default: return qsTrId("none")
2021-01-19 20:26:01 +00:00
}
}
onClicked: searchEngineModal.createObject(root).open()
}
StatusSettingsLineButton {
id: ethereumExplorerBtn
2021-02-18 16:36:05 +00:00
//% "Ethereum explorer used in the address bar"
text: qsTrId("ethereum-explorer-used-in-the-address-bar")
currentValue: {
2021-03-16 16:24:35 +00:00
switch (appSettings.useBrowserEthereumExplorer) {
case Constants.browserEthereumExplorerEtherscan: return "etherscan.io"
case Constants.browserEthereumExplorerEthplorer: return "ethplorer.io"
case Constants.browserEthereumExplorerBlockchair: return "blockchair.com"
case Constants.browserSearchEngineNone:
2021-02-18 16:36:05 +00:00
//% "None"
default: return qsTrId("none")
}
}
onClicked: ethereumExplorerModal.createObject(root).open()
}
StyledText {
2021-02-18 16:36:05 +00:00
//% "Open an ethereum explorer after a transaction hash or an address is entered"
text: qsTrId("open-an-ethereum-explorer-after-a-transaction-hash-or-an-address-is-entered")
font.pixelSize: 15
color: Style.current.secondaryText
2021-01-19 20:26:01 +00:00
width: parent.width - 150
wrapMode: Text.WordWrap
2021-01-19 20:26:01 +00:00
bottomPadding: Style.current.bigPadding
}
2021-01-19 20:26:01 +00:00
Separator {
id: separator1
anchors.topMargin: Style.current.bigPadding
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
}
2021-01-19 20:26:01 +00:00
StatusSectionHeadline {
2021-02-18 16:36:05 +00:00
//% "Privacy"
text: qsTrId("privacy")
2021-01-19 20:26:01 +00:00
topPadding: Style.current.bigPadding
bottomPadding: Style.current.padding
}
2021-01-19 20:26:01 +00:00
StatusSettingsLineButton {
2021-02-18 16:36:05 +00:00
//% "Set DApp access permissions"
text: qsTrId("set-dapp-access-permissions")
2021-01-19 20:26:01 +00:00
isSwitch: false
onClicked: {
dappListPopup.createObject(root).open()
}
}
}
}
}
/*##^##
Designer {
D{i:0;height:400;width:700}
}
##^##*/