make unchangable properties readonly

This commit is contained in:
Cyril Anisimov 2024-12-14 19:33:54 +01:00
parent 906cf7b939
commit 378db1a9e5
2 changed files with 22 additions and 20 deletions

View file

@ -32,10 +32,10 @@ PageType {
QtObject { QtObject {
id: telegramGroup id: telegramGroup
property string title: qsTr("Telegram group") readonly property string title: qsTr("Telegram group")
property string description: qsTr("To discuss features") readonly property string description: qsTr("To discuss features")
property string imageSource: "qrc:/images/controls/telegram.svg" readonly property string imageSource: "qrc:/images/controls/telegram.svg"
property var handler: function() { readonly property var handler: function() {
Qt.openUrlExternally(qsTr("https://t.me/amnezia_vpn_en")) Qt.openUrlExternally(qsTr("https://t.me/amnezia_vpn_en"))
} }
} }
@ -43,10 +43,10 @@ PageType {
QtObject { QtObject {
id: mail id: mail
property string title: qsTr("support@amnezia.org") readonly property string title: qsTr("support@amnezia.org")
property string description: qsTr("For reviews and bug reports") readonly property string description: qsTr("For reviews and bug reports")
property string imageSource: "qrc:/images/controls/mail.svg" readonly property string imageSource: "qrc:/images/controls/mail.svg"
property var handler: function() { readonly property var handler: function() {
GC.copyToClipBoard(title) GC.copyToClipBoard(title)
PageController.showNotificationMessage(qsTr("Copied")) PageController.showNotificationMessage(qsTr("Copied"))
} }
@ -55,10 +55,10 @@ PageType {
QtObject { QtObject {
id: github id: github
property string title: qsTr("GitHub") readonly property string title: qsTr("GitHub")
property string description: qsTr("Discover the source code") readonly property string description: qsTr("Discover the source code")
property string imageSource: "qrc:/images/controls/github.svg" readonly property string imageSource: "qrc:/images/controls/github.svg"
property var handler: function() { readonly property var handler: function() {
Qt.openUrlExternally(qsTr("https://github.com/amnezia-vpn/amnezia-client")) Qt.openUrlExternally(qsTr("https://github.com/amnezia-vpn/amnezia-client"))
} }
} }
@ -66,10 +66,10 @@ PageType {
QtObject { QtObject {
id: website id: website
property string title: qsTr("Website") readonly property string title: qsTr("Website")
property string description: qsTr("Visit official website") readonly property string description: qsTr("Visit official website")
property string imageSource: "qrc:/images/controls/amnezia.svg" readonly property string imageSource: "qrc:/images/controls/amnezia.svg"
property var handler: function() { readonly property var handler: function() {
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl()) Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
} }
} }

View file

@ -46,13 +46,15 @@ PageType {
QtObject { QtObject {
id: onlyForwardApps id: onlyForwardApps
property string name: qsTr("Only the apps from the list should have access via VPN")
property int type: routeMode.onlyForwardApps readonly property string name: qsTr("Only the apps from the list should have access via VPN")
readonly property int type: routeMode.onlyForwardApps
} }
QtObject { QtObject {
id: allExceptApps id: allExceptApps
property string name: qsTr("Apps from the list should not have access via VPN")
property int type: routeMode.allExceptApps readonly property string name: qsTr("Apps from the list should not have access via VPN")
readonly property int type: routeMode.allExceptApps
} }
function getRouteModesModelIndex() { function getRouteModesModelIndex() {