aboutsummaryrefslogtreecommitdiff
path: root/wizard/WizardWalletInput.qml
diff options
context:
space:
mode:
authorrating89us <45968869+rating89us@users.noreply.github.com>2021-08-23 18:09:22 +0200
committerselsta <selsta@sent.at>2023-02-12 23:25:49 +0100
commit198dfb338cb26177763b5fff835a3740b0a4f0c5 (patch)
tree8e5608e824fde049ef9c0a5a37fd44c87dc6611a /wizard/WizardWalletInput.qml
parentb7ba9437d8cca6df4ecff7f5ae38a53cac5e26b2 (diff)
downloadmonzero-gui-198dfb338cb26177763b5fff835a3740b0a4f0c5.tar.gz
monzero-gui-198dfb338cb26177763b5fff835a3740b0a4f0c5.tar.xz
monzero-gui-198dfb338cb26177763b5fff835a3740b0a4f0c5.zip
wizard: redesign seed page
- move mnemonic seed - restore height into a separate page - pdf template - seed verification - responsive UI - accessibility
Diffstat (limited to 'wizard/WizardWalletInput.qml')
-rw-r--r--wizard/WizardWalletInput.qml259
1 files changed, 152 insertions, 107 deletions
diff --git a/wizard/WizardWalletInput.qml b/wizard/WizardWalletInput.qml
index c4b31b85..7eb92cec 100644
--- a/wizard/WizardWalletInput.qml
+++ b/wizard/WizardWalletInput.qml
@@ -41,9 +41,16 @@ GridLayout {
Layout.fillWidth: true
property alias walletName: walletName
property alias walletLocation: walletLocation
+ property alias browseButton: browseButton
+ property alias errorMessageWalletName: errorMessageWalletName
+ property alias errorMessageWalletLocation: errorMessageWalletLocation
+ property bool rowLayout: true
+ property var walletNameKeyNavigationBackTab: browseButton
+ property var browseButtonKeyNavigationTab: walletName
- columnSpacing: 20
- columns: 2
+ columnSpacing: rowLayout ? 20 : 0
+ rowSpacing: rowLayout ? 0 : 20
+ columns: rowLayout ? 2 : 1
function verify() {
if (walletName.text !== '' && walletLocation.text !== '') {
@@ -61,79 +68,163 @@ GridLayout {
walletName.text = Wizard.unusedWalletName(appWindow.accountsDir, defaultAccountName, walletManager);
}
- MoneroComponents.LineEdit {
- id: walletName
- Layout.preferredWidth: grid.width/5
+ ColumnLayout {
+ MoneroComponents.LineEdit {
+ id: walletName
+ Layout.preferredWidth: grid.width/5
- function verify(){
- 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;
+ function verify(){
+ 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;
}
- errorMessageWalletName.text = "";
- return true;
+
+ labelText: qsTr("Wallet name") + translationManager.emptyString
+ labelFontSize: 14
+ fontSize: 16
+ placeholderFontSize: 16
+ placeholderText: ""
+ errorWhenEmpty: true
+ text: defaultAccountName
+
+ onTextChanged: walletName.error = !walletName.verify();
+ Component.onCompleted: walletName.error = !walletName.verify();
+
+ Accessible.role: Accessible.EditableText
+ Accessible.name: labelText + text
+ KeyNavigation.up: walletNameKeyNavigationBackTab
+ KeyNavigation.backtab: walletNameKeyNavigationBackTab
+ KeyNavigation.down: errorMessageWalletName.text != "" ? errorMessageWalletName : appWindow.walletMode >= 2 ? walletLocation : wizardNav.btnPrev
+ KeyNavigation.tab: errorMessageWalletName.text != "" ? errorMessageWalletName : appWindow.walletMode >= 2 ? walletLocation : wizardNav.btnPrev
}
- labelText: qsTr("Wallet name") + translationManager.emptyString
- labelFontSize: 14
- fontSize: 16
- placeholderFontSize: 16
- placeholderText: ""
- errorWhenEmpty: true
- text: defaultAccountName
+ RowLayout {
+ Layout.preferredWidth: grid.width/5
- onTextChanged: walletName.error = !walletName.verify();
- Component.onCompleted: walletName.error = !walletName.verify();
+ 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
+ Accessible.role: Accessible.StaticText
+ Accessible.name: text
+ KeyNavigation.up: walletName
+ KeyNavigation.backtab: walletName
+ KeyNavigation.down: walletLocation
+ KeyNavigation.tab: walletLocation
+ }
+ }
}
- MoneroComponents.LineEdit {
- id: walletLocation
- Layout.preferredWidth: grid.width/3
+ ColumnLayout {
+ visible: appWindow.walletMode >= 2
- function verify() {
- if (walletLocation.text == "") {
- errorMessageWalletLocation.text = qsTr("Wallet location is empty") + translationManager.emptyString;
- return false;
+ MoneroComponents.LineEdit {
+ 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;
}
- errorMessageWalletLocation.text = "";
- return true;
- }
- labelText: qsTr("Wallet location") + translationManager.emptyString
- labelFontSize: 14
- fontSize: 16
- placeholderText: ""
- placeholderFontSize: 16
- errorWhenEmpty: true
- text: appWindow.accountsDir + "/"
- onTextChanged: {
- walletLocation.error = !walletLocation.verify();
- walletName.error = !walletName.verify();
+ labelText: qsTr("Wallet location") + translationManager.emptyString
+ labelFontSize: 14
+ fontSize: 16
+ placeholderText: ""
+ placeholderFontSize: 16
+ errorWhenEmpty: true
+ text: appWindow.accountsDir + "/"
+ onTextChanged: {
+ walletLocation.error = !walletLocation.verify();
+ walletName.error = !walletName.verify();
+ }
+ Component.onCompleted: walletLocation.error = !walletLocation.verify();
+ Accessible.role: Accessible.EditableText
+ Accessible.name: labelText + text
+ KeyNavigation.up: errorMessageWalletName.text != "" ? errorMessageWalletName : walletName
+ KeyNavigation.backtab: errorMessageWalletName.text != "" ? errorMessageWalletName : walletName
+ KeyNavigation.down: browseButton
+ KeyNavigation.tab: browseButton
+
+ MoneroComponents.InlineButton {
+ id: browseButton
+ 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()
+ walletLocation.focus = true
+ }
+ Accessible.role: Accessible.Button
+ Accessible.name: qsTr("Browse") + translationManager.emptyString
+ KeyNavigation.up: walletLocation
+ KeyNavigation.backtab: walletLocation
+ KeyNavigation.down: errorMessageWalletLocation.text != "" ? errorMessageWalletLocation : browseButtonKeyNavigationTab
+ KeyNavigation.tab: errorMessageWalletLocation.text != "" ? errorMessageWalletLocation : browseButtonKeyNavigationTab
+ }
}
- Component.onCompleted: walletLocation.error = !walletLocation.verify();
- MoneroComponents.InlineButton {
- 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()
- walletLocation.focus = true
+ 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
+ Accessible.role: Accessible.StaticText
+ Accessible.name: text
+ KeyNavigation.up: browseButton
+ KeyNavigation.backtab: browseButton
+ KeyNavigation.down: browseButtonKeyNavigationTab
+ KeyNavigation.tab: browseButtonKeyNavigationTab
}
}
}
@@ -152,50 +243,4 @@ 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
- }
- }
}