Receive page; modified subaddress table

This commit is contained in:
Sander Ferdinand 2018-03-19 02:42:46 +01:00 committed by moneromooo-monero
parent 4977049425
commit 57a9508849
7 changed files with 171 additions and 182 deletions

View file

@ -150,10 +150,6 @@ Item {
id: cancelButton
width: 120
fontSize: 14
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
text: qsTr("Cancel") + translationManager.emptyString
KeyNavigation.tab: input
onClicked: {
@ -165,10 +161,6 @@ Item {
id: okButton
width: 120
fontSize: 14
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
text: qsTr("Ok")
KeyNavigation.tab: cancelButton
onClicked: {

View file

@ -36,13 +36,15 @@ TextArea {
property bool error: false
property bool addressValidation: false
property bool wrapAnywhere: true
property int fontSize: 18 * scaleRatio
id: textArea
font.family: Style.fontRegular.name
font.pixelSize: 18 * scaleRatio
font.family: Style.fontRegular
font.pixelSize: fontSize
font.bold: false
horizontalAlignment: TextInput.AlignLeft
selectByMouse: true
color: Style.defaultFontColor
wrapMode: {
if(wrapAnywhere){
return Text.WrapAnywhere;

View file

@ -131,7 +131,7 @@ Item {
id: inputItem
height: inputHeight * scaleRatio
anchors.top: showingHeader ? inputLabel.bottom : parent.top
anchors.topMargin: showingHeader ? 12 * scaleRatio : 2
anchors.topMargin: showingHeader ? 12 * scaleRatio : 2 * scaleRatio
width: parent.width
Text {

View file

@ -32,6 +32,7 @@ import "." 1.0
ColumnLayout {
id: lineditmulti
property alias text: multiLine.text
property alias placeholderText: placeholderLabel.text
property alias inputLabelText: inputLabel.text
@ -43,6 +44,10 @@ ColumnLayout {
property bool labelButtonVisible: false
property bool copyButton: false
property bool wrapAnywhere: true
property bool showingHeader: true
property bool showBorder: true
property int fontSize: 18 * scaleRatio
signal labelButtonClicked();
signal inputLabelLinkActivated();
@ -52,6 +57,7 @@ ColumnLayout {
color: "transparent"
Layout.fillWidth: true
height: (inputLabel.height + 10) * scaleRatio
visible: showingHeader ? true : false
Text {
id: inputLabel
@ -91,11 +97,12 @@ ColumnLayout {
id: multiLine
readOnly: false
addressValidation: true
anchors.top: inputLabelRect.bottom
anchors.top: parent.showingHeader ? inputLabelRect.bottom : parent.top
Layout.fillWidth: true
topPadding: 10 * scaleRatio
topPadding: parent.showingHeader ? 10 * scaleRatio : 0
bottomPadding: 10 * scaleRatio
wrapAnywhere: parent.wrapAnywhere
fontSize: parent.fontSize
Text {
id: placeholderLabel
@ -125,6 +132,7 @@ ColumnLayout {
}
radius: 4
anchors.fill: parent
visible: lineditmulti.showBorder
}
}
}

View file

@ -28,40 +28,57 @@
import QtQuick 2.0
import moneroComponents.Clipboard 1.0
import "." 1.0
ListView {
id: listView
clip: true
boundsBehavior: ListView.StopAtBounds
highlightMoveDuration: 0
highlightFollowsCurrentItem: true
anchors.topMargin: 0
spacing: 0
delegate: Rectangle {
id: delegate
height: 64
height: 74
color: 'transparent';
anchors.topMargin: 0
width: listView.width
LineEdit {
LineEditMulti {
id: addressLine
//borderDisabled: true
fontSize: 12
readOnly: true
width: parent.width
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 5
anchors.leftMargin: 5
anchors.topMargin: 12
anchors.rightMargin: 40
anchors.bottomMargin: 0
onTextChanged: cursorPosition = 0
text: address
showBorder: false
IconButton {
id: clipboardButton
imageSource: "../images/copyToClipboard.png"
onClicked: {
console.log(addressLine.text + " copied to clipboard");
clipboard.setText(addressLine.text);
appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3);
}
showingHeader: false
showBorder: false
}
IconButton {
id: clipboardButton
imageSource: "../images/copyToClipboard.png"
onClicked: {
console.log(addressLine.text + " copied to clipboard");
clipboard.setText(addressLine.text);
appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3);
}
anchors.right: parent.right
anchors.rightMargin: 0
anchors.verticalCenter: parent.verticalCenter
}
Text {
@ -85,7 +102,7 @@ ListView {
font.family: "Arial"
font.bold: true
font.pixelSize: 12
color: "#444444"
color: Style.greyFontColor
text: label
}
@ -96,14 +113,46 @@ ListView {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: clipboardButton.width
onClicked: listView.currentIndex = index
cursorShape: Qt.PointingHandCursor
onClicked: {
listView.currentIndex = index;
}
}
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: Style.grey
z: 6
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: Style.grey
z: 6
}
Rectangle {
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
color: Style.grey
height: 1
z: 6
}
Rectangle {
width: 3
color: 'white'
visible: listView.currentIndex == index
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
highlight: Rectangle {
height: 64
color: '#FF4304'
opacity: 0.2
z: 2
}
}

View file

@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import QtQuick 2.7
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
@ -44,9 +44,6 @@ import moneroComponents.SubaddressModel 1.0
Rectangle {
id: pageReceive
color: "transparent"
property alias addressText : addressLine.text
property alias paymentIdText : paymentIdLine.text
property alias integratedAddressText : integratedAddressLine.text
property var model
property var current_address
property alias addressText : pageReceive.current_address
@ -156,26 +153,69 @@ Rectangle {
anchors.top: parent.top
anchors.right: parent.right
spacing: 26 * scaleRatio
spacing: 20 * scaleRatio
property int labelWidth: 120 * scaleRatio
property int editWidth: 400 * scaleRatio
property int lineEditFontSize: 12 * scaleRatio
property int qrCodeSize: 240 * scaleRatio
ColumnLayout {
<<<<<<< HEAD
id: addressRow
spacing: 0
Label {
id: addressLabel
text: qsTr("Addresses") + translationManager.emptyString
width: mainLayout.labelWidth
}
Rectangle {
id: header
Layout.fillWidth: true
Layout.topMargin: 10
height: 10
color: "#CC000000"
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 10
anchors.leftMargin: 10
height: 1
color: "#404040"
}
Image {
anchors.top: parent.top
anchors.left: parent.left
width: 10
height: 10
source: "../images/historyBorderRadius.png"
}
Image {
anchors.top: parent.top
anchors.right: parent.right
width: 10
height: 10
source: "../images/historyBorderRadius.png"
rotation: 90
}
}
Rectangle {
id: tableRect
Layout.fillWidth: true
Layout.preferredHeight: 200
color: "#FFFFFF"
Layout.preferredHeight: 240
color: "transparent"
Scroll {
id: flickableScroll
anchors.right: table.right
@ -183,6 +223,7 @@ Rectangle {
anchors.bottom: table.bottom
flickable: table
}
SubaddressTable {
id: table
anchors.fill: parent
@ -195,11 +236,10 @@ Rectangle {
RowLayout {
spacing: 20
Layout.topMargin: 20
StandardButton {
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
small: true
text: qsTr("Create new address") + translationManager.emptyString;
onClicked: {
inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString
@ -213,10 +253,7 @@ Rectangle {
}
}
StandardButton {
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
small: true
enabled: table.currentIndex > 0
text: qsTr("Rename") + translationManager.emptyString;
onClicked: {
@ -224,123 +261,42 @@ Rectangle {
inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, table.currentIndex)
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, table.currentIndex, inputDialog.inputText)
=======
id: addressLineRow
LineEditMulti {
id: addressLine
inputLabelText: qsTr("Address") + translationManager.emptyString
placeholderText: qsTr("ReadOnly wallet address displayed here") + translationManager.emptyString;
readOnly: true
Layout.fillWidth: true
copyButton: true
}
}
GridLayout {
id: paymentIdRow
columns:2
// @TODO: copy button copies the wrong input box
LineEdit {
id: paymentIdLine
placeholderText: qsTr("16 hexadecimal characters") + translationManager.emptyString;
readOnly: false
onTextChanged: updatePaymentId(paymentIdLine.text)
inlineButtonText: "Generate"
inlineButton.onClicked: updatePaymentId()
width: mainLayout.editWidth
Layout.fillWidth: true
copyButton: true
labelText: qsTr("Payment ID") + qsTr("<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\
<font size='2'> ( </font><a href='#'>help</a><font size='2'> )</font> ")
+ translationManager.emptyString
onLabelLinkActivated: {
trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
trackingHowToUseDialog.text = qsTr(
"<p><font size='+2'>This is a simple sales tracker:</font></p>" +
"<p>Click Generate to create a random payment id for a new customer</p> " +
"<p>Let your customer scan that QR code to make a payment (if that customer has software which " +
"supports QR code scanning).</p>" +
"<p>This page will automatically scan the blockchain and the tx pool " +
"for incoming transactions using this QR code. If you input an amount, it will also check " +
"that incoming transactions total up to that amount.</p>" +
"It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be " +
"confirmed in short order, but there is still a possibility they might not, so for larger " +
"values you may want to wait for one or more confirmation(s).</p>"
)
trackingHowToUseDialog.icon = StandardIcon.Information
trackingHowToUseDialog.open()
}
}
// @TODO: CLEAR BUTTON should be present as labelButton
// StandardButton {
// id: clearPaymentId
// enabled: !!paymentIdLine.text
// shadowReleasedColor: "#FF4304"
// shadowPressedColor: "#B32D00"
// releasedColor: "#FF6C3C"
// pressedColor: "#FF4304"
// text: qsTr("Clear") + translationManager.emptyString;
// onClicked: updatePaymentId("")
// }
}
ColumnLayout {
id: integratedAddressRow
LineEditMulti {
id: integratedAddressLine
inputLabelText: qsTr("Integrated address") + translationManager.emptyString
placeholderText: qsTr("Generate payment ID for integrated address") + translationManager.emptyString
readOnly: true
Layout.fillWidth: true
copyButton: true
}
}
GridLayout {
columns: (isMobile)? 1 : 2
Layout.fillWidth: true
columnSpacing: 32
ColumnLayout {
Layout.fillWidth: true
RowLayout {
Layout.fillWidth: true
Layout.minimumWidth: 200
LineEdit {
id: amountLine
placeholderText: qsTr("Amount to receive") + translationManager.emptyString
readOnly: false
inlineIcon: true
labelText: qsTr("Amount")
Layout.fillWidth: true
validator: DoubleValidator {
bottom: 0.0
top: 18446744.073709551615
decimals: 12
notation: DoubleValidator.StandardNotation
locale: "C"
>>>>>>> Receive page development
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
}
}
}
ColumnLayout {
}
ColumnLayout {
id: amountRow
Label {
id: amountLabel
text: qsTr("Amount") + translationManager.emptyString
width: mainLayout.labelWidth
}
LineEdit {
id: amountLine
placeholderText: qsTr("Amount to receive") + translationManager.emptyString
readOnly: false
width: mainLayout.editWidth
Layout.fillWidth: true
validator: DoubleValidator {
bottom: 0.0
top: 18446744.073709551615
decimals: 12
notation: DoubleValidator.StandardNotation
locale: "C"
}
}
}
RowLayout {
ColumnLayout {
id: trackingRow
Layout.fillWidth: true
visible: !isAndroid && !isIOS
<<<<<<< HEAD
Label {
id: trackingLabel
textFormat: Text.RichText
@ -368,41 +324,17 @@ Rectangle {
trackingHowToUseDialog.open()
}
}
=======
>>>>>>> Receive page development
TextEdit {
id: trackingLine
anchors.top: trackingRow.top
horizontalAlignment: TextInput.AlignLeft
readOnly: true
width: mainLayout.editWidth
Layout.fillWidth: true
textFormat: Text.RichText
text: ""
readOnly: true
selectByMouse: true
color: Style.defaultFontColor
font.family: Style.fontRegular.name
font.pixelSize: 16 * scaleRatio
leftPadding: 12 * scaleRatio
rightPadding: 12 * scaleRatio
topPadding: 8 * scaleRatio
bottomPadding: 8 * scaleRatio
Rectangle {
color: "transparent"
border.width: 1
border.color: {
if(trackingLine.activeFocus){
return Qt.rgba(255, 255, 255, 0.35);
} else {
return Qt.rgba(255, 255, 255, 0.25);
}
}
radius: 4
anchors.fill: parent
}
color: 'white'
}
}
MessageDialog {

View file

@ -574,17 +574,20 @@ Rectangle {
TextBlock {
Layout.topMargin: 8
font.pixelSize: 14
Layout.fillWidth: true
text: qsTr("GUI version: ") + Version.GUI_VERSION + translationManager.emptyString
}
TextBlock {
id: guiMoneroVersion
Layout.fillWidth: true
font.pixelSize: 14
text: qsTr("Embedded Monero version: ") + Version.GUI_MONERO_VERSION + translationManager.emptyString
}
TextBlock {
id: restoreHeightText
Layout.fillWidth: true
font.pixelSize: 14
textFormat: Text.RichText
property var txt: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C}</style>" + qsTr("Wallet creation height: ") + (currentWallet ? currentWallet.walletCreationHeight : "") + translationManager.emptyString
property var linkTxt: qsTr(" <a href='#'>(Click to change)</a>") + translationManager.emptyString
@ -652,14 +655,17 @@ Rectangle {
TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: (!currentWallet) ? "" : qsTr("Wallet log path: ") + currentWallet.walletLogPath + translationManager.emptyString
}
TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: qsTr("Wallet Name: ") + walletName + translationManager.emptyString
}
TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: (!currentWallet) ? "" : qsTr("Daemon log path: ") + currentWallet.daemonLogPath + translationManager.emptyString
}
}