feat: add search engine settings in the profile
This commit is contained in:
parent
6c2836ded1
commit
1c83ac98a0
|
@ -14,8 +14,8 @@ Item {
|
|||
property Component dappListPopup: DappList {
|
||||
onClosed: destroy()
|
||||
}
|
||||
|
||||
property Component homePagePopup: HomepageModal {}
|
||||
property Component searchEngineModal: SearchEngineModal {}
|
||||
|
||||
Column {
|
||||
id: generalColumn
|
||||
|
@ -48,10 +48,16 @@ Item {
|
|||
|
||||
StatusSettingsLineButton {
|
||||
text: qsTr("Search engine used in the address bar")
|
||||
currentValue: qsTr("None")
|
||||
onClicked: function () {
|
||||
console.log('Change search engine')
|
||||
currentValue: {
|
||||
switch (appSettings.browserSearchEngine) {
|
||||
case Constants.browserSearchEngineGoogle: return "Google"
|
||||
case Constants.browserSearchEngineYahoo: return "Yahoo!"
|
||||
case Constants.browserSearchEngineDuckDuckGo: return "DuckDuckGo"
|
||||
case Constants.browserSearchEngineNone:
|
||||
default: return qsTr("None")
|
||||
}
|
||||
}
|
||||
onClicked: searchEngineModal.createObject(root).open()
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import "../../../../../imports"
|
||||
import "../../../../../shared"
|
||||
import "../../../../../shared/status"
|
||||
|
||||
ModalPopup {
|
||||
id: popup
|
||||
|
||||
title: qsTr("Search engine")
|
||||
|
||||
onClosed: {
|
||||
destroy()
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: Style.current.bigPadding
|
||||
width: parent.width
|
||||
|
||||
ButtonGroup {
|
||||
id: searchEnginGroup
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
text: qsTr("None")
|
||||
ButtonGroup.group: searchEnginGroup
|
||||
checked: appSettings.browserSearchEngine === Constants.browserSearchEngineNone
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
appSettings.browserSearchEngine = Constants.browserSearchEngineNone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
text: "Google"
|
||||
ButtonGroup.group: searchEnginGroup
|
||||
checked: appSettings.browserSearchEngine === Constants.browserSearchEngineGoogle
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
appSettings.browserSearchEngine = Constants.browserSearchEngineGoogle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
text: "Yahoo!"
|
||||
ButtonGroup.group: searchEnginGroup
|
||||
checked: appSettings.browserSearchEngine === Constants.browserSearchEngineYahoo
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
appSettings.browserSearchEngine = Constants.browserSearchEngineYahoo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
text: "DuckDuckGo"
|
||||
ButtonGroup.group: searchEnginGroup
|
||||
checked: appSettings.browserSearchEngine === Constants.browserSearchEngineDuckDuckGo
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
appSettings.browserSearchEngine = Constants.browserSearchEngineDuckDuckGo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -100,4 +100,9 @@ QtObject {
|
|||
readonly property string eth_prod: "eth.prod"
|
||||
readonly property string eth_staging: "eth.staging"
|
||||
readonly property string eth_test: "eth.test"
|
||||
|
||||
readonly property int browserSearchEngineNone: 0
|
||||
readonly property int browserSearchEngineGoogle: 1
|
||||
readonly property int browserSearchEngineYahoo: 2
|
||||
readonly property int browserSearchEngineDuckDuckGo: 3
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@ ApplicationWindow {
|
|||
property bool openLinksInStatus: true
|
||||
property bool showFavoritesBar: false
|
||||
property string browserHomepage: ""
|
||||
property int browserSearchEngine: Constants.browserSearchEngineNone
|
||||
property bool autoLoadImages: true
|
||||
property bool javaScriptEnabled: true
|
||||
property bool errorPageEnabled: true
|
||||
|
@ -160,6 +161,7 @@ ApplicationWindow {
|
|||
property bool openLinksInStatus: defaultAppSettings.openLinksInStatus
|
||||
property bool showFavoritesBar: defaultAppSettings.showFavoritesBar
|
||||
property string browserHomepage: defaultAppSettings.browserHomepage
|
||||
property int browserSearchEngine: defaultAppSettings.browserSearchEngine
|
||||
property bool autoLoadImages: defaultAppSettings.autoLoadImages
|
||||
property bool javaScriptEnabled: defaultAppSettings.javaScriptEnabled
|
||||
property bool errorPageEnabled: defaultAppSettings.errorPageEnabled
|
||||
|
|
|
@ -186,6 +186,7 @@ DISTFILES += \
|
|||
app/AppLayouts/Profile/Sections/BackupSeedModal.qml \
|
||||
app/AppLayouts/Profile/Sections/BrowserContainer.qml \
|
||||
app/AppLayouts/Profile/Sections/BrowserModals/HomepageModal.qml \
|
||||
app/AppLayouts/Profile/Sections/BrowserModals/SearchEngineModal.qml \
|
||||
app/AppLayouts/Profile/Sections/ChangeProfilePicModal.qml \
|
||||
app/AppLayouts/Profile/Sections/MyProfileContainer.qml \
|
||||
app/AppLayouts/Profile/Sections/OpenLinksWithModal.qml \
|
||||
|
|
Loading…
Reference in New Issue