2020-10-21 14:45:28 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import "../popups"
|
2020-10-21 14:45:28 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
2021-04-08 15:44:58 +00:00
|
|
|
clip: true
|
2020-10-21 14:45:28 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
property var store
|
2021-12-09 13:28:02 +00:00
|
|
|
property int profileContentWidth
|
2021-10-06 09:16:39 +00:00
|
|
|
|
2021-01-04 20:26:56 +00:00
|
|
|
property Component dappListPopup: DappList {
|
2021-10-06 09:16:39 +00:00
|
|
|
store: root.store
|
2021-01-04 20:26:56 +00:00
|
|
|
onClosed: destroy()
|
|
|
|
}
|
2021-01-04 20:34:46 +00:00
|
|
|
property Component homePagePopup: HomepageModal {}
|
2021-01-04 21:06:38 +00:00
|
|
|
property Component searchEngineModal: SearchEngineModal {}
|
2021-01-04 21:23:20 +00:00
|
|
|
property Component ethereumExplorerModal: EthereumExplorerModal {}
|
2021-01-04 20:34:46 +00:00
|
|
|
|
2021-01-19 20:26:01 +00:00
|
|
|
Item {
|
2020-12-29 15:31:26 +00:00
|
|
|
anchors.top: parent.top
|
2021-10-06 09:16:39 +00:00
|
|
|
anchors.topMargin: 64
|
2021-01-19 20:26:01 +00:00
|
|
|
anchors.bottom: parent.bottom
|
2021-12-09 13:28:02 +00:00
|
|
|
width: profileContentWidth
|
2021-04-08 15:44:58 +00:00
|
|
|
|
2021-03-18 09:33:39 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-12-29 15:31:26 +00:00
|
|
|
|
2021-01-19 20:26:01 +00:00
|
|
|
Column {
|
|
|
|
id: generalColumn
|
|
|
|
width: parent.width
|
2020-12-29 15:31:26 +00:00
|
|
|
|
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-04 20:26:56 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
// TODO: Replace with StatusQ StatusListItem component
|
2021-01-19 20:26:01 +00:00
|
|
|
StatusSettingsLineButton {
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Homepage"
|
|
|
|
text: qsTrId("homepage")
|
|
|
|
//% "Default"
|
2021-10-20 09:50:50 +00:00
|
|
|
currentValue: localAccountSensitiveSettings.browserHomepage === "" ? qsTrId("default") : localAccountSensitiveSettings.browserHomepage
|
2021-01-19 20:26:01 +00:00
|
|
|
onClicked: homePagePopup.createObject(root).open()
|
2020-12-29 15:31:26 +00:00
|
|
|
}
|
2020-10-21 14:49:13 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
// TODO: Replace with StatusQ StatusListItem component
|
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-10-20 09:50:50 +00:00
|
|
|
switchChecked: localAccountSensitiveSettings.shouldShowFavoritesBar
|
2021-01-19 20:26:01 +00:00
|
|
|
onClicked: function (checked) {
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.shouldShowFavoritesBar = checked
|
2021-01-04 21:06:38 +00:00
|
|
|
}
|
2020-10-21 14:49:13 +00:00
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
// TODO: Replace with StatusQ StatusListItem component
|
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-10-20 09:50:50 +00:00
|
|
|
switch (localAccountSensitiveSettings.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()
|
|
|
|
}
|
2021-01-04 20:26:56 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
// TODO: Replace with StatusQ StatusListItem component
|
2021-01-04 20:26:56 +00:00
|
|
|
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")
|
2021-01-04 21:23:20 +00:00
|
|
|
currentValue: {
|
2021-10-20 09:50:50 +00:00
|
|
|
switch (localAccountSensitiveSettings.useBrowserEthereumExplorer) {
|
2021-01-04 21:23:20 +00:00
|
|
|
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")
|
2021-01-04 21:23:20 +00:00
|
|
|
}
|
2020-10-21 14:49:13 +00:00
|
|
|
}
|
2021-01-04 21:23:20 +00:00
|
|
|
onClicked: ethereumExplorerModal.createObject(root).open()
|
2020-10-21 14:49:13 +00:00
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
StatusBaseText {
|
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")
|
2021-01-04 20:26:56 +00:00
|
|
|
font.pixelSize: 15
|
2021-10-06 09:16:39 +00:00
|
|
|
color: Theme.palette.baseColor1
|
2021-01-19 20:26:01 +00:00
|
|
|
width: parent.width - 150
|
2021-01-04 20:26:56 +00:00
|
|
|
wrapMode: Text.WordWrap
|
2021-01-19 20:26:01 +00:00
|
|
|
bottomPadding: Style.current.bigPadding
|
2020-10-21 14:49:13 +00:00
|
|
|
}
|
|
|
|
|
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-04 20:26:56 +00:00
|
|
|
|
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
|
|
|
|
}
|
2020-10-21 14:49:13 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
// TODO: Replace with StatusQ StatusListItem component
|
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()
|
|
|
|
}
|
|
|
|
}
|
2021-01-04 20:26:56 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-21 14:45:28 +00:00
|
|
|
}
|