aboutsummaryrefslogtreecommitdiff
path: root/wizard
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-07-10 17:54:34 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-07-10 17:54:34 -0400
commitf81bfa186510e6bf230b5a14697abc3f28533886 (patch)
tree240e3bd89a5a95b2b3b12fb0c62d9e6cae549a9a /wizard
parente4a3e282b55571ad2727d6d3588440122cab0ed4 (diff)
parent6739b51a5b2bfbc928ef49fc6db9eaf99ff0c44b (diff)
downloadmonzero-gui-f81bfa186510e6bf230b5a14697abc3f28533886.tar.gz
monzero-gui-f81bfa186510e6bf230b5a14697abc3f28533886.tar.xz
monzero-gui-f81bfa186510e6bf230b5a14697abc3f28533886.zip
Merge pull request #3613
6739b51 WizardWalletInput: red border if error; error messages; remove placeholders; smaller font; icon for browse button (rating89us)
Diffstat (limited to 'wizard')
-rw-r--r--wizard/WizardCreateDevice1.qml2
-rw-r--r--wizard/WizardCreateWallet1.qml2
-rw-r--r--wizard/WizardRestoreWallet1.qml2
-rw-r--r--wizard/WizardWalletInput.qml107
4 files changed, 96 insertions, 17 deletions
diff --git a/wizard/WizardCreateDevice1.qml b/wizard/WizardCreateDevice1.qml
index 4dea592c..21d0ac93 100644
--- a/wizard/WizardCreateDevice1.qml
+++ b/wizard/WizardCreateDevice1.qml
@@ -80,7 +80,7 @@ Rectangle {
ColumnLayout {
spacing: 0
- Layout.topMargin: 10
+ Layout.topMargin: -10
Layout.fillWidth: true
MoneroComponents.StandardDropdown {
diff --git a/wizard/WizardCreateWallet1.qml b/wizard/WizardCreateWallet1.qml
index 2e2aff68..c1ecf026 100644
--- a/wizard/WizardCreateWallet1.qml
+++ b/wizard/WizardCreateWallet1.qml
@@ -71,7 +71,7 @@ Rectangle {
ColumnLayout {
spacing: 0
- Layout.topMargin: 10
+ Layout.topMargin: -10
Layout.fillWidth: true
MoneroComponents.LineEditMulti {
diff --git a/wizard/WizardRestoreWallet1.qml b/wizard/WizardRestoreWallet1.qml
index 4eccc662..075a4d5a 100644
--- a/wizard/WizardRestoreWallet1.qml
+++ b/wizard/WizardRestoreWallet1.qml
@@ -111,7 +111,7 @@ Rectangle {
}
RowLayout {
- Layout.topMargin: 10
+ Layout.topMargin: -10
spacing: 30
Layout.fillWidth: true
diff --git a/wizard/WizardWalletInput.qml b/wizard/WizardWalletInput.qml
index 5f86295c..c4b31b85 100644
--- a/wizard/WizardWalletInput.qml
+++ b/wizard/WizardWalletInput.qml
@@ -30,6 +30,7 @@ import QtQuick 2.9
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0
+import FontAwesome 1.0
import "../js/Wizard.js" as Wizard
import "../components"
@@ -42,11 +43,11 @@ GridLayout {
property alias walletLocation: walletLocation
columnSpacing: 20
- columns: 3
+ columns: 2
function verify() {
- if(walletName.text !== '' && walletLocation.text !== ''){
- if(!walletName.error){
+ if (walletName.text !== '' && walletLocation.text !== '') {
+ if (!walletName.error && !walletLocation.error) {
return true;
}
}
@@ -55,26 +56,41 @@ GridLayout {
function reset() {
walletName.error = !walletName.verify();
- walletLocation.error = walletLocation.text === "";
+ walletLocation.error = !walletLocation.verify();
walletLocation.text = appWindow.accountsDir;
walletName.text = Wizard.unusedWalletName(appWindow.accountsDir, defaultAccountName, walletManager);
}
MoneroComponents.LineEdit {
id: walletName
- Layout.preferredWidth: grid.width/3
+ Layout.preferredWidth: grid.width/5
function verify(){
- if(walletLocation === "" || /[\\\/]/.test(walletName.text)) return false;
-
- var exists = Wizard.walletPathExists(appWindow.accountsDir, walletLocation.text, walletName.text, isIOS, walletManager);
- return !exists && walletLocation.error === false;
+ if (walletName.text === "") {
+ errorMessageWalletName.text = qsTr("Wallet name is empty") + translationManager.emptyString;
+ return false;
+ }
+ if (/[\\\/]/.test(walletName.text)) {
+ errorMessageWalletName.text = qsTr("Wallet name is invalid") + translationManager.emptyString;
+ return false;
+ }
+ if (walletLocation.text !== "") {
+ var walletAlreadyExists = Wizard.walletPathExists(appWindow.accountsDir, walletLocation.text, walletName.text, isIOS, walletManager);
+ if (walletAlreadyExists) {
+ errorMessageWalletName.text = qsTr("Wallet already exists") + translationManager.emptyString;
+ return false;
+ }
+ }
+ errorMessageWalletName.text = "";
+ return true;
}
labelText: qsTr("Wallet name") + translationManager.emptyString
labelFontSize: 14
+ fontSize: 16
placeholderFontSize: 16
- placeholderText: "-"
+ placeholderText: ""
+ errorWhenEmpty: true
text: defaultAccountName
onTextChanged: walletName.error = !walletName.verify();
@@ -85,18 +101,35 @@ GridLayout {
id: walletLocation
Layout.preferredWidth: grid.width/3
+ function verify() {
+ if (walletLocation.text == "") {
+ errorMessageWalletLocation.text = qsTr("Wallet location is empty") + translationManager.emptyString;
+ return false;
+ }
+ errorMessageWalletLocation.text = "";
+ return true;
+ }
+
labelText: qsTr("Wallet location") + translationManager.emptyString
labelFontSize: 14
- placeholderText: "..."
+ fontSize: 16
+ placeholderText: ""
placeholderFontSize: 16
+ errorWhenEmpty: true
text: appWindow.accountsDir + "/"
onTextChanged: {
- walletLocation.error = walletLocation.text === "";
+ walletLocation.error = !walletLocation.verify();
+ walletName.error = !walletName.verify();
}
+ Component.onCompleted: walletLocation.error = !walletLocation.verify();
MoneroComponents.InlineButton {
- small: true
- text: qsTr("Browse") + translationManager.emptyString
+ fontFamily: FontAwesome.fontFamilySolid
+ fontStyleName: "Solid"
+ fontPixelSize: 18
+ text: FontAwesome.folderOpen
+ tooltip: qsTr("Browse") + translationManager.emptyString
+ tooltipLeft: true
onClicked: {
fileWalletDialog.folder = walletManager.localPathToUrl(walletLocation.text)
fileWalletDialog.open()
@@ -119,4 +152,50 @@ GridLayout {
fileWalletDialog.visible = false;
}
}
+
+ RowLayout {
+ Layout.preferredWidth: grid.width/5
+
+ MoneroComponents.TextPlain {
+ visible: errorMessageWalletName.text != ""
+ font.family: FontAwesome.fontFamilySolid
+ font.styleName: "Solid"
+ font.pixelSize: 15
+ text: FontAwesome.exclamationCircle
+ color: "#FF0000"
+ themeTransition: false
+ }
+
+ MoneroComponents.TextPlain {
+ id: errorMessageWalletName
+ textFormat: Text.PlainText
+ font.family: MoneroComponents.Style.fontRegular.name
+ font.pixelSize: 14
+ color: "#FF0000"
+ themeTransition: false
+ }
+ }
+
+ RowLayout {
+ Layout.preferredWidth: grid.width/3
+
+ MoneroComponents.TextPlain {
+ visible: errorMessageWalletLocation.text != ""
+ font.family: FontAwesome.fontFamilySolid
+ font.styleName: "Solid"
+ font.pixelSize: 15
+ text: FontAwesome.exclamationCircle
+ color: "#FF0000"
+ themeTransition: false
+ }
+
+ MoneroComponents.TextPlain {
+ id: errorMessageWalletLocation
+ textFormat: Text.PlainText
+ font.family: MoneroComponents.Style.fontRegular.name
+ font.pixelSize: 14
+ color: "#FF0000"
+ themeTransition: false
+ }
+ }
}