@ -91,8 +91,14 @@ Page {
walletMessageArea . messageCode = 1
return ; / / e x i t f u n c t i o n a n d d o n o t p r o c e e d a n y f u r t h e r
}
/ / I n c a s e p a s s w o r d d o e s n o t f i t t h e r e g e x r e q u i r e m e n t s
if ( ! walletPasswordField . acceptableInput ) {
walletMessageArea . text = "Wallet password is too short (minimum length: 8)"
walletMessageArea . messageCode = 1
return ;
}
/ / I n c a s e w a l l e t p a s s w o r d s d o n o t m a t c h , d i s p l a y e r r o r m e s s a g e
if ( walletPasswordConfirmField . text != walletPasswordField . text || ! walletPasswordField . acceptableInput ) {
if ( walletPasswordConfirmField . text != walletPasswordField . text ) {
walletMessageArea . text = ( walletPasswordConfirmField . length > 0 ) ? qsTr ( "Wallet passwords do not match" ) : qsTr ( "Wallet password must be confirmed" )
walletMessageArea . messageCode = 1
return ;
@ -588,6 +594,7 @@ Page {
/ / S w i t c h t o H o m e P a g e
pageStack . pushPage ( "qrc:/qml/pages/HomePage.qml" , StackView . Immediate )
/ / c o n s o l e . l o g ( " S e e d : " , W a l l e t . g e t S e e d ( ) )
navBar . messageCounterText = User . messagesCount
}
/ / r e s t o r e f r o m s e e d
if ( walletRestoreStack . currentIndex == 1 ) {
@ -716,364 +723,454 @@ Page {
}
}
GridLayout {
anchors.horizontalCenter: parent . horizontalCenter / / ( w a l l e t S e e d R e p e a t e r . m o d e l ) ? t h i s . h o r i z o n t a l C e n t e r : p a r e n t . h o r i z o n t a l C e n t e r
ColumnLayout {
anchors.fill: parent
anchors.margins: 20
/*anchors.horizontalCenter: parent.horizontalCenter/ / ( walletSeedRepeater . model ) ? this.horizontalCenter : parent . horizontalCenter
anchors.verticalCenter: parent . verticalCenter
anchors.top: parent . top
anchors.topMargin: 20
anchors.topMargin: 20 * /
/ / a n c h o r s . l e f t : p a r e n t . l e f t
/ / a n c h o r s . l e f t M a r g i n : w a l l e t P a g e N e x t B u t t o n . w i d t h + 2 0
/ / w i d t h : 8 0 0
/ / / / a n c h o r s . r i g h t M a r g i n : w a l l e t P a g e N e x t B u t t o n . w i d t h + 2 0 / / a n c h o r s . m a r g i n s : 5 0
columns: 2 / / S e t c o l u m n l i m i t t o 2
columnSpacing: 100 / / T h e d e f a u l t v a l u e i s 5 . S a m e w i t h r o w S p a c i n g
/*columns: 2 / / Set column limit to 2
columnSpacing: 100 * / / / The default value is 5 . Same with rowSpacin g
/ / / / r o w s : 1 0
/ / / / r o w S p a c i n g : 1 5
RowLayout {
/ / R e m i n d e r : L a y o u t . f u n c t i o n s w o r k f o r i t e m s i n s i d e L a y o u t s b u t n o t f o r t h e L a y o u t i t s e l f !
Text {
id: walletGenPageTitle
Layout.row: 0
Layout.column: 0
text: qsTr ( "Create Wallet" )
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
font.bold: true
font.pointSize: 14
}
/ / w a l l e t n a m e c r e a t i o n t e x t
Text {
id: walletNameText
Layout.row: 1
Layout.column: 0
text: qsTr ( "Wallet name" )
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
font.bold: true
}
/ / w a l l e t n a m e c r e a t i o n f i e l d
TextField {
id: walletNameField
Layout.preferredWidth: 500
Layout.preferredHeight: 50 / / w i d t h : 5 0 0 ; h e i g h t : 5 0
Layout.row: 2
Layout.column: 0
Layout.topMargin: ( walletNameText . visible ) ? 5 : 0
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
placeholderText: qsTr ( "wallet" ) ; placeholderTextColor: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000" / / t e x t C o l o r
selectByMouse: true
/ / t o d o : v a l i d a t o r r e g e x f o r p r e v e n t i n g s p e c i a l c h a r a c t e r s l i k e : * . " / \ [ ] : ; | , f r o m b e i n g a d d e d t o t h e w a l l e t n a m e
background: Rectangle {
color: ( NeroshopComponents . Style . darkTheme ) ? "#101010" : "#ffffff"
border.color: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
radius: 3
}
}
/ / w a l l e t p a s s w o r d c r e a t i o n f i e l d
TextField {
id: walletPasswordField
Layout.preferredWidth: 500
Layout.preferredHeight: 50 / / w i d t h : 5 0 0 ; h e i g h t : 5 0
Layout.row: 3
Layout.column: 0
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
placeholderText: qsTr ( "Wallet Password" )
placeholderTextColor: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
color: NeroshopComponents . Style . moneroOrangeColor / / t e x t C o l o r
echoMode: ( ! walletPasswordVisibilityToggle . checked ) ? TextInput.Normal : TextInput . Password / / T e x t I n p u t . P a s s w o r d E c h o O n E d i t
inputMethodHints: Qt . ImhSensitiveData
selectByMouse: true
/ / v a l i d a t o r : R e g u l a r E x p r e s s i o n V a l i d a t o r { r e g u l a r E x p r e s s i o n : " ^ ( ? = . * ? [ A - Z ] ) ( ? = . * ? [ a - z ] ) ( ? = . * ? [ 0 - 9 ] ) ( ? = . * ? [ # ? ! @ $ % ^ & * - ] ) . { 8 , } $ " }
background: Rectangle {
color: walletNameField . background . color
border.color: ( ! parent . acceptableInput ) ? walletPasswordStatusMark.invalidColor : parent . placeholderTextColor / /walletPasswordConfirmField.background.border.color/ / / / ( ( p a r e n t . l e n g t h > 0 & & w a l l e t P a s s w o r d C o n f i r m F i e l d . l e n g t h = = 0 ) ? ( ( w a l l e t P a s s w o r d C o n f i r m F i e l d . t e x t ! = w a l l e t P a s s w o r d F i e l d . t e x t | | ! w a l l e t P a s s w o r d F i e l d . a c c e p t a b l e I n p u t ) ? w a l l e t P a s s w o r d S t a t u s M a r k . i n v a l i d C o l o r : w a l l e t P a s s w o r d S t a t u s M a r k . v a l i d C o l o r ) : w a l l e t P a s s w o r d C o n f i r m F i e l d . b a c k g r o u n d . b o r d e r . c o l o r )
border.width: ( ! parent . acceptableInput ) ? 2 : 1 / /walletPasswordConfirmField.background.border.width/ / / / ( p a r e n t . l e n g t h > 0 & & w a l l e t P a s s w o r d C o n f i r m F i e l d . l e n g t h = = 0 ) ? 2 : w a l l e t P a s s w o r d C o n f i r m F i e l d . b a c k g r o u n d . b o r d e r . w i d t h
radius: 3
}
/ / t o d o : m a y b e a d d a r e g e x v a l i d a t o r
rightPadding: 15 + walletPasswordVisibilityToggle . width
/ / w a l l e t p a s s w o r d v i s i b i l i t y t o g g l e
Button {
id: walletPasswordVisibilityToggle
text: ( checked ) ? FontAwesome.eye : FontAwesome . eyeSlash / / i c o n . s o u r c e :
anchors.right: parent . right
anchors.rightMargin: 15
anchors.verticalCenter: parent . verticalCenter
implicitWidth: 24 ; implicitHeight: 24
checkable: true
checked: true / / f a l s e
hoverEnabled: true
/ / c h e c k e d = s h o w , u n c h e c k e d = h i d e . P a s s w o r d s a r e h i d d e n b y d e f a u l t
background: Rectangle {
color: "transparent"
}
contentItem: Text {
text: parent . text
color: ( parent . checked ) ? "#a9a9a9" : "#696969"
verticalAlignment: Text . AlignVCenter
font.bold: true
}
}
}
/ / w a l l e t p a s s w o r d c o n f i r m a t i o n f i e l d
TextField {
id: walletPasswordConfirmField
Layout.preferredWidth: 500
Layout.preferredHeight: 50 / / w i d t h : 5 0 0 ; h e i g h t : 5 0
Layout.row: 4
Layout.column: 0
/ / L a y o u t . t o p M a r g i n : 5
/ / r i g h t P a d d i n g
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
placeholderText: qsTr ( "Confirm Wallet Password" )
placeholderTextColor: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
color: walletPasswordField . color / /NeroshopComponents.Style.moneroOrangeColor / / textColor
echoMode: ( ! walletPasswordVisibilityToggle . checked ) ? TextInput.Normal : TextInput . Password
inputMethodHints: Qt . ImhSensitiveData
selectByMouse: true
background: Rectangle {
color: walletPasswordField . background . color / / N e r o s h o p C o m p o n e n t s . S t y l e . m o n e r o G r a y C o l o r
border.color: ( parent . length > 0 ) ? walletPasswordStatusMark.color : parent . placeholderTextColor
border.width: ( parent . length > 0 ) ? 2 : 1
radius: 3
}
rightPadding: 30 + walletPasswordStatusMark . contentWidth / / d o u b l e r i g h t m a r g i n s i z e
/ / w a l l e t p a s s w o r d v a l i d a t i o n s t a t u s m a r k
Text {
id: walletPasswordStatusMark
property string validColor: "#50b954"
property string invalidColor: "#f17982"
anchors.right: parent . right
anchors.rightMargin: 15
anchors.verticalCenter: parent . verticalCenter
text: ( walletPasswordConfirmField . text != walletPasswordField . text || ! walletPasswordField . acceptableInput ) ? qsTr ( FontAwesome . xmark ) : qsTr ( FontAwesome . check )
visible: ( walletPasswordConfirmField . length > 0 )
font.bold: true
font.family: FontAwesome . fontFamily
color: ( walletPasswordConfirmField . text != walletPasswordField . text || ! walletPasswordField . acceptableInput ) ? invalidColor : validColor
}
}
/ / w a l l e t p a t h t e x t
Text {
id: walletPathText
Layout.row: 5
Layout.column: 0
Layout.topMargin: 10
text: qsTr ( "Wallet path" )
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
font.bold: true
}
/ / w a l l e t p a t h f i e l d
TextField {
id: walletPathField
Layout.row: 6
Layout.column: 0
Layout.preferredWidth: 500 ; Layout.preferredHeight: 50
Layout.topMargin: ( walletPathText . visible ) ? 5 : 0
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
text: walletFolderDialog . folder / / / / ( w a l l e t N a m e F i e l d . t e x t ) ? q s T r ( w a l l e t F o l d e r D i a l o g . f o l d e r + " / % 1 . k e y s " ) . a r g ( w a l l e t N a m e F i e l d . t e x t ) : q s T r ( w a l l e t F o l d e r D i a l o g . f o l d e r + " / % 1 . k e y s " ) . a r g ( w a l l e t N a m e F i e l d . p l a c e h o l d e r T e x t )
color: "#000000" / /(NeroshopComponents.Style.darkTheme) ? "#ffffff" : "#000000" / / textColor
selectByMouse: true
readOnly: true
/ / R o w R e c t 1
Item { / / R e c t a n g l e {
Layout.alignment: Qt . AlignTop | Qt . AlignLeft
Layout.fillWidth: true
Layout.fillHeight: true
/ * r a d i u s : 3
color: "transparent"
border.color: "#ffffff" * /
ColumnLayout {
id: rectColumn1
anchors.centerIn: parent / / Never use "anchors.fill: parent" for this so we have full control over the spacing and margins!/ / "anchors.margins: 20" - makes no sense if centered in parent
states: [
State {
name: "expand"
PropertyChanges {
target: rectColumn1
width: 600 / / 6 0 0 o r 5 4 0 i n s t e a d o f 5 0 0 , t o l e a v e r o o m f o r t h e m a r g i n s w i t h o u t r e d u c i n g c h i l d r e n s i z e
}
} ,
State {
name: "shrink"
PropertyChanges {
target: rectColumn1
width: parent . width
}
}
]
state: ( walletSeedRepeater . model == null ) ? "expand" : "shrink"
/ * T e x t {
id: walletGenPageTitle
text: qsTr ( "Create Wallet" )
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
font.bold: true
font.pointSize: 14
} * /
Item {
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop / / r e m o v e t h i s i f w a n t t o f i l l w i d t h
Layout.maximumWidth: 500 / / r e m o v e t h i s t o o i f w a n t t o f i l l w i d t h
Layout.fillWidth: true
Layout.preferredHeight: childrenRect . height
Layout.leftMargin: 20 ; Layout.rightMargin: 20
/ / w a l l e t n a m e c r e a t i o n t e x t
Column {
spacing: 10
Text {
id: walletNameText
text: qsTr ( "Wallet name" )
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
font.bold: true
}
/ / w a l l e t n a m e c r e a t i o n f i e l d
TextField {
id: walletNameField
width: parent . parent . width / / 5 0 0
height: 50
placeholderText: qsTr ( "wallet" ) ; placeholderTextColor: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000" / / t e x t C o l o r
selectByMouse: true
maximumLength: 255
/ / v a l i d a t o r r e g e x f o r p r e v e n t i n g s p e c i a l c h a r a c t e r s l i k e : * . " \ / [ ] : ; < > ^ | , ? f r o m b e i n g a d d e d t o t h e w a l l e t n a m e
validator: RegExpValidator {
regExp: /^(?![. ])(?!.*[. ]$)[^*/"\\[\]:;<>\^|,?]*$/
}
background: Rectangle {
color: ( NeroshopComponents . Style . darkTheme ) ? "#101010" : "#ffffff"
border.color: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
radius: 3
}
}
}
}
Item {
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.maximumWidth: 500
Layout.fillWidth: true
Layout.preferredHeight: childrenRect . height
Layout.leftMargin: 20 ; Layout.rightMargin: 20
/ / w a l l e t p a s s w o r d c r e a t i o n f i e l d
Column {
spacing: 10
TextField {
id: walletPasswordField
width: parent . parent . width ; height: 50
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
placeholderText: qsTr ( "Wallet Password" )
placeholderTextColor: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
color: NeroshopComponents . Style . moneroOrangeColor / / t e x t C o l o r
echoMode: ( ! walletPasswordVisibilityToggle . checked ) ? TextInput.Normal : TextInput . Password / / T e x t I n p u t . P a s s w o r d E c h o O n E d i t
inputMethodHints: Qt . ImhSensitiveData
selectByMouse: true
validator: RegExpValidator {
regExp: /^.{8,}$/
/ / E x p l a n a t i o n o f t h e r e g e x :
/ / . { 8 , } - M i n i m u m 8 c h a r a c t e r s
}
background: Rectangle {
color: walletNameField . background . color
border.color: ( ! parent . acceptableInput && parent . text . length > 0 ) ? walletPasswordStatusMark.invalidColor : parent . placeholderTextColor / /walletPasswordConfirmField.background.border.color/ / / / ( ( p a r e n t . l e n g t h > 0 & & w a l l e t P a s s w o r d C o n f i r m F i e l d . l e n g t h = = 0 ) ? ( ( w a l l e t P a s s w o r d C o n f i r m F i e l d . t e x t ! = w a l l e t P a s s w o r d F i e l d . t e x t | | ! w a l l e t P a s s w o r d F i e l d . a c c e p t a b l e I n p u t ) ? w a l l e t P a s s w o r d S t a t u s M a r k . i n v a l i d C o l o r : w a l l e t P a s s w o r d S t a t u s M a r k . v a l i d C o l o r ) : w a l l e t P a s s w o r d C o n f i r m F i e l d . b a c k g r o u n d . b o r d e r . c o l o r )
border.width: ( ! parent . acceptableInput && parent . text . length > 0 ) ? 2 : 1 / /walletPasswordConfirmField.background.border.width/ / / / ( p a r e n t . l e n g t h > 0 & & w a l l e t P a s s w o r d C o n f i r m F i e l d . l e n g t h = = 0 ) ? 2 : w a l l e t P a s s w o r d C o n f i r m F i e l d . b a c k g r o u n d . b o r d e r . w i d t h
radius: 3
}
/ / t o d o : m a y b e a d d a r e g e x v a l i d a t o r
rightPadding: 15 + walletPasswordVisibilityToggle . width
/ / w a l l e t p a s s w o r d v i s i b i l i t y t o g g l e
Button {
id: walletPasswordVisibilityToggle
text: ( checked ) ? FontAwesome.eye : FontAwesome . eyeSlash / / i c o n . s o u r c e :
anchors.right: parent . right
anchors.rightMargin: 15
anchors.verticalCenter: parent . verticalCenter
implicitWidth: 24 ; implicitHeight: 24
checkable: true
checked: true / / f a l s e
hoverEnabled: true
/ / c h e c k e d = s h o w , u n c h e c k e d = h i d e . P a s s w o r d s a r e h i d d e n b y d e f a u l t
background: Rectangle {
color: "transparent"
}
contentItem: Text {
text: parent . text
color: ( parent . checked ) ? "#a9a9a9" : "#696969"
verticalAlignment: Text . AlignVCenter
font.bold: true
}
}
}
/ / w a l l e t p a s s w o r d c o n f i r m a t i o n f i e l d
TextField {
id: walletPasswordConfirmField
width: parent . parent . width ; height: 50
/ / L a y o u t . t o p M a r g i n : 5
/ / r i g h t P a d d i n g
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
placeholderText: qsTr ( "Confirm Wallet Password" )
placeholderTextColor: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
color: walletPasswordField . color / /NeroshopComponents.Style.moneroOrangeColor / / textColor
echoMode: ( ! walletPasswordVisibilityToggle . checked ) ? TextInput.Normal : TextInput . Password
inputMethodHints: Qt . ImhSensitiveData
selectByMouse: true
background: Rectangle {
color: walletPasswordField . background . color / / N e r o s h o p C o m p o n e n t s . S t y l e . m o n e r o G r a y C o l o r
border.color: ( parent . length > 0 ) ? walletPasswordStatusMark.color : parent . placeholderTextColor
border.width: ( parent . length > 0 ) ? 2 : 1
radius: 3
}
rightPadding: 30 + walletPasswordStatusMark . contentWidth / / d o u b l e r i g h t m a r g i n s i z e
/ / w a l l e t p a s s w o r d v a l i d a t i o n s t a t u s m a r k
Text {
id: walletPasswordStatusMark
property string validColor: "#50b954"
property string invalidColor: "#f17982"
anchors.right: parent . right
anchors.rightMargin: 15
anchors.verticalCenter: parent . verticalCenter
text: ( walletPasswordConfirmField . text != walletPasswordField . text ) ? qsTr ( FontAwesome . xmark ) : qsTr ( FontAwesome . check )
visible: ( walletPasswordConfirmField . length > 0 )
font.bold: true
font.family: FontAwesome . fontFamily
color: ( walletPasswordConfirmField . text != walletPasswordField . text ) ? invalidColor : validColor
}
}
} / / c o l u m n
} / / w a l l e t p a s s w o r d i t e m
Item {
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.maximumWidth: 500
Layout.fillWidth: true
Layout.preferredHeight: childrenRect . height
Layout.leftMargin: 20 ; Layout.rightMargin: 20
Column {
spacing: 10
/ / w a l l e t p a t h t e x t
Text {
id: walletPathText
text: qsTr ( "Wallet path" )
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
font.bold: true
}
/ / w a l l e t p a t h f i e l d
TextField {
id: walletPathField
width: parent . parent . width ; height: 50
text: walletFolderDialog . folder / / / / ( w a l l e t N a m e F i e l d . t e x t ) ? q s T r ( w a l l e t F o l d e r D i a l o g . f o l d e r + " / % 1 . k e y s " ) . a r g ( w a l l e t N a m e F i e l d . t e x t ) : q s T r ( w a l l e t F o l d e r D i a l o g . f o l d e r + " / % 1 . k e y s " ) . a r g ( w a l l e t N a m e F i e l d . p l a c e h o l d e r T e x t )
color: "#000000" / /(NeroshopComponents.Style.darkTheme) ? "#ffffff" : "#000000" / / textColor
selectByMouse: true
readOnly: true
background: Rectangle {
color: "#708090" / / ( N e r o s h o p C o m p o n e n t s . S t y l e . d a r k T h e m e ) ? " # 1 0 1 0 1 0 " : " # f f f f f f "
border.color: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
radius: 3
}
}
RowLayout {
Layout.row: 7
Layout.column: 0
/ / v i s i b l e : ! w a l l e t S e e d R e p e a t e r . m o d e l
/ / w a l l e t p a t h c h a n g e o r u p l o a d b u t t o n
Button {
id: walletPathChangeButton
Layout.topMargin: 10
Layout.preferredWidth: walletPathField . width / 4 / / w a l l e t P a t h C h a n g e B u t t o n T e x t . c o n t e n t W i d t h + 2 0
Layout.preferredHeight: 50 / / w a l l e t P a t h F i e l d . L a y o u t . p r e f e r r e d H e i g h t
text: qsTr ( "Change" )
/ / d i s p l a y : A b s t r a c t B u t t o n . I c o n O n l y / / A b s t r a c t B u t t o n . T e x t B e s i d e I c o n / / A b s t r a c t B u t t o n . T e x t O n l y
/ / i c o n . s o u r c e : " q r c : / a s s e t s / i m a g e s / c h a n g e . p n g "
/ / i c o n . c o l o r : " # f f f f f f "
hoverEnabled: true
onClicked: walletFolderDialog . open ( )
background: Rectangle {
color: "#708090" / / ( N e r o s h o p C o m p o n e n t s . S t y l e . d a r k T h e m e ) ? " # 1 0 1 0 1 0 " : " # f f f f f f "
border.color: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
radius: 3
}
}
}
}
Row {
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.maximumWidth: 500
Layout.fillWidth: true
Layout.leftMargin: 20 ; Layout.rightMargin: 20
spacing: 5
/ / w a l l e t p a t h c h a n g e o r u p l o a d b u t t o n
Button {
id: walletPathChangeButton
/ / L a y o u t . t o p M a r g i n : 1 0
width: parent . width / 4 / / w a l l e t P a t h C h a n g e B u t t o n T e x t . c o n t e n t W i d t h + 2 0
height: 50 / / w a l l e t P a t h F i e l d . L a y o u t . p r e f e r r e d H e i g h t
text: qsTr ( "Change" )
/ / d i s p l a y : A b s t r a c t B u t t o n . I c o n O n l y / / A b s t r a c t B u t t o n . T e x t B e s i d e I c o n / / A b s t r a c t B u t t o n . T e x t O n l y
/ / i c o n . s o u r c e : " q r c : / a s s e t s / i m a g e s / c h a n g e . p n g "
/ / i c o n . c o l o r : " # f f f f f f "
hoverEnabled: true
onClicked: walletFolderDialog . open ( )
background: Rectangle {
color: NeroshopComponents . Style . moneroGrayColor
radius: 5
border.color: walletPathChangeButton . hovered ? "#ffffff" : this . color / /"#ffffff"/ / control . down ? "#17a81a" : "#21be2b"
}
background: Rectangle {
color: NeroshopComponents . Style . moneroGrayColor
radius: 5
border.color: walletPathChangeButton . hovered ? "#ffffff" : this . color / /"#ffffff"/ / control . down ? "#17a81a" : "#21be2b"
}
contentItem: Text {
id: walletPathChangeButtonText
text: parent . text
color: "#ffffff"
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
font.bold: true
}
contentItem: Text {
id: walletPathChangeButtonText
text: parent . text
color: "#ffffff"
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
font.bold: true
}
MouseArea {
anchors.fill: parent
onPressed: mouse . accepted = false
cursorShape: Qt . PointingHandCursor
}
ToolTip.delay: 1000
ToolTip.visible: hovered
ToolTip.text: qsTr ( "Change wallet path" )
}
/ / g e n e r a t e k e y b u t t o n
Button {
id: generateKeysButton
Layout.topMargin: 10 / / 2 0
Layout.preferredWidth: ( walletPathChangeButton . width * 3 ) - parent . spacing / / 1 5 0
Layout.preferredHeight: 50
text: qsTr ( "Generate" ) / / ( " G e n e r a t e K e y s " )
hoverEnabled: true
onClicked: generateWalletKeys ( )
ToolTip.delay: 1000
ToolTip.visible: hovered
ToolTip.text: qsTr ( "Change wallet path" )
}
/ / g e n e r a t e k e y b u t t o n
Button {
id: generateKeysButton
/ / L a y o u t . t o p M a r g i n : 1 0 // 2 0
w idth: ( walletPathChangeButton . width * 3 ) - parent . spacing / / 1 5 0
h eight: 50
text: qsTr ( "Generate" ) / / ( " G e n e r a t e K e y s " )
hoverEnabled: true
onClicked: generateWalletKeys ( )
contentItem: Text {
/ / i d : g e n e r a t e K e y s B u t t o n T e x t
font.bold: true
text: generateKeysButton . text
color: "#ffffff" / / w h i t e
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
}
contentItem: Text {
/ / i d : g e n e r a t e K e y s B u t t o n T e x t
font.bold: true
text: generateKeysButton . text
color: "#ffffff" / / w h i t e
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
}
background: Rectangle {
color: NeroshopComponents . Style . moneroOrangeColor
radius: 5
}
}
} / / R o w L a y o u t c o n t a i n i n g b o t h w a l l e t P a t h C h a n g e B u t t o n a n d g e n e r a t e K e y s b u t t o n
/ / i m p o r t a n t w a l l e t m e s s a g e b o x
TextArea {
id: walletMessageArea
visible: true / / / / f a l s e
Layout.row: 8
Layout.column: 0
Layout.fillWidth: true / / e x t e n d s t h e T e x t A r e a ' s w i d t h t o t h e w i d t h o f t h e L a y o u t
Layout.maximumWidth: walletPathField . width / / k e e p s t e x t a r e a f r o m g o i n g p a s t g r i d b o u n d s w h e n t e x t i s a d d e d
Layout.preferredHeight: contentHeight + 20
Layout.topMargin: 20 / / 1 5
selectByMouse: true
readOnly: true
verticalAlignment: TextEdit . AlignVCenter / / a l i g n t h e t e x t w i t h i n t h e c e n t e r o f T e x t A r e a i t e m ' s h e i g h t
wrapMode: TextEdit . Wrap / / m o v e t e x t t o n e w l i n e i f i t r e a c h e s t h e w i d t h o f t h e T e x t A r e a
text: qsTr ( "Please generate your wallet keys before registering your wallet." )
color: ( messageCode == 1 ) ? "#b22222" : ( ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#404040" ) / / t e x t c o l o r
property int messageCode: 0 / / 0 = i n f o ; 1 = w a r n i n g o r e r r o r
background: Rectangle {
color: "transparent"
border.color: ( parent . messageCode == 1 ) ? "#b22222" : "#2196f3" / / / / p a r e n t . c o l o r / / ( N e r o s h o p C o m p o n e n t s . S t y l e . d a r k T h e m e ) ? " # f f f f f f " : " # 4 0 4 0 4 0 "
radius: 3
}
leftPadding: 30 + circleInfo . contentWidth
Text {
id: circleInfo
anchors.left: parent . left
anchors.leftMargin: 15
anchors.verticalCenter: parent . verticalCenter
text: ( parent . messageCode == 1 ) ? qsTr ( FontAwesome . triangleExclamation ) : qsTr ( FontAwesome . circleInfo )
color: ( parent . messageCode == 1 ) ? "#b22222" : "#2196f3"
font.bold: true
font.family: FontAwesome . fontFamily
}
}
/ / w a l l e t s e e d m e s s a g e b o x
TextArea {
id: seedMessageArea
visible: ( walletSeedRepeater . model != null )
Layout.row: 0
Layout.column: 1
Layout.fillWidth: true / / e x t e n d s t h e T e x t A r e a ' s w i d t h t o t h e w i d t h o f t h e L a y o u t
Layout.maximumWidth: 550 / / / / w a l l e t P a t h F i e l d . w i d t h / / k e e p s t e x t a r e a f r o m g o i n g p a s t g r i d b o u n d s w h e n t e x t i s a d d e d
/ / / / i m p l i c i t H e i g h t : c o n t e n t H e i g h t + 2 0 / / / / L a y o u t . p r e f e r r e d H e i g h t : c o n t e n t H e i g h t + 2 0 / / c a u s e o f Q M L T e x t A r e a : B i n d i n g l o o p d e t e c t e d f o r p r o p e r t y " i m p l i c i t W i d t h " e r r o r
/ / / / L a y o u t . t o p M a r g i n : 2 0 / / 1 5
selectByMouse: true
readOnly: true
verticalAlignment: TextEdit . AlignVCenter / / a l i g n t h e t e x t w i t h i n t h e c e n t e r o f T e x t A r e a i t e m ' s h e i g h t
wrapMode: TextEdit . Wrap / / m o v e t e x t t o n e w l i n e i f i t r e a c h e s t h e w i d t h o f t h e T e x t A r e a
text: qsTr ( "" )
/ / f o n t . b o l d : t r u e
color: ( messageCode == 1 ) ? "#b22222" : ( ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#404040" ) / / t e x t c o l o r
property int messageCode: 0 / / 0 = i n f o ; 1 = w a r n i n g o r e r r o r
background: Rectangle {
background: Rectangle {
color: NeroshopComponents . Style . moneroOrangeColor
radius: 5
}
MouseArea {
anchors.fill: parent
onPressed: mouse . accepted = false
cursorShape: Qt . PointingHandCursor
}
}
} / / R o w c o n t a i n i n g b o t h w a l l e t P a t h C h a n g e B u t t o n a n d g e n e r a t e K e y s b u t t o n
/ / i m p o r t a n t w a l l e t m e s s a g e b o x
TextArea {
id: walletMessageArea
visible: true / / / / f a l s e
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.fillWidth: true / / e x t e n d s t h e T e x t A r e a ' s w i d t h t o t h e w i d t h o f t h e L a y o u t
Layout.maximumWidth: walletPathField . width / / k e e p s t e x t a r e a f r o m g o i n g p a s t g r i d b o u n d s w h e n t e x t i s a d d e d
Layout.preferredHeight: contentHeight + 20
Layout.topMargin: 20 / / 1 5
Layout.leftMargin: 20 ; Layout.rightMargin: 20
selectByMouse: true
readOnly: true
verticalAlignment: TextEdit . AlignVCenter / / a l i g n t h e t e x t w i t h i n t h e c e n t e r o f T e x t A r e a i t e m ' s h e i g h t
wrapMode: TextEdit . Wrap / / m o v e t e x t t o n e w l i n e i f i t r e a c h e s t h e w i d t h o f t h e T e x t A r e a
text: qsTr ( "Please generate your wallet keys before registering your wallet address." )
color: ( messageCode == 1 ) ? "#b22222" : ( ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#404040" ) / / t e x t c o l o r
property int messageCode: 0 / / 0 = i n f o ; 1 = w a r n i n g o r e r r o r
background: Rectangle {
color: "transparent"
border.color: ( parent . messageCode == 1 ) ? "#b22222" : "#2196f3" / / / / p a r e n t . c o l o r / / ( N e r o s h o p C o m p o n e n t s . S t y l e . d a r k T h e m e ) ? " # f f f f f f " : " # 4 0 4 0 4 0 "
radius: 3
}
leftPadding: 30 + circleInfo . contentWidth
Text {
id: circleInfo
anchors.left: parent . left
anchors.leftMargin: 15
anchors.verticalCenter: parent . verticalCenter
text: ( parent . messageCode == 1 ) ? qsTr ( FontAwesome . triangleExclamation ) : qsTr ( FontAwesome . circleInfo )
color: ( parent . messageCode == 1 ) ? "#b22222" : "#2196f3"
font.bold: true
font.family: FontAwesome . fontFamily
}
}
} / / C o l u m n L a y o u t f o r R e c t
} / / R o w R e c t 1
/ / R o w R e c t 2
Item { / / R e c t a n g l e {
Layout.fillWidth: true
Layout.fillHeight: true
visible: ( walletSeedRepeater . model != null )
/ * r a d i u s : 3
color: "transparent"
border.color: ( parent . messageCode == 1 ) ? "#b22222" : ( ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : parent . color ) / / / / p a r e n t . c o l o r
radius: 3
}
leftPadding: 25 + circleInfo . contentWidth
Text {
/ / / / i d : c i r c l e I n f o
anchors.left: parent . left
anchors.leftMargin: 15
anchors.verticalCenter: parent . verticalCenter
text: ( parent . messageCode == 1 ) ? qsTr ( FontAwesome . triangleExclamation ) : qsTr ( FontAwesome . circleInfo ) / / ( p a r e n t . m e s s a g e C o d e = = 2 ) ? q s T r ( F o n t A w e s o m e . s e e d l i n g ) : ( ( p a r e n t . m e s s a g e C o d e = = 1 ) ? q s T r ( F o n t A w e s o m e . t r i a n g l e E x c l a m a t i o n ) : q s T r ( F o n t A w e s o m e . c i r c l e I n f o ) )
color: ( parent . messageCode == 1 ) ? "#b22222" : "#2196f3" / / ( p a r e n t . m e s s a g e C o d e = = 2 ) ? " # 2 2 8 b 2 2 " : ( ( p a r e n t . m e s s a g e C o d e = = 1 ) ? " # b 2 2 2 2 2 " : " # 2 1 9 6 f 3 " )
font.bold: true
font.family: FontAwesome . fontFamily
}
}
/ / t e s t i n g l i s t v i e w f o r w a l l e t s e e d d i s p l a y
Flow { / / / / R o w L a y o u t {
id: walletSeedDisplay
/ / L a y o u t . p r e f e r r e d H e i g h t : 2 0 0
Layout.rowSpan: 7 / / / / 8 / / f i l l t h e r o w 8 t i m e s ?
Layout.row: 1
Layout.column: 1
/ / / / L a y o u t . f i l l W i d t h : t r u e / / n o r e a s o n t o f i l l w i d t h s i n c e w e s e t t h e m a x i m u m w i d t h
/ / L a y o u t . p r e f e r r e d H e i g h t : 4 0 * L a y o u t . r o w S p a n / / r e m o v e
Layout.maximumWidth: 550 / / w a l l e t M e s s a g e A r e a . w i d t h
Layout.topMargin: 20 / / 1 5
/****orientation: ListView.Horizontal****/
spacing: 5
border.color: "#ffffff" * /
ColumnLayout {
anchors.centerIn: parent
width: parent . width
/ / w a l l e t s e e d m e s s a g e b o x
TextArea {
id: seedMessageArea
visible: ( walletSeedRepeater . model != null )
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.fillWidth: true / / e x t e n d s t h e T e x t A r e a ' s w i d t h t o t h e w i d t h o f t h e L a y o u t
Layout.maximumWidth: walletSeedDisplay . width / / / / p a r e n t . w i d t h
Layout.leftMargin: 20 ; Layout.rightMargin: 20
/ / / / i m p l i c i t H e i g h t : c o n t e n t H e i g h t + 2 0 / / / / L a y o u t . p r e f e r r e d H e i g h t : c o n t e n t H e i g h t + 2 0 / / c a u s e o f Q M L T e x t A r e a : B i n d i n g l o o p d e t e c t e d f o r p r o p e r t y " i m p l i c i t W i d t h " e r r o r
/ / / / L a y o u t . t o p M a r g i n : 2 0 / / 1 5
selectByMouse: true
readOnly: true
verticalAlignment: TextEdit . AlignVCenter / / a l i g n t h e t e x t w i t h i n t h e c e n t e r o f T e x t A r e a i t e m ' s h e i g h t
wrapMode: TextEdit . Wrap / / m o v e t e x t t o n e w l i n e i f i t r e a c h e s t h e w i d t h o f t h e T e x t A r e a
text: qsTr ( "" )
/ / f o n t . b o l d : t r u e
color: ( messageCode == 1 ) ? "#b22222" : ( ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#404040" ) / / t e x t c o l o r
property int messageCode: 0 / / 0 = i n f o ; 1 = w a r n i n g o r e r r o r
background: Rectangle {
color: "transparent"
border.color: ( parent . messageCode == 1 ) ? "#b22222" : ( ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : parent . color ) / / / / p a r e n t . c o l o r
radius: 3
}
leftPadding: 25 + circleInfo . contentWidth
Text {
/ / / / i d : c i r c l e I n f o
anchors.left: parent . left
anchors.leftMargin: 15
anchors.verticalCenter: parent . verticalCenter
text: ( parent . messageCode == 1 ) ? qsTr ( FontAwesome . triangleExclamation ) : qsTr ( FontAwesome . circleInfo ) / / ( p a r e n t . m e s s a g e C o d e = = 2 ) ? q s T r ( F o n t A w e s o m e . s e e d l i n g ) : ( ( p a r e n t . m e s s a g e C o d e = = 1 ) ? q s T r ( F o n t A w e s o m e . t r i a n g l e E x c l a m a t i o n ) : q s T r ( F o n t A w e s o m e . c i r c l e I n f o ) )
color: ( parent . messageCode == 1 ) ? "#b22222" : "#2196f3" / / ( p a r e n t . m e s s a g e C o d e = = 2 ) ? " # 2 2 8 b 2 2 " : ( ( p a r e n t . m e s s a g e C o d e = = 1 ) ? " # b 2 2 2 2 2 " : " # 2 1 9 6 f 3 " )
font.bold: true
font.family: FontAwesome . fontFamily
}
}
/ / t e s t i n g l i s t v i e w f o r w a l l e t s e e d d i s p l a y
Flow { / / / / R o w L a y o u t {
id: walletSeedDisplay
/ / L a y o u t . p r e f e r r e d H e i g h t : 2 0 0
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.fillWidth: true / / n o r e a s o n t o f i l l w i d t h s i n c e w e s e t t h e m a x i m u m w i d t h
/ / L a y o u t . p r e f e r r e d H e i g h t : 4 0 * L a y o u t . r o w S p a n / / r e m o v e
Layout.maximumWidth: 670 / / / / p a r e n t . w i d t h
Layout.topMargin: 20 / / 1 5
Layout.leftMargin: 20 ; Layout.rightMargin: 20
/ / o r i e n t a t i o n : L i s t V i e w . H o r i z o n t a l
spacing: 5
Repeater {
id: walletSeedRepeater
/ / / / m o d e l : n u l l
delegate: Rectangle {
width: 130 ; height: 40
Text {
text: ( index + 1 ) + ". " + modelData
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
anchors.verticalCenter: parent . verticalCenter / / v e r t i c a l A l i g n m e n t : T e x t . A l i g n V C e n t e r
anchors.left: parent . left
anchors.leftMargin: 15
}
color: "transparent"
border.color: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
radius: 3
/ / M o u s e A r e a {
/ / a n c h o r s . f i l l : p a r e n t
/ / o n C l i c k e d : { }
/ / }
}
}
} / / F l o w ?
/ / w a l l e t s e e d c o p y b u t t o n
Button {
id: seedCopyButton
Layout.row: 9
Layout.column: 1
Layout.fillWidth: true / / / / w i d t h : c o n t e n t W i d t h + 2 0 ; h e i g h t : 4 0
visible: ( walletSeedRepeater . model != null )
text: qsTr ( "Copy" )
icon.source: "qrc:/assets/images/copy.png"
icon.color: "#ffffff"
display: AbstractButton . IconOnly / /AbstractButton.TextBesideIcon/ / AbstractButton . TextOnly / / A b s t r a c t B u t t o n . T e x t U n d e r I c o n
hoverEnabled: true
onClicked: Backend . copyTextToClipboard ( Wallet . getSeed ( ) )
Repeater {
id: walletSeedRepeater
/ / / / m o d e l : n u l l
delegate: Rectangle {
width: 130 ; height: 40
Text {
text: ( index + 1 ) + ". " + modelData
color: ( NeroshopComponents . Style . darkTheme ) ? "#ffffff" : "#000000"
anchors.verticalCenter: parent . verticalCenter / / v e r t i c a l A l i g n m e n t : T e x t . A l i g n V C e n t e r
anchors.left: parent . left
anchors.leftMargin: 15
}
color: "transparent"
border.color: ( NeroshopComponents . Style . darkTheme ) ? "#a9a9a9" : "#696969"
radius: 3
/ / M o u s e A r e a {
/ / a n c h o r s . f i l l : p a r e n t
/ / o n C l i c k e d : { }
/ / }
}
}
} / / F l o w ?
/ / w a l l e t s e e d c o p y b u t t o n
Button {
id: seedCopyButton
Layout.alignment: Qt . AlignHCenter | Qt . AlignTop
Layout.fillWidth: true / / / / w i d t h : c o n t e n t W i d t h + 2 0 ; h e i g h t : 4 0
Layout.maximumWidth: walletSeedDisplay . width / / / / p a r e n t . w i d t h
Layout.leftMargin: 20 ; Layout.rightMargin: 20
visible: ( walletSeedRepeater . model != null )
text: qsTr ( "Copy" )
icon.source: "qrc:/assets/images/copy.png"
icon.color: "#ffffff"
display: AbstractButton . IconOnly / /AbstractButton.TextBesideIcon/ / AbstractButton . TextOnly / / A b s t r a c t B u t t o n . T e x t U n d e r I c o n
hoverEnabled: true
onClicked: Backend . copyTextToClipboard ( Wallet . getSeed ( ) )
background: Rectangle {
color: "#404040"
radius: 5
border.color: parent . hovered ? "#ffffff" : this . color / /"#ffffff"/ / control . down ? "#17a81a" : "#21be2b"
}
background: Rectangle {
color: "#404040"
radius: 5
border.color: parent . hovered ? "#ffffff" : this . color / /"#ffffff"/ / control . down ? "#17a81a" : "#21be2b"
}
ToolTip.delay: 1000
ToolTip.visible: hovered
ToolTip.text: qsTr ( "Copy seed phrase" ) / / / / q s T r ( " C o p y t o c l i p b o a r d " )
} / / c o p y B u t t o n
} / / G r i d L a y o u t f o r w a l l e t G e n e r a t i o n P a g e
ToolTip.delay: 1000
ToolTip.visible: hovered
ToolTip.text: qsTr ( "Copy seed phrase" ) / / / / q s T r ( " C o p y t o c l i p b o a r d " )
} / / c o p y B u t t o n
} / / C o l u m n L a y o u t f o r R e c t
} / / R o w R e c t a n g l e 2
} / / R O W L A Y O U T
} / / C o l u m n L a y o u t f o r w a l l e t G e n e r a t i o n P a g e
} / / e o f w a l l e t G e n e r a t i o n P a g e
Rectangle {
id: registrationPage