Receive page development

This commit is contained in:
Sander Ferdinand
2017-12-09 00:01:10 +01:00
committed by moneromooo-monero
parent de3fd183d8
commit e5357c8a0b
5 changed files with 316 additions and 166 deletions

View File

@@ -26,8 +26,8 @@
// 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.0
import QtQuick.Controls 1.4
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
@@ -43,7 +43,7 @@ import moneroComponents.SubaddressModel 1.0
Rectangle {
id: pageReceive
color: "#F0EEEE"
color: "transparent"
property alias addressText : addressLine.text
property alias paymentIdText : paymentIdLine.text
property alias integratedAddressText : integratedAddressLine.text
@@ -156,14 +156,14 @@ Rectangle {
anchors.top: parent.top
anchors.right: parent.right
spacing: 20 * scaleRatio
spacing: 26 * 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
Label {
id: addressLabel
@@ -224,43 +224,123 @@ 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 {
id: amountRow
Label {
id: amountLabel
text: qsTr("Amount") + translationManager.emptyString
width: mainLayout.labelWidth
}
LineEdit {
id: amountLine
// fontSize: mainLayout.lineEditFontSize
placeholderText: qsTr("Amount to receive") + translationManager.emptyString
readOnly: false
width: mainLayout.editWidth
ColumnLayout {
Layout.fillWidth: true
validator: DoubleValidator {
bottom: 0.0
top: 18446744.073709551615
decimals: 12
notation: DoubleValidator.StandardNotation
locale: "C"
}
}
}
RowLayout {
id: trackingRow
Layout.fillWidth: true
visible: !isAndroid && !isIOS
<<<<<<< HEAD
Label {
id: trackingLabel
textFormat: Text.RichText
@@ -288,16 +368,39 @@ Rectangle {
trackingHowToUseDialog.open()
}
}
=======
>>>>>>> Receive page development
TextEdit {
id: trackingLine
anchors.top: trackingRow.top
horizontalAlignment: TextInput.AlignLeft
Layout.fillWidth: true
textFormat: Text.RichText
text: ""
readOnly: true
width: mainLayout.editWidth
Layout.fillWidth: 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
}
}
}