Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aeon upstream 7 #58

Merged
merged 12 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 54 additions & 17 deletions LeftPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import moneroComponents.Wallet 1.0
import moneroComponents.NetworkType 1.0
import "components"
import moneroComponents.Clipboard 1.0
import "components" as MoneroComponents

Rectangle {
id: panel
Expand All @@ -46,6 +47,8 @@ Rectangle {
property alias daemonProgressBar : daemonProgressBar
property alias minutesToUnlockTxt: unlockedBalanceLabel.text
property int titleBarHeight: 50
property string copyValue: ""
Clipboard { id: clipboard }

signal dashboardClicked()
signal historyClicked()
Expand Down Expand Up @@ -202,6 +205,23 @@ Rectangle {
}
return defaultSize;
}

MouseArea {
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onEntered: {
parent.color = MoneroComponents.Style.blue
}
onExited: {
parent.color = MoneroComponents.Style.white
}
onClicked: {
console.log("Copied to clipboard");
clipboard.setText(parent.text);
appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
}
}
}

Text {
Expand All @@ -223,9 +243,26 @@ Rectangle {
}
return defaultSize;
}

MouseArea {
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onEntered: {
parent.color = MoneroComponents.Style.blue
}
onExited: {
parent.color = MoneroComponents.Style.white
}
onClicked: {
console.log("Copied to clipboard");
clipboard.setText(parent.text);
appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
}
}
}

Label {
MoneroComponents.Label {
id: unlockedBalanceLabel
visible: true
text: qsTr("Unlocked balance") + translationManager.emptyString
Expand All @@ -236,7 +273,7 @@ Rectangle {
anchors.topMargin: 110
}

Label {
MoneroComponents.Label {
visible: !isMobile
id: balanceLabel
text: qsTr("Balance") + translationManager.emptyString
Expand Down Expand Up @@ -334,7 +371,7 @@ Rectangle {
}

// ------------- Transfer tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: transferButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -359,7 +396,7 @@ Rectangle {

// ------------- AddressBook tab ---------------

MenuButton {
MoneroComponents.MenuButton {
id: addressBookButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -384,7 +421,7 @@ Rectangle {
}

// ------------- Receive tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: receiveButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -408,7 +445,7 @@ Rectangle {

// ------------- History tab ---------------

MenuButton {
MoneroComponents.MenuButton {
id: historyButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -431,7 +468,7 @@ Rectangle {
}

// ------------- Advanced tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: advancedButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -454,7 +491,7 @@ Rectangle {

// ------------- Mining tab ---------------
/*
MenuButton {
MoneroComponents.MenuButton {
id: miningButton
visible: !isAndroid && !isIOS
anchors.left: parent.left
Expand All @@ -480,7 +517,7 @@ Rectangle {
}
*/
// ------------- TxKey tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: txkeyButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -504,7 +541,7 @@ Rectangle {
}
// ------------- Shared RingDB tab ---------------
/*
MenuButton {
MoneroComponents.MenuButton {
id: sharedringdbButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -530,7 +567,7 @@ Rectangle {


// ------------- Sign/verify tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: signButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -553,7 +590,7 @@ Rectangle {
height: 1
}
// ------------- Settings tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: settingsButton
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -575,7 +612,7 @@ Rectangle {
height: 1
}
// ------------- Sign/verify tab ---------------
MenuButton {
MoneroComponents.MenuButton {
id: keysButton
anchors.left: parent.left
anchors.right: parent.right
Expand Down Expand Up @@ -613,7 +650,7 @@ Rectangle {
color: "transparent"
}

NetworkStatusItem {
MoneroComponents.NetworkStatusItem {
id: networkStatus
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -624,7 +661,7 @@ Rectangle {
height: 48 * scaleRatio
}

ProgressBar {
MoneroComponents.ProgressBar {
id: progressBar
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -634,7 +671,7 @@ Rectangle {
visible: networkStatus.connected
}

ProgressBar {
MoneroComponents.ProgressBar {
id: daemonProgressBar
anchors.left: parent.left
anchors.right: parent.right
Expand Down
4 changes: 4 additions & 0 deletions clipboardAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ void clipboardAdapter::setText(const QString &text) {
m_pClipboard->setText(text, QClipboard::Clipboard);
m_pClipboard->setText(text, QClipboard::Selection);
}

QString clipboardAdapter::text() const {
return m_pClipboard->text();
}
1 change: 1 addition & 0 deletions clipboardAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class clipboardAdapter : public QObject
public:
explicit clipboardAdapter(QObject *parent = 0);
Q_INVOKABLE void setText(const QString &text);
Q_INVOKABLE QString text() const;

private:
QClipboard *m_pClipboard;
Expand Down
20 changes: 18 additions & 2 deletions components/HistoryTable.qml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,23 @@ ListView {

return _amount + " AEON";
}
color: isOut ? "white" : "#2eb358"
color: isOut ? MoneroComponents.Style.white : MoneroComponents.Style.green

MouseArea {
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onEntered: {
parent.color = MoneroComponents.Style.blue
}
onExited: {
parent.color = isOut ? MoneroComponents.Style.white : MoneroComponents.Style.green }
onClicked: {
console.log("Copied to clipboard");
clipboard.setText(parent.text.split(" ")[0]);
appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
}
}
}

Rectangle {
Expand Down Expand Up @@ -293,7 +309,7 @@ ListView {
anchors.left: parent.left
anchors.leftMargin: 30 * scaleRatio

labelHeader: QsTr("Transaction ID") + translationManager.emptyString
labelHeader: qsTr("Transaction ID") + translationManager.emptyString
labelValue: hash.substring(0, 18) + "..."
copyValue: hash
}
Expand Down
46 changes: 30 additions & 16 deletions components/LineEditMulti.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ ColumnLayout {
property bool mouseSelection: true
property alias readOnly: input.readOnly
property bool copyButton: false
property bool pasteButton: false
property var onPaste: function(clipboardText) {
item.text = clipboardText;
}
property bool showingHeader: true
property var wrapMode: Text.NoWrap
property alias addressValidation: input.addressValidation
Expand Down Expand Up @@ -109,25 +113,35 @@ ColumnLayout {
}
}

MoneroComponents.LabelButton {
id: labelButton
onClicked: labelButtonClicked()
visible: labelButtonVisible
}
RowLayout {
anchors.right: parent.right
spacing: 16 * scaleRatio

MoneroComponents.LabelButton {
id: labelButton
onClicked: labelButtonClicked()
visible: labelButtonVisible
}

MoneroComponents.LabelButton {
id: copyButtonId
visible: copyButton && input.text !== ""
text: qsTr("Copy")
anchors.right: labelButton.visible ? inputLabel.right : parent.right
anchors.rightMargin: labelButton.visible? 4 : 0
onClicked: {
if (input.text.length > 0) {
console.log("Copied to clipboard");
clipboard.setText(input.text);
appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
MoneroComponents.LabelButton {
id: copyButtonId
visible: copyButton && input.text !== ""
text: qsTr("Copy")
onClicked: {
if (input.text.length > 0) {
console.log("Copied to clipboard");
clipboard.setText(input.text);
appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
}
}
}

MoneroComponents.LabelButton {
id: pasteButtonId
onClicked: item.onPaste(clipboard.text())
text: qsTr("Paste")
visible: pasteButton
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions components/Style.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ QtObject {
property QtObject fontRegular: FontLoader { id: _fontRegular; source: "qrc:/fonts/Roboto-Regular.ttf"; }

property string grey: "#404040"
property string blue: "#4ddbff"
property string orange: "#FF6C3C"
property string white: "#FFFFFF"
property string green: "#2EB358"

property string defaultFontColor: "white"
property string dimmedFontColor: "#BBBBBB"
Expand Down
1 change: 1 addition & 0 deletions components/TitleBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Rectangle {
z: parent.z + 1

Image {
visible: !isMobile
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 11
Expand Down
3 changes: 2 additions & 1 deletion main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ ApplicationWindow {
// console.log("opening wallet at: ", wallet_path, "with password: ", appWindow.walletPassword);
console.log("opening wallet at: ", wallet_path, ", network type: ", persistentSettings.nettype == NetworkType.MAINNET ? "mainnet" : persistentSettings.nettype == NetworkType.TESTNET ? "testnet" : "stagenet");
walletManager.openWalletAsync(wallet_path, walletPassword,
persistentSettings.nettype);
persistentSettings.nettype, persistentSettings.kdfRounds);
}

// Hide titlebar based on persistentSettings.customDecorations
Expand Down Expand Up @@ -1031,6 +1031,7 @@ ApplicationWindow {
property bool segregatePreForkOutputs: true
property bool keyReuseMitigation2: true
property int segregationHeight: 0
property int kdfRounds: 1
}

// Information dialog
Expand Down
2 changes: 1 addition & 1 deletion pages/History.qml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Rectangle {
LineEdit {
id: searchLine
fontSize: 14 * scaleRatio
inputHeight: 28 * scaleRatio
inputHeight: 36 * scaleRatio
borderDisabled: true
Layout.fillWidth: true
backgroundColor: "#404040"
Expand Down
Loading