aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-10-04 17:38:14 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-10-04 17:38:14 -0500
commitcdfe9f338fdf46b301fd6eb627b13109fca561ff (patch)
tree1c961643ffede90c03d962da8efb638d591bbbc4
parentadb04cef71c0b0a7dbb53e120ccaa5c661dfa8fd (diff)
parentf5c5df7b677e10c78bddb2defa7b392bfe42696a (diff)
downloadmonzero-gui-cdfe9f338fdf46b301fd6eb627b13109fca561ff.tar.gz
monzero-gui-cdfe9f338fdf46b301fd6eb627b13109fca561ff.tar.xz
monzero-gui-cdfe9f338fdf46b301fd6eb627b13109fca561ff.zip
Merge pull request #3025
f5c5df7 main: accountsDir runtime configuration support (xiphon)
-rw-r--r--js/Wizard.js4
-rw-r--r--main.qml7
-rw-r--r--pages/History.qml2
-rw-r--r--pages/Transfer.qml4
-rw-r--r--pages/settings/SettingsInfo.qml2
-rw-r--r--wizard/WizardController.qml6
-rw-r--r--wizard/WizardOpenWallet1.qml2
-rw-r--r--wizard/WizardWalletInput.qml6
8 files changed, 17 insertions, 16 deletions
diff --git a/js/Wizard.js b/js/Wizard.js
index 054b13f7..52c43a84 100644
--- a/js/Wizard.js
+++ b/js/Wizard.js
@@ -65,7 +65,7 @@ function createWalletPath(isIOS, folder_path,account_name){
return folder_path + "/" + account_name + "/" + account_name
}
-function walletPathExists(directory, filename, isIOS, walletManager) {
+function walletPathExists(accountsDir, directory, filename, isIOS, walletManager) {
if(!filename || filename === "") return false;
if(!directory || directory === "") return false;
@@ -76,7 +76,7 @@ function walletPathExists(directory, filename, isIOS, walletManager) {
directory += "/"
if(isIOS)
- var path = moneroAccountsDir + filename;
+ var path = accountsDir + filename;
else
var path = directory + filename + "/" + filename;
diff --git a/main.qml b/main.qml
index 2c4a0136..89943610 100644
--- a/main.qml
+++ b/main.qml
@@ -61,6 +61,7 @@ ApplicationWindow {
property bool hideBalanceForced: false
property bool ctrlPressed: false
property alias persistentSettings : persistentSettings
+ property string accountsDir: !persistentSettings.portable ? moneroAccountsDir : persistentSettings.portableFolderName + "/wallets"
property var currentWallet;
property bool disconnected: currentWallet ? currentWallet.disconnected : false
property var transaction;
@@ -261,7 +262,7 @@ ApplicationWindow {
// wallet already opened with wizard, we just need to initialize it
var wallet_path = persistentSettings.wallet_path;
if(isIOS)
- wallet_path = moneroAccountsDir + wallet_path;
+ wallet_path = appWindow.accountsDir + wallet_path;
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.walletPassword);
console.log("opening wallet at: ", wallet_path, ", network type: ", persistentSettings.nettype == NetworkType.MAINNET ? "mainnet" : persistentSettings.nettype == NetworkType.TESTNET ? "testnet" : "stagenet");
@@ -801,7 +802,7 @@ ApplicationWindow {
function walletsFound() {
if (persistentSettings.wallet_path.length > 0) {
if(isIOS)
- return walletManager.walletExists(moneroAccountsDir + persistentSettings.wallet_path);
+ return walletManager.walletExists(appWindow.accountsDir + persistentSettings.wallet_path);
else
return walletManager.walletExists(persistentSettings.wallet_path);
}
@@ -916,7 +917,7 @@ ApplicationWindow {
FileDialog {
id: saveTxDialog
title: "Please choose a location"
- folder: "file://" +moneroAccountsDir
+ folder: "file://" + appWindow.accountsDir
selectExisting: false;
onAccepted: {
diff --git a/pages/History.qml b/pages/History.qml
index 685dcfe4..1c0a7c18 100644
--- a/pages/History.qml
+++ b/pages/History.qml
@@ -1709,7 +1709,7 @@ Rectangle {
informationPopup.open();
}
Component.onCompleted: {
- var _folder = 'file://' + moneroAccountsDir;
+ var _folder = 'file://' + appWindow.accountsDir;
try {
_folder = 'file://' + desktopFolder;
}
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index dc344069..c3ebeff3 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -621,7 +621,7 @@ Rectangle {
FileDialog {
id: signTxDialog
title: qsTr("Please choose a file") + translationManager.emptyString
- folder: "file://" +moneroAccountsDir
+ folder: "file://" + appWindow.accountsDir
nameFilters: [ "Unsigned transfers (*)"]
onAccepted: {
@@ -682,7 +682,7 @@ Rectangle {
FileDialog {
id: submitTxDialog
title: qsTr("Please choose a file") + translationManager.emptyString
- folder: "file://" +moneroAccountsDir
+ folder: "file://" + appWindow.accountsDir
nameFilters: [ "signed transfers (*)"]
onAccepted: {
diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml
index 52726fbe..c6bcd1fc 100644
--- a/pages/settings/SettingsInfo.qml
+++ b/pages/settings/SettingsInfo.qml
@@ -135,7 +135,7 @@ Rectangle {
Layout.fillWidth: true
color: MoneroComponents.Style.dimmedFontColor
font.pixelSize: 14
- property string walletPath: (isIOS ? moneroAccountsDir : "") + persistentSettings.wallet_path
+ property string walletPath: (isIOS ? appWindow.accountsDir : "") + persistentSettings.wallet_path
text: "\
<style type='text/css'>\
a {cursor:pointer;text-decoration: none; color: #FF6C3C}\
diff --git a/wizard/WizardController.qml b/wizard/WizardController.qml
index ececc7b0..1c4f96b5 100644
--- a/wizard/WizardController.qml
+++ b/wizard/WizardController.qml
@@ -307,7 +307,7 @@ Rectangle {
FileDialog {
id: fileDialog
title: qsTr("Please choose a file") + translationManager.emptyString
- folder: "file://" + moneroAccountsDir
+ folder: "file://" + appWindow.accountsDir
nameFilters: [ "Wallet files (*.keys)"]
sidebarVisible: false
@@ -381,7 +381,7 @@ Rectangle {
};
if (isIOS) {
- new_wallet_filename = moneroAccountsDir + new_wallet_filename;
+ new_wallet_filename = appWindow.accountsDir + new_wallet_filename;
}
console.log("saving new wallet to", new_wallet_filename);
wizardController.m_wallet.storeAsync(handler, new_wallet_filename);
@@ -539,7 +539,7 @@ Rectangle {
persistentSettings.wallet_path = fn;
if(isIOS)
- persistentSettings.wallet_path = persistentSettings.wallet_path.replace(moneroAccountsDir, "");
+ persistentSettings.wallet_path = persistentSettings.wallet_path.replace(appWindow.accountsDir, "");
appWindow.openWallet();
}
diff --git a/wizard/WizardOpenWallet1.qml b/wizard/WizardOpenWallet1.qml
index 9385b88b..5aedb350 100644
--- a/wizard/WizardOpenWallet1.qml
+++ b/wizard/WizardOpenWallet1.qml
@@ -299,7 +299,7 @@ Rectangle {
function onPageCompleted(previousView){
if(previousView.viewName == "wizardHome"){
- walletKeysFilesModel.refresh(moneroAccountsDir);
+ walletKeysFilesModel.refresh(appWindow.accountsDir);
wizardOpenWallet1.walletCount = walletKeysFilesModel.rowCount();
flow._height = flow.calcHeight();
}
diff --git a/wizard/WizardWalletInput.qml b/wizard/WizardWalletInput.qml
index 261f4b37..5b2f3b69 100644
--- a/wizard/WizardWalletInput.qml
+++ b/wizard/WizardWalletInput.qml
@@ -55,7 +55,7 @@ GridLayout {
function reset() {
walletName.error = !walletName.verify();
walletLocation.error = walletLocation.text === "";
- walletLocation.text = moneroAccountsDir;
+ walletLocation.text = appWindow.accountsDir;
walletName.text = defaultAccountName;
}
@@ -66,7 +66,7 @@ GridLayout {
function verify(){
if(walletLocation === "" || /[\\\/]/.test(walletName.text)) return false;
- var exists = Wizard.walletPathExists(walletLocation.text, walletName.text, isIOS, walletManager);
+ var exists = Wizard.walletPathExists(appWindow.accountsDir, walletLocation.text, walletName.text, isIOS, walletManager);
return !exists && walletLocation.error === false;
}
@@ -88,7 +88,7 @@ GridLayout {
labelFontSize: 14
placeholderText: "..."
placeholderFontSize: 16
- text: moneroAccountsDir + "/"
+ text: appWindow.accountsDir + "/"
inlineButton.small: true
inlineButtonText: qsTr("Browse") + translationManager.emptyString
inlineButton.onClicked: {