From 1364c2b4988d0fad4ef236ca09bff226432764ce Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Sat, 6 Feb 2016 19:19:54 +0300 Subject: Password strength level updated --- components/PrivacyLevelSmall.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/PrivacyLevelSmall.qml b/components/PrivacyLevelSmall.qml index 21c794ef..9321ffbd 100644 --- a/components/PrivacyLevelSmall.qml +++ b/components/PrivacyLevelSmall.qml @@ -36,6 +36,13 @@ Item { height: 40 clip: true + onFillLevelChanged: { + if (!interactive) { + //print("fillLevel: " + fillLevel) + fillRect.width = row.positions[fillLevel].currentX + row.x + } + } + Rectangle { anchors.left: parent.left anchors.right: parent.right @@ -134,6 +141,7 @@ Item { if(index !== -1) { fillRect.width = Qt.binding(function(){ return row.positions[index].currentX + row.x }) item.fillLevel = index + print ("fillLevel: " + item.fillLevel) } } @@ -148,7 +156,7 @@ Item { anchors.rightMargin: 8 anchors.top: bar.bottom anchors.topMargin: 5 - property var positions: new Array() + property var positions: [] Row { id: row2 -- cgit v1.2.3 From eaf59243b2cbe3d7ea6de1d8dcd18493df9f365d Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Thu, 16 Jun 2016 17:13:46 +0300 Subject: basic "send money" functionality implemented in GUI --- LeftPanel.qml | 2 ++ MiddlePanel.qml | 14 ++++++++++++++ components/LineEdit.qml | 3 +++ main.cpp | 3 +++ main.qml | 25 +++++++++++++++++++++++++ pages/Transfer.qml | 27 +++++++++++++++++++++------ src/libwalletqt/PendingTransaction.h | 2 ++ src/libwalletqt/WalletManager.cpp | 9 +++++++++ src/libwalletqt/WalletManager.h | 3 +++ 9 files changed, 82 insertions(+), 6 deletions(-) (limited to 'components') diff --git a/LeftPanel.qml b/LeftPanel.qml index 1eddf019..95b5aa6f 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -56,6 +56,7 @@ Rectangle { width: 260 color: "#FFFFFF" + // Item with monero logo Item { id: logoItem anchors.left: parent.left @@ -85,6 +86,7 @@ Rectangle { } } + Column { id: column1 anchors.left: parent.left diff --git a/MiddlePanel.qml b/MiddlePanel.qml index 62072af9..28d6f137 100644 --- a/MiddlePanel.qml +++ b/MiddlePanel.qml @@ -30,6 +30,7 @@ import QtQuick 2.2 Rectangle { color: "#F0EEEE" + signal paymentClicked(string address, string paymentId, double amount, double fee, int privacyLevel) states: [ State { @@ -72,6 +73,19 @@ Rectangle { anchors.right: parent.right anchors.top: styledRow.bottom anchors.bottom: parent.bottom + onLoaded: { + console.log("Loaded " + item); + } + + } + + Connections { + ignoreUnknownSignals: false + target: loader.item + onPaymentClicked : { + console.log("MiddlePanel: paymentClicked") + paymentClicked(address, paymentId, amount, fee, privacyLevel) + } } Rectangle { diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 6994b75f..37c2390d 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -31,7 +31,9 @@ import QtQuick 2.0 Item { property alias placeholderText: input.placeholderText property alias text: input.text + property alias validator: input.validator property int fontSize: 18 + height: 37 Rectangle { @@ -54,5 +56,6 @@ Item { anchors.leftMargin: 4 anchors.rightMargin: 4 font.pixelSize: parent.fontSize + } } diff --git a/main.cpp b/main.cpp index 7331a4e4..70390a80 100644 --- a/main.cpp +++ b/main.cpp @@ -36,6 +36,7 @@ #include "oshelper.h" #include "WalletManager.h" #include "Wallet.h" +#include "PendingTransaction.h" @@ -53,6 +54,8 @@ int main(int argc, char *argv[]) qmlRegisterType("moneroComponents", 1, 0, "Clipboard"); qmlRegisterUncreatableType("Bitmonero.Wallet", 1, 0, "Wallet", "Wallet can't be instantiated directly"); + qmlRegisterUncreatableType("Bitmonero.PendingTransaction", 1, 0, "PendingTransaction", + "PendingTransaction can't be instantiated directly"); QQmlApplicationEngine engine; diff --git a/main.qml b/main.qml index 3b79d1ec..d6109339 100644 --- a/main.qml +++ b/main.qml @@ -32,6 +32,7 @@ import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import Qt.labs.settings 1.0 import Bitmonero.Wallet 1.0 +import Bitmonero.PendingTransaction 1.0 import "components" import "wizard" @@ -120,6 +121,8 @@ ApplicationWindow { function initialize() { + middlePanel.paymentClicked.connect(handlePayment); + if (typeof wizard.settings['wallet'] !== 'undefined') { wallet = wizard.settings['wallet']; } else { @@ -157,6 +160,27 @@ ApplicationWindow { return wallets.length > 0; } + function handlePayment(address, paymentId, amount, fee, privacyLevel) { + console.log("Process payment here: ", address, paymentId, amount, fee, privacyLevel) + // TODO: handle payment id + // TODO: handle fee; + // TODO: handle mixins + var amountxmr = walletManager.amountFromString(amount); + + console.log("integer amount: ", amountxmr); + var pendingTransaction = wallet.createTransaction(address, amountxmr); + if (pendingTransaction.status !== PendingTransaction.Status_Ok) { + console.error("Can't create transaction: ", pendingTransaction.errorString); + } else { + console.log("Transaction created, amount: " + walletManager.displayAmount(pendingTransaction.amount) + + ", fee: " + walletManager.displayAmount(pendingTransaction.fee)); + if (!pendingTransaction.commit()) { + console.log("Error committing transaction: " + pendingTransaction.errorString); + } + } + wallet.disposeTransaction(pendingTransaction); + } + visible: true width: rightPanelExpanded ? 1269 : 1269 - 300 height: 800 @@ -423,6 +447,7 @@ ApplicationWindow { } property var previousPosition + onPressed: { previousPosition = globalCursor.getPosition() } diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 2535b8fe..df0a5b20 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -30,8 +30,11 @@ import QtQuick 2.0 import "../components" Rectangle { + signal paymentClicked(string address, string paymentId, double amount, double fee, int privacyLevel) + color: "#F0EEEE" + Label { id: amountLabel anchors.left: parent.left @@ -67,8 +70,9 @@ Rectangle { source: "../images/moneroIcon.png" } } - + // Amount input LineEdit { + id: amountLine placeholderText: qsTr("Amount...") width: parent.width - 37 - 17 } @@ -133,7 +137,7 @@ Rectangle { onLinkActivated: appWindow.showPageRequest("AddressBook") } - + // recipient address input LineEdit { id: addressLine anchors.left: parent.left @@ -142,10 +146,11 @@ Rectangle { anchors.leftMargin: 17 anchors.rightMargin: 17 anchors.topMargin: 5 + // validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g } } Label { - id: paymentLabel + id: paymentIdLabel anchors.left: parent.left anchors.right: parent.right anchors.top: addressLine.bottom @@ -156,21 +161,23 @@ Rectangle { text: qsTr("Payment ID ( Optional )") } + // payment id input LineEdit { - id: paymentLine + id: paymentIdLine anchors.left: parent.left anchors.right: parent.right - anchors.top: paymentLabel.bottom + anchors.top: paymentIdLabel.bottom anchors.leftMargin: 17 anchors.rightMargin: 17 anchors.topMargin: 5 + // validator: DoubleValidator { top: 0.0 } } Label { id: descriptionLabel anchors.left: parent.left anchors.right: parent.right - anchors.top: paymentLine.bottom + anchors.top: paymentIdLine.bottom anchors.leftMargin: 17 anchors.rightMargin: 17 anchors.topMargin: 17 @@ -200,5 +207,13 @@ Rectangle { shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" pressedColor: "#FF4304" + onClicked: { + // do more smart validation + + if (addressLine.text.length > 0 && amountLine.text.length > 0) { + console.log("paymentClicked") + paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, 0.0002, 1) + } + } } } diff --git a/src/libwalletqt/PendingTransaction.h b/src/libwalletqt/PendingTransaction.h index 29fa7cb4..d8c4ec1e 100644 --- a/src/libwalletqt/PendingTransaction.h +++ b/src/libwalletqt/PendingTransaction.h @@ -24,6 +24,8 @@ public: Status_Error = Bitmonero::PendingTransaction::Status_Error }; + Q_ENUM(Status) + Status status() const; QString errorString() const; Q_INVOKABLE bool commit(); diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index 6ad81e2a..a7742bca 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -92,6 +92,15 @@ QString WalletManager::displayAmount(quint64 amount) return QString::fromStdString(Bitmonero::Wallet::displayAmount(amount)); } +quint64 WalletManager::amountFromString(const QString &amount) +{ + return Bitmonero::Wallet::amountFromString(amount.toStdString()); +} + +quint64 WalletManager::amountFromDouble(double amount) +{ + return Bitmonero::Wallet::amountFromDouble(amount); +} WalletManager::WalletManager(QObject *parent) : QObject(parent) { diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h index 30e6b02a..29df9048 100644 --- a/src/libwalletqt/WalletManager.h +++ b/src/libwalletqt/WalletManager.h @@ -45,6 +45,9 @@ public: //! since we can't call static method from QML, move it to this class Q_INVOKABLE QString displayAmount(quint64 amount); + Q_INVOKABLE quint64 amountFromString(const QString &amount); + Q_INVOKABLE quint64 amountFromDouble(double amount); + signals: public slots: -- cgit v1.2.3 From 17f38a930e33c25392dd565f484009e5eddba56a Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Sun, 26 Jun 2016 18:04:45 +0300 Subject: Added "Receive" page. Hide all pages except "Transfer" and "Receive". --- LeftPanel.qml | 50 ++++++++++- MiddlePanel.qml | 5 ++ components/IconButton.qml | 72 ++++++++++++++++ components/Input.qml | 1 + components/LineEdit.qml | 3 +- get_libwallet_api.sh | 2 + main.qml | 4 +- pages/Receive.qml | 184 ++++++++++++++++++++++++++++++++++++++++ qml.qrc | 2 + src/libwalletqt/Wallet.cpp | 25 +++++- src/libwalletqt/Wallet.h | 16 +++- wizard/WizardCreateWallet.qml | 4 +- wizard/WizardRecoveryWallet.qml | 2 +- 13 files changed, 359 insertions(+), 11 deletions(-) create mode 100644 components/IconButton.qml create mode 100644 pages/Receive.qml (limited to 'components') diff --git a/LeftPanel.qml b/LeftPanel.qml index 95b5aa6f..0c1ccd12 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -34,10 +34,12 @@ Rectangle { property alias unlockedBalanceText: unlockedBalanceText.text property alias balanceText: balanceText.text + property alias networkStatus : networkStatus signal dashboardClicked() signal historyClicked() signal transferClicked() + signal receiveClicked() signal settingsClicked() signal addressBookClicked() signal miningClicked() @@ -47,9 +49,11 @@ Rectangle { if(pos === "Dashboard") menuColumn.previousButton = dashboardButton else if(pos === "History") menuColumn.previousButton = historyButton else if(pos === "Transfer") menuColumn.previousButton = transferButton + else if(pos === "Receive") menuColumn.previousButton = receiveButton else if(pos === "AddressBook") menuColumn.previousButton = addressBookButton else if(pos === "Mining") menuColumn.previousButton = miningButton else if(pos === "Settings") menuColumn.previousButton = settingsButton + menuColumn.previousButton.checked = true } @@ -120,7 +124,7 @@ Rectangle { font.family: "Arial" font.pixelSize: 26 color: "#000000" - text: "78.9245" + text: "N/A" } } @@ -144,7 +148,7 @@ Rectangle { font.family: "Arial" font.pixelSize: 18 color: "#000000" - text: "2324.9245" + text: "N/A" } } @@ -179,7 +183,11 @@ Rectangle { anchors.right: parent.right anchors.top: parent.top - property var previousButton: dashboardButton + property var previousButton: transferButton + + // ------------- Dashboard tab --------------- + + /* MenuButton { id: dashboardButton anchors.left: parent.left @@ -195,6 +203,7 @@ Rectangle { } } + Rectangle { anchors.left: parent.left anchors.right: parent.right @@ -202,7 +211,10 @@ Rectangle { color: dashboardButton.checked || transferButton.checked ? "#1C1C1C" : "#505050" height: 1 } + */ + + // ------------- Transfer tab --------------- MenuButton { id: transferButton anchors.left: parent.left @@ -221,10 +233,35 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 16 - color: transferButton.checked || historyButton.checked ? "#1C1C1C" : "#505050" + color: transferButton.checked || receiveButton.checked ? "#1C1C1C" : "#505050" height: 1 } + // ------------- Receive tab --------------- + MenuButton { + id: receiveButton + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Receive") + symbol: qsTr("R") + dotColor: "#AAFFBB" + onClicked: { + parent.previousButton.checked = false + parent.previousButton = receiveButton + panel.receiveClicked() + } + } + /* + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 16 + color: transferButton.checked || historyButton.checked ? "#1C1C1C" : "#505050" + height: 1 + }*/ + + // ------------- History tab --------------- + /* MenuButton { id: historyButton anchors.left: parent.left @@ -246,6 +283,7 @@ Rectangle { color: historyButton.checked || addressBookButton.checked ? "#1C1C1C" : "#505050" height: 1 } + // ------------- AddressBook tab --------------- MenuButton { id: addressBookButton @@ -269,6 +307,7 @@ Rectangle { height: 1 } + // ------------- Mining tab --------------- MenuButton { id: miningButton anchors.left: parent.left @@ -291,6 +330,7 @@ Rectangle { height: 1 } + // ------------- Settings tab --------------- MenuButton { id: settingsButton anchors.left: parent.left @@ -304,9 +344,11 @@ Rectangle { panel.settingsClicked() } } + */ } NetworkStatusItem { + id: networkStatus anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom diff --git a/MiddlePanel.qml b/MiddlePanel.qml index edb4963d..4d65636c 100644 --- a/MiddlePanel.qml +++ b/MiddlePanel.qml @@ -31,6 +31,7 @@ import QtQuick 2.2 Rectangle { color: "#F0EEEE" signal paymentClicked(string address, string paymentId, double amount, int mixinCount) + signal generatePaymentIdInvoked() states: [ State { @@ -42,6 +43,9 @@ Rectangle { }, State { name: "Transfer" PropertyChanges { target: loader; source: "pages/Transfer.qml" } + }, State { + name: "Receive" + PropertyChanges { target: loader; source: "pages/Receive.qml" } }, State { name: "AddressBook" PropertyChanges { target: loader; source: "pages/AddressBook.qml" } @@ -79,6 +83,7 @@ Rectangle { } + /* connect "payment" click */ Connections { ignoreUnknownSignals: false target: loader.item diff --git a/components/IconButton.qml b/components/IconButton.qml new file mode 100644 index 00000000..042439f1 --- /dev/null +++ b/components/IconButton.qml @@ -0,0 +1,72 @@ +// Copyright (c) 2014-2015, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// 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 + +Item { + property alias imageSource : buttonImage.source + + signal clicked(var mouse) + + + id: button + width: parent.height + height: parent.height + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + + Image { + id: buttonImage + source: "" + x : (parent.width - width) / 2 + y : (parent.height - height) /2 + z: 100 + } + + MouseArea { + id: buttonArea + anchors.fill: parent + + + onPressed: { + buttonImage.x = buttonImage.x + 2 + buttonImage.y = buttonImage.y + 2 + } + onReleased: { + buttonImage.x = buttonImage.x - 2 + buttonImage.y = buttonImage.y - 2 + } + + onClicked: { + parent.clicked(mouse) + } + } + +} diff --git a/components/Input.qml b/components/Input.qml index c10994d0..78bec8ea 100644 --- a/components/Input.qml +++ b/components/Input.qml @@ -32,6 +32,7 @@ import QtQuick 2.2 TextField { font.family: "Arial" + horizontalAlignment: TextInput.AlignLeft style: TextFieldStyle { textColor: "#3F3F3F" diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 37c2390d..81786881 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -32,8 +32,10 @@ Item { property alias placeholderText: input.placeholderText property alias text: input.text property alias validator: input.validator + property alias readOnly : input.readOnly property int fontSize: 18 + height: 37 Rectangle { @@ -56,6 +58,5 @@ Item { anchors.leftMargin: 4 anchors.rightMargin: 4 font.pixelSize: parent.fontSize - } } diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index c9f67ff8..9f8750d0 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -2,6 +2,7 @@ BITMONERO_URL=https://github.com/mbg033/bitmonero +BITMONERO_BRANCH=fee-mul CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo) pushd $(pwd) ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -13,6 +14,7 @@ BITMONERO_DIR=$ROOT_DIR/bitmonero if [ ! -d $BITMONERO_DIR ]; then git clone --depth=1 $BITMONERO_URL $BITMONERO_DIR + git checkout $BITMONERO_BRANCH else cd $BITMONERO_DIR; git pull; diff --git a/main.qml b/main.qml index 6f90bcf8..c2292798 100644 --- a/main.qml +++ b/main.qml @@ -226,6 +226,7 @@ ApplicationWindow { property bool allow_background_mining : true property bool testnet: true property string daemon_address: "localhost:38081" + property string payment_id } Item { @@ -274,6 +275,7 @@ ApplicationWindow { onDashboardClicked: middlePanel.state = "Dashboard" onHistoryClicked: middlePanel.state = "History" onTransferClicked: middlePanel.state = "Transfer" + onReceiveClicked: middlePanel.state = "Receive" onAddressBookClicked: middlePanel.state = "AddressBook" onMiningClicked: middlePanel.state = "Minning" onSettingsClicked: middlePanel.state = "Settings" @@ -294,7 +296,7 @@ ApplicationWindow { anchors.left: leftPanel.right anchors.right: rightPanel.left height: parent.height - state: "Dashboard" + state: "Transfer" } TipItem { diff --git a/pages/Receive.qml b/pages/Receive.qml new file mode 100644 index 00000000..623c629d --- /dev/null +++ b/pages/Receive.qml @@ -0,0 +1,184 @@ +// Copyright (c) 2014-2015, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// 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.Controls.Styles 1.4 +import QtQuick.Layouts 1.1 + +import "../components" +import moneroComponents 1.0 + +Rectangle { + + color: "#F0EEEE" + property alias addressText : addressLine.text + property alias paymentIdText : paymentIdLine.text + property alias integratedAddressText : integratedAddressLine.text + + function updatePaymentId() { + var payment_id = appWindow.persistentSettings.payment_id + if (payment_id.length === 0) { + payment_id = appWindow.wallet.generatePaymentId() + appWindow.persistentSettings.payment_id = payment_id + appWindow.wallet.payment_id = payment_id + } + paymentIdLine.text = payment_id + addressLine.text = appWindow.wallet.address + integratedAddressLine.text = appWindow.wallet.integratedAddress(payment_id) + } + + Clipboard { id: clipboard } + + + /* main layout */ + ColumnLayout { + id: mainLayout + anchors.margins: 40 + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + + spacing: 20 + property int labelWidth: 120 + property int editWidth: 400 + property int lineEditFontSize: 12 + + + RowLayout { + id: addressRow + + Label { + id: addressLabel + fontSize: 14 + text: qsTr("Address") + width: mainLayout.labelWidth + } + + LineEdit { + id: addressLine + fontSize: mainLayout.lineEditFontSize + placeholderText: "ReadOnly wallet address displayed here"; + readOnly: true + width: mainLayout.editWidth + Layout.fillWidth: true + IconButton { + imageSource: "../images/copyToClipboard.png" + onClicked: { + if (addressLine.text.length > 0) { + clipboard.setText(addressLine.text) + } + } + } + } + } + + RowLayout { + id: integratedAddressRow + Label { + id: integratedAddressLabel + fontSize: 14 + text: qsTr("Integrated address") + width: mainLayout.labelWidth + } + + + LineEdit { + + id: integratedAddressLine + fontSize: mainLayout.lineEditFontSize + placeholderText: "ReadOnly wallet integrated address displayed here"; + readOnly: true + width: mainLayout.editWidth + Layout.fillWidth: true + IconButton { + imageSource: "../images/copyToClipboard.png" + onClicked: { + if (integratedAddressLine.text.length > 0) { + clipboard.setText(integratedAddressLine.text) + } + } + } + + } + } + + RowLayout { + id: paymentIdRow + Label { + id: paymentIdLabel + fontSize: 14 + text: qsTr("Payment ID") + width: mainLayout.labelWidth + } + + + LineEdit { + id: paymentIdLine + fontSize: mainLayout.lineEditFontSize + placeholderText: "PaymentID here"; + readOnly: false + + width: mainLayout.editWidth + Layout.fillWidth: true + + IconButton { + imageSource: "../images/copyToClipboard.png" + onClicked: { + if (paymentIdLine.text.length > 0) { + clipboard.setText(paymentIdLine.text) + } + } + } + } + + StandardButton { + id: generatePaymentId + width: 80 + fontSize: 14 + shadowReleasedColor: "#FF4304" + shadowPressedColor: "#B32D00" + releasedColor: "#FF6C3C" + pressedColor: "#FF4304" + text: qsTr("Generate") + anchors.right: parent.right + onClicked: { + appWindow.persistentSettings.payment_id = appWindow.wallet.generatePaymentId(); + updatePaymentId() + } + } + } + + } + + Component.onCompleted: { + console.log("Receive page loaded"); + updatePaymentId() + } + +} diff --git a/qml.qrc b/qml.qrc index bfa55389..36861fe4 100644 --- a/qml.qrc +++ b/qml.qrc @@ -111,5 +111,7 @@ wizard/WizardRecoveryWallet.qml wizard/WizardMemoTextInput.qml wizard/utils.js + pages/Receive.qml + components/IconButton.qml diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 4e6b6787..da9cba01 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -88,10 +88,11 @@ bool Wallet::refresh() return result; } -PendingTransaction *Wallet::createTransaction(const QString &dst_addr, quint64 amount, quint32 mixin_count) +PendingTransaction *Wallet::createTransaction(const QString &dst_addr, const QString &payment_id, + quint64 amount, quint32 mixin_count) { Bitmonero::PendingTransaction * ptImpl = m_walletImpl->createTransaction( - dst_addr.toStdString(), amount, mixin_count); + dst_addr.toStdString(), payment_id.toStdString(), amount, mixin_count); PendingTransaction * result = new PendingTransaction(ptImpl, this); return result; } @@ -112,6 +113,26 @@ TransactionHistory *Wallet::history() } +QString Wallet::generatePaymentId() const +{ + return QString::fromStdString(Bitmonero::Wallet::genPaymentId()); +} + +QString Wallet::integratedAddress(const QString &paymentId) const +{ + return QString::fromStdString(m_walletImpl->integratedAddress(paymentId.toStdString())); +} + +QString Wallet::paymentId() const +{ + return m_paymentId; +} + +void Wallet::setPaymentId(const QString &paymentId) +{ + m_paymentId = paymentId; +} + Wallet::Wallet(Bitmonero::Wallet *w, QObject *parent) : QObject(parent), m_walletImpl(w), m_history(nullptr) diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 4991476a..675ff52e 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -23,6 +23,7 @@ class Wallet : public QObject Q_PROPERTY(quint64 balance READ balance) Q_PROPERTY(quint64 unlockedBalance READ unlockedBalance) Q_PROPERTY(TransactionHistory * history READ history) + Q_PROPERTY(QString paymentId READ paymentId WRITE setPaymentId) public: enum Status { @@ -75,7 +76,7 @@ public: Q_INVOKABLE bool refresh(); //! creates transaction - Q_INVOKABLE PendingTransaction * createTransaction(const QString &dst_addr, + Q_INVOKABLE PendingTransaction * createTransaction(const QString &dst_addr, const QString &payment_id, quint64 amount, quint32 mixin_count); //! deletes transaction and frees memory @@ -84,6 +85,18 @@ public: //! returns transaction history TransactionHistory * history(); + //! generate payment id + Q_INVOKABLE QString generatePaymentId() const; + + //! integrated address + Q_INVOKABLE QString integratedAddress(const QString &paymentId) const; + + + //! saved payment id + QString paymentId() const; + + void setPaymentId(const QString &paymentId); + // TODO: setListenter() when it implemented in API signals: void updated(); @@ -99,6 +112,7 @@ private: Bitmonero::Wallet * m_walletImpl; // history lifetime managed by wallet; TransactionHistory * m_history; + QString m_paymentId; }; #endif // WALLET_H diff --git a/wizard/WizardCreateWallet.qml b/wizard/WizardCreateWallet.qml index 0aad0052..d39d52d2 100644 --- a/wizard/WizardCreateWallet.qml +++ b/wizard/WizardCreateWallet.qml @@ -60,7 +60,9 @@ Item { var wallet_filename = oshelper.temporaryFilename(); if (typeof settingsObject.wallet === 'undefined') { //var wallet = walletManager.createWallet(wallet_filename, "", settingsObject.language) - var wallet = walletManager.createWallet(wallet_filename, "", settingsObject.wallet_language) + var testnet = appWindow.persistentSettings.testnet; + var wallet = walletManager.createWallet(wallet_filename, "", settingsObject.wallet_language, + testnet) uiItem.wordsTextItem.memoText = wallet.seed // saving wallet in "global" settings object // TODO: wallet should have a property pointing to the file where it stored or loaded from diff --git a/wizard/WizardRecoveryWallet.qml b/wizard/WizardRecoveryWallet.qml index 19530157..aded7661 100644 --- a/wizard/WizardRecoveryWallet.qml +++ b/wizard/WizardRecoveryWallet.qml @@ -49,7 +49,7 @@ Item { } function recoveryWallet(settingsObject) { - var testnet = true; + var testnet = appWindow.persistentSettings.testnet; var wallet = walletManager.recoveryWallet(oshelper.temporaryFilename(), settingsObject.words, testnet); var success = wallet.status === Wallet.Status_Ok; if (success) { -- cgit v1.2.3 From 32ebf180acce258f8efb9bcaeca945a1fdd311ce Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Wed, 20 Jul 2016 22:28:11 +0300 Subject: dynamic translation support. closes #24 --- BasicPanel.qml | 8 +-- LeftPanel.qml | 34 ++++----- RightPanel.qml | 6 +- components/AddressBookTable.qml | 4 +- components/DashboardTable.qml | 8 +-- components/HistoryTable.qml | 10 +-- components/NetworkStatusItem.qml | 2 +- components/PrivacyLevelSmall.qml | 6 +- components/SearchInput.qml | 2 +- components/TickDelegate.qml | 6 +- components/TitleBar.qml | 2 +- main.qml | 19 ++--- pages/AddressBook.qml | 17 ++--- pages/Dashboard.qml | 3 +- pages/History.qml | 27 +++---- pages/Receive.qml | 12 ++-- pages/Transfer.qml | 20 +++--- translations/monero-core_de.ts | 150 ++++++++++++++++++++++++++++++--------- translations/monero-core_en.ts | 150 ++++++++++++++++++++++++++++++--------- translations/monero-core_it.ts | 150 ++++++++++++++++++++++++++++++--------- translations/monero-core_pl.ts | 150 ++++++++++++++++++++++++++++++--------- translations/monero-core_ru.ts | 150 ++++++++++++++++++++++++++++++--------- translations/monero-core_zh.ts | 150 ++++++++++++++++++++++++++++++--------- wizard/WizardConfigure.qml | 11 +-- wizard/WizardCreateWallet.qml | 4 +- wizard/WizardDonation.qml | 10 +-- wizard/WizardFinish.qml | 5 +- wizard/WizardMain.qml | 6 +- wizard/WizardManageWalletUI.qml | 8 +-- wizard/WizardMemoTextInput.qml | 1 + wizard/WizardOptions.qml | 8 +-- wizard/WizardPassword.qml | 1 + wizard/WizardRecoveryWallet.qml | 6 +- wizard/utils.js | 5 ++ 34 files changed, 837 insertions(+), 314 deletions(-) (limited to 'components') diff --git a/BasicPanel.qml b/BasicPanel.qml index 5698316f..3c8de955 100644 --- a/BasicPanel.qml +++ b/BasicPanel.qml @@ -152,7 +152,7 @@ Rectangle { height: 32 fontSize: 15 width: parent.width - sendButton.width - row.spacing - placeholderText: qsTr("amount...") + placeholderText: qsTr("amount...") + translationManager.emptyString } StandardButton { @@ -176,7 +176,7 @@ Rectangle { anchors.margins: 12 fontSize: 15 height: 32 - placeholderText: qsTr("destination...") + placeholderText: qsTr("destination...") + translationManager.emptyString } Text { @@ -188,7 +188,7 @@ Rectangle { font.family: "Arial" font.pixelSize: 12 color: "#535353" - text: qsTr("Privacy level") + text: qsTr("Privacy level") + translationManager.emptyString } PrivacyLevelSmall { @@ -209,6 +209,6 @@ Rectangle { anchors.margins: 12 fontSize: 15 height: 32 - placeholderText: qsTr("payment ID (optional)...") + placeholderText: qsTr("payment ID (optional)...") + translationManager.emptyString } } diff --git a/LeftPanel.qml b/LeftPanel.qml index 6e067d03..604f2d6e 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -103,7 +103,7 @@ Rectangle { text: qsTr("Balance") + translationManager.emptyString anchors.left: parent.left anchors.leftMargin: 50 - tipText: qsTr("Test tip 1

line 2") + tipText: qsTr("Test tip 1

line 2") + translationManager.emptyString } Row { @@ -135,10 +135,10 @@ Rectangle { } Label { - text: qsTr("Unlocked balance") + text: qsTr("Unlocked balance") + translationManager.emptyString anchors.left: parent.left anchors.leftMargin: 50 - tipText: qsTr("Test tip 2

line 2") + tipText: qsTr("Test tip 2

line 2") + translationManager.emptyString } Text { @@ -192,8 +192,8 @@ Rectangle { id: dashboardButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("Dashboard") - symbol: qsTr("D") + text: qsTr("Dashboard") + translationManager.emptyString + symbol: qsTr("D") + translationManager.emptyString dotColor: "#FFE00A" checked: true onClicked: { @@ -219,8 +219,8 @@ Rectangle { id: transferButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("Transfer") - symbol: qsTr("T") + text: qsTr("Transfer") + translationManager.emptyString + symbol: qsTr("T") + translationManager.emptyString dotColor: "#FF6C3C" onClicked: { parent.previousButton.checked = false @@ -242,8 +242,8 @@ Rectangle { id: receiveButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("Receive") - symbol: qsTr("R") + text: qsTr("Receive") + translationManager.emptyString + symbol: qsTr("R") + translationManager.emptyString dotColor: "#AAFFBB" onClicked: { parent.previousButton.checked = false @@ -266,8 +266,8 @@ Rectangle { id: historyButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("History") - symbol: qsTr("H") + text: qsTr("History") + translationManager.emptyString + symbol: qsTr("H") + translationManager.emptyString dotColor: "#6B0072" onClicked: { parent.previousButton.checked = false @@ -289,8 +289,8 @@ Rectangle { id: addressBookButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("Address book") - symbol: qsTr("B") + text: qsTr("Address book") + translationManager.emptyString + symbol: qsTr("B") + translationManager.emptyString dotColor: "#FF4F41" onClicked: { parent.previousButton.checked = false @@ -312,8 +312,8 @@ Rectangle { id: miningButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("Mining") - symbol: qsTr("M") + text: qsTr("Mining") + translationManager.emptyString + symbol: qsTr("M") + translationManager.emptyString dotColor: "#FFD781" onClicked: { parent.previousButton.checked = false @@ -335,8 +335,8 @@ Rectangle { id: settingsButton anchors.left: parent.left anchors.right: parent.right - text: qsTr("Settings") - symbol: qsTr("S") + text: qsTr("Settings") + translationManager.emptyString + symbol: qsTr("S") + translationManager.emptyString dotColor: "#36B25C" onClicked: { parent.previousButton.checked = false diff --git a/RightPanel.qml b/RightPanel.qml index c5878146..932b3916 100644 --- a/RightPanel.qml +++ b/RightPanel.qml @@ -56,9 +56,9 @@ Rectangle { Tab { id: twitter; title: qsTr("Twitter"); source: "tabs/Twitter.qml" } - Tab { title: "News" } - Tab { title: "Help" } - Tab { title: "About" } + Tab { title: qsTr("News") + translationManager.emptyString } + Tab { title: qsTr("Help") + translationManager.emptyString } + Tab { title: qsTr("About") + translationManager.emptyString } diff --git a/components/AddressBookTable.qml b/components/AddressBookTable.qml index ab4bf61d..756445f7 100644 --- a/components/AddressBookTable.qml +++ b/components/AddressBookTable.qml @@ -44,7 +44,7 @@ ListView { font.family: "Arial" font.pixelSize: 14 color: "#545454" - text: qsTr("No more results") + text: qsTr("No more results") + translationManager.emptyString } } @@ -103,7 +103,7 @@ ListView { font.pixelSize: 12 font.letterSpacing: -1 color: "#535353" - text: qsTr("Payment ID:") + text: qsTr("Payment ID:") + + translationManager.emptyString } Text { diff --git a/components/DashboardTable.qml b/components/DashboardTable.qml index 07fe6ac2..05b23c6e 100644 --- a/components/DashboardTable.qml +++ b/components/DashboardTable.qml @@ -44,7 +44,7 @@ ListView { font.family: "Arial" font.pixelSize: 14 color: "#545454" - text: qsTr("No more results") + text: qsTr("No more results") + translationManager.emptyString } } @@ -134,7 +134,7 @@ ListView { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("Date") + text: qsTr("Date") + translationManager.emptyString } Row { @@ -169,7 +169,7 @@ ListView { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("Balance") + text: qsTr("Balance") + translationManager.emptyString } Text { @@ -190,7 +190,7 @@ ListView { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("Amount") + text: qsTr("Amount") + translationManager.emptyString } Row { diff --git a/components/HistoryTable.qml b/components/HistoryTable.qml index 3ee8c82c..db92aa69 100644 --- a/components/HistoryTable.qml +++ b/components/HistoryTable.qml @@ -44,7 +44,7 @@ ListView { font.family: "Arial" font.pixelSize: 14 color: "#545454" - text: qsTr("No more results") + text: qsTr("No more results") + translationManager.emptyString } } @@ -126,7 +126,7 @@ ListView { font.pixelSize: 12 font.letterSpacing: -1 color: "#535353" - text: paymentId !== "" ? qsTr("Payment ID:") : "" + text: paymentId !== "" ? qsTr("Payment ID:") + translationManager.emptyString : "" } Text { @@ -164,7 +164,7 @@ ListView { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("Date") + text: qsTr("Date") + translationManager.emptyString } Row { @@ -199,7 +199,7 @@ ListView { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("Balance") + text: qsTr("Balance") + translationManager.emptyString } Text { @@ -220,7 +220,7 @@ ListView { font.family: "Arial" font.pixelSize: 12 color: "#545454" - text: qsTr("Amount") + text: qsTr("Amount") + translationManager.emptyString } Row { diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index 720fe536..6fb1d2eb 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -63,7 +63,7 @@ Row { font.family: "Arial" font.pixelSize: 18 color: item.connected ? "#FF6C3B" : "#AAAAAA" - text: item.connected ? qsTr("Connected") : qsTr("Disconnected") + text: (item.connected ? qsTr("Connected") : qsTr("Disconnected")) + translationManager.emptyString } } } diff --git a/components/PrivacyLevelSmall.qml b/components/PrivacyLevelSmall.qml index 9321ffbd..cb1cd36e 100644 --- a/components/PrivacyLevelSmall.qml +++ b/components/PrivacyLevelSmall.qml @@ -99,7 +99,7 @@ Item { font.bold: true color: "#000000" x: row.x + (row.positions[0] !== undefined ? row.positions[0].currentX - 3 : 0) - width - text: qsTr("LOW") + text: qsTr("LOW") + translationManager.emptyString } Text { @@ -110,7 +110,7 @@ Item { font.bold: true color: "#000000" x: row.x + (row.positions[4] !== undefined ? row.positions[4].currentX - 3 : 0) - width - text: qsTr("MEDIUM") + text: qsTr("MEDIUM") + translationManager.emptyString } Text { @@ -121,7 +121,7 @@ Item { font.bold: true color: "#000000" x: row.x + (row.positions[13] !== undefined ? row.positions[13].currentX - 3 : 0) - width - text: qsTr("HIGH") + text: qsTr("HIGH") + translationManager.emptyString } MouseArea { diff --git a/components/SearchInput.qml b/components/SearchInput.qml index b104247c..35be896f 100644 --- a/components/SearchInput.qml +++ b/components/SearchInput.qml @@ -66,7 +66,7 @@ Item { anchors.leftMargin: 45 font.pixelSize: 18 verticalAlignment: TextInput.AlignVCenter - placeholderText: qsTr("Search by...") + placeholderText: qsTr("Search by...") + translationManager.emptyString } Item { diff --git a/components/TickDelegate.qml b/components/TickDelegate.qml index 70ef1b50..2163d3e7 100644 --- a/components/TickDelegate.qml +++ b/components/TickDelegate.qml @@ -52,9 +52,9 @@ Item { font.pixelSize: 12 color: "#4A4949" text: { - if(currentIndex === 0) return qsTr("LOW") - if(currentIndex === 3) return qsTr("MEDIUM") - if(currentIndex === 13) return qsTr("HIGH") + if(currentIndex === 0) return qsTr("LOW") + translationManager.emptyString + if(currentIndex === 3) return qsTr("MEDIUM") + translationManager.emptyString + if(currentIndex === 13) return qsTr("HIGH") + translationManager.emptyString return "" } } diff --git a/components/TitleBar.qml b/components/TitleBar.qml index f27caf73..e0baf8f1 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -35,7 +35,7 @@ Rectangle { color: "#000000" y: -height property int mouseX: 0 - property string title: "Monero - Donations" + property string title: qsTr("Monero - Donations") + translationManager.emptyString property bool containsMouse: false property alias maximizeButtonVisible: maximizeButton.visible property alias basicButtonVisible: goToBasicVersionButton.visible diff --git a/main.qml b/main.qml index 7316fc56..da8545af 100644 --- a/main.qml +++ b/main.qml @@ -145,7 +145,7 @@ ApplicationWindow { wallet = walletManager.openWallet(wallet_path, "", persistentSettings.testnet); if (wallet.status !== Wallet.Status_Ok) { console.log("Error opening wallet: ", wallet.errorString); - informationPopup.title = qsTr("Error"); + informationPopup.title = qsTr("Error") + translationManager.emptyString; informationPopup.text = qsTr("Couldn't open wallet: ") + wallet.errorString; informationPopup.icon = StandardIcon.Critical informationPopup.open() @@ -200,7 +200,7 @@ ApplicationWindow { transaction = wallet.createTransaction(address, paymentId, amountxmr, mixinCount, priority); if (transaction.status !== PendingTransaction.Status_Ok) { console.error("Can't create transaction: ", transaction.errorString); - informationPopup.title = qsTr("Error"); + informationPopup.title = qsTr("Error") + translationManager.emptyString; informationPopup.text = qsTr("Can't create transaction: ") + transaction.errorString informationPopup.icon = StandardIcon.Critical informationPopup.open(); @@ -213,12 +213,13 @@ ApplicationWindow { // here we show confirmation popup; - transactionConfirmationPopup.title = qsTr("Confirmation") + transactionConfirmationPopup.title = qsTr("Confirmation") + translationManager.emptyString transactionConfirmationPopup.text = qsTr("Please confirm transaction:\n\n") + qsTr("\nAddress: ") + address + qsTr("\nPayment ID: ") + paymentId + qsTr("\nAmount: ") + walletManager.displayAmount(transaction.amount) + qsTr("\nFee: ") + walletManager.displayAmount(transaction.fee) + + translationManager.emptyString transactionConfirmationPopup.icon = StandardIcon.Question transactionConfirmationPopup.open() // committing transaction @@ -229,12 +230,12 @@ ApplicationWindow { function handleTransactionConfirmed() { if (!transaction.commit()) { console.log("Error committing transaction: " + transaction.errorString); - informationPopup.title = qsTr("Error"); + informationPopup.title = qsTr("Error") + translationManager.emptyString informationPopup.text = qsTr("Couldn't send the money: ") + transaction.errorString informationPopup.icon = StandardIcon.Critical } else { - informationPopup.title = qsTr("Information") - informationPopup.text = qsTr("Money sent successfully") + informationPopup.title = qsTr("Information") + translationManager.emptyString + informationPopup.text = qsTr("Money sent successfully") + translationManager.emptyString informationPopup.icon = StandardIcon.Information } @@ -332,7 +333,7 @@ ApplicationWindow { PropertyChanges { target: titleBar; maximizeButtonVisible: false } PropertyChanges { target: frameArea; blocked: true } PropertyChanges { target: titleBar; y: 0 } - PropertyChanges { target: titleBar; title: "Program setup wizard" } + PropertyChanges { target: titleBar; title: qsTr("Program setup wizard") + translationManager.emptyString } }, State { name: "normal" PropertyChanges { target: leftPanel; visible: true } @@ -346,7 +347,7 @@ ApplicationWindow { PropertyChanges { target: titleBar; maximizeButtonVisible: true } PropertyChanges { target: frameArea; blocked: false } PropertyChanges { target: titleBar; y: -titleBar.height } - PropertyChanges { target: titleBar; title: "Monero - Donations" } + PropertyChanges { target: titleBar; title: qsTr("Monero - Donations") + translationManager.emptyString } } ] @@ -385,7 +386,7 @@ ApplicationWindow { TipItem { id: tipItem - text: "send to the same destination" + text: qsTr("send to the same destination") + translationManager.emptyString visible: false } diff --git a/pages/AddressBook.qml b/pages/AddressBook.qml index 2fcd939a..7ca79f35 100644 --- a/pages/AddressBook.qml +++ b/pages/AddressBook.qml @@ -44,7 +44,7 @@ Rectangle { font.family: "Arial" font.pixelSize: 18 color: "#4A4949" - text: qsTr("Add new entry") + text: qsTr("Add new entry") + translationManager.emptyString } Label { @@ -55,7 +55,7 @@ Rectangle { anchors.topMargin: 17 text: qsTr("Address") fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } LineEdit { @@ -74,9 +74,10 @@ Rectangle { anchors.top: addressLine.bottom anchors.leftMargin: 17 anchors.topMargin: 17 - text: qsTr("Payment ID (Optional)") + text: qsTr("Payment ID (Optional)") + translationManager.emptyString fontSize: 14 tipText: qsTr("Payment ID

A unique user name used in
the address book. It is not a
transfer of information sent
during thevtransfer") + + translationManager.emptyString } LineEdit { @@ -95,9 +96,9 @@ Rectangle { anchors.top: paymentIdLine.bottom anchors.leftMargin: 17 anchors.topMargin: 17 - text: qsTr("Description (Local database)") + text: qsTr("Description (Local database)") + translationManager.emptyString fontSize: 14 - tipText: qsTr("Tip tekst test

test line 2") + tipText: qsTr("Tip tekst test

test line 2") + translationManager.emptyString } LineEdit { @@ -169,9 +170,9 @@ Rectangle { ListModel { id: columnsModel - ListElement { columnName: "Address"; columnWidth: 148 } - ListElement { columnName: "Payment ID"; columnWidth: 148 } - ListElement { columnName: "Description"; columnWidth: 148 } + ListElement { columnName: qsTr("Address") + translationManager.emptyString; columnWidth: 148 } + ListElement { columnName: qsTr("Payment ID") + translationManager.emptyString; columnWidth: 148 } + ListElement { columnName: qsTr("Description") + translationManager.emptyString; columnWidth: 148 } } TableHeader { diff --git a/pages/Dashboard.qml b/pages/Dashboard.qml index da8642ec..3f1621ed 100644 --- a/pages/Dashboard.qml +++ b/pages/Dashboard.qml @@ -54,7 +54,7 @@ Rectangle { font.family: "Arial" font.pixelSize: 18 color: "#4A4949" - text: qsTr("Quick transfer") + text: qsTr("Quick transfer") + translationManager.emptyString } LineEdit { @@ -101,6 +101,7 @@ Rectangle { textFormat: Text.RichText text: qsTr("\ lookng for security level and address book? go to Transfer tab") + + translationManager.emptyString font.underline: false onLinkActivated: appWindow.showPageRequest("Transfer") } diff --git a/pages/History.qml b/pages/History.qml index 6e67d04e..9ec2dd2b 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -44,7 +44,7 @@ Rectangle { font.family: "Arial" font.pixelSize: 18 color: "#4A4949" - text: qsTr("Filter trasactions history") + text: qsTr("Filter trasactions history") + translationManager.emptyString } Label { @@ -55,7 +55,7 @@ Rectangle { anchors.topMargin: 17 text: qsTr("Address") fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } LineEdit { @@ -74,9 +74,10 @@ Rectangle { anchors.top: addressLine.bottom anchors.leftMargin: 17 anchors.topMargin: 17 - text: qsTr("Payment ID (Optional)") + text: qsTr("Payment ID (Optional)") + translationManager.emptyString fontSize: 14 tipText: qsTr("Payment ID

A unique user name used in
the address book. It is not a
transfer of information sent
during thevtransfer") + + translationManager.emptyString } LineEdit { @@ -95,9 +96,9 @@ Rectangle { anchors.top: paymentIdLine.bottom anchors.leftMargin: 17 anchors.topMargin: 17 - text: qsTr("Description (Local database)") + text: qsTr("Description (Local database)") + translationManager.emptyString fontSize: 14 - tipText: qsTr("Tip tekst test

test line 2") + tipText: qsTr("Tip tekst test

test line 2") + translationManager.emptyString } LineEdit { @@ -117,9 +118,9 @@ Rectangle { anchors.leftMargin: 17 anchors.topMargin: 17 width: 156 - text: qsTr("Date from") + text: qsTr("Date from") + translationManager.emptyString fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } DatePicker { @@ -139,7 +140,7 @@ Rectangle { anchors.topMargin: 17 text: qsTr("To") fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } DatePicker { @@ -185,9 +186,9 @@ Rectangle { anchors.leftMargin: 17 anchors.topMargin: 17 width: 156 - text: qsTr("Type of transation") + text: qsTr("Type of transation") + translationManager.emptyString fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } ListModel { @@ -219,9 +220,9 @@ Rectangle { anchors.leftMargin: 17 anchors.topMargin: 17 width: 156 - text: qsTr("Amount from") + text: qsTr("Amount from") + translationManager.emptyString fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } LineEdit { @@ -242,7 +243,7 @@ Rectangle { width: 156 text: qsTr("To") fontSize: 14 - tipText: qsTr("Tip tekst test") + tipText: qsTr("Tip tekst test") + translationManager.emptyString } LineEdit { diff --git a/pages/Receive.qml b/pages/Receive.qml index 623c629d..1218ed7c 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -76,14 +76,14 @@ Rectangle { Label { id: addressLabel fontSize: 14 - text: qsTr("Address") + text: qsTr("Address") + translationManager.emptyString width: mainLayout.labelWidth } LineEdit { id: addressLine fontSize: mainLayout.lineEditFontSize - placeholderText: "ReadOnly wallet address displayed here"; + placeholderText: qsTr("ReadOnly wallet address displayed here") + translationManager.emptyString; readOnly: true width: mainLayout.editWidth Layout.fillWidth: true @@ -103,7 +103,7 @@ Rectangle { Label { id: integratedAddressLabel fontSize: 14 - text: qsTr("Integrated address") + text: qsTr("Integrated address") + translationManager.emptyString width: mainLayout.labelWidth } @@ -112,7 +112,7 @@ Rectangle { id: integratedAddressLine fontSize: mainLayout.lineEditFontSize - placeholderText: "ReadOnly wallet integrated address displayed here"; + placeholderText: qsTr("ReadOnly wallet integrated address displayed here") + translationManager.emptyString readOnly: true width: mainLayout.editWidth Layout.fillWidth: true @@ -133,7 +133,7 @@ Rectangle { Label { id: paymentIdLabel fontSize: 14 - text: qsTr("Payment ID") + text: qsTr("Payment ID") + translationManager.emptyString width: mainLayout.labelWidth } @@ -141,7 +141,7 @@ Rectangle { LineEdit { id: paymentIdLine fontSize: mainLayout.lineEditFontSize - placeholderText: "PaymentID here"; + placeholderText: qsTr("PaymentID here") + translationManager.emptyString; readOnly: false width: mainLayout.editWidth diff --git a/pages/Transfer.qml b/pages/Transfer.qml index aa79c18f..342e73cb 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -54,7 +54,7 @@ Rectangle { anchors.leftMargin: 17 anchors.rightMargin: 17 anchors.topMargin: 17 - text: qsTr("Amount") + text: qsTr("Amount") + translationManager.emptyString fontSize: 14 } @@ -64,7 +64,7 @@ Rectangle { anchors.topMargin: 17 fontSize: 14 x: (parent.width - 17) / 2 + 17 - text: qsTr("Transaction priority") + text: qsTr("Transaction priority") + translationManager.emptyString } Row { @@ -86,16 +86,16 @@ Rectangle { // Amount input LineEdit { id: amountLine - placeholderText: qsTr("Amount...") + placeholderText: qsTr("Amount...") + translationManager.emptyString width: parent.width - 37 - 17 } } ListModel { id: priorityModel - ListElement { column1: "LOW"; column2: ""; priority: PendingTransaction.Priority_Low } - ListElement { column1: "MEDIUM"; column2: ""; priority: PendingTransaction.Priority_Medium } - ListElement { column1: "HIGH"; column2: ""; priority: PendingTransaction.Priority_High } + ListElement { column1: qsTr("LOW") + translationManager.emptyString; column2: ""; priority: PendingTransaction.Priority_Low } + ListElement { column1: qsTr("MEDIUM") + translationManager.emptyString; column2: ""; priority: PendingTransaction.Priority_Medium } + ListElement { column1: qsTr("HIGH") + translationManager.emptyString; column2: ""; priority: PendingTransaction.Priority_High } } StandardDropdown { @@ -124,7 +124,7 @@ Rectangle { anchors.rightMargin: 17 anchors.topMargin: 30 fontSize: 14 - text: qsTr("Privacy Level") + text: qsTr("Privacy Level") + translationManager.emptyString } PrivacyLevel { @@ -166,6 +166,7 @@ Rectangle { textFormat: Text.RichText text: qsTr("\ Address ( Type in or select from Address book )") + + translationManager.emptyString onLinkActivated: appWindow.showPageRequest("AddressBook") } @@ -190,7 +191,7 @@ Rectangle { anchors.rightMargin: 17 anchors.topMargin: 17 fontSize: 14 - text: qsTr("Payment ID ( Optional )") + text: qsTr("Payment ID ( Optional )") + translationManager.emptyString } // payment id input @@ -215,6 +216,7 @@ Rectangle { anchors.topMargin: 17 fontSize: 14 text: qsTr("Description ( An optional description that will be saved to the local address book if entered )") + + translationManager.emptyString } LineEdit { @@ -234,7 +236,7 @@ Rectangle { anchors.leftMargin: 17 anchors.topMargin: 17 width: 60 - text: qsTr("SEND") + text: qsTr("SEND") + translationManager.emptyString shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" diff --git a/translations/monero-core_de.ts b/translations/monero-core_de.ts index f2c59688..ea08d710 100644 --- a/translations/monero-core_de.ts +++ b/translations/monero-core_de.ts @@ -10,6 +10,7 @@ + Address @@ -29,20 +30,30 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + ADD + + + Payment ID + + + + + Description + + AddressBookTable @@ -160,11 +171,11 @@ - - - - - + + + + + <b>Tip tekst test</b> @@ -179,43 +190,43 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + Date from - - + + To - + FILTER - + Advance filtering - + Type of transation - + Amount from @@ -334,16 +345,31 @@ Address + + + ReadOnly wallet address displayed here + + Integrated address + + + ReadOnly wallet integrated address displayed here + + Payment ID + + + PaymentID here + + Generate @@ -357,6 +383,21 @@ Twitter + + + News + + + + + Help + + + + + About + + SearchInput @@ -389,6 +430,14 @@ + + TitleBar + + + Monero - Donations + + + Transfer @@ -406,6 +455,21 @@ Amount... + + + LOW + + + + + MEDIUM + + + + + HIGH + + Privacy Level @@ -422,17 +486,17 @@ - + Payment ID <font size='2'>( Optional )</font> - + Description <font size='2'>( An optional description that will be saved to the local address book if entered )</font> - + SEND @@ -455,22 +519,22 @@ - + Enable disk conservation mode? - + Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as a regular Monero instance. However, storing the full blockchain is beneficial to the security of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you. - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -511,12 +575,12 @@ - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -559,12 +623,12 @@ - + An overview of your Monero configuration is below: - + You’re all setup! @@ -604,6 +668,11 @@ Your wallet is stored in + + + Please choose a directory + + WizardMemoTextInput @@ -681,7 +750,7 @@ - + Error @@ -732,24 +801,39 @@ Fee: - + Couldn't send the money: - + Information - + Money sent successfully - + Initializing Wallet... + + + Program setup wizard + + + + + Monero - Donations + + + + + send to the same destination + + diff --git a/translations/monero-core_en.ts b/translations/monero-core_en.ts index f8f7b3ea..dca4c577 100644 --- a/translations/monero-core_en.ts +++ b/translations/monero-core_en.ts @@ -10,6 +10,7 @@ + Address @@ -29,20 +30,30 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + ADD + + + Payment ID + + + + + Description + + AddressBookTable @@ -160,11 +171,11 @@ - - - - - + + + + + <b>Tip tekst test</b> @@ -179,43 +190,43 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + Date from - - + + To - + FILTER - + Advance filtering - + Type of transation - + Amount from @@ -334,16 +345,31 @@ Address + + + ReadOnly wallet address displayed here + + Integrated address + + + ReadOnly wallet integrated address displayed here + + Payment ID + + + PaymentID here + + Generate @@ -357,6 +383,21 @@ Twitter + + + News + + + + + Help + + + + + About + + SearchInput @@ -389,6 +430,14 @@ + + TitleBar + + + Monero - Donations + + + Transfer @@ -406,6 +455,21 @@ Amount... + + + LOW + + + + + MEDIUM + + + + + HIGH + + Privacy Level @@ -422,17 +486,17 @@ - + Payment ID <font size='2'>( Optional )</font> - + Description <font size='2'>( An optional description that will be saved to the local address book if entered )</font> - + SEND @@ -455,22 +519,22 @@ - + Enable disk conservation mode? - + Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as a regular Monero instance. However, storing the full blockchain is beneficial to the security of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you. - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -511,12 +575,12 @@ - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -559,12 +623,12 @@ - + An overview of your Monero configuration is below: - + You’re all setup! @@ -604,6 +668,11 @@ Your wallet is stored in + + + Please choose a directory + + WizardMemoTextInput @@ -681,7 +750,7 @@ - + Error @@ -732,24 +801,39 @@ Fee: - + Couldn't send the money: - + Information - + Money sent successfully - + Initializing Wallet... + + + Program setup wizard + + + + + Monero - Donations + + + + + send to the same destination + + diff --git a/translations/monero-core_it.ts b/translations/monero-core_it.ts index 3b4e2760..2c9c4b78 100644 --- a/translations/monero-core_it.ts +++ b/translations/monero-core_it.ts @@ -10,6 +10,7 @@ + Address @@ -29,20 +30,30 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + ADD + + + Payment ID + + + + + Description + + AddressBookTable @@ -160,11 +171,11 @@ - - - - - + + + + + <b>Tip tekst test</b> @@ -179,43 +190,43 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + Date from - - + + To - + FILTER - + Advance filtering - + Type of transation - + Amount from @@ -334,16 +345,31 @@ Address + + + ReadOnly wallet address displayed here + + Integrated address + + + ReadOnly wallet integrated address displayed here + + Payment ID + + + PaymentID here + + Generate @@ -357,6 +383,21 @@ Twitter + + + News + + + + + Help + + + + + About + + SearchInput @@ -389,6 +430,14 @@ + + TitleBar + + + Monero - Donations + + + Transfer @@ -406,6 +455,21 @@ Amount... + + + LOW + + + + + MEDIUM + + + + + HIGH + + Privacy Level @@ -422,17 +486,17 @@ - + Payment ID <font size='2'>( Optional )</font> - + Description <font size='2'>( An optional description that will be saved to the local address book if entered )</font> - + SEND @@ -455,22 +519,22 @@ - + Enable disk conservation mode? - + Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as a regular Monero instance. However, storing the full blockchain is beneficial to the security of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you. - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -511,12 +575,12 @@ - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -559,12 +623,12 @@ - + An overview of your Monero configuration is below: - + You’re all setup! @@ -604,6 +668,11 @@ Your wallet is stored in + + + Please choose a directory + + WizardMemoTextInput @@ -681,7 +750,7 @@ - + Error @@ -732,24 +801,39 @@ Fee: - + Couldn't send the money: - + Information - + Money sent successfully - + Initializing Wallet... + + + Program setup wizard + + + + + Monero - Donations + + + + + send to the same destination + + diff --git a/translations/monero-core_pl.ts b/translations/monero-core_pl.ts index 6c15a0b0..a3496ddb 100644 --- a/translations/monero-core_pl.ts +++ b/translations/monero-core_pl.ts @@ -10,6 +10,7 @@ + Address @@ -29,20 +30,30 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + ADD + + + Payment ID + + + + + Description + + AddressBookTable @@ -160,11 +171,11 @@ - - - - - + + + + + <b>Tip tekst test</b> @@ -179,43 +190,43 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + Date from - - + + To - + FILTER - + Advance filtering - + Type of transation - + Amount from @@ -334,16 +345,31 @@ Address + + + ReadOnly wallet address displayed here + + Integrated address + + + ReadOnly wallet integrated address displayed here + + Payment ID + + + PaymentID here + + Generate @@ -357,6 +383,21 @@ Twitter + + + News + + + + + Help + + + + + About + + SearchInput @@ -389,6 +430,14 @@ + + TitleBar + + + Monero - Donations + + + Transfer @@ -406,6 +455,21 @@ Amount... + + + LOW + + + + + MEDIUM + + + + + HIGH + + Privacy Level @@ -422,17 +486,17 @@ - + Payment ID <font size='2'>( Optional )</font> - + Description <font size='2'>( An optional description that will be saved to the local address book if entered )</font> - + SEND @@ -455,22 +519,22 @@ - + Enable disk conservation mode? - + Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as a regular Monero instance. However, storing the full blockchain is beneficial to the security of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you. - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -511,12 +575,12 @@ - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -559,12 +623,12 @@ - + An overview of your Monero configuration is below: - + You’re all setup! @@ -604,6 +668,11 @@ Your wallet is stored in + + + Please choose a directory + + WizardMemoTextInput @@ -681,7 +750,7 @@ - + Error @@ -732,24 +801,39 @@ Fee: - + Couldn't send the money: - + Information - + Money sent successfully - + Initializing Wallet... + + + Program setup wizard + + + + + Monero - Donations + + + + + send to the same destination + + diff --git a/translations/monero-core_ru.ts b/translations/monero-core_ru.ts index 7921567d..29bf9b7f 100644 --- a/translations/monero-core_ru.ts +++ b/translations/monero-core_ru.ts @@ -10,6 +10,7 @@ + Address @@ -29,20 +30,30 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + ADD + + + Payment ID + + + + + Description + + AddressBookTable @@ -160,11 +171,11 @@ - - - - - + + + + + <b>Tip tekst test</b> @@ -179,43 +190,43 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + Date from - - + + To - + FILTER - + Advance filtering - + Type of transation - + Amount from @@ -334,16 +345,31 @@ Address + + + ReadOnly wallet address displayed here + + Integrated address + + + ReadOnly wallet integrated address displayed here + + Payment ID + + + PaymentID here + + Generate @@ -357,6 +383,21 @@ Twitter + + + News + + + + + Help + + + + + About + + SearchInput @@ -389,6 +430,14 @@ + + TitleBar + + + Monero - Donations + + + Transfer @@ -406,6 +455,21 @@ Amount... + + + LOW + + + + + MEDIUM + + + + + HIGH + + Privacy Level @@ -422,17 +486,17 @@ - + Payment ID <font size='2'>( Optional )</font> - + Description <font size='2'>( An optional description that will be saved to the local address book if entered )</font> - + SEND @@ -455,22 +519,22 @@ - + Enable disk conservation mode? - + Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as a regular Monero instance. However, storing the full blockchain is beneficial to the security of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you. - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -511,12 +575,12 @@ - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -559,12 +623,12 @@ - + An overview of your Monero configuration is below: - + You’re all setup! @@ -604,6 +668,11 @@ Your wallet is stored in + + + Please choose a directory + + WizardMemoTextInput @@ -681,7 +750,7 @@ - + Error @@ -732,24 +801,39 @@ Fee: - + Couldn't send the money: - + Information - + Money sent successfully - + Initializing Wallet... + + + Program setup wizard + + + + + Monero - Donations + + + + + send to the same destination + + diff --git a/translations/monero-core_zh.ts b/translations/monero-core_zh.ts index 0a2faf01..e5e60dab 100644 --- a/translations/monero-core_zh.ts +++ b/translations/monero-core_zh.ts @@ -10,6 +10,7 @@ + Address @@ -29,20 +30,30 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + ADD + + + Payment ID + + + + + Description + + AddressBookTable @@ -160,11 +171,11 @@ - - - - - + + + + + <b>Tip tekst test</b> @@ -179,43 +190,43 @@ - + Description <font size='2'>(Local database)</font> - + <b>Tip tekst test</b><br/><br/>test line 2 - + Date from - - + + To - + FILTER - + Advance filtering - + Type of transation - + Amount from @@ -334,16 +345,31 @@ Address + + + ReadOnly wallet address displayed here + + Integrated address + + + ReadOnly wallet integrated address displayed here + + Payment ID + + + PaymentID here + + Generate @@ -357,6 +383,21 @@ Twitter + + + News + + + + + Help + + + + + About + + SearchInput @@ -389,6 +430,14 @@ + + TitleBar + + + Monero - Donations + + + Transfer @@ -406,6 +455,21 @@ Amount... + + + LOW + + + + + MEDIUM + + + + + HIGH + + Privacy Level @@ -422,17 +486,17 @@ - + Payment ID <font size='2'>( Optional )</font> - + Description <font size='2'>( An optional description that will be saved to the local address book if entered )</font> - + SEND @@ -455,22 +519,22 @@ - + Enable disk conservation mode? - + Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as a regular Monero instance. However, storing the full blockchain is beneficial to the security of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you. - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -511,12 +575,12 @@ - + Allow background mining? - + Mining secures the Monero network, and also pays a small reward for the work done. This option will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working. @@ -559,12 +623,12 @@ - + An overview of your Monero configuration is below: - + You’re all setup! @@ -604,6 +668,11 @@ Your wallet is stored in + + + Please choose a directory + + WizardMemoTextInput @@ -681,7 +750,7 @@ - + Error @@ -732,24 +801,39 @@ Fee: - + Couldn't send the money: - + Information - + Money sent successfully - + Initializing Wallet... + + + Program setup wizard + + + + + Monero - Donations + + + + + send to the same destination + + diff --git a/wizard/WizardConfigure.qml b/wizard/WizardConfigure.qml index acfae0bd..343f9c88 100644 --- a/wizard/WizardConfigure.qml +++ b/wizard/WizardConfigure.qml @@ -76,7 +76,7 @@ Item { wrapMode: Text.Wrap //renderType: Text.NativeRendering color: "#3F3F3F" - text: qsTr("We’re almost there - let’s just configure some Monero preferences") + text: qsTr("We’re almost there - let’s just configure some Monero preferences") + translationManager.emptyString } Column { @@ -94,7 +94,7 @@ Item { spacing: 12 CheckBox { - text: qsTr("Kickstart the Monero blockchain?") + text: qsTr("Kickstart the Monero blockchain?") + translationManager.emptyString anchors.left: parent.left anchors.right: parent.right background: "#F0EEEE" @@ -114,6 +114,7 @@ Item { wrapMode: Text.Wrap text: qsTr("It is very important to write it down as this is the only backup you will need for your wallet. " + "You will be asked to confirm the seed in the next screen to ensure it has copied down correctly.") + + translationManager.emptyString } } @@ -123,7 +124,7 @@ Item { spacing: 12 CheckBox { - text: qsTr("Enable disk conservation mode?") + text: qsTr("Enable disk conservation mode?") + translationManager.emptyString anchors.left: parent.left anchors.right: parent.right background: "#F0EEEE" @@ -144,6 +145,7 @@ Item { text: qsTr("Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as " + "a regular Monero instance. However, storing the full blockchain is beneficial to the security " + "of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you.") + + translationManager.emptyString } } @@ -153,7 +155,7 @@ Item { spacing: 12 CheckBox { - text: qsTr("Allow background mining?") + text: qsTr("Allow background mining?") + translationManager.emptyString anchors.left: parent.left anchors.right: parent.right background: "#F0EEEE" @@ -173,6 +175,7 @@ Item { wrapMode: Text.Wrap text: qsTr("Mining secures the Monero network, and also pays a small reward for the work done. This option " + "will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working.") + + translationManager.emptyString } } } diff --git a/wizard/WizardCreateWallet.qml b/wizard/WizardCreateWallet.qml index d39d52d2..2181a359 100644 --- a/wizard/WizardCreateWallet.qml +++ b/wizard/WizardCreateWallet.qml @@ -78,8 +78,8 @@ Item { WizardManageWalletUI { id: uiItem - titleText: qsTr("A new wallet has been created for you") - wordsTextTitle: qsTr("This is the 25 word mnemonic for your wallet") + titleText: qsTr("A new wallet has been created for you") + translationManager.emptyString + wordsTextTitle: qsTr("This is the 25 word mnemonic for your wallet") + translationManager.emptyString wordsTextItem.clipboardButtonVisible: true wordsTextItem.tipTextVisible: true wordsTextItem.memoTextReadOnly: true diff --git a/wizard/WizardDonation.qml b/wizard/WizardDonation.qml index 80ebd78b..57e03524 100644 --- a/wizard/WizardDonation.qml +++ b/wizard/WizardDonation.qml @@ -90,7 +90,7 @@ Item { wrapMode: Text.Wrap //renderType: Text.NativeRendering color: "#3F3F3F" - text: qsTr("Monero development is solely supported by donations") + text: qsTr("Monero development is solely supported by donations") + translationManager.emptyString } Column { @@ -110,7 +110,7 @@ Item { CheckBox { id: enableAutoDonationCheckBox anchors.verticalCenter: parent.verticalCenter - text: qsTr("Enable auto-donations of?") + text: qsTr("Enable auto-donations of?") + translationManager.emptyString background: "#F0EEEE" fontColor: "#4A4646" fontSize: 18 @@ -150,7 +150,7 @@ Item { font.family: "Arial" font.pixelSize: 18 color: "#4A4646" - text: qsTr("% of my fee added to each transaction") + text: qsTr("% of my fee added to each transaction") + translationManager.emptyString } } @@ -164,6 +164,7 @@ Item { text: qsTr("For every transaction, a small transaction fee is charged. This option lets you add an additional amount, " + "as a percentage of that fee, to your transaction to support Monero development. For instance, a 50% " + "autodonation take a transaction fee of 0.005 XMR and add a 0.0025 XMR to support Monero development.") + + translationManager.emptyString } Column { anchors.left: parent.left @@ -172,7 +173,7 @@ Item { CheckBox { id: allowBackgroundMiningCheckBox - text: qsTr("Allow background mining?") + text: qsTr("Allow background mining?") + translationManager.emptyString anchors.left: parent.left anchors.right: parent.right background: "#F0EEEE" @@ -192,6 +193,7 @@ Item { wrapMode: Text.Wrap text: qsTr("Mining secures the Monero network, and also pays a small reward for the work done. This option " + "will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working.") + + translationManager.emptyString } } } diff --git a/wizard/WizardFinish.qml b/wizard/WizardFinish.qml index 427a2340..7c9c89e7 100644 --- a/wizard/WizardFinish.qml +++ b/wizard/WizardFinish.qml @@ -45,10 +45,11 @@ Item { + qsTr("Enable auto donation: ") + wizard.settings['auto_donations_enabled'] + "
" + qsTr("Auto donation amount: ") + wizard.settings['auto_donations_amount'] + "
" + qsTr("Allow background mining: ") + wizard.settings['allow_background_mining'] + "
" + + translationManager.emptyString return str; } function updateSettingsSummary() { - settingsText.text = qsTr("An overview of your Monero configuration is below:") + settingsText.text = qsTr("An overview of your Monero configuration is below:") + translationManager.emptyString + "
" + buildSettingsString(); } @@ -99,7 +100,7 @@ Item { horizontalAlignment: Text.AlignHCenter //renderType: Text.NativeRendering color: "#3F3F3F" - text: qsTr("You’re all setup!") + text: qsTr("You’re all setup!") + translationManager.emptyString } Text { diff --git a/wizard/WizardMain.qml b/wizard/WizardMain.qml index 987ac897..1103c2ff 100644 --- a/wizard/WizardMain.qml +++ b/wizard/WizardMain.qml @@ -82,9 +82,9 @@ Rectangle { // disable "next" button until passwords match nextButton.enabled = passwordPage.passwordValid; if (currentPath === "create_wallet") { - passwordPage.titleText = qsTr("Now that your wallet has been created, please set a password for the wallet") + passwordPage.titleText = qsTr("Now that your wallet has been created, please set a password for the wallet") + translationManager.emptyString } else { - passwordPage.titleText = qsTr("Now that your wallet has been restored, please set a password for the wallet") + passwordPage.titleText = qsTr("Now that your wallet has been restored, please set a password for the wallet") + translationManager.emptyString } break; case finishPage: @@ -306,7 +306,7 @@ Rectangle { anchors.bottom: parent.bottom anchors.margins: 50 width: 110 - text: qsTr("USE MONERO") + text: qsTr("USE MONERO") + translationManager.emptyString shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" diff --git a/wizard/WizardManageWalletUI.qml b/wizard/WizardManageWalletUI.qml index 58f4e59a..a11ee094 100644 --- a/wizard/WizardManageWalletUI.qml +++ b/wizard/WizardManageWalletUI.qml @@ -100,7 +100,7 @@ Item { horizontalAlignment: Text.AlignHCenter //renderType: Text.NativeRendering color: "#4A4646" - text: qsTr("This is the name of your wallet. You can change it to a different name if you’d like:") + text: qsTr("This is the name of your wallet. You can change it to a different name if you’d like:") + translationManager.emptyString } } @@ -122,7 +122,7 @@ Item { renderType: Text.NativeRendering color: "#FF6C3C" focus: true - text: qsTr("My account name") + text: qsTr("My account name") + translationManager.emptyString } Rectangle { @@ -172,7 +172,7 @@ Item { font.pixelSize: 18 //renderType: Text.NativeRendering color: "#4A4646" - text: qsTr("Your wallet is stored in") + text: qsTr("Your wallet is stored in") + translationManager.emptyString } Item { @@ -184,7 +184,7 @@ Item { id: fileDialog selectMultiple: false selectFolder: true - title: "Please choose a directory" + title: qsTr("Please choose a directory") + translationManager.emptyString onAccepted: { fileUrlInput.text = fileDialog.folder fileDialog.visible = false diff --git a/wizard/WizardMemoTextInput.qml b/wizard/WizardMemoTextInput.qml index 39f9211b..9497d9e5 100644 --- a/wizard/WizardMemoTextInput.qml +++ b/wizard/WizardMemoTextInput.qml @@ -74,6 +74,7 @@ Column { color: "#4A4646" wrapMode: Text.Wrap text: qsTr("It is very important to write it down as this is the only backup you will need for your wallet. You will be asked to confirm the seed in the next screen to ensure it has copied down correctly.") + + translationManager.emptyString } } } diff --git a/wizard/WizardOptions.qml b/wizard/WizardOptions.qml index 621cac78..7aa3be2f 100644 --- a/wizard/WizardOptions.qml +++ b/wizard/WizardOptions.qml @@ -59,7 +59,7 @@ Item { color: "#3F3F3F" wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter - text: qsTr("Welcome to Monero!") + text: qsTr("Welcome to Monero!") + translationManager.emptyString } Text { @@ -71,7 +71,7 @@ Item { color: "#4A4646" wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter - text: qsTr("Please select one of the following options:") + text: qsTr("Please select one of the following options:") + translationManager.emptyString } } @@ -107,7 +107,7 @@ Item { font.pixelSize: 16 color: "#4A4949" horizontalAlignment: Text.AlignHCenter - text: qsTr("This is my first time, I want to
create a new account") + text: qsTr("This is my first time, I want to
create a new account") + translationManager.emptyString } } @@ -138,7 +138,7 @@ Item { font.pixelSize: 16 color: "#4A4949" horizontalAlignment: Text.AlignHCenter - text: qsTr("I want to recover my account
from my 24 work seed") + text: qsTr("I want to recover my account
from my 24 work seed") + translationManager.emptyString } } } diff --git a/wizard/WizardPassword.qml b/wizard/WizardPassword.qml index 4825c02d..0e79d57c 100644 --- a/wizard/WizardPassword.qml +++ b/wizard/WizardPassword.qml @@ -120,6 +120,7 @@ Item { horizontalAlignment: Text.AlignHCenter text: qsTr("Note that this password cannot be recovered, and if forgotten you will need to restore your wallet from the mnemonic seed you were just given

Your password will be used to protect your wallet and to confirm actions, so make sure that your password is sufficiently secure.") + + translationManager.emptyString } } diff --git a/wizard/WizardRecoveryWallet.qml b/wizard/WizardRecoveryWallet.qml index aded7661..972ee6a1 100644 --- a/wizard/WizardRecoveryWallet.qml +++ b/wizard/WizardRecoveryWallet.qml @@ -66,9 +66,9 @@ Item { WizardManageWalletUI { id: uiItem - accountNameText: qsTr("My account name") - titleText: qsTr("We're ready to recover your account") - wordsTextTitle: qsTr("Please enter your 25 word private key") + accountNameText: qsTr("My account name") + translationManager.emptyString + titleText: qsTr("We're ready to recover your account") + translationManager.emptyString + wordsTextTitle: qsTr("Please enter your 25 word private key") + translationManager.emptyString wordsTextItem.clipboardButtonVisible: false wordsTextItem.tipTextVisible: false wordsTextItem.memoTextReadOnly: false diff --git a/wizard/utils.js b/wizard/utils.js index 6d16951d..0cc910c6 100644 --- a/wizard/utils.js +++ b/wizard/utils.js @@ -37,3 +37,8 @@ function mapScope (inputScopeFrom, inputScopeTo, outputScopeFrom, outputScopeTo, var result = outputScopeFrom + ((outputScopeTo - outputScopeFrom) * x); return result; } + + +function tr(text) { + return qsTr(text) + translationManager.emptyString +} -- cgit v1.2.3 From d0a5339289e6465c5ead8b73973b0840cfbb279b Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Wed, 10 Aug 2016 15:09:05 +0300 Subject: Removed: hardcoded "Monero - Donations" --- components/TitleBar.qml | 2 +- main.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/TitleBar.qml b/components/TitleBar.qml index e0baf8f1..8e1c9e32 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -35,7 +35,7 @@ Rectangle { color: "#000000" y: -height property int mouseX: 0 - property string title: qsTr("Monero - Donations") + translationManager.emptyString + property string title property bool containsMouse: false property alias maximizeButtonVisible: maximizeButton.visible property alias basicButtonVisible: goToBasicVersionButton.visible diff --git a/main.qml b/main.qml index da8545af..a7f2deb9 100644 --- a/main.qml +++ b/main.qml @@ -347,7 +347,7 @@ ApplicationWindow { PropertyChanges { target: titleBar; maximizeButtonVisible: true } PropertyChanges { target: frameArea; blocked: false } PropertyChanges { target: titleBar; y: -titleBar.height } - PropertyChanges { target: titleBar; title: qsTr("Monero - Donations") + translationManager.emptyString } + PropertyChanges { target: titleBar; title: qsTr("Monero") + translationManager.emptyString } } ] -- cgit v1.2.3 From 6f1343aaa04bf2e4f959b5d3201239fe7fc85398 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Tue, 16 Aug 2016 23:21:46 +0300 Subject: ask user for the password if wallet is password-protected --- components/PasswordDialog.qml | 5 +++++ main.qml | 40 +++++++++++++++++++++++++++++++++------- monero-core.pro | 5 ++++- qml.qrc | 1 + wizard/WizardMain.qml | 39 ++++++--------------------------------- 5 files changed, 49 insertions(+), 41 deletions(-) create mode 100644 components/PasswordDialog.qml (limited to 'components') diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml new file mode 100644 index 00000000..9c36e13c --- /dev/null +++ b/components/PasswordDialog.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + +} diff --git a/main.qml b/main.qml index 919d0a8b..7320d3af 100644 --- a/main.qml +++ b/main.qml @@ -139,19 +139,18 @@ ApplicationWindow { if (typeof wizard.settings['wallet'] !== 'undefined') { wallet = wizard.settings['wallet']; } else { - var wallet_path = persistentSettings.wallet_path + "/" + persistentSettings.account_name + "/" - + persistentSettings.account_name; + var wallet_path = walletPath(); + console.log("opening wallet at: ", wallet_path); // TODO: wallet password dialog wallet = walletManager.openWallet(wallet_path, "", persistentSettings.testnet); if (wallet.status !== Wallet.Status_Ok) { - console.log("Error opening wallet: ", wallet.errorString); - informationPopup.title = qsTr("Error") + translationManager.emptyString; - informationPopup.text = qsTr("Couldn't open wallet: ") + wallet.errorString; - informationPopup.icon = StandardIcon.Critical - informationPopup.open() + console.error("Error opening wallet with empty password: ", wallet.errorString); + + // try to open wallet with password; + passwordDialog.open(); return; } console.log("Wallet opened successfully: ", wallet.errorString); @@ -165,6 +164,13 @@ ApplicationWindow { } + function walletPath() { + var wallet_path = persistentSettings.wallet_path + "/" + persistentSettings.account_name + "/" + + persistentSettings.account_name; + return wallet_path; + } + + function onWalletUpdate() { console.log(">>> wallet updated") basicPanel.unlockedBalanceText = leftPanel.unlockedBalanceText = walletManager.displayAmount(wallet.unlockedBalance); @@ -291,6 +297,7 @@ ApplicationWindow { // Information dialog MessageDialog { id: informationPopup + standardButtons: StandardButton.Ok } @@ -303,6 +310,25 @@ ApplicationWindow { } } + PasswordDialog { + id: passwordDialog + standardButtons: StandardButton.Ok + StandardButton.Cancel + onAccepted: { + + var wallet_path = walletPath(); + console.log("opening wallet with password: ", wallet_path); + wallet = walletManager.openWallet(wallet_path, password, persistentSettings.testnet); + if (wallet.status !== Wallet.Status_Ok) { + console.error("Error opening wallet with password: ", wallet.errorString); + informationPopup.title = qsTr("Error") + translationManager.emptyString; + informationPopup.text = qsTr("Couldn't open wallet: ") + wallet.errorString; + informationPopup.icon = StandardIcon.Critical + informationPopup.open() + + } + } + } + Window { id: walletInitializationSplash modality: Qt.ApplicationModal diff --git a/monero-core.pro b/monero-core.pro index c247a802..9520cd37 100644 --- a/monero-core.pro +++ b/monero-core.pro @@ -155,6 +155,8 @@ langrel.CONFIG += no_link QMAKE_EXTRA_TARGETS += langupd deploy deploy_win QMAKE_EXTRA_COMPILERS += langrel + + PRE_TARGETDEPS += langupd compiler_langrel_make_all RESOURCES += qml.qrc @@ -180,7 +182,8 @@ OTHER_FILES += \ $$TRANSLATIONS DISTFILES += \ - notes.txt + notes.txt \ + components/PasswordDialog.qml # windows application icon RC_FILE = monero-core.rc diff --git a/qml.qrc b/qml.qrc index eca9f561..dcf4b9b1 100644 --- a/qml.qrc +++ b/qml.qrc @@ -114,5 +114,6 @@ pages/Receive.qml components/IconButton.qml lang/flags/italy.png + components/PasswordDialog.qml diff --git a/wizard/WizardMain.qml b/wizard/WizardMain.qml index f0556efc..488bd959 100644 --- a/wizard/WizardMain.qml +++ b/wizard/WizardMain.qml @@ -78,24 +78,6 @@ Rectangle { } } - // TODO: remove it - function handlePageChanged() { - -// switch (pages[currentPage]) { -//// case finishPage: -//// // display settings summary -//// finishPage.updateSettingsSummary(); -//// nextButton.visible = false; -//// break; -// case recoveryWalletPage: -// // disable "next button" until 25 words private key entered -// nextButton.enabled = false -// break -// default: -// nextButton.enabled = true - -// } - } function openCreateWalletPage() { @@ -126,10 +108,9 @@ Rectangle { //! actually writes the wallet function applySettings() { - print ("Here we apply the settings"); + console.log("Here we apply the settings"); // here we need to actually move wallet to the new location - // put wallet files to the subdirectory with the same name as - // wallet name + var new_wallet_filename = settings.wallet_path + "/" + settings.account_name + "/" + settings.account_name; @@ -138,9 +119,12 @@ Rectangle { if (new_wallet_filename !== settings.wallet_filename) { // using previously saved wallet; settings.wallet.store(new_wallet_filename); - //walletManager.moveWallet(settingsObject.wallet_filename, new_wallet_filename); } + // protecting wallet with password + console.log("Protecting wallet with password: " + settings.wallet_password) + settings.wallet.setPassword(settings.wallet_password); + // saving wallet_filename; settings['wallet_filename'] = new_wallet_filename; @@ -163,17 +147,6 @@ Rectangle { } -// Settings { -// id: persistentSettings - -// property string language -// property string account_name -// property string wallet_path -// property bool auto_donations_enabled : true -// property int auto_donations_amount : 50 -// property bool allow_background_mining : true -// } - Rectangle { id: nextButton anchors.verticalCenter: parent.verticalCenter -- cgit v1.2.3 From c1269301f7c19a849b0fae7ddbe9afd38aaf71d3 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Wed, 17 Aug 2016 15:14:43 +0300 Subject: Ask for password in wallet is password protected. closes #26 --- BasicPanel.qml | 8 ++++ LeftPanel.qml | 9 +++++ MiddlePanel.qml | 9 +++++ RightPanel.qml | 10 +++++ components/PasswordDialog.qml | 37 +++++++++++++++++- main.qml | 87 +++++++++++++++++++++++++++++-------------- monero-core.pro | 13 +++++-- 7 files changed, 141 insertions(+), 32 deletions(-) (limited to 'components') diff --git a/BasicPanel.qml b/BasicPanel.qml index 481fe8c4..abeb135c 100644 --- a/BasicPanel.qml +++ b/BasicPanel.qml @@ -27,6 +27,7 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import QtQuick 2.0 +import QtGraphicalEffects 1.0 import "components" import "pages" @@ -167,5 +168,12 @@ Rectangle { } } + // indicate disabled state + Desaturate { + anchors.fill: parent + source: parent + desaturation: root.enabled ? 0.0 : 1.0 + } + } diff --git a/LeftPanel.qml b/LeftPanel.qml index 604f2d6e..851db047 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -27,6 +27,7 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import QtQuick 2.2 +import QtGraphicalEffects 1.0 import "components" Rectangle { @@ -355,4 +356,12 @@ Rectangle { connected: false } } + // indicate disabled state + Desaturate { + anchors.fill: parent + source: parent + desaturation: panel.enabled ? 0.0 : 1.0 + } + + } diff --git a/MiddlePanel.qml b/MiddlePanel.qml index cb1c74d6..a2cabc1c 100644 --- a/MiddlePanel.qml +++ b/MiddlePanel.qml @@ -27,8 +27,10 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import QtQuick 2.2 +import QtGraphicalEffects 1.0 Rectangle { + id: root color: "#F0EEEE" signal paymentClicked(string address, string paymentId, double amount, int mixinCount, int priority) signal generatePaymentIdInvoked() @@ -116,4 +118,11 @@ Rectangle { height: 1 color: "#DBDBDB" } + + // indicate disabled state + Desaturate { + anchors.fill: parent + source: parent + desaturation: root.enabled ? 0.0 : 1.0 + } } diff --git a/RightPanel.qml b/RightPanel.qml index 932b3916..d27b8b73 100644 --- a/RightPanel.qml +++ b/RightPanel.qml @@ -29,10 +29,13 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 +import QtGraphicalEffects 1.0 + import "tabs" import "components" Rectangle { + id: root width: 330 color: "#FFFFFF" @@ -145,4 +148,11 @@ Rectangle { width: 1 color: "#DBDBDB" } + + // indicate disabled state + Desaturate { + anchors.fill: parent + source: parent + desaturation: root.enabled ? 0.0 : 1.0 + } } diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml index 9c36e13c..cd66d461 100644 --- a/components/PasswordDialog.qml +++ b/components/PasswordDialog.qml @@ -1,5 +1,40 @@ import QtQuick 2.0 +import QtQuick.Controls 1.4 +import QtQuick.Dialogs 1.2 +import QtQuick.Layouts 1.1 +import QtQuick.Controls.Styles 1.4 -Item { +// import "../components" +Dialog { + id: root + readonly property alias password: passwordInput.text + standardButtons: StandardButton.Ok + StandardButton.Cancel + ColumnLayout { + id: column + height: 40 + anchors.fill: parent + + Label { + text: qsTr("Please enter wallet password") + Layout.columnSpan: 2 + Layout.fillWidth: true + font.family: "Arial" + font.pixelSize: 32 + } + + TextField { + id : passwordInput + + echoMode: TextInput.Password + focus: true + Layout.fillWidth: true + font.family: "Arial" + font.pixelSize: 24 + style: TextFieldStyle { + passwordCharacter: "•" + } + } + } } + diff --git a/main.qml b/main.qml index 7320d3af..faeaf123 100644 --- a/main.qml +++ b/main.qml @@ -41,7 +41,8 @@ import "wizard" ApplicationWindow { id: appWindow - objectName: "appWindow" + + property var currentItem property bool whatIsEnable: false property bool ctrlPressed: false @@ -50,6 +51,8 @@ ApplicationWindow { property alias persistentSettings : persistentSettings property var wallet; property var transaction; + property alias password : passwordDialog.password + function altKeyReleased() { ctrlPressed = false; } @@ -98,24 +101,24 @@ ApplicationWindow { } function mousePressed(obj, mouseX, mouseY) { - if(obj.objectName === "appWindow") - obj = rootItem - - var tmp = rootItem.mapFromItem(obj, mouseX, mouseY) - if(tmp !== undefined) { - mouseX = tmp.x - mouseY = tmp.y - } - - if(currentItem !== undefined) { - var tmp_x = rootItem.mapToItem(currentItem, mouseX, mouseY).x - var tmp_y = rootItem.mapToItem(currentItem, mouseX, mouseY).y - - if(!currentItem.containsPoint(tmp_x, tmp_y)) { - currentItem.hide() - currentItem = undefined - } - } +// if(obj.objectName === "appWindow") +// obj = rootItem + +// var tmp = rootItem.mapFromItem(obj, mouseX, mouseY) +// if(tmp !== undefined) { +// mouseX = tmp.x +// mouseY = tmp.y +// } + +// if(currentItem !== undefined) { +// var tmp_x = rootItem.mapToItem(currentItem, mouseX, mouseY).x +// var tmp_y = rootItem.mapToItem(currentItem, mouseX, mouseY).y + +// if(!currentItem.containsPoint(tmp_x, tmp_y)) { +// currentItem.hide() +// currentItem = undefined +// } +// } } function mouseReleased(obj, mouseX, mouseY) { @@ -142,17 +145,18 @@ ApplicationWindow { var wallet_path = walletPath(); console.log("opening wallet at: ", wallet_path); - // TODO: wallet password dialog - wallet = walletManager.openWallet(wallet_path, "", persistentSettings.testnet); - - + wallet = walletManager.openWallet(wallet_path, appWindow.password, + persistentSettings.testnet); if (wallet.status !== Wallet.Status_Ok) { console.error("Error opening wallet with empty password: ", wallet.errorString); - + console.log("closing wallet...") + walletManager.closeWallet(wallet) + console.log("wallet closed") // try to open wallet with password; passwordDialog.open(); return; } + console.log("Wallet opened successfully: ", wallet.errorString); } // subscribing for wallet updates @@ -195,6 +199,8 @@ ApplicationWindow { } + + // called on "transfer" function handlePayment(address, paymentId, amount, mixinCount, priority) { console.log("Creating transaction: ") @@ -213,6 +219,7 @@ ApplicationWindow { informationPopup.title = qsTr("Error") + translationManager.emptyString; informationPopup.text = qsTr("Can't create transaction: ") + transaction.errorString informationPopup.icon = StandardIcon.Critical + informationPopup.onCloseCallback = null informationPopup.open(); // deleting transaction object, we don't want memleaks wallet.disposeTransaction(transaction); @@ -248,13 +255,22 @@ ApplicationWindow { informationPopup.text = qsTr("Money sent successfully") + translationManager.emptyString informationPopup.icon = StandardIcon.Information } - + informationPopup.onCloseCallback = null informationPopup.open() wallet.refresh() wallet.disposeTransaction(transaction) } + // blocks UI if wallet can't be opened or no connection to the daemon + function enableUI(enable) { + middlePanel.enabled = enable; + leftPanel.enabled = enable; + rightPanel.enabled = enable; + basicPanel.enabled = enable; + } + + objectName: "appWindow" visible: true width: rightPanelExpanded ? 1269 : 1269 - 300 height: 800 @@ -262,6 +278,7 @@ ApplicationWindow { flags: Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint onWidthChanged: x -= 0 + Component.onCompleted: { x = (Screen.width - width) / 2 y = (Screen.height - height) / 2 @@ -278,6 +295,7 @@ ApplicationWindow { } } + Settings { id: persistentSettings property string language @@ -296,9 +314,15 @@ ApplicationWindow { // Information dialog MessageDialog { + // dynamically change onclose handler + property var onCloseCallback id: informationPopup - standardButtons: StandardButton.Ok + onAccepted: { + if (onCloseCallback) { + onCloseCallback() + } + } } // Confrirmation aka question dialog @@ -317,6 +341,7 @@ ApplicationWindow { var wallet_path = walletPath(); console.log("opening wallet with password: ", wallet_path); + wallet = walletManager.openWallet(wallet_path, password, persistentSettings.testnet); if (wallet.status !== Wallet.Status_Ok) { console.error("Error opening wallet with password: ", wallet.errorString); @@ -324,9 +349,16 @@ ApplicationWindow { informationPopup.text = qsTr("Couldn't open wallet: ") + wallet.errorString; informationPopup.icon = StandardIcon.Critical informationPopup.open() - + informationPopup.onCloseCallback = appWindow.initialize + walletManager.closeWallet(wallet); } } + onRejected: { + appWindow.enableUI(false) + } + onDiscard: { + appWindow.enableUI(false) + } } Window { @@ -339,7 +371,6 @@ ApplicationWindow { anchors.fill: parent text: qsTr("Initializing Wallet..."); } - } diff --git a/monero-core.pro b/monero-core.pro index 9520cd37..2dde61fe 100644 --- a/monero-core.pro +++ b/monero-core.pro @@ -146,6 +146,8 @@ isEmpty(QMAKE_LRELEASE) { langupd.command = \ $$LANGUPD $$LANGUPD_OPTIONS $$shell_path($$_PRO_FILE) -ts $$_PRO_FILE_PWD/$$TRANSLATIONS + + langrel.depends = langupd langrel.input = TRANSLATIONS langrel.output = $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm @@ -157,7 +159,12 @@ QMAKE_EXTRA_TARGETS += langupd deploy deploy_win QMAKE_EXTRA_COMPILERS += langrel -PRE_TARGETDEPS += langupd compiler_langrel_make_all + +# temporary: do not update/release translations for "Debug" build, +# as we have an issue with linking +CONFIG(release, debug|release) { + PRE_TARGETDEPS += langupd compiler_langrel_make_all +} RESOURCES += qml.qrc @@ -182,8 +189,8 @@ OTHER_FILES += \ $$TRANSLATIONS DISTFILES += \ - notes.txt \ - components/PasswordDialog.qml + notes.txt + # windows application icon RC_FILE = monero-core.rc -- cgit v1.2.3 From 376db6cf16910b0facf10c90afcdfe2a50fc1045 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Tue, 23 Aug 2016 11:55:51 +0300 Subject: Display "processing.." splashscreen while wallet initializing --- components/PasswordDialog.qml | 28 ++++++++++++++++++ components/ProcessingSplash.qml | 63 +++++++++++++++++++++++++++++++++++++++++ main.cpp | 3 ++ main.qml | 44 +++++++++++++++++----------- qml.qrc | 1 + 5 files changed, 122 insertions(+), 17 deletions(-) create mode 100644 components/ProcessingSplash.qml (limited to 'components') diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml index cd66d461..a8ff294a 100644 --- a/components/PasswordDialog.qml +++ b/components/PasswordDialog.qml @@ -1,3 +1,31 @@ +// Copyright (c) 2014-2015, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// 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.Dialogs 1.2 diff --git a/components/ProcessingSplash.qml b/components/ProcessingSplash.qml new file mode 100644 index 00000000..f98feb3b --- /dev/null +++ b/components/ProcessingSplash.qml @@ -0,0 +1,63 @@ +// Copyright (c) 2014-2015, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// 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.Window 2.1 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.1 + +Window { + id: splash + modality: Qt.ApplicationModal + flags: Qt.SplashScreen + property alias message: message.text + width: 200 + height: 100 + opacity: 0.5 + + ColumnLayout { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + BusyIndicator { + running: parent.visible + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter + } + + Text { + id: message + text: "Please wait..." + font { + pointSize: 22 + } + horizontalAlignment: Text.AlignHCenter + } + } + + +} diff --git a/main.cpp b/main.cpp index d0e9e085..387c4b13 100644 --- a/main.cpp +++ b/main.cpp @@ -72,6 +72,8 @@ int main(int argc, char *argv[]) qRegisterMetaType(); + + QQmlApplicationEngine engine; OSCursor cursor; @@ -83,6 +85,7 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("translationManager", TranslationManager::instance()); + // export to QML monero accounts root directory // wizard is talking about where // to save the wallet file (.keys, .bin), they have to be user-accessible for diff --git a/main.qml b/main.qml index f589c666..636945e8 100644 --- a/main.qml +++ b/main.qml @@ -147,11 +147,11 @@ ApplicationWindow { walletManager.openWalletAsync(wallet_path, appWindow.password, persistentSettings.testnet); } - } function connectWallet(wallet) { + showProcessingSplash() currentWallet = wallet currentWallet.refreshed.connect(onWalletRefresh) currentWallet.updated.connect(onWalletUpdate) @@ -167,7 +167,6 @@ ApplicationWindow { function onWalletOpened(wallet) { console.log(">>> wallet opened: " + wallet) - if (wallet.status !== Wallet.Status_Ok) { if (appWindow.password === '') { console.error("Error opening wallet with empty password: ", wallet.errorString); @@ -188,7 +187,6 @@ ApplicationWindow { informationPopup.onCloseCallback = function() { passwordDialog.open() } - } return; } @@ -212,6 +210,10 @@ ApplicationWindow { function onWalletRefresh() { console.log(">>> wallet refreshed") + if (splash.visible) { + hideProcessingSplash() + } + leftPanel.networkStatus.connected = currentWallet.connected onWalletUpdate(); } @@ -297,6 +299,19 @@ ApplicationWindow { basicPanel.enabled = enable; } + function showProcessingSplash(message) { + console.log("Displaying processing splash") + if (typeof message != 'undefined') { + splash.message = message + } + splash.show() + } + + function hideProcessingSplash() { + console.log("Hiding processing splash") + splash.hide() + } + objectName: "appWindow" visible: true @@ -371,10 +386,6 @@ ApplicationWindow { onAccepted: { appWindow.currentWallet = null appWindow.initialize(); - -// var wallet_path = walletPath(); -// console.log("opening wallet with password: ", wallet_path); -// walletManager.openWalletAsync(wallet_path, password, persistentSettings.testnet); } onRejected: { appWindow.enableUI(false) @@ -384,19 +395,18 @@ ApplicationWindow { } } - Window { - id: walletInitializationSplash - modality: Qt.ApplicationModal - flags: Qt.SplashScreen - height: 100 - width: 250 - Text { - anchors.fill: parent - text: qsTr("Initializing Wallet..."); - } + + ProcessingSplash { + id: splash + width: appWindow.width / 2 + height: appWindow.height / 2 + x: (appWindow.width - width) / 2 + appWindow.x + y: (appWindow.height - height) / 2 + appWindow.y + message: qsTr("Please wait...") } + Item { id: rootItem anchors.fill: parent diff --git a/qml.qrc b/qml.qrc index dcf4b9b1..a44266b9 100644 --- a/qml.qrc +++ b/qml.qrc @@ -115,5 +115,6 @@ components/IconButton.qml lang/flags/italy.png components/PasswordDialog.qml + components/ProcessingSplash.qml -- cgit v1.2.3 From 4fa8ad3b199483094cf9988f33da1ab6343d7c8a Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Tue, 23 Aug 2016 16:07:52 +0300 Subject: Transfer page: validate amount --- components/StandardButton.qml | 11 +++++++++-- main.cpp | 2 +- main.qml | 27 +++++++++++++++++++++------ pages/Transfer.qml | 27 ++++++++++++++++----------- src/libwalletqt/WalletManager.cpp | 16 +++++++++++++--- src/libwalletqt/WalletManager.h | 11 ++++++++--- 6 files changed, 68 insertions(+), 26 deletions(-) (limited to 'components') diff --git a/components/StandardButton.qml b/components/StandardButton.qml index 208d90d3..5a088fbf 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -47,7 +47,10 @@ Item { height: parent.height - 1 y: buttonArea.pressed ? 0 : 1 //radius: 4 - color: buttonArea.pressed ? parent.shadowPressedColor : parent.shadowReleasedColor + color: { + parent.enabled ? (buttonArea.pressed ? parent.shadowPressedColor : parent.shadowReleasedColor) + : Qt.lighter(parent.shadowReleasedColor) + } } Rectangle { @@ -55,7 +58,11 @@ Item { anchors.right: parent.right height: parent.height - 1 y: buttonArea.pressed ? 1 : 0 - color: buttonArea.pressed ? parent.pressedColor : parent.releasedColor + color: { + parent.enabled ? (buttonArea.pressed ? parent.pressedColor : parent.releasedColor) + : Qt.lighter(parent.releasedColor) + + } //radius: 4 } diff --git a/main.cpp b/main.cpp index 387c4b13..e356659c 100644 --- a/main.cpp +++ b/main.cpp @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) QObject::connect(eventFilter, SIGNAL(mousePressed(QVariant,QVariant,QVariant)), rootObject, SLOT(mousePressed(QVariant,QVariant,QVariant))); QObject::connect(eventFilter, SIGNAL(mouseReleased(QVariant,QVariant,QVariant)), rootObject, SLOT(mouseReleased(QVariant,QVariant,QVariant))); - WalletManager::instance()->setLogLevel(WalletManager::LogLevel_Max); + WalletManager::instance()->setLogLevel(WalletManager::LogLevel_Silent); return app.exec(); } diff --git a/main.qml b/main.qml index 636945e8..6d57b634 100644 --- a/main.qml +++ b/main.qml @@ -135,7 +135,7 @@ ApplicationWindow { } middlePanel.paymentClicked.connect(handlePayment); - basicPanel.paymentClicked.connect(handlePayment); + // basicPanel.paymentClicked.connect(handlePayment); // wallet already opened with wizard, we just need to initialize it @@ -240,10 +240,25 @@ ApplicationWindow { ", mixins: ", mixinCount, ", priority: ", priority); - var amountxmr = walletManager.amountFromString(amount); + // validate amount; + var amountxmr = walletManager.amountFromString(amount); console.log("integer amount: ", amountxmr); - transaction = wallet.createTransaction(address, paymentId, amountxmr, mixinCount, priority); + if (amountxmr <= 0) { + informationPopup.title = qsTr("Error") + translationManager.emptyString; + informationPopup.text = qsTr("Amount is wrong: expected number from %1 to %2") + .arg(walletManager.displayAmount(0)) + .arg(walletManager.maximumAllowedAmountAsSting()) + + translationManager.emptyString + + informationPopup.icon = StandardIcon.Critical + informationPopup.onCloseCallback = null + informationPopup.open() + return; + } + + // validate address; + transaction = currentWallet.createTransaction(address, paymentId, amountxmr, mixinCount, priority); if (transaction.status !== PendingTransaction.Status_Ok) { console.error("Can't create transaction: ", transaction.errorString); informationPopup.title = qsTr("Error") + translationManager.emptyString; @@ -252,7 +267,7 @@ ApplicationWindow { informationPopup.onCloseCallback = null informationPopup.open(); // deleting transaction object, we don't want memleaks - wallet.disposeTransaction(transaction); + currentWallet.disposeTransaction(transaction); } else { console.log("Transaction created, amount: " + walletManager.displayAmount(transaction.amount) @@ -287,8 +302,8 @@ ApplicationWindow { } informationPopup.onCloseCallback = null informationPopup.open() - wallet.refresh() - wallet.disposeTransaction(transaction) + currentWallet.refresh() + currentWallet.disposeTransaction(transaction) } // blocks UI if wallet can't be opened or no connection to the daemon diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 70fde050..508b32af 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -32,6 +32,7 @@ import "../components" Rectangle { + id: root signal paymentClicked(string address, string paymentId, double amount, int mixinCount, int priority) @@ -88,6 +89,11 @@ Rectangle { id: amountLine placeholderText: qsTr("Amount...") + translationManager.emptyString width: parent.width - 37 - 17 + validator: DoubleValidator { + bottom: 0.0 + notation: DoubleValidator.StandardNotation + locale: "C" + } } } @@ -170,7 +176,7 @@ Rectangle { textFormat: Text.RichText text: qsTr("\ Address ( Type in or select from Address book )") - + translationManager.emptyString + + translationManager.emptyString onLinkActivated: appWindow.showPageRequest("AddressBook") } @@ -220,7 +226,7 @@ Rectangle { anchors.topMargin: 17 fontSize: 14 text: qsTr("Description ( An optional description that will be saved to the local address book if entered )") - + translationManager.emptyString + + translationManager.emptyString } LineEdit { @@ -245,16 +251,15 @@ Rectangle { shadowPressedColor: "#B32D00" releasedColor: "#FF6C3C" pressedColor: "#FF4304" + enabled : addressLine.text.length > 0 && amountLine.text.length > 0 onClicked: { - // do more smart validation - - if (addressLine.text.length > 0 && amountLine.text.length > 0) { - console.log("paymentClicked") - var priority = priorityModel.get(priorityDropdown.currentIndex).priority - console.log("priority: " + priority) - paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, scaleValueToMixinCount(privacyLevelItem.fillLevel), - priority) - } + console.log("Transfer: paymentClicked") + var priority = priorityModel.get(priorityDropdown.currentIndex).priority + console.log("priority: " + priority) + console.log("amount: " + amountLine.text) + root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, scaleValueToMixinCount(privacyLevelItem.fillLevel), + priority) } } } + diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index 947ccbfb..a9f332a3 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -122,17 +122,27 @@ QString WalletManager::walletLanguage(const QString &locale) return "English"; } -QString WalletManager::displayAmount(quint64 amount) +quint64 WalletManager::maximumAllowedAmount() const +{ + return Bitmonero::Wallet::maximumAllowedAmount(); +} + +QString WalletManager::maximumAllowedAmountAsSting() const +{ + return WalletManager::displayAmount(WalletManager::maximumAllowedAmount()); +} + +QString WalletManager::displayAmount(quint64 amount) const { return QString::fromStdString(Bitmonero::Wallet::displayAmount(amount)); } -quint64 WalletManager::amountFromString(const QString &amount) +quint64 WalletManager::amountFromString(const QString &amount) const { return Bitmonero::Wallet::amountFromString(amount.toStdString()); } -quint64 WalletManager::amountFromDouble(double amount) +quint64 WalletManager::amountFromDouble(double amount) const { return Bitmonero::Wallet::amountFromDouble(amount); } diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h index 1866b7cd..3629242a 100644 --- a/src/libwalletqt/WalletManager.h +++ b/src/libwalletqt/WalletManager.h @@ -12,6 +12,7 @@ namespace Bitmonero { class WalletManager : public QObject { Q_OBJECT + public: enum LogLevel { LogLevel_Silent = Bitmonero::WalletManagerFactory::LogLevel_Silent, @@ -79,9 +80,13 @@ public: //! since we can't call static method from QML, move it to this class - Q_INVOKABLE QString displayAmount(quint64 amount); - Q_INVOKABLE quint64 amountFromString(const QString &amount); - Q_INVOKABLE quint64 amountFromDouble(double amount); + Q_INVOKABLE QString displayAmount(quint64 amount) const; + Q_INVOKABLE quint64 amountFromString(const QString &amount) const; + Q_INVOKABLE quint64 amountFromDouble(double amount) const; + Q_INVOKABLE quint64 maximumAllowedAmount() const; + + // QML JS engine doesn't support unsigned integers + Q_INVOKABLE QString maximumAllowedAmountAsSting() const; void setLogLevel(int logLevel); -- cgit v1.2.3