2021-10-06 09:16:39 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
2021-11-02 19:00:47 +00:00
|
|
|
property var profile: profileModule.model
|
2021-10-13 21:31:04 +00:00
|
|
|
property var contactsModuleInst: contactsModule
|
|
|
|
property var aboutModuleInst: aboutModule
|
2021-10-21 18:37:21 +00:00
|
|
|
property var languageModuleInst: languageModule
|
2021-10-21 22:31:41 +00:00
|
|
|
property var mnemonicModuleInst: mnemonicModule
|
2021-10-13 21:31:04 +00:00
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
property var profileModuleInst: profileSectionModule
|
|
|
|
property AdvancedStore advancedStore: AdvancedStore {
|
|
|
|
advancedModule: profileModuleInst.advancedModule
|
|
|
|
}
|
|
|
|
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property var chatsModelInst: chatsModel
|
|
|
|
// Not Refactored Yet
|
|
|
|
// property var utilsModelInst: utilsModel
|
|
|
|
// Not Refactored Yet
|
|
|
|
// property var walletModelInst: walletModel
|
|
|
|
// Not Refactored Yet
|
|
|
|
// property var nodeModelInst: nodeModel
|
|
|
|
|
|
|
|
// Not Refactored Yet
|
|
|
|
// property var ens: profileModelInst.ens
|
2021-10-22 19:21:04 +00:00
|
|
|
property var dappList: dappPermissionsModule.dapps
|
|
|
|
property var permissionList: dappPermissionsModule.permissions
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property var mailservers: profileModelInst.mailservers
|
|
|
|
// property var mailserversList: profileModelInst.mailservers.list
|
2021-10-21 19:13:13 +00:00
|
|
|
property var contacts: contactsModuleInst.model.list
|
|
|
|
property var blockedContacts: contactsModuleInst.model.blockedContacts
|
|
|
|
property var addedContacts: contactsModuleInst.model.addedContacts
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property var mutedChatsContacts: profileModelInst.mutedChats.contacts
|
|
|
|
// property var mutedChats: profileModelInst.mutedChats.chats
|
|
|
|
// property var devicesList: profileModelInst.devices.list
|
|
|
|
|
|
|
|
// Not Refactored Yet
|
|
|
|
property string ensRegisterAddress: "" //utilsModelInst.ensRegisterAddress
|
|
|
|
// Not Refactored Yet
|
|
|
|
property string etherscanLink: "" //walletModelInst.utilsView.etherscanLink
|
2021-10-13 21:31:04 +00:00
|
|
|
property string pubKey: profile.pubKey
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property string preferredUsername: profileModelInst.ens.preferredUsername
|
|
|
|
// property string firstEnsUsername: profileModelInst.ens.firstEnsUsername
|
2021-10-13 21:31:04 +00:00
|
|
|
property string username: profile.username
|
|
|
|
property string identicon: profile.identicon
|
|
|
|
property string profileLargeImage: profile.largeImage
|
|
|
|
property string profileThumbnailImage: profile.thumbnailImage
|
2021-10-06 09:16:39 +00:00
|
|
|
|
2021-10-13 21:31:04 +00:00
|
|
|
property bool profileHasIdentityImage: profile.hasIdentityImage
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property bool automaticMailserverSelection: profileModelInst.mailservers.automaticSelection
|
|
|
|
// Not Refactored Yet
|
2021-12-21 16:20:05 +00:00
|
|
|
property bool devicesSetup: false //profileModelInst.devices.isSetup
|
2021-10-21 22:31:41 +00:00
|
|
|
property bool mnemonicBackedUp: mnemonicModuleInst.isBackedUp
|
2021-10-13 21:31:04 +00:00
|
|
|
property bool messagesFromContactsOnly: profile.messagesFromContactsOnly
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
property int profile_id: 0
|
|
|
|
property int contacts_id: 1
|
|
|
|
property int ens_id: 2
|
|
|
|
property int privacy_and_security_id: 3
|
|
|
|
property int appearance_id: 4
|
|
|
|
property int sound_id: 5
|
|
|
|
property int language_id: 6
|
|
|
|
property int notifications_id: 7
|
|
|
|
property int sync_settings_id: 8
|
|
|
|
property int devices_settings_id: 9
|
|
|
|
property int browser_settings_id: 10
|
|
|
|
property int advanced_id: 11
|
|
|
|
property int need_help_id: 12
|
|
|
|
property int about_id: 13
|
|
|
|
property int signout_id: 14
|
|
|
|
|
2021-10-20 09:50:50 +00:00
|
|
|
property bool browserMenuItemEnabled: localAccountSensitiveSettings.isBrowserEnabled
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
property ListModel mainMenuItems: ListModel {
|
|
|
|
ListElement {
|
|
|
|
menu_id: 0
|
|
|
|
text: qsTr("My Profile")
|
|
|
|
icon: "profile"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 1
|
|
|
|
text: qsTr("Contacts")
|
|
|
|
icon: "contact"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 2
|
|
|
|
text: qsTr("ENS usernames")
|
|
|
|
icon: "username"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property ListModel settingsMenuItems: ListModel {
|
|
|
|
ListElement {
|
|
|
|
menu_id: 3
|
|
|
|
text: qsTr("Privacy and security")
|
|
|
|
icon: "security"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 4
|
|
|
|
text: qsTr("Appearance")
|
|
|
|
icon: "appearance"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 5
|
|
|
|
text: qsTr("Sound")
|
|
|
|
icon: "sound"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 6
|
|
|
|
text: qsTr("Language")
|
|
|
|
icon: "language"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 7
|
|
|
|
text: qsTr("Notifications")
|
|
|
|
icon: "notification"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 8
|
|
|
|
text: qsTr("Sync settings")
|
|
|
|
icon: "mobile"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 9
|
|
|
|
text: qsTr("Devices settings")
|
|
|
|
icon: "mobile"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 10
|
|
|
|
text: qsTr("Browser settings")
|
|
|
|
icon: "browser"
|
|
|
|
ifEnabled: "browser"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 11
|
|
|
|
text: qsTr("Advanced")
|
|
|
|
icon: "settings"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property ListModel extraMenuItems: ListModel {
|
|
|
|
ListElement {
|
|
|
|
menu_id: 12
|
|
|
|
text: qsTr("Need help?")
|
|
|
|
icon: "help"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 13
|
|
|
|
text: qsTr("About")
|
|
|
|
icon: "info"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
menu_id: 14
|
|
|
|
function_name: "exit"
|
|
|
|
text: qsTr("Sign out & Quit")
|
|
|
|
icon: "logout"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function initPermissionList(name) {
|
2021-10-22 19:21:04 +00:00
|
|
|
dappPermissionsModule.fetchPermissions(name)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
2021-10-22 19:21:04 +00:00
|
|
|
function revokePermission(dapp, name) {
|
|
|
|
dappPermissionsModule.revokePermission(dapp, name)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
2021-10-22 19:21:04 +00:00
|
|
|
function clearPermissions(dapp) {
|
|
|
|
dappPermissionsModule.clearPermissions(dapp)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function initDappList() {
|
2021-10-22 19:21:04 +00:00
|
|
|
dappPermissionsModule.fetchDapps()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getQrCodeSource(publicKey) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.qrCode(publicKey)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function copyToClipboard(value) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// chatsModelInst.copyToClipboard(value)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function uploadImage(source, aX, aY, bX, bY) {
|
2021-11-02 19:00:47 +00:00
|
|
|
return profileModule.upload(source, aX, aY, bX, bY)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function removeImage() {
|
2021-11-02 19:00:47 +00:00
|
|
|
return profileModule.remove()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function lookupContact(value) {
|
2021-10-13 21:31:04 +00:00
|
|
|
contactsModuleInst.lookupContact(value)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function addContact(pubKey) {
|
2021-10-13 21:31:04 +00:00
|
|
|
contactsModuleInst.addContact(pubKey)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function generateAlias(pubKey) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return utilsModelInst.generateAlias(pubKey)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function joinPrivateChat(address) {
|
2021-12-09 16:25:38 +00:00
|
|
|
let chatCommunitySectionModule = mainModule.getChatSectionModule()
|
|
|
|
chatCommunitySectionModule.createOneToOneChat(address, "")
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function unblockContact(address) {
|
2021-10-13 21:31:04 +00:00
|
|
|
contactsModuleInst.unblockContact(address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function blockContact(address) {
|
2021-10-13 21:31:04 +00:00
|
|
|
contactsModuleInst.blockContact(address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function isContactAdded(address) {
|
2021-10-13 21:31:04 +00:00
|
|
|
return contactsModuleInst.model.isAdded(address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function removeContact(address) {
|
2021-10-13 21:31:04 +00:00
|
|
|
contactsModuleInst.removeContact(address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function ensDetails(username) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.ens.details(username)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function ensPendingLen() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.pendingLen()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function validateEns(ensName, isStatus) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.ens.validate(ensName, isStatus)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
2021-10-13 21:31:04 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
function registerEnsGasEstimate(username, address) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.registerENSGasEstimate(username, address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
2021-10-13 21:31:04 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
function registerEns(username, address, gasLimit, tipLimit, overallLimit, gasPrice, password) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.registerENS(username,
|
|
|
|
// address, gasLimit, tipLimit, overallLimit, gasPrice, password)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getEnsUsernameRegistrar() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.getUsernameRegistrar()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEnsRegistry() {
|
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.getENSRegistry()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function releaseEnsEstimate(username, address) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.releaseEstimate(username, address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function releaseEns(username, address, gasLimit, gasPrice, password) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.release(username, address, gasLimit, gasPrice, password)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getGasPrice() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// walletModelInst.gasView.getGasPrice()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getGasPricePredictions() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// walletModelInst.gasView.getGasPricePredictions()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function ensConnectOwnedUsername(name, isStatus) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.ens.connectOwnedUsername(name, isStatus)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getWalletDefaultAddress() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return walletModelInst.getDefaultAddress()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getSntBalance() {
|
2021-12-14 16:11:31 +00:00
|
|
|
// Not Refactored Yet - This should be fetched from corresponding module, not from the global Utils
|
2021-12-13 14:24:21 +00:00
|
|
|
// return utilsModelInst.getSNTBalance()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function changeLocale(l) {
|
2021-11-02 19:31:51 +00:00
|
|
|
localAppSettings.locale = l
|
2021-10-21 18:37:21 +00:00
|
|
|
languageModuleInst.changeLocale(l)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getMailserverName(mailserver) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.mailservers.list.getMailserverName(mailserver)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setMailserver(mailserver) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.mailservers.setMailserver(mailserver);
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function saveMailserver(name, enode) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.mailservers.save(name, enode)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function enableAutomaticMailserverSelection(checked) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.mailservers.enableAutomaticSelection(checked)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getNetworkName() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return utilsModelInst.getNetworkName()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setBloomLevel(mode) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// nodeModelInst.setBloomLevel(mode)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setWakuV2LightClient(mode) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// nodeModelInst.setWakuV2LightClient(mode)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getCurrentVersion() {
|
2021-10-13 21:31:04 +00:00
|
|
|
return aboutModuleInst.getCurrentVersion()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function nodeVersion() {
|
2021-10-13 21:31:04 +00:00
|
|
|
return aboutModuleInst.nodeVersion()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function checkForUpdates() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// utilsModelInst.checkForUpdates()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setPubKeyGasEstimate(username, address) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.setPubKeyGasEstimate(username, address)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setPubKey(username, address, gasLimit, gasPrice, password) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return profileModelInst.ens.setPubKey(username, address, gasLimit, gasPrice, password)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setDeviceName(name) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.devices.setName(name)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function advertiseDevice() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.devices.advertise()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function enableDeviceInstallation(id, pairedSwitch) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.devices.enableInstallation(id, pairedSwitch)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function syncAllDevices() {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.devices.syncAll()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function readTextFile(path) {
|
2021-12-14 16:11:31 +00:00
|
|
|
return globalUtils.readTextFile(path)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function writeTextFile(path, value) {
|
2021-12-14 16:11:31 +00:00
|
|
|
globalUtils.writeTextFile(path, value)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setMessagesFromContactsOnly(checked) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// profileModelInst.setMessagesFromContactsOnly(checked)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
2021-10-28 20:23:30 +00:00
|
|
|
|
|
|
|
function userNameOrAlias(pk) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return chatsModelInst.userNameOrAlias(pk);
|
2021-10-28 20:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function generateIdenticon(pk) {
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// return utilsModelInst.generateIdenticon(pk);
|
2021-10-28 20:23:30 +00:00
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|