From 15c5269e350354e864e5ece458d762e76387eebe Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 13:37:59 +0200 Subject: [PATCH 01/27] Moving settings QML files under pages/settings/ --- pages/{ => settings}/Settings.qml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pages/{ => settings}/Settings.qml (100%) diff --git a/pages/Settings.qml b/pages/settings/Settings.qml similarity index 100% rename from pages/Settings.qml rename to pages/settings/Settings.qml From 4f4d969416d2b56d0efc3b9a3c5b6d979e3b631e Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:00:53 +0200 Subject: [PATCH 02/27] Extra properties for components LineEditMulti and RemoteNodeEdit --- components/InputMulti.qml | 20 +++---- components/LineEdit.qml | 8 ++- components/LineEditMulti.qml | 108 ++++++++++++++++++++++------------ components/RemoteNodeEdit.qml | 15 +++-- pages/Keys.qml | 3 +- pages/Transfer.qml | 8 ++- 6 files changed, 103 insertions(+), 59 deletions(-) diff --git a/components/InputMulti.qml b/components/InputMulti.qml index b8005354..f7706d75 100644 --- a/components/InputMulti.qml +++ b/components/InputMulti.qml @@ -32,31 +32,25 @@ import QtQuick 2.7 import "../js/TxUtils.js" as TxUtils import "../components" as MoneroComponents - TextArea { - property bool error: false - property bool addressValidation: false - property bool wrapAnywhere: true property int fontSize: 18 * scaleRatio property bool fontBold: false + property string fontColor: MoneroComponents.Style.defaultFontColor + + property bool mouseSelection: true + property bool error: false + property bool addressValidation: false id: textArea font.family: MoneroComponents.Style.fontRegular.name + color: fontColor font.pixelSize: fontSize font.bold: fontBold horizontalAlignment: TextInput.AlignLeft - selectByMouse: true - color: MoneroComponents.Style.defaultFontColor + selectByMouse: mouseSelection selectionColor: MoneroComponents.Style.dimmedFontColor selectedTextColor: MoneroComponents.Style.defaultFontColor - wrapMode: { - if(wrapAnywhere){ - return Text.WrapAnywhere; - } else { - return Text.WordWrap; - } - } onTextChanged: { if(addressValidation){ // js replacement for `RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }` diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 8a194c12..9eb50b04 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -50,6 +50,8 @@ Item { property alias inlineButtonText: inlineButtonId.text property alias inlineIcon: inlineIcon.visible property bool copyButton: false + + property bool borderDisabled: false property string borderColor: { if(input.activeFocus){ return MoneroComponents.Style.inputBorderColorActive; @@ -57,9 +59,8 @@ Item { return MoneroComponents.Style.inputBorderColorInActive; } } - property bool borderDisabled: false + property int fontSize: 18 * scaleRatio - property bool showBorder: true property bool fontBold: false property alias fontColor: input.color property bool error: false @@ -140,6 +141,7 @@ Item { anchors.top: showingHeader ? inputLabel.bottom : parent.top anchors.topMargin: showingHeader ? 12 * scaleRatio : 2 * scaleRatio width: parent.width + clip: true Text { id: placeholderLabel @@ -200,6 +202,8 @@ Item { onEditingFinished: item.editingFinished() onAccepted: item.accepted(); onTextChanged: item.textUpdated() + topPadding: 10 * scaleRatio + bottomPadding: 10 * scaleRatio } MoneroComponents.InlineButton { diff --git a/components/LineEditMulti.qml b/components/LineEditMulti.qml index 8243a7ee..87cee6d4 100644 --- a/components/LineEditMulti.qml +++ b/components/LineEditMulti.qml @@ -32,25 +32,56 @@ import QtQuick.Layouts 1.1 import "../components" as MoneroComponents ColumnLayout { - id: lineditmulti - property alias text: multiLine.text - property alias placeholderText: placeholderLabel.text + id: item + + Layout.fillWidth: true + Layout.preferredHeight: childrenRect.height + + property alias text: input.text property alias labelText: inputLabel.text - property alias error: multiLine.error - property alias readOnly: multiLine.readOnly - property alias addressValidation: multiLine.addressValidation property alias labelButtonText: labelButton.text + property alias placeholderText: placeholderLabel.text + + property bool placeholderCenter: false + property string placeholderFontFamily: MoneroComponents.Style.fontRegular.name + property bool placeholderFontBold: false + property int placeholderFontSize: 18 * scaleRatio + property string placeholderColor: MoneroComponents.Style.defaultFontColor + property real placeholderOpacity: 0.35 + + property bool borderDisabled: false + property string borderColor: { + if(input.error && input.text !== ""){ + return MoneroComponents.Style.inputBorderColorInvalid; + } else if(input.activeFocus){ + return MoneroComponents.Style.inputBorderColorActive; + } else { + return MoneroComponents.Style.inputBorderColorInActive; + } + } + + property bool error: false + + property string labelFontColor: MoneroComponents.Style.defaultFontColor property bool labelFontBold: false + property int labelFontSize: 16 * scaleRatio property bool labelButtonVisible: false - property bool copyButton: false - property bool wrapAnywhere: true - property bool showingHeader: true - property bool showBorder: true + + property string fontColor: "white" property bool fontBold: false property int fontSize: 16 * scaleRatio + property bool mouseSelection: true + property alias readOnly: input.readOnly + property bool copyButton: false + property bool showingHeader: true + property var wrapMode: Text.NoWrap + property alias addressValidation: input.addressValidation + property string backgroundColor: "" // mock + signal labelButtonClicked(); signal inputLabelLinkActivated(); + signal editingFinished(); spacing: 0 Rectangle { @@ -65,11 +96,17 @@ ColumnLayout { anchors.top: parent.top anchors.left: parent.left font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 16 * scaleRatio + font.pixelSize: item.labelFontSize font.bold: labelFontBold textFormat: Text.RichText - color: MoneroComponents.Style.defaultFontColor + color: item.labelFontColor onLinkActivated: inputLabelLinkActivated() + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + } } MoneroComponents.LabelButton { @@ -80,14 +117,14 @@ ColumnLayout { MoneroComponents.LabelButton { id: copyButtonId - visible: copyButton && multiLine.text !== "" + visible: copyButton && input.text !== "" text: qsTr("Copy") anchors.right: labelButton.visible ? inputLabel.right : parent.right anchors.rightMargin: labelButton.visible? 4 : 0 onClicked: { - if (multiLine.text.length > 0) { + if (input.text.length > 0) { console.log("Copied to clipboard"); - clipboard.setText(multiLine.text); + clipboard.setText(input.text); appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3); } } @@ -95,27 +132,32 @@ ColumnLayout { } MoneroComponents.InputMulti { - id: multiLine + id: input readOnly: false - addressValidation: true - anchors.top: parent.showingHeader ? inputLabelRect.bottom : parent.top + addressValidation: false + anchors.top: item.showingHeader ? inputLabelRect.bottom : item.top Layout.fillWidth: true - topPadding: parent.showingHeader ? 10 * scaleRatio : 0 + topPadding: item.showingHeader ? 10 * scaleRatio : 0 bottomPadding: 10 * scaleRatio - wrapAnywhere: parent.wrapAnywhere - fontSize: parent.fontSize - fontBold: parent.fontBold + wrapMode: item.wrapMode + fontSize: item.fontSize + fontBold: item.fontBold + fontColor: item.fontColor + mouseSelection: item.mouseSelection + onEditingFinished: item.editingFinished() + error: item.error Text { id: placeholderLabel - visible: multiLine.text ? false : true + visible: input.text ? false : true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: 10 * scaleRatio - opacity: 0.35 - color: MoneroComponents.Style.defaultFontColor - font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 18 * scaleRatio + opacity: item.placeholderOpacity + color: item.placeholderColor + font.family: item.placeholderFontFamily + font.bold: item.placeholderFontBold + font.pixelSize: item.placeholderFontSize text: "" z: 3 } @@ -123,18 +165,10 @@ ColumnLayout { Rectangle { color: "transparent" border.width: 1 - border.color: { - if(multiLine.error && multiLine.text !== ""){ - return MoneroComponents.Style.inputBorderColorInvalid; - } else if(multiLine.activeFocus){ - return MoneroComponents.Style.inputBorderColorActive; - } else { - return MoneroComponents.Style.inputBorderColorInActive; - } - } + border.color: item.borderColor radius: 4 anchors.fill: parent - visible: lineditmulti.showBorder + visible: !item.borderDisabled } } } diff --git a/components/RemoteNodeEdit.qml b/components/RemoteNodeEdit.qml index ecc8b496..36d2ee94 100644 --- a/components/RemoteNodeEdit.qml +++ b/components/RemoteNodeEdit.qml @@ -53,6 +53,8 @@ GridLayout { property string lineEditBorderColor: Qt.rgba(0, 0, 0, 0.15) property string lineEditBackgroundColor: "white" property string lineEditFontColor: "black" + property int lineEditFontSize: 18 * scaleRatio + property int labelFontSize: 16 * scaleRatio property bool lineEditFontBold: true signal editingFinished() @@ -61,7 +63,7 @@ GridLayout { return daemonAddr.text.trim() + ":" + daemonPort.text.trim() } - LineEdit { + LineEditMulti { id: daemonAddr Layout.fillWidth: true placeholderText: qsTr("Remote Node Hostname / IP") + translationManager.emptyString @@ -70,14 +72,16 @@ GridLayout { placeholderFontSize: root.placeholderFontSize placeholderColor: root.placeholderColor placeholderOpacity: root.placeholderOpacity - onEditingFinished: root.editingFinished() + labelFontSize: root.labelFontSize borderColor: lineEditBorderColor backgroundColor: lineEditBackgroundColor fontColor: lineEditFontColor fontBold: lineEditFontBold + fontSize: lineEditFontSize + onEditingFinished: root.editingFinished() } - LineEdit { + LineEditMulti { id: daemonPort Layout.fillWidth: true placeholderText: qsTr("Port") + translationManager.emptyString @@ -86,10 +90,13 @@ GridLayout { placeholderFontSize: root.placeholderFontSize placeholderColor: root.placeholderColor placeholderOpacity: root.placeholderOpacity - onEditingFinished: root.editingFinished() + labelFontSize: root.labelFontSize borderColor: lineEditBorderColor backgroundColor: lineEditBackgroundColor fontColor: lineEditFontColor fontBold: lineEditFontBold + fontSize: lineEditFontSize + + onEditingFinished: root.editingFinished() } } diff --git a/pages/Keys.qml b/pages/Keys.qml index 1148a148..03786310 100644 --- a/pages/Keys.qml +++ b/pages/Keys.qml @@ -128,7 +128,8 @@ Rectangle { copyButton: true addressValidation: false readOnly: true - wrapAnywhere: false + wrapMode: Text.WordWrap + fontColor: "white" } } diff --git a/pages/Transfer.qml b/pages/Transfer.qml index fe3c6c21..d7f009d8 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -255,6 +255,8 @@ Rectangle { + translationManager.emptyString labelButtonText: qsTr("Resolve") + translationManager.emptyString placeholderText: "4.. / 8.." + wrapMode: Text.WrapAnywhere + addressValidation: true onInputLabelLinkActivated: { appWindow.showPageRequest("AddressBook") } } @@ -319,17 +321,19 @@ Rectangle { RowLayout { // payment id input - LineEdit { + LineEditMulti { id: paymentIdLine fontBold: true labelText: qsTr("Payment ID ( Optional )") + translationManager.emptyString placeholderText: qsTr("16 or 64 hexadecimal characters") + translationManager.emptyString Layout.fillWidth: true + wrapMode: Text.WrapAnywhere + addressValidation: false } } RowLayout { - LineEdit { + LineEditMulti { id: descriptionLine labelText: qsTr("Description ( Optional )") + translationManager.emptyString placeholderText: qsTr("Saved to local wallet history") + translationManager.emptyString From da27e1c78b47fc199d1c0c433350f8324aa470d7 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:02:39 +0200 Subject: [PATCH 03/27] Added static images for the Settings page --- images/settings_local.png | Bin 0 -> 651 bytes images/settings_navbar_side.png | Bin 0 -> 15465 bytes images/settings_navbar_side_active.png | Bin 0 -> 15460 bytes images/settings_remote.png | Bin 0 -> 440 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/settings_local.png create mode 100755 images/settings_navbar_side.png create mode 100755 images/settings_navbar_side_active.png create mode 100644 images/settings_remote.png diff --git a/images/settings_local.png b/images/settings_local.png new file mode 100644 index 0000000000000000000000000000000000000000..6d25a9e34288905b90fb34f45dc7c1d5699fe286 GIT binary patch literal 651 zcmV;60(AX}P)Px%MM*?KR7efAmc1_oK^TXv6I>)DD0~%i6cVA+ah;M#6bjM%8#FpZr6&@Vl4z6& z5)u+0jfPWPP#_@@-#O23jEQx($KBaCc``dQ@B4dqcHfy@uP8@LrBWq?Ov4jgz!7YF zp7&0h)f8BSzz|Jc2G2u8)-#NkG1d-!&<1yCEYVKle?}W@IIhCMHx9Xegt_3T&l!BG zVFWhe8D=2*Tb!B4u@)5g0P}wevQGH-Ljv}o>1S;5_W>N5>F+{0tic2P*?5F2ICp{K zc77&w$(YdlTZD6ng9;#LBjGhcy>JT4=(LBW>PB{0qT@Py>@bA+oo^ zJE*#halHUjU;TVq;`I(yG%*)1QP_6_T+puom3TphhKlX8s<|kED;Ovx0ya3MXb8}rFAs4r{+YJC%VcBEtVX3`{>h=RVb8&I0&ki&rDt&a5E z_sl23L=z;fV_qvHRx8pCODFBuAX7r!Q37&$hw`^^if{A@2X%1NBh@=p(WshKz8UwS z#_hcPvi@CpK?yZZu&QVb2A~Rbdh5h7XC19h2J_!Yy9^VY@`3-2S(6cLjHKF--OvF_ lV9q*PB|e5NlKlEd`~e&6&s?xHmE!;a002ovPDHLkV1jzK9IyZY literal 0 HcmV?d00001 diff --git a/images/settings_navbar_side.png b/images/settings_navbar_side.png new file mode 100755 index 0000000000000000000000000000000000000000..b57695fb9bb99236cc505bf2de8f73b55d9bf5bf GIT binary patch literal 15465 zcmeI3O^n+_6o987Az0c&g#?t74_zT(22Fx<_3J<2XEoQ2jJ7Z^U*2zdMH@kiV%AEk>q_0z5Cwd z2%Y`FZEwb#trslY?-#J+cSvE_51=LXvOE|J3Io01hugARsZ?Y|lQm6(9#XXD#ds)r(do>|*iVy0cIXDN>w7}t z7kB*KxF(88pvg6wS3j5p@}dztpePSDc@p`&=^Iv^M!U1%A#_W~kskjUQ+ZL)G5rgD1G z>|?h(U7Q(DiRRF;lc9TvS)$3z(p1P+s0wqn8X>{4AGUqJSI@F+eT-0OG}5dR&RlUl z#~(z?Rhc%KuJ_a%Y2ujFAsGB!MWRWLO0bS~6L*WoI8e^n zT%Z?27wR7F<@zLZaUdAR6-9T9qNFOsmMTiIEMe1eq_WyIOU_xlpTa z1lhWm%VNmow6a|$ugtcN6+JhtPyr4jlI*{lINpGhk~XPWiA}nXEo>*Xt!^jVgE&=r zrgb{3iRH-5onOwQA;|pa%ny$-*dZQkdu6WDUWYr0{BAtJAvwPd8FG}JpLv}%qup2K zlh7vJNr)Zm!Rw`>!xl}AkxU7Syn>tY(QZkImGT-eo7;x%V#ue({ zTZU;C+dJ6XCQe-*C-Au8zqE2ktA}^Hffk%C|AUpwcH(SJ9GCL>8d^L;WnMrVWaDCtkKQ1#kxBrz0IZzCuo$M1P~}Sq1zYQZB6a;8N-}nWSFf~?tVHg zo>?p0t-~J$dGb$TuC7jwpL_XZI-`5(mGZ@dP(aus$HnGDX*n(m2wUX1*nB80$3+2Q ziyRl552fX}C?IT+<6`rnv>X=&ge`JhY(A8hg_Xp|l(q z1%xefTx>p+mgAy;utkoG&4TzKE;b)Z%W+Xa*doWp=0j;Y zE(!=+|m;Y5MFf@!)~m0X$iIQ~9z2Pvr{s>P8Ep z{U;H6?RA8H`xCx@Mrc<-=$ESqS??h9n1A!-FD^je`dagRd-&ZC->AoKE5~muw>~>~ z|BZv?}_Va;)}(cCX?l_GH((#5T5b z$!^6*MRCnlcW?y_1t0-OLxF$_35kvd2~pBOa}pf|g0Yzd<7x2y0zKdq2Kq?w{Yry`e}au!D;&SV7PfPM(Cl3)Av2-otuv# z^!)o?doS5*y<|H@cb}Uys+gPcMY#N|X5-g1RJwLWbbuo);)8A>cEDBkdym$ zN3FVekR+ik%fsQYG}KE$v@ffcWyy*rYnnuRNb#Yc;F09VXYwGEI872ekryUj;0tM7 z+zAFrT@=$q(_?&H{cxJdkH_pNMR|lnSuH8@GLh>{HQ^xYWvAvkGU<^%@spV9)TO%c zAV`AvAUG!F)O~DXIwq~wH22c;?e~|aj+2cm6u}tjQf1se42ir$;$RRtWaA3Glrzh& zKJmJDOLJv)A^`ZY*l|&(QHL21j&1X7_Gqdx`%TyRK2ZH zsb*_tF-D;$j6v6rixYgJD8;^oIId%NgQ$;_hS$gYL=OG^nmlVP^qkHrdp+m{5j`!^ z&};It=7K7lY4(;MC)jt$RC z2C>yD$`?X6180z~78*J)ENmKeE`lQ$5(qve5T&ydaMD%J`B2L+mEWM&g7FN2X>=L3W(-cd>ETr1> zVmez73$vKc<*c$@Ag|50P8>Zit56}1Vv?@Ex;R;Y(~>r=Sg9sk$2NA-+SYK=^A?BmWC-&31^Mwgh6luFEw4OO*6a8nanMbMI3jENbcUQ{<>yi7WiWhA zPWOVI_YVw2jIaE?VK5Za#TBzGxk~y$%8F!GJBEZ!O|1~aR4uhS8Rk13hO%xO)}%uH zd&4lB#m)it_let(Cs#IU_%Dsz$?D;qE}$iQ%l}~H@|8GW6DOs7v4+;t+X|c3Us?-r zR`=AJywEnAGkO2Lw2t-$S^ui0(1YH5(qk+wx}o$UTUvBO=}h^G? zzA;~*x9Ox&F$|sVIj|Wjw!IPQ?KM5RgU0DjKoeyW*uGSEai-JfgayY~n2%K9emX0j zc`LnJr+*aW=|6>qx;ou{?&go#72VCKAQn#ofUr%Di_HgkIW7Q%ZE{>}KETUy0U&IX z<6`pxUXBX@VVfKmn-B1ETmT5$HaRXfAK>M<01&px zak2RTFUJLduuYDO%?EfnE&zmWa$Iaaz{_y~AZ(N4V)FrBjtc-`n;aLL5Abqa00`UU zxY&Gvm*WCJ*e1ut<^#MO7XZRGIW9II;N`dg5Vpy2vH1Wm#|40}O^%Dr2Y5Ly0EBIF zTx>qT%W(l9Y?I?+^8sFt3jkr8Ok69oXK#s5AGjUTCu=)DzxM=vDpznecUlM?J%!Ng zZz1&ipY;0|ga!&izg|MfzK+nN!L?VvIY;|iTg|oh=*OSFy|s#zQ}?ZXclrT!^`mzO z;fl8LmHo%9)vd<0n>Q{s5!#I2_~G;GH#Ua1KfC(jZ%?8xZ$9$r)m`xu8U$@^oNs>o I!lgI=0){iN82|tP literal 0 HcmV?d00001 diff --git a/images/settings_remote.png b/images/settings_remote.png new file mode 100644 index 0000000000000000000000000000000000000000..ed7087de8d7a94ae042d8a60288815d9b4392fd8 GIT binary patch literal 440 zcmV;p0Z0CcP)Px$a!Eu%R7efomb*&CKoo{2UeLl)u+QANV)?A50e0 zr8$&UY$k%L)xGi^Wpgb9+-f7p$A+4_Bgl&Szy-V7MGyXCqM=$81;?P i5jZZ`Y~s>wjsF0GLxK@nC~7$X0000 Date: Wed, 18 Jul 2018 15:09:47 +0200 Subject: [PATCH 04/27] Added property itemTopMargin for component StandardDropdown --- components/StandardDropdown.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/StandardDropdown.qml b/components/StandardDropdown.qml index 7ff021ed..82f9406a 100644 --- a/components/StandardDropdown.qml +++ b/components/StandardDropdown.qml @@ -32,6 +32,7 @@ import "../components" as MoneroComponents Item { id: dropdown + property int itemTopMargin: 0 property alias dataModel: repeater.model property string shadowPressedColor property string shadowReleasedColor @@ -76,6 +77,7 @@ Item { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top + anchors.topMargin: parent.itemTopMargin height: dropdown.dropdownHeight Rectangle { From 48da5a3dbaf4126a43f4941f551034de131ee3eb Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:15:40 +0200 Subject: [PATCH 05/27] Reworked page 'Settings', added a stackview --- MiddlePanel.qml | 3 +- pages/settings/Settings.qml | 843 ++++-------------------------------- 2 files changed, 84 insertions(+), 762 deletions(-) diff --git a/MiddlePanel.qml b/MiddlePanel.qml index 6101b28d..1b1a4a83 100644 --- a/MiddlePanel.qml +++ b/MiddlePanel.qml @@ -37,6 +37,7 @@ import QtGraphicalEffects 1.0 import moneroComponents.Wallet 1.0 import "./pages" +import "./pages/settings" Rectangle { id: root @@ -141,7 +142,7 @@ Rectangle { }, State { name: "Settings" PropertyChanges { target: root; currentView: settingsView } - PropertyChanges { target: mainFlickable; contentHeight: settingsView.settingsHeight + 100 } + PropertyChanges { target: mainFlickable; contentHeight: settingsView.settingsHeight } }, State { name: "Mining" PropertyChanges { target: root; currentView: miningView } diff --git a/pages/settings/Settings.qml b/pages/settings/Settings.qml index 4abd62f7..71005168 100644 --- a/pages/settings/Settings.qml +++ b/pages/settings/Settings.qml @@ -31,788 +31,109 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 -import "../version.js" as Version -import "../js/Windows.js" as Windows -import "../js/Utils.js" as Utils - - -import "../components" +import "../../js/Windows.js" as Windows +import "../../js/Utils.js" as Utils +import "../../components" as MoneroComponents +import "../../pages" +import "." import moneroComponents.Clipboard 1.0 -Rectangle { - property bool viewOnly: false - property alias settingsHeight: mainLayout.height - id: page - - color: "transparent" - - // fires on every page load - function onPageCompleted() { - console.log("Settings page loaded"); - - if(typeof daemonManager != "undefined"){ - daemonRunning = persistentSettings.useRemoteNode ? false : appWindow.daemonRunning; - } - - logLevelDropdown.update() - } - +ColumnLayout { + id: settingsPage + Layout.fillWidth: true + Layout.preferredHeight: 900 + spacing: 0 Clipboard { id: clipboard } + property bool viewOnly: false + property int settingsHeight: 900 - ColumnLayout { - id: mainLayout - anchors.margins: (isMobile)? 17 : 40 - anchors.left: parent.left - anchors.top: parent.top - anchors.right: parent.right - spacing: 26 * scaleRatio + Navbar{} - //! Manage wallet - RowLayout { - Layout.fillWidth: true - Label { - id: manageWalletLabel - fontSize: 22 * scaleRatio - Layout.fillWidth: true - text: qsTr("Manage wallet") + translationManager.emptyString - Layout.topMargin: 10 * scaleRatio + Rectangle{ + id: settingsStateView + property Item currentView + property Item previousView + property SettingsWallet settingsWalletView: SettingsWallet { } + property SettingsLayout settingsLayoutView: SettingsLayout { } + property SettingsNode settingsNodeView: SettingsNode { } + property SettingsLog settingsLogView: SettingsLog { } + property SettingsInfo settingsInfoView: SettingsInfo { } + Layout.fillWidth: true + Layout.preferredHeight: parent.height + color: "transparent" + state: "Wallet" + + onCurrentViewChanged: { + if (previousView) { +// if (typeof previousView.onPageClosed === "function") { +// previousView.onPageClosed(); +// } } - - Rectangle { - anchors.top: manageWalletLabel.bottom - anchors.topMargin: 4 - anchors.left: parent.left - anchors.right: parent.right - Layout.fillWidth: true - height: 2 - color: Style.dividerColor - opacity: Style.dividerOpacity + previousView = currentView + if (currentView) { + stackView.replace(currentView) + // Component.onCompleted is called before wallet is initilized +// if (typeof currentView.onPageCompleted === "function") { +// currentView.onPageCompleted(); +// } } } - GridLayout { - columns: (isMobile)? 1 : 4 - StandardButton { - id: closeWalletButton - small: true - text: qsTr("Close wallet") + translationManager.emptyString - visible: true - onClicked: { - console.log("closing wallet button clicked") - appWindow.showWizard(); - } + states: [ + State { + name: "Wallet" + PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsWalletView } + }, State { + name: "UI" + PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsLayoutView } + }, State { + name: "Node" + PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsNodeView } + }, State { + name: "Log" + PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsLogView } + }, State { + name: "Info" + PropertyChanges { target: settingsStateView; currentView: settingsStateView.settingsInfoView } } + ] - StandardButton { - id: createViewOnlyWalletButton - enabled: !viewOnly - small: true - text: qsTr("Create view only wallet") + translationManager.emptyString - visible: true - onClicked: { - wizard.openCreateViewOnlyWalletPage(); - } - } + StackView { + id: stackView + initialItem: settingsStateView.settingsWalletView + anchors.fill: parent + clip: false // otherwise animation will affect left panel -/* Rescan cache - Disabled until we know it's needed - - StandardButton { - id: rescanWalletbutton - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" - text: qsTr("Rescan wallet cache") + translationManager.emptyString - onClicked: { - // Show confirmation dialog - confirmationDialog.title = qsTr("Rescan wallet cache") + translationManager.emptyString; - confirmationDialog.text = qsTr("Are you sure you want to rebuild the wallet cache?\n" - + "The following information will be deleted\n" - + "- Recipient addresses\n" - + "- Tx keys\n" - + "- Tx descriptions\n\n" - + "The old wallet cache file will be renamed and can be restored later.\n" - ); - confirmationDialog.icon = StandardIcon.Question - confirmationDialog.cancelText = qsTr("Cancel") - confirmationDialog.onAcceptedCallback = function() { - walletManager.closeWallet(); - walletManager.clearWalletCache(persistentSettings.wallet_path); - walletManager.openWalletAsync(persistentSettings.wallet_path, appWindow.walletPassword, - persistentSettings.nettype); + delegate: StackViewDelegate { + pushTransition: StackViewTransition { + PropertyAnimation { + target: enterItem + property: "x" + from: 0 - target.width + to: 0 + duration: 300 + easing.type: Easing.OutCubic } - - confirmationDialog.onRejectedCallback = null; - - confirmationDialog.open() - - } - } -*/ - StandardButton { - id: rescanSpentButton - small: true - enabled: !persistentSettings.useRemoteNode - text: qsTr("Rescan wallet balance") + translationManager.emptyString - onClicked: { - if (!currentWallet.rescanSpent()) { - console.error("Error: ", currentWallet.errorString); - informationPopup.title = qsTr("Error") + translationManager.emptyString; - informationPopup.text = qsTr("Error: ") + currentWallet.errorString - informationPopup.icon = StandardIcon.Critical - informationPopup.onCloseCallback = null - informationPopup.open(); - } else { - informationPopup.title = qsTr("Information") + translationManager.emptyString - informationPopup.text = qsTr("Successfully rescanned spent outputs.") + translationManager.emptyString - informationPopup.icon = StandardIcon.Information - informationPopup.onCloseCallback = null - informationPopup.open(); + PropertyAnimation { + target: exitItem + property: "x" + from: 0 + to: target.width + duration: 300 + easing.type: Easing.OutCubic } } } } - - RowLayout{ - Layout.fillWidth: true - - StandardButton { - id: changePasswordButton - small: true - text: qsTr("Change password") + translationManager.emptyString - onClicked: { - passwordDialog.onAcceptedCallback = function() { - if(appWindow.walletPassword === passwordDialog.password){ - newPasswordDialog.open() - } else { - informationPopup.title = qsTr("Error") + translationManager.emptyString; - informationPopup.text = qsTr("Wrong password"); - informationPopup.open() - informationPopup.onCloseCallback = function() { - changePasswordDialog.open() - } - passwordDialog.open() - } - } - passwordDialog.onRejectedCallback = null; - passwordDialog.open() - } - } - } - - RowLayout { - Layout.fillWidth: true - - LabelSubheader { - text: qsTr("Daemon mode") + translationManager.emptyString - } - } - - ColumnLayout { - RadioButton { - id: remoteDisconnect - checked: !persistentSettings.useRemoteNode - text: qsTr("Local Node") + translationManager.emptyString - onClicked: { - persistentSettings.useRemoteNode = false; - remoteConnect.checked = false; - appWindow.disconnectRemoteNode(); - } - } - - RadioButton { - id: remoteConnect - checked: persistentSettings.useRemoteNode - text: qsTr("Remote Node") + translationManager.emptyString - onClicked: { - persistentSettings.useRemoteNode = true; - remoteDisconnect.checked = false; - appWindow.connectRemoteNode(); - } - } - } - - RowLayout { - visible: !isMobile && !persistentSettings.useRemoteNode - Layout.fillWidth: true - - LabelSubheader { - text: qsTr("Bootstrap node") + translationManager.emptyString - } - } - - RowLayout { - visible: !isMobile && !persistentSettings.useRemoteNode - - ColumnLayout { - Layout.fillWidth: true - - RemoteNodeEdit { - id: bootstrapNodeEdit - Layout.minimumWidth: 100 * scaleRatio - Layout.bottomMargin: 20 * scaleRatio - - lineEditBackgroundColor: "transparent" - lineEditFontColor: "white" - lineEditBorderColor: Style.inputBorderColorActive - - daemonAddrLabelText: qsTr("Address") + translationManager.emptyString - daemonPortLabelText: qsTr("Port") + translationManager.emptyString - daemonAddrText: persistentSettings.bootstrapNodeAddress.split(":")[0].trim() - daemonPortText: { - var node_split = persistentSettings.bootstrapNodeAddress.split(":"); - if(node_split.length == 2){ - (node_split[1].trim() == "") ? "18081" : node_split[1]; - } else { - return "" - } - } - onEditingFinished: { - persistentSettings.bootstrapNodeAddress = daemonAddrText ? bootstrapNodeEdit.getAddress() : ""; - console.log("setting bootstrap node to " + persistentSettings.bootstrapNodeAddress) - } - } - } - } - - RowLayout { - visible: persistentSettings.useRemoteNode - ColumnLayout { - Layout.fillWidth: true - - RemoteNodeEdit { - id: remoteNodeEdit - Layout.minimumWidth: 100 * scaleRatio - - lineEditBackgroundColor: "transparent" - lineEditFontColor: "white" - lineEditBorderColor: Qt.rgba(255, 255, 255, 0.35) - - daemonAddrLabelText: qsTr("Address") - daemonPortLabelText: qsTr("Port") - - property var rna: persistentSettings.remoteNodeAddress - daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : "" - daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? "18081" : rna.split(":")[1] : "" - onEditingFinished: { - persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); - console.log("setting remote node to " + persistentSettings.remoteNodeAddress) - } - } - } - } - - RowLayout{ - visible: persistentSettings.useRemoteNode - Layout.fillWidth: true - - StandardButton { - id: remoteNodeSave - small: true - text: qsTr("Connect") + translationManager.emptyString - onClicked: { - // Update daemon login - persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); - persistentSettings.daemonUsername = daemonUsername.text; - persistentSettings.daemonPassword = daemonPassword.text; - persistentSettings.useRemoteNode = true - - currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword); - - appWindow.connectRemoteNode() - } - } - } - - //! Manage daemon - RowLayout { - visible: !isMobile - - Label { - id: manageDaemonLabel - fontSize: 22 * scaleRatio - text: qsTr("Manage Daemon") + translationManager.emptyString - } - - Rectangle { - anchors.top: manageDaemonLabel.bottom - anchors.topMargin: 4 - anchors.left: parent.left - anchors.right: parent.right - Layout.fillWidth: true - height: 2 - color: Style.dividerColor - opacity: Style.dividerOpacity - } - } - - GridLayout { - visible: !isMobile && !persistentSettings.useRemoteNode - id: daemonStatusRow - columns: (isMobile) ? 2 : 4 - StandardButton { - id: startDaemonButton - small: true - visible: !daemonRunning - text: qsTr("Start Local Node") + translationManager.emptyString - onClicked: { - // Update bootstrap daemon address - persistentSettings.bootstrapNodeAddress = bootstrapNodeEdit.daemonAddrText ? bootstrapNodeEdit.getAddress() : ""; - - // Set current daemon address to local - appWindow.currentDaemonAddress = appWindow.localDaemonAddress; - appWindow.startDaemon(daemonFlags.text); - } - } - - StandardButton { - id: stopDaemonButton - small: true - visible: daemonRunning - text: qsTr("Stop Local Node") + translationManager.emptyString - onClicked: { - appWindow.stopDaemon() - } - } - - StandardButton { - id: daemonStatusButton - small: true - visible: true - text: qsTr("Show status") + translationManager.emptyString - onClicked: { - daemonManager.sendCommand("status",currentWallet.nettype); - daemonConsolePopup.open(); - } - } - } - - ColumnLayout { - id: blockchainFolderRow - visible: !isMobile && !persistentSettings.useRemoteNode - - RowLayout { - Layout.fillWidth: true - Layout.bottomMargin: 14 * scaleRatio - - LabelSubheader { - text: qsTr("Blockchain location") + translationManager.emptyString - } - } - - RowLayout { - visible: persistentSettings.blockchainDataDir.length > 0 - - LineEdit { - id: blockchainFolder - Layout.preferredWidth: 200 - - Layout.fillWidth: true - text: persistentSettings.blockchainDataDir; - placeholderText: qsTr("(optional)") + translationManager.emptyString - } - } - - RowLayout { - Layout.fillWidth: true - Layout.topMargin: 8 - StandardButton { - id: blockchainFolderButton - small: true - visible: true - text: qsTr("Change location") + translationManager.emptyString - onClicked: { - //mouse.accepted = false - if(persistentSettings.blockchainDataDir != "") - blockchainFileDialog.folder = "file://" + persistentSettings.blockchainDataDir - blockchainFileDialog.open() - blockchainFolder.focus = true - } - } - } - } - - RowLayout{ - CheckBox { - id: daemonAdvanced - text: qsTr("Show advanced") + translationManager.emptyString - } - } - - RowLayout { - visible: daemonAdvanced.checked && !isMobile && !persistentSettings.useRemoteNode - id: daemonFlagsRow - - LineEdit { - id: daemonFlags - Layout.preferredWidth: 200 - Layout.fillWidth: true - labelText: qsTr("Local daemon startup flags") + translationManager.emptyString - text: appWindow.persistentSettings.daemonFlags; - placeholderText: qsTr("(optional)") + translationManager.emptyString - } - } - - ColumnLayout { - visible: (daemonAdvanced.checked || isMobile) && persistentSettings.useRemoteNode - GridLayout { - columns: (isMobile) ? 1 : 2 - columnSpacing: 32 - - LineEdit { - id: daemonUsername - Layout.fillWidth: true - labelText: "Daemon username" - text: persistentSettings.daemonUsername - placeholderText: qsTr("Username") + translationManager.emptyString - } - - LineEdit { - id: daemonPassword - Layout.fillWidth: true - labelText: "Daemon password" - text: persistentSettings.daemonPassword - placeholderText: qsTr("Password") + translationManager.emptyString - echoMode: TextInput.Password - } - } - } - - RowLayout { - visible: !isMobile - Label { - id: layoutSettingsLabel - fontSize: 22 * scaleRatio - text: qsTr("Layout settings") + translationManager.emptyString - } - - Rectangle { - anchors.top: layoutSettingsLabel.bottom - anchors.topMargin: 4 - anchors.left: parent.left - anchors.right: parent.right - Layout.fillWidth: true - height: 2 - color: Style.dividerColor - opacity: Style.dividerOpacity - } - } - - RowLayout { - CheckBox { - visible: !isMobile - id: customDecorationsCheckBox - checked: persistentSettings.customDecorations - onClicked: Windows.setCustomWindowDecorations(checked) - text: qsTr("Custom decorations") + translationManager.emptyString - } - } - - // Log level - - RowLayout { - Label { - id: logLevelLabel - fontSize: 22 * scaleRatio - text: qsTr("Log level") + translationManager.emptyString - } - - Rectangle { - anchors.top: logLevelLabel.bottom - anchors.topMargin: 4 - anchors.left: parent.left - anchors.right: parent.right - Layout.fillWidth: true - height: 2 - color: Style.dividerColor - opacity: Style.dividerOpacity - } - } - - GridLayout { - columns: (isMobile)? 1 : 3 - Layout.fillWidth: true - columnSpacing: 32 - - ColumnLayout { - spacing: 0 - Layout.fillWidth: true - - ListModel { - id: logLevel - ListElement { name: "none"; column1: "0"; } - ListElement { column1: "1"; } - ListElement { column1: "2"; } - ListElement { column1: "3"; } - ListElement { column1: "4"; } - ListElement { column1: "custom"; } - } - - StandardDropdown { - id: logLevelDropdown - dataModel: logLevel - currentIndex: appWindow.persistentSettings.logLevel; - onChanged: { - if (currentIndex == 5) { - console.log("log categories changed: ", logCategories.text); - walletManager.setLogCategories(logCategories.text); - } - else { - console.log("log level changed: ",currentIndex); - walletManager.setLogLevel(currentIndex); - } - appWindow.persistentSettings.logLevel = currentIndex; - } - Layout.fillWidth: true - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#363636" - pressedColor: "#202020" - } - // Make sure dropdown is on top - } - - ColumnLayout { - Layout.fillWidth: true - } - - ColumnLayout { - Layout.fillWidth: true - } - - z: parent.z + 1 - } - - ColumnLayout { - LineEdit { - id: logCategories - Layout.fillWidth: true - text: appWindow.persistentSettings.logCategories - labelText: "Log Categories" - placeholderText: "(e.g. *:WARNING,net.p2p:DEBUG)" - enabled: logLevelDropdown.currentIndex === 5 - onEditingFinished: { - if(enabled) { - console.log("log categories changed: ", text); - walletManager.setLogCategories(text); - appWindow.persistentSettings.logCategories = text; - } - } - } - } - - // Version - RowLayout { - Label { - id: debugLabel - text: qsTr("Debug info") + translationManager.emptyString - fontSize: 22 - anchors.topMargin: 30 * scaleRatio - Layout.topMargin: 30 * scaleRatio - } - - Rectangle { - anchors.top: debugLabel.bottom - anchors.topMargin: 4 - anchors.left: parent.left - anchors.right: parent.right - Layout.fillWidth: true - height: 2 - color: Style.dividerColor - opacity: Style.dividerOpacity - } - } - - GridLayout { - id: grid - columns: 2 - columnSpacing: 20 * scaleRatio - - TextBlock { - font.pixelSize: 14 - text: qsTr("GUI version: ") + translationManager.emptyString - } - - TextBlock { - font.pixelSize: 14 - font.bold: true - text: Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")" + translationManager.emptyString - } - - TextBlock { - id: guiMoneroVersion - font.pixelSize: 14 - text: qsTr("Embedded Monero version: ") + translationManager.emptyString - } - - TextBlock { - font.pixelSize: 14 - font.bold: true - text: Version.GUI_MONERO_VERSION + translationManager.emptyString - } - - TextBlock { - Layout.fillWidth: true - font.pixelSize: 14 - text: qsTr("Wallet name: ") + translationManager.emptyString - } - - TextBlock { - Layout.fillWidth: true - font.pixelSize: 14 - font.bold: true - text: walletName + translationManager.emptyString - } - - TextBlock { - id: restoreHeight - font.pixelSize: 14 - textFormat: Text.RichText - text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + translationManager.emptyString - } - - TextBlock { - id: restoreHeightText - textFormat: Text.RichText - font.pixelSize: 14 - font.bold: true - property var style: "" - text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" (Click to change)") + translationManager.emptyString - onLinkActivated: { - inputDialog.labelText = qsTr("Set a new restore height:") + translationManager.emptyString; - inputDialog.inputText = currentWallet ? currentWallet.walletCreationHeight : "0"; - inputDialog.onAcceptedCallback = function() { - var _restoreHeight = inputDialog.inputText; - if(Utils.isNumeric(_restoreHeight)){ - _restoreHeight = parseInt(_restoreHeight); - if(_restoreHeight >= 0) { - currentWallet.walletCreationHeight = _restoreHeight - // Restore height is saved in .keys file. Set password to trigger rewrite. - currentWallet.setPassword(appWindow.walletPassword) - - // Show confirmation dialog - confirmationDialog.title = qsTr("Rescan wallet cache") + translationManager.emptyString; - confirmationDialog.text = qsTr("Are you sure you want to rebuild the wallet cache?\n" - + "The following information will be deleted\n" - + "- Recipient addresses\n" - + "- Tx keys\n" - + "- Tx descriptions\n\n" - + "The old wallet cache file will be renamed and can be restored later.\n" - ); - confirmationDialog.icon = StandardIcon.Question - confirmationDialog.cancelText = qsTr("Cancel") - confirmationDialog.onAcceptedCallback = function() { - walletManager.closeWallet(); - walletManager.clearWalletCache(persistentSettings.wallet_path); - walletManager.openWalletAsync(persistentSettings.wallet_path, appWindow.walletPassword, - persistentSettings.nettype); - } - - confirmationDialog.onRejectedCallback = null; - confirmationDialog.open() - return; - } - } - - appWindow.showStatusMessage(qsTr("Invalid restore height specified. Must be a number."),3); - } - inputDialog.onRejectedCallback = null; - inputDialog.open() - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton - cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor - } - } - - TextBlock { - Layout.fillWidth: true - font.pixelSize: 14 - text: qsTr("Wallet log path: ") + translationManager.emptyString - } - - TextBlock { - Layout.fillWidth: true - font.pixelSize: 14 - text: walletLogPath - } - } - } - - // Choose blockchain folder - FileDialog { - id: blockchainFileDialog - title: qsTr("Please choose a folder") + translationManager.emptyString; - selectFolder: true - folder: "file://" + persistentSettings.blockchainDataDir - - onAccepted: { - var dataDir = walletManager.urlToLocalPath(blockchainFileDialog.fileUrl); - console.log(dataDir); - var validator = daemonManager.validateDataDir(dataDir); - if(!validator.valid) { - - confirmationDialog.title = qsTr("Warning") + translationManager.emptyString; - confirmationDialog.text = ""; - if(validator.readOnly) { - confirmationDialog.text += qsTr("Error: Filesystem is read only") + "\n\n" - } - - if(validator.storageAvailable < estimatedBlockchainSize) { - confirmationDialog.text += qsTr("Warning: There's only %1 GB available on the device. Blockchain requires ~%2 GB of data.").arg(validator.storageAvailable).arg(estimatedBlockchainSize) + "\n\n" - } else { - confirmationDialog.text += qsTr("Note: There's %1 GB available on the device. Blockchain requires ~%2 GB of data.").arg(validator.storageAvailable).arg(estimatedBlockchainSize) + "\n\n" - } - - if(!validator.lmdbExists) { - confirmationDialog.text += qsTr("Note: lmdb folder not found. A new folder will be created.") + "\n\n" - } - - confirmationDialog.icon = StandardIcon.Question - confirmationDialog.cancelText = qsTr("Cancel") - - // Continue - confirmationDialog.onAcceptedCallback = function() { - persistentSettings.blockchainDataDir = dataDir - } - - // Cancel - confirmationDialog.onRejectedCallback = function() { - }; - - confirmationDialog.open() - } else { - persistentSettings.blockchainDataDir = dataDir - } - - delete validator; - - - } - onRejected: { - console.log("data dir selection canceled") - } - - } - - // fires only once - Component.onCompleted: { - if(typeof daemonManager != "undefined") - daemonManager.daemonConsoleUpdated.connect(onDaemonConsoleUpdated) } function onDaemonConsoleUpdated(message){ // Update daemon console - daemonConsolePopup.textArea.logMessage(message) + settingsStateView.settingsLogView.consoleArea.logMessage(message) } - - - + // fires on every page load + function onPageCompleted() { + console.log("Settings page loaded"); + } } - - - - From 140b7634ff77602fff39ddc15824b247ed3a395b Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:16:08 +0200 Subject: [PATCH 06/27] Added settings navbar componenent --- pages/settings/Navbar.qml | 337 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 337 insertions(+) create mode 100644 pages/settings/Navbar.qml diff --git a/pages/settings/Navbar.qml b/pages/settings/Navbar.qml new file mode 100644 index 00000000..5fc656ad --- /dev/null +++ b/pages/settings/Navbar.qml @@ -0,0 +1,337 @@ +// Copyright (c) 2014-2018, 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 QtQuick.Dialogs 1.2 +import "../../js/Windows.js" as Windows +import "../../js/Utils.js" as Utils +import "../../components" as MoneroComponents +import "../../pages" +import "." +import moneroComponents.Clipboard 1.0 + +Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 96 + color: "transparent" + + ColumnLayout { + spacing: 0 + Layout.preferredHeight: 32 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + + GridLayout { + id: grid + anchors.horizontalCenter: parent.horizontalCenter + columnSpacing: 0 + property string fontColor: "white" + property int fontSize: 13 * scaleRatio + property bool fontBold: true + property var fontFamily: MoneroComponents.Style.fontRegular.name + property string borderColor: "#808080" + property int textMargin: 28 // left-right margins in a given cell + Image { + Layout.preferredWidth: 2 + Layout.preferredHeight: 32 + source: { + if(settingsStateView.state === "Wallet"){ + return "../../images/settings_navbar_side_active.png" + } else { + return "../../images/settings_navbar_side.png" + } + } + } + ColumnLayout { + // WALLET + id: navWallet + Layout.preferredWidth: navWalletText.width + grid.textMargin + Layout.minimumWidth: 72 * scaleRatio + Layout.preferredHeight: 32 + spacing: 0 + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + Rectangle { + color: settingsStateView.state === "Wallet" ? grid.borderColor : "transparent" + height: 30 * scaleRatio + Layout.fillWidth: true + + Text { + id: navWalletText + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.family: grid.fontFamily + font.pixelSize: grid.fontSize + font.bold: grid.fontBold + text: qsTr("Wallet") + translationManager.emptyString + color: grid.fontColor + } + } + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Wallet" } + } + } + Rectangle{ + Layout.preferredWidth: 1 + Layout.preferredHeight: 32 + color: grid.borderColor + } + ColumnLayout { + // UI + id: navUI + Layout.preferredWidth: navUIText.width + grid.textMargin + Layout.preferredHeight: 32 + Layout.minimumWidth: 72 * scaleRatio + spacing: 0 + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + Rectangle { + color: settingsStateView.state === "UI" ? grid.borderColor : "transparent" + height: 30 * scaleRatio + Layout.fillWidth: true + + Text { + id: navUIText + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.family: grid.fontFamily + font.pixelSize: grid.fontSize + font.bold: grid.fontBold + text: qsTr("Layout") + translationManager.emptyString + color: grid.fontColor + } + } + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "UI" } + } + } + Rectangle{ + Layout.preferredWidth: 1 + Layout.preferredHeight: 32 + color: grid.borderColor + } + ColumnLayout { + // NODE + id: navNode + Layout.preferredWidth: navNodeText.width + grid.textMargin + Layout.preferredHeight: 32 + Layout.minimumWidth: 72 * scaleRatio + spacing: 0 + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + Rectangle { + color: settingsStateView.state === "Node" ? grid.borderColor : "transparent" + height: 30 * scaleRatio + Layout.fillWidth: true + + Text { + id: navNodeText + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.family: grid.fontFamily + font.pixelSize: grid.fontSize + font.bold: grid.fontBold + text: qsTr("Node") + translationManager.emptyString + color: grid.fontColor + } + } + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Node" } + } + } + Rectangle{ + Layout.preferredWidth: 1 + Layout.preferredHeight: 32 + color: grid.borderColor + } + ColumnLayout { + // LOG + id: navLog + Layout.preferredWidth: navLogText.width + grid.textMargin + Layout.preferredHeight: 32 + Layout.minimumWidth: 72 * scaleRatio + spacing: 0 + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + Rectangle { + color: settingsStateView.state === "Log" ? grid.borderColor : "transparent" + height: 30 * scaleRatio + Layout.fillWidth: true + + Text { + id: navLogText + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.family: grid.fontFamily + font.pixelSize: grid.fontSize + font.bold: grid.fontBold + text: qsTr("Log") + translationManager.emptyString + color: grid.fontColor + } + } + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Log" } + } + } + Rectangle{ + Layout.preferredWidth: 1 + Layout.preferredHeight: 32 + color: grid.borderColor + } + ColumnLayout { + // INFO + id: navInfo + Layout.preferredWidth: navInfoText.width + grid.textMargin + Layout.preferredHeight: 32 + Layout.minimumWidth: 72 * scaleRatio + spacing: 0 + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + Rectangle { + color: settingsStateView.state === "Info" ? grid.borderColor : "transparent" + height: 30 * scaleRatio + Layout.fillWidth: true + + Text { + id: navInfoText + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.family: grid.fontFamily + font.pixelSize: grid.fontSize + font.bold: grid.fontBold + text: qsTr("Info") + translationManager.emptyString + color: grid.fontColor + } + } + + Rectangle { + color: grid.borderColor + Layout.preferredHeight: 1 + Layout.fillWidth: true + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Info" } + } + } + Image { + Layout.preferredWidth: 2 + Layout.preferredHeight: 32 + source: { + if(settingsStateView.state === "Info"){ + return "../../images/settings_navbar_side_active.png" + } else { + return "../../images/settings_navbar_side.png" + } + + } + rotation: 180 + } + Rectangle { + color: "transparent" + Layout.fillWidth: true + } + } + } +} From 1257eb642a52c8374631363a0568e7e89de3e609 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:19:28 +0200 Subject: [PATCH 07/27] Added settings page: Layout --- pages/settings/SettingsLayout.qml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pages/settings/SettingsLayout.qml diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml new file mode 100644 index 00000000..d0450945 --- /dev/null +++ b/pages/settings/SettingsLayout.qml @@ -0,0 +1,39 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 +import QtQuick.Dialogs 1.2 + +import "../../js/Utils.js" as Utils +import "../../js/Windows.js" as Windows +import "../../components" as MoneroComponents + +Rectangle { + color: "transparent" + height: 1400 + Layout.fillWidth: true + + ColumnLayout { + id: settingsUI + property int itemHeight: 60 * scaleRatio + Layout.fillWidth: true + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: (isMobile)? 17 : 20 + anchors.topMargin: 0 + spacing: 0 + + MoneroComponents.CheckBox { + visible: !isMobile + id: customDecorationsCheckBox + checked: persistentSettings.customDecorations + onClicked: Windows.setCustomWindowDecorations(checked) + text: qsTr("Custom decorations") + translationManager.emptyString + } + } + + Component.onCompleted: { + console.log('SettingsLayout loaded'); + } +} + From 9019fa8baad06240554a0df3ac777a99835a38bc Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:19:45 +0200 Subject: [PATCH 08/27] Added settings page: Node --- pages/settings/SettingsNode.qml | 485 ++++++++++++++++++++++++++++++++ 1 file changed, 485 insertions(+) create mode 100644 pages/settings/SettingsNode.qml diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml new file mode 100644 index 00000000..58eff891 --- /dev/null +++ b/pages/settings/SettingsNode.qml @@ -0,0 +1,485 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 +import "../../components" as MoneroComponents + +Rectangle{ + color: "transparent" + height: 1400 + Layout.fillWidth: true + + /* main layout */ + ColumnLayout { + id: root + anchors.margins: (isMobile)? 17 : 20 + anchors.topMargin: 0 + + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + + spacing: 0 * scaleRatio + property int labelWidth: 120 + property int editWidth: 400 + property int lineEditFontSize: 14 * scaleRatio + property int buttonWidth: 110 + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 90 + color: "transparent" + + Rectangle { + id: localNodeDivider + Layout.fillWidth: true + anchors.topMargin: 0 * scaleRatio + anchors.left: parent.left + anchors.right: parent.right + height: 1 + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + Rectangle { + visible: !persistentSettings.useRemoteNode + Layout.fillHeight: true + anchors.top: parent.top + anchors.bottom: parent.bottom + color: "white" + width: 2 + } + + Rectangle { + width: parent.width + height: localNodeHeader.height + localNodeArea.contentHeight + color: "transparent"; + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + + Rectangle { + id: localNodeIcon + color: "transparent" + height: 32 + width: 32 + anchors.left: parent.left + anchors.leftMargin: 16 * scaleRatio + anchors.verticalCenter: parent.verticalCenter + + Image{ + height: 27 + width: 27 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + source: "../../images/settings_local.png" + } + } + + Text { + id: localNodeHeader + anchors.left: localNodeIcon.right + anchors.leftMargin: 14 * scaleRatio + anchors.top: parent.top + color: "white" + font.bold: true + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 18 * scaleRatio + text: qsTr("Local node") + translationManager.emptyString + } + + TextArea { + id: localNodeArea + anchors.top: localNodeHeader.bottom + anchors.topMargin: 2 * scaleRatio + anchors.left: localNodeIcon.right + anchors.leftMargin: 14 * scaleRatio + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 15 * scaleRatio + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + wrapMode: Text.WordWrap; + textMargin: 0 + leftPadding: 0 + topPadding: 0 + text: qsTr("The blockchain is downloaded to your computer. Provides higher security and requires more local storage.") + translationManager.emptyString + width: parent.width - (localNodeIcon.width + localNodeIcon.anchors.leftMargin + anchors.leftMargin) + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + persistentSettings.useRemoteNode = false; + appWindow.disconnectRemoteNode(); + } + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 90 + color: "transparent" + + Rectangle { + id: remoteNodeDivider + Layout.fillWidth: true + anchors.topMargin: 0 * scaleRatio + anchors.left: parent.left + anchors.right: parent.right + height: 1 + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + Rectangle { + visible: persistentSettings.useRemoteNode + Layout.fillHeight: true + anchors.top: parent.top + anchors.bottom: parent.bottom + color: "white" + width: 2 + } + + Rectangle { + width: parent.width + height: remoteNodeHeader.height + remoteNodeArea.contentHeight + color: "transparent"; + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + + Rectangle { + id: remoteNodeIcon + color: "transparent" + height: 32 + width: 32 + anchors.left: parent.left + anchors.leftMargin: 16 * scaleRatio + anchors.verticalCenter: parent.verticalCenter + + Image{ + height: 27 + width: 22 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + source: "../../images/settings_remote.png" + } + } + + Text { + id: remoteNodeHeader + anchors.left: remoteNodeIcon.right + anchors.leftMargin: 14 * scaleRatio + anchors.top: parent.top + color: "white" + font.bold: true + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 18 * scaleRatio + text: qsTr("Remote node") + translationManager.emptyString + } + + TextArea { + id: remoteNodeArea + anchors.top: remoteNodeHeader.bottom + anchors.topMargin: 2 * scaleRatio + anchors.left: remoteNodeIcon.right + anchors.leftMargin: 14 * scaleRatio + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 15 * scaleRatio + activeFocusOnPress: false + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + wrapMode: Text.WordWrap; + textMargin: 0 + leftPadding: 0 + topPadding: 0 + text: qsTr("Uses a third-party server to connect to the Monero network. Less secure, but easier on your computer.") + translationManager.emptyString + width: parent.width - (remoteNodeIcon.width + remoteNodeIcon.anchors.leftMargin + anchors.leftMargin) + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + persistentSettings.useRemoteNode = true; + appWindow.connectRemoteNode(); + } + } + } + + Rectangle { + id: localNodeBottomDivider + Layout.fillWidth: true + anchors.topMargin: 0 * scaleRatio + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 1 + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + } + + ColumnLayout { + id: remoteNodeLayout + anchors.margins: 0 + spacing: 20 * scaleRatio + Layout.fillWidth: true + Layout.topMargin: 20 + visible: !isMobile && persistentSettings.useRemoteNode + + TextArea { + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 15 * scaleRatio + horizontalAlignment: TextInput.AlignLeft + text: qsTr("To find a remote node, type 'Monero remote node' into your favorite search engine. Please ensure the node is run by a trusted third party. For more details, view this tutorial.") + translationManager.emptyString + width: parent.width - (remoteNodeIcon.width + remoteNodeIcon.anchors.leftMargin + anchors.leftMargin) + activeFocusOnPress: false + selectByMouse: false + wrapMode: Text.WordWrap + textMargin: 0 + leftPadding: 0 + topPadding: 0 + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + + MoneroComponents.RemoteNodeEdit { + id: remoteNodeEdit + Layout.minimumWidth: 100 * scaleRatio + + lineEditBackgroundColor: "transparent" + lineEditFontColor: "white" + lineEditFontBold: false + lineEditBorderColor: Qt.rgba(255, 255, 255, 0.35) + labelFontSize: 14 * scaleRatio + placeholderFontSize: 15 * scaleRatio + + daemonAddrLabelText: qsTr("Address") + daemonPortLabelText: qsTr("Port") + + property var rna: persistentSettings.remoteNodeAddress + daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : "" + daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? "18081" : rna.split(":")[1] : "" + onEditingFinished: { + persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); + console.log("setting remote node to " + persistentSettings.remoteNodeAddress) + } + } + + GridLayout { + columns: (isMobile) ? 1 : 2 + columnSpacing: 32 + + MoneroComponents.LineEdit { + id: daemonUsername + Layout.fillWidth: true + labelText: "Daemon username" + text: persistentSettings.daemonUsername + placeholderText: qsTr("(optional)") + translationManager.emptyString + placeholderFontSize: 15 * scaleRatio + labelFontSize: 14 * scaleRatio + fontSize: 15 * scaleRatio + } + + MoneroComponents.LineEdit { + id: daemonPassword + Layout.fillWidth: true + labelText: "Daemon password" + text: persistentSettings.daemonPassword + placeholderText: qsTr("Password") + translationManager.emptyString + echoMode: TextInput.Password + placeholderFontSize: 15 * scaleRatio + labelFontSize: 14 * scaleRatio + fontSize: 15 * scaleRatio + } + } + + Rectangle { + id: rectConnectRemote + Layout.topMargin: 12 * scaleRatio + color: MoneroComponents.Style.buttonBackgroundColorDisabled + width: btnConnectRemote.width + 40 + height: 26 + radius: 2 + + Text { + id: btnConnectRemote + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Connect") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + // Update daemon login + persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress(); + persistentSettings.daemonUsername = daemonUsername.text; + persistentSettings.daemonPassword = daemonPassword.text; + persistentSettings.useRemoteNode = true + + currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword); + + appWindow.connectRemoteNode() + } + } + } + } + + ColumnLayout { + id: localNodeLayout + anchors.margins: 0 + spacing: 20 * scaleRatio + Layout.topMargin: 40 + anchors.left: parent.left + anchors.right: parent.right + visible: !isMobile && !persistentSettings.useRemoteNode + + Rectangle { + color: "transparent" + Layout.topMargin: 0 * scaleRatio + Layout.bottomMargin: 8 * scaleRatio + Layout.preferredHeight: 24 * scaleRatio + Layout.preferredWidth: parent.width + + Rectangle { + id: rectStopNode + color: MoneroComponents.Style.buttonBackgroundColorDisabled + width: btnStopNode.width + 40 + height: 24 + radius: 2 + + Text { + id: btnStopNode + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Stop local node") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + appWindow.stopDaemon(); + } + } + } + } + + RowLayout { + MoneroComponents.LineEditMulti { + id: blockchainFolder + Layout.preferredWidth: 200 + Layout.fillWidth: true + fontSize: 15 * scaleRatio + labelFontSize: 14 * scaleRatio + property string style: "" + labelText: qsTr("Blockchain location") + style + qsTr(" (change)") + translationManager.emptyString + placeholderText: qsTr("(default)") + translationManager.emptyString + placeholderFontSize: 15 * scaleRatio + text: { + if(persistentSettings.blockchainDataDir.length > 0){ + return persistentSettings.blockchainDataDir; + } else { return "" } + } + addressValidation: false + onInputLabelLinkActivated: { + //mouse.accepted = false + if(persistentSettings.blockchainDataDir !== ""){ + blockchainFileDialog.folder = "file://" + persistentSettings.blockchainDataDir; + } + blockchainFileDialog.open(); + blockchainFolder.focus = true; + } + } + } + + RowLayout { + id: daemonFlagsRow + + MoneroComponents.LineEditMulti { + id: daemonFlags + Layout.preferredWidth: 200 + Layout.fillWidth: true + labelFontSize: 14 * scaleRatio + fontSize: 15 * scaleRatio + labelText: qsTr("Daemon startup flags") + translationManager.emptyString + placeholderText: qsTr("(optional)") + translationManager.emptyString + placeholderFontSize: 15 * scaleRatio + text: appWindow.persistentSettings.daemonFlags + addressValidation: false + } + } + + RowLayout { + visible: !isMobile && !persistentSettings.useRemoteNode + + ColumnLayout { + Layout.fillWidth: true + + MoneroComponents.RemoteNodeEdit { + id: bootstrapNodeEdit + Layout.minimumWidth: 100 * scaleRatio + Layout.bottomMargin: 20 * scaleRatio + + lineEditBackgroundColor: "transparent" + lineEditFontColor: "white" + lineEditBorderColor: MoneroComponents.Style.inputBorderColorActive + placeholderFontSize: 15 * scaleRatio + labelFontSize: 14 * scaleRatio + lineEditFontBold: false + lineEditFontSize: 15 * scaleRatio + + daemonAddrLabelText: qsTr("Bootstrap Address") + daemonPortLabelText: qsTr("Bootstrap Port") + daemonAddrText: persistentSettings.bootstrapNodeAddress.split(":")[0].trim() + daemonPortText: { + var node_split = persistentSettings.bootstrapNodeAddress.split(":"); + if(node_split.length == 2){ + (node_split[1].trim() == "") ? "18081" : node_split[1]; + } else { + return "" + } + } + onEditingFinished: { + persistentSettings.bootstrapNodeAddress = daemonAddrText ? bootstrapNodeEdit.getAddress() : ""; + console.log("setting bootstrap node to " + persistentSettings.bootstrapNodeAddress) + } + } + } + } + } + } +} + From 28bd9a72d219d53314aebc2530df666748a8adca Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:19:59 +0200 Subject: [PATCH 09/27] Added settings page: Wallet --- pages/settings/SettingsWallet.qml | 407 ++++++++++++++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 pages/settings/SettingsWallet.qml diff --git a/pages/settings/SettingsWallet.qml b/pages/settings/SettingsWallet.qml new file mode 100644 index 00000000..ef2c43df --- /dev/null +++ b/pages/settings/SettingsWallet.qml @@ -0,0 +1,407 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 +import QtQuick.Dialogs 1.2 + +import "../../js/Utils.js" as Utils +import "../../components" as MoneroComponents + +Rectangle { + color: "transparent" + height: 1400 + Layout.fillWidth: true + + ColumnLayout { + id: settingsWallet + property int itemHeight: 60 * scaleRatio + Layout.fillWidth: true + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: (isMobile)? 17 : 20 + anchors.topMargin: 0 + spacing: 0 + + Rectangle { + // divider + Layout.preferredHeight: 1 * scaleRatio + Layout.fillWidth: true + Layout.bottomMargin: 8 * scaleRatio + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + GridLayout { + Layout.fillWidth: true + Layout.preferredHeight: settingsWallet.itemHeight + columnSpacing: 0 + + ColumnLayout { + Layout.fillWidth: true + anchors.verticalCenter: parent.verticalCenter + spacing: 0 + + Text { + Layout.fillWidth: true + Layout.preferredHeight: 20 * scaleRatio + Layout.topMargin: 8 * scaleRatio + color: "white" + font.bold: true + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 16 * scaleRatio + text: qsTr("Close this wallet") + translationManager.emptyString + } + + TextArea { + Layout.fillWidth: true + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + wrapMode: Text.WordWrap; + textMargin: 0 + leftPadding: 0 + topPadding: 0 + text: qsTr("Logs out of this wallet.") + translationManager.emptyString + width: parent.width + readOnly: true + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + } + + Rectangle { + Layout.minimumWidth: 120 * scaleRatio + Layout.preferredWidth: closeWalletText.width + (20 * scaleRatio) + Layout.preferredHeight: parent.height + color: "transparent" + + Rectangle{ + width: parent.width + height: 24 * scaleRatio + radius: 2 * scaleRatio + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.buttonBackgroundColorDisabled + + Text { + id: closeWalletText + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Close wallet") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + appWindow.showWizard(); + } + } + } + } + } + + Rectangle { + // divider + Layout.preferredHeight: 1 * scaleRatio + Layout.fillWidth: true + Layout.topMargin: 8 * scaleRatio + Layout.bottomMargin: 8 * scaleRatio + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + GridLayout { + Layout.fillWidth: true + Layout.preferredHeight: settingsWallet.itemHeight + columnSpacing: 0 + + ColumnLayout { + Layout.fillWidth: true + anchors.verticalCenter: parent.verticalCenter + spacing: 0 + + Text { + Layout.fillWidth: true + Layout.preferredHeight: 20 * scaleRatio + Layout.topMargin: 8 * scaleRatio + color: "white" + font.bold: true + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 16 * scaleRatio + text: qsTr("Create a view-only wallet") + translationManager.emptyString + } + + TextArea { + Layout.fillWidth: true + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + wrapMode: Text.WordWrap; + textMargin: 0 + leftPadding: 0 + topPadding: 0 + text: qsTr("Creates a new wallet that can only view transactions, cannot initialize transactions.") + translationManager.emptyString + width: parent.width + readOnly: true + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + } + + Rectangle { + Layout.minimumWidth: 120 * scaleRatio + Layout.preferredWidth: createViewOnlyText.width + (20 * scaleRatio) + Layout.preferredHeight: parent.height + color: "transparent" + + Rectangle{ + width: parent.width + height: 24 * scaleRatio + radius: 2 * scaleRatio + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.buttonBackgroundColorDisabled + + Text { + id: createViewOnlyText + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Create wallet") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + wizard.openCreateViewOnlyWalletPage(); + } + } + } + } + } + + Rectangle { + // divider + Layout.preferredHeight: 1 * scaleRatio + Layout.fillWidth: true + Layout.topMargin: 8 * scaleRatio + Layout.bottomMargin: 8 * scaleRatio + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + GridLayout { + Layout.fillWidth: true + Layout.preferredHeight: settingsWallet.itemHeight + columnSpacing: 0 + + ColumnLayout { + Layout.fillWidth: true + anchors.verticalCenter: parent.verticalCenter + spacing: 0 + + Text { + Layout.fillWidth: true + Layout.preferredHeight: 20 * scaleRatio + Layout.topMargin: 8 * scaleRatio + color: "white" + font.bold: true + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 16 * scaleRatio + text: qsTr("Show seed & keys") + translationManager.emptyString + } + + TextArea { + Layout.fillWidth: true + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + wrapMode: Text.WordWrap; + textMargin: 0 * scaleRatio + leftPadding: 0 + topPadding: 0 + text: qsTr("Store this information safely to recover your wallet in the future.") + translationManager.emptyString + width: parent.width + readOnly: true + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + } + + Rectangle { + Layout.minimumWidth: 120 * scaleRatio + Layout.preferredWidth: showSeedText.width + (20 * scaleRatio) + Layout.preferredHeight: parent.height + color: "transparent" + + Rectangle{ + width: parent.width + height: 24 * scaleRatio + radius: 2 * scaleRatio + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.buttonBackgroundColorDisabled + + Text { + id: showSeedText + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Show seed") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + Utils.showSeedPage(); + } + } + } + } + } + + Rectangle { + // divider + Layout.preferredHeight: 1 * scaleRatio + Layout.fillWidth: true + Layout.topMargin: 8 * scaleRatio + Layout.bottomMargin: 8 * scaleRatio + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + GridLayout { + Layout.fillWidth: true + Layout.preferredHeight: settingsWallet.itemHeight + columnSpacing: 0 + + ColumnLayout { + Layout.fillWidth: true + anchors.verticalCenter: parent.verticalCenter + spacing: 0 + + Text { + Layout.fillWidth: true + Layout.preferredHeight: 20 * scaleRatio + Layout.topMargin: 8 * scaleRatio + color: "white" + font.bold: true + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 16 * scaleRatio + text: qsTr("Rescan wallet balance") + translationManager.emptyString + } + + TextArea { + Layout.fillWidth: true + color: MoneroComponents.Style.greyFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + wrapMode: Text.WordWrap; + textMargin: 0 + leftPadding: 0 + topPadding: 0 + text: qsTr("Use this feature if you think the shown balance is not accurate.") + translationManager.emptyString + width: parent.width + readOnly: true + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + } + + Rectangle { + Layout.minimumWidth: 120 * scaleRatio + Layout.preferredWidth: rescanButtonText.width + (20 * scaleRatio) + Layout.preferredHeight: parent.height + color: "transparent" + + Rectangle{ + width: parent.width + + height: 24 * scaleRatio + radius: 2 * scaleRatio + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.buttonBackgroundColorDisabled + + Text { + id: rescanButtonText + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Rescan") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + if (!currentWallet.rescanSpent()) { + console.error("Error: ", currentWallet.errorString); + informationPopup.title = qsTr("Error") + translationManager.emptyString; + informationPopup.text = qsTr("Error: ") + currentWallet.errorString + informationPopup.icon = StandardIcon.Critical + informationPopup.onCloseCallback = null + informationPopup.open(); + } else { + informationPopup.title = qsTr("Information") + translationManager.emptyString + informationPopup.text = qsTr("Successfully rescanned spent outputs.") + translationManager.emptyString + informationPopup.icon = StandardIcon.Information + informationPopup.onCloseCallback = null + informationPopup.open(); + } + } + } + } + } + } + } + + Component.onCompleted: { + console.log('SettingsWallet loaded'); + } +} + From b7dbb83294f058f6e02ec096d41c26f400f76668 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 15:20:13 +0200 Subject: [PATCH 10/27] Added settings page: Log --- pages/settings/SettingsLog.qml | 214 +++++++++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 pages/settings/SettingsLog.qml diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml new file mode 100644 index 00000000..61b54901 --- /dev/null +++ b/pages/settings/SettingsLog.qml @@ -0,0 +1,214 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 + +import "../../js/Utils.js" as Utils +import "../../components" as MoneroComponents + + +Rectangle { + property alias consoleArea: consoleArea + color: "transparent" + height: 1400 + Layout.fillWidth: true + + ColumnLayout { + id: settingsLog + property int itemHeight: 60 * scaleRatio + Layout.fillWidth: true + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: (isMobile)? 17 : 20 + anchors.topMargin: 0 + spacing: 10 + +// Rectangle { +// // divider +// Layout.preferredHeight: 1 * scaleRatio +// Layout.fillWidth: true +// Layout.bottomMargin: 8 * scaleRatio +// color: MoneroComponents.Style.dividerColor +// opacity: MoneroComponents.Style.dividerOpacity +// } + + Text { + Layout.bottomMargin: 2 * scaleRatio + color: MoneroComponents.Style.defaultFontColor + font.pixelSize: 18 * scaleRatio + font.family: MoneroComponents.Style.fontRegular.name + text: qsTr("Log level") + translationManager.emptyString + } + + GridLayout { + columns: appWindow.persistentSettings.logLevel === 5 ? 2 : 1 + Layout.fillWidth: true + columnSpacing: 32 * scaleRatio + z: parent.z + 1 + + ColumnLayout { + spacing: 0 + Layout.fillWidth: true + + ListModel { + id: logLevel + ListElement { column1: "0"; name: "none"; } + ListElement { column1: "1"; } + ListElement { column1: "2"; } + ListElement { column1: "3"; } + ListElement { column1: "4"; } + ListElement { column1: "custom"; } + } + + MoneroComponents.StandardDropdown { + id: logLevelDropdown + dataModel: logLevel + itemTopMargin: 2 * scaleRatio + currentIndex: appWindow.persistentSettings.logLevel; + onChanged: { + if (currentIndex == 5) { + console.log("log categories changed: ", logCategories.text); + walletManager.setLogCategories(logCategories.text); + } + else { + console.log("log level changed: ",currentIndex); + walletManager.setLogLevel(currentIndex); + } + appWindow.persistentSettings.logLevel = currentIndex; + } + Layout.fillWidth: true + shadowReleasedColor: "#FF4304" + shadowPressedColor: "#B32D00" + releasedColor: "#363636" + pressedColor: "#202020" + } + } + + MoneroComponents.LineEdit { + id: logCategories + visible: persistentSettings.logLevel === 5 + Layout.fillWidth: true + text: appWindow.persistentSettings.logCategories + placeholderText: "(e.g. *:WARNING,net.p2p:DEBUG)" + placeholderFontSize: 14 * scaleRatio + enabled: logLevelDropdown.currentIndex === 5 + onEditingFinished: { + if(enabled) { + console.log("log categories changed: ", text); + walletManager.setLogCategories(text); + appWindow.persistentSettings.logCategories = text; + } + } + } + } + + Text { + Layout.topMargin: 10 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + color: MoneroComponents.Style.defaultFontColor + font.pixelSize: 18 * scaleRatio + font.family: MoneroComponents.Style.fontRegular.name + text: qsTr("Daemon log") + translationManager.emptyString + } + + Flickable { + id: flickable + Layout.fillWidth: true + Layout.preferredHeight: 240 * scaleRatio + + TextArea.flickable: TextArea { + id : consoleArea + anchors.fill: parent + color: MoneroComponents.Style.defaultFontColor + selectionColor: MoneroComponents.Style.dimmedFontColor + textFormat: TextEdit.RichText + selectByMouse: true + selectByKeyboard: true + font.family: "Ariel" + font.pixelSize: 14 * scaleRatio + wrapMode: TextEdit.Wrap + readOnly: true + background: Rectangle { + color: "transparent" + anchors.fill: parent + border.color: Qt.rgba(255, 255, 255, 0.25); + border.width: 1 + radius: 4 + } + function logCommand(msg){ + msg = log_color(msg, "lime"); + consoleArea.append(msg); + } + function logMessage(msg){ + msg = msg.trim(); + var color = "white"; + if(msg.toLowerCase().indexOf('error') >= 0){ + color = "red"; + } else if (msg.toLowerCase().indexOf('warning') >= 0){ + color = "yellow"; + } + + // format multi-lines + if(msg.split("\n").length >= 2){ + msg = msg.split("\n").join('
'); + } + + log(msg, color); + } + function log_color(msg, color){ + return "" + msg + ""; + } + function log(msg, color){ + var timestamp = Utils.formatDate(new Date(), { + weekday: undefined, + month: "numeric", + timeZoneName: undefined + }); + + var _timestamp = log_color("[" + timestamp + "]", "#FFFFFF"); + var _msg = log_color(msg, color); + consoleArea.append(_timestamp + " " + _msg); + + // scroll to bottom + //if(flickable.contentHeight > content.height){ + // flickable.contentY = flickable.contentHeight; + //} + } + } + + ScrollBar.vertical: ScrollBar { + // TODO: scrollbar always visible is buggy. + // QT 5.9 introduces `policy: ScrollBar.AlwaysOn` + contentItem.opacity: 1 + anchors.top: flickable.top + anchors.left: flickable.right + anchors.leftMargin: 10 * scaleRatio + anchors.bottom: flickable.bottom + } + } + + MoneroComponents.LineEdit { + id: sendCommandText + Layout.fillWidth: true + fontBold: false + fontFamily: MoneroComponents.Style.fontRegular.name + placeholderText: qsTr("command + enter (e.g help)") + translationManager.emptyString + placeholderFontSize: 16 * scaleRatio + onAccepted: { + if(text.length > 0) { + consoleArea.logCommand(">>> " + text) + daemonManager.sendCommand(text, currentWallet.nettype); + } + text = "" + } + } + } + + Component.onCompleted: { + logLevelDropdown.currentIndex = persistentSettings.logLevel; + logLevelDropdown.update(); + + if(typeof daemonManager != "undefined") + daemonManager.daemonConsoleUpdated.connect(onDaemonConsoleUpdated) + } +} From eb457019dde0d15c5cb0fc940e1d05c76cbe8235 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 16:51:56 +0200 Subject: [PATCH 11/27] Move function to show the seed page to Utils.js --- js/Utils.js | 27 +++++++++++++++++++++++++++ main.qml | 27 ++------------------------- pages/settings/SettingsWallet.qml | 4 +--- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/js/Utils.js b/js/Utils.js index fdf24c6b..56953f50 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -26,4 +26,31 @@ function formatDate( date, params ) { function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n); +} + +function showSeedPage() { + // Shows `Settings->Seed & keys`. Prompts a password dialog. + passwordDialog.onAcceptedCallback = function() { + if(walletPassword === passwordDialog.password){ + if(currentWallet.seedLanguage == "") { + console.log("No seed language set. Using English as default"); + currentWallet.setSeedLanguage("English"); + } + // Load keys page + middlePanel.state = "Keys" + } else { + informationPopup.title = qsTr("Error") + translationManager.emptyString; + informationPopup.text = qsTr("Wrong password"); + informationPopup.open() + informationPopup.onCloseCallback = function() { + passwordDialog.open() + } + } + } + passwordDialog.onRejectedCallback = function() { + appWindow.showPageRequest("Settings"); + } + passwordDialog.open(); + if(isMobile) hideMenu(); + updateBalance(); } \ No newline at end of file diff --git a/main.qml b/main.qml index 4b6a6942..a842e098 100644 --- a/main.qml +++ b/main.qml @@ -40,6 +40,7 @@ import moneroComponents.NetworkType 1.0 import "components" import "wizard" +import "../js/Utils.js" as Utils import "js/Windows.js" as Windows ApplicationWindow { @@ -1415,31 +1416,7 @@ ApplicationWindow { updateBalance(); } - onKeysClicked: { - passwordDialog.onAcceptedCallback = function() { - if(walletPassword === passwordDialog.password){ - if(currentWallet.seedLanguage == "") { - console.log("No seed language set. Using English as default"); - currentWallet.setSeedLanguage("English"); - } - // Load keys page - middlePanel.state = "Keys" - } else { - informationPopup.title = qsTr("Error") + translationManager.emptyString; - informationPopup.text = qsTr("Wrong password"); - informationPopup.open() - informationPopup.onCloseCallback = function() { - passwordDialog.open() - } - } - } - passwordDialog.onRejectedCallback = function() { - appWindow.showPageRequest("Settings"); - } - passwordDialog.open(); - if(isMobile) hideMenu(); - updateBalance(); - } + onKeysClicked: Utils.showSeedPage(); } RightPanel { diff --git a/pages/settings/SettingsWallet.qml b/pages/settings/SettingsWallet.qml index ef2c43df..6536d7c7 100644 --- a/pages/settings/SettingsWallet.qml +++ b/pages/settings/SettingsWallet.qml @@ -286,9 +286,7 @@ Rectangle { MouseArea { cursorShape: Qt.PointingHandCursor anchors.fill: parent - onClicked: { - Utils.showSeedPage(); - } + onClicked: Utils.showSeedPage(); } } } From 6be5e5731e3b1c59c518cb8dcf81dc7d3540321a Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 18:23:50 +0200 Subject: [PATCH 12/27] Added settings page: Info --- pages/settings/SettingsInfo.qml | 212 ++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 pages/settings/SettingsInfo.qml diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml new file mode 100644 index 00000000..4c5806e0 --- /dev/null +++ b/pages/settings/SettingsInfo.qml @@ -0,0 +1,212 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 + +import "../../js/Utils.js" as Utils +import "../../components" as MoneroComponents + + +Rectangle { + color: "transparent" + height: 1400 + Layout.fillWidth: true + + ColumnLayout { + id: infoLayout + Layout.fillWidth: true + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: (isMobile)? 17 : 20 + anchors.topMargin: 0 + spacing: 0 + + GridLayout { + columns: 2 + columnSpacing: 0 + + MoneroComponents.TextBlock { + font.pixelSize: 14 + text: qsTr("GUI version: ") + translationManager.emptyString + } + + MoneroComponents.TextBlock { + font.pixelSize: 14 + text: Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")" + translationManager.emptyString + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + MoneroComponents.TextBlock { + id: guiMoneroVersion + font.pixelSize: 14 + text: qsTr("Embedded Monero version: ") + translationManager.emptyString + } + + MoneroComponents.TextBlock { + font.pixelSize: 14 + text: Version.GUI_MONERO_VERSION + translationManager.emptyString + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + MoneroComponents.TextBlock { + Layout.fillWidth: true + font.pixelSize: 14 + text: qsTr("Wallet name: ") + translationManager.emptyString + } + + MoneroComponents.TextBlock { + Layout.fillWidth: true + font.pixelSize: 14 + text: walletName + translationManager.emptyString + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + MoneroComponents.TextBlock { + id: restoreHeight + font.pixelSize: 14 + textFormat: Text.RichText + text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + translationManager.emptyString + } + + MoneroComponents.TextBlock { + id: restoreHeightText + textFormat: Text.RichText + font.pixelSize: 14 + property var style: "" + text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" (change)") + translationManager.emptyString + onLinkActivated: { + inputDialog.labelText = qsTr("Set a new restore height:") + translationManager.emptyString; + inputDialog.inputText = currentWallet ? currentWallet.walletCreationHeight : "0"; + inputDialog.onAcceptedCallback = function() { + var _restoreHeight = inputDialog.inputText; + if(Utils.isNumeric(_restoreHeight)){ + _restoreHeight = parseInt(_restoreHeight); + if(_restoreHeight >= 0) { + currentWallet.walletCreationHeight = _restoreHeight + // Restore height is saved in .keys file. Set password to trigger rewrite. + currentWallet.setPassword(appWindow.walletPassword) + + // Show confirmation dialog + confirmationDialog.title = qsTr("Rescan wallet cache") + translationManager.emptyString; + confirmationDialog.text = qsTr("Are you sure you want to rebuild the wallet cache?\n" + + "The following information will be deleted\n" + + "- Recipient addresses\n" + + "- Tx keys\n" + + "- Tx descriptions\n\n" + + "The old wallet cache file will be renamed and can be restored later.\n" + ); + confirmationDialog.icon = StandardIcon.Question + confirmationDialog.cancelText = qsTr("Cancel") + confirmationDialog.onAcceptedCallback = function() { + walletManager.closeWallet(); + walletManager.clearWalletCache(persistentSettings.wallet_path); + walletManager.openWalletAsync(persistentSettings.wallet_path, appWindow.walletPassword, + persistentSettings.nettype); + } + + confirmationDialog.onRejectedCallback = null; + confirmationDialog.open() + return; + } + } + + appWindow.showStatusMessage(qsTr("Invalid restore height specified. Must be a number."),3); + } + inputDialog.onRejectedCallback = null; + inputDialog.open() + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + } + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + Rectangle { + height: 1 + Layout.topMargin: 2 * scaleRatio + Layout.bottomMargin: 2 * scaleRatio + Layout.fillWidth: true + color: MoneroComponents.Style.dividerColor + opacity: MoneroComponents.Style.dividerOpacity + } + + MoneroComponents.TextBlock { + Layout.fillWidth: true + font.pixelSize: 14 + text: qsTr("Wallet log path: ") + translationManager.emptyString + } + + MoneroComponents.TextBlock { + Layout.fillWidth: true + font.pixelSize: 14 + text: walletLogPath + } + } + } + + Component.onCompleted: { + + } +} From 9872689abeae2a684283e1a8271da1422ed275ac Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 18:26:34 +0200 Subject: [PATCH 13/27] Fixes some javascript errors --- components/InputDialog.qml | 2 +- js/Windows.js | 5 ++--- pages/settings/SettingsLog.qml | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/InputDialog.qml b/components/InputDialog.qml index fd1c3e3d..e51a16db 100644 --- a/components/InputDialog.qml +++ b/components/InputDialog.qml @@ -65,7 +65,7 @@ Item { } ColumnLayout { - z: bg.z + 1 + z: parent.z + 1 id: mainLayout spacing: 10 anchors { fill: parent; margins: 35 } diff --git a/js/Windows.js b/js/Windows.js index be2f503e..435a91de 100644 --- a/js/Windows.js +++ b/js/Windows.js @@ -11,12 +11,11 @@ function setCustomWindowDecorations(custom) { var y = appWindow.y if (x < 0) x = 0 if (y < 0) y = 0 - + // Update persistentSettings persistentSettings.customDecorations = custom; titleBar.visible = custom; - daemonConsolePopup.titleBar.visible = custom; if (custom) { appWindow.flags = flagsCustomDecorations; @@ -25,7 +24,7 @@ function setCustomWindowDecorations(custom) { appWindow.flags = flags; daemonConsolePopup.flags = flags; } - + // Reset window appWindow.hide() appWindow.x = x diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 61b54901..99ba0b95 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -11,7 +11,7 @@ Rectangle { color: "transparent" height: 1400 Layout.fillWidth: true - + ColumnLayout { id: settingsLog property int itemHeight: 60 * scaleRatio @@ -31,7 +31,7 @@ Rectangle { // color: MoneroComponents.Style.dividerColor // opacity: MoneroComponents.Style.dividerOpacity // } - + Text { Layout.bottomMargin: 2 * scaleRatio color: MoneroComponents.Style.defaultFontColor @@ -191,7 +191,6 @@ Rectangle { id: sendCommandText Layout.fillWidth: true fontBold: false - fontFamily: MoneroComponents.Style.fontRegular.name placeholderText: qsTr("command + enter (e.g help)") + translationManager.emptyString placeholderFontSize: 16 * scaleRatio onAccepted: { @@ -207,7 +206,7 @@ Rectangle { Component.onCompleted: { logLevelDropdown.currentIndex = persistentSettings.logLevel; logLevelDropdown.update(); - + if(typeof daemonManager != "undefined") daemonManager.daemonConsoleUpdated.connect(onDaemonConsoleUpdated) } From 951be246b702ac585a7036c019a076e62b930de4 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 18 Jul 2018 18:26:42 +0200 Subject: [PATCH 14/27] Updating qml.qrc --- qml.qrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qml.qrc b/qml.qrc index 591d3760..3b007013 100644 --- a/qml.qrc +++ b/qml.qrc @@ -19,7 +19,6 @@ pages/History.qml pages/AddressBook.qml pages/Mining.qml - pages/Settings.qml components/NetworkStatusItem.qml images/statusConnected.png images/statusDisconnected.png @@ -209,5 +208,16 @@ js/Utils.js components/RadioButton.qml images/editIcon.png + pages/settings/Settings.qml + pages/settings/SettingsWallet.qml + pages/settings/SettingsNode.qml + pages/settings/SettingsLog.qml + pages/settings/SettingsLayout.qml + pages/settings/SettingsInfo.qml + pages/settings/Navbar.qml + images/settings_remote.png + images/settings_navbar_side.png + images/settings_navbar_side_active.png + images/settings_local.png From 46ee2e9cc839f71bc6a7152f4b1c24c69e69f5db Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 12:55:24 +0200 Subject: [PATCH 15/27] Include version.js --- pages/settings/SettingsInfo.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 4c5806e0..98e47cf6 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -3,6 +3,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 import "../../js/Utils.js" as Utils +import "../../version.js" as Version import "../../components" as MoneroComponents From 666203bd0e7fe84abab1704bab08dd5e1a92a142 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 13:13:59 +0200 Subject: [PATCH 16/27] Fixes the wallet creation height dialog --- pages/settings/SettingsInfo.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 98e47cf6..4492babe 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -1,6 +1,7 @@ import QtQuick 2.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 +import QtQuick.Dialogs 1.2 import "../../js/Utils.js" as Utils import "../../version.js" as Version @@ -122,10 +123,12 @@ Rectangle { MoneroComponents.TextBlock { id: restoreHeightText + Layout.fillWidth: true textFormat: Text.RichText font.pixelSize: 14 + font.bold: true property var style: "" - text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" (change)") + translationManager.emptyString + text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" (Click to change)") + translationManager.emptyString onLinkActivated: { inputDialog.labelText = qsTr("Set a new restore height:") + translationManager.emptyString; inputDialog.inputText = currentWallet ? currentWallet.walletCreationHeight : "0"; From 2671cd926c4c86f7967439daceca211ddfaffde3 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 13:16:27 +0200 Subject: [PATCH 17/27] Change text selection color for input dialogs --- components/InputDialog.qml | 2 ++ components/PasswordDialog.qml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/InputDialog.qml b/components/InputDialog.qml index e51a16db..ac56a56b 100644 --- a/components/InputDialog.qml +++ b/components/InputDialog.qml @@ -103,6 +103,8 @@ Item { leftPadding: 10 topPadding: 10 color: MoneroComponents.Style.defaultFontColor + selectionColor: MoneroComponents.Style.dimmedFontColor + selectedTextColor: MoneroComponents.Style.defaultFontColor background: Rectangle { radius: 2 diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml index e8e39e4c..bab1eda2 100644 --- a/components/PasswordDialog.qml +++ b/components/PasswordDialog.qml @@ -108,6 +108,8 @@ Item { leftPadding: 10 topPadding: 10 color: MoneroComponents.Style.defaultFontColor + selectionColor: MoneroComponents.Style.dimmedFontColor + selectedTextColor: MoneroComponents.Style.defaultFontColor background: Rectangle { radius: 2 From eef3f8a3ac5a506a5a0d405ac253185ce6cdd270 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 19:22:59 +0200 Subject: [PATCH 18/27] Lighten up the grey colors a bit --- components/HistoryTableInnerColumn.qml | 4 ++-- components/Style.qml | 1 - pages/settings/SettingsNode.qml | 6 +++--- pages/settings/SettingsWallet.qml | 8 ++++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/components/HistoryTableInnerColumn.qml b/components/HistoryTableInnerColumn.qml index 8a8acbe7..566c2466 100644 --- a/components/HistoryTableInnerColumn.qml +++ b/components/HistoryTableInnerColumn.qml @@ -53,7 +53,7 @@ Rectangle{ font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 * scaleRatio text: labelHeader - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor } Text { @@ -77,7 +77,7 @@ Rectangle{ label2.color = MoneroComponents.Style.defaultFontColor; } onExited: { - label1.color = MoneroComponents.Style.greyFontColor; + label1.color = MoneroComponents.Style.dimmedFontColor label2.color = MoneroComponents.Style.dimmedFontColor; } onClicked: { diff --git a/components/Style.qml b/components/Style.qml index 21a27f7c..bf0a5084 100644 --- a/components/Style.qml +++ b/components/Style.qml @@ -11,7 +11,6 @@ QtObject { property string grey: "#404040" property string defaultFontColor: "white" - property string greyFontColor: "#808080" property string dimmedFontColor: "#BBBBBB" property string inputBoxBackground: "black" property string inputBoxBackgroundError: "#FFDDDD" diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index 58eff891..0bc1f39b 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -92,7 +92,7 @@ Rectangle{ anchors.topMargin: 2 * scaleRatio anchors.left: localNodeIcon.right anchors.leftMargin: 14 * scaleRatio - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 15 * scaleRatio horizontalAlignment: TextInput.AlignLeft @@ -191,7 +191,7 @@ Rectangle{ anchors.topMargin: 2 * scaleRatio anchors.left: remoteNodeIcon.right anchors.leftMargin: 14 * scaleRatio - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 15 * scaleRatio activeFocusOnPress: false @@ -244,7 +244,7 @@ Rectangle{ visible: !isMobile && persistentSettings.useRemoteNode TextArea { - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 15 * scaleRatio horizontalAlignment: TextInput.AlignLeft diff --git a/pages/settings/SettingsWallet.qml b/pages/settings/SettingsWallet.qml index 6536d7c7..242decb2 100644 --- a/pages/settings/SettingsWallet.qml +++ b/pages/settings/SettingsWallet.qml @@ -54,7 +54,7 @@ Rectangle { TextArea { Layout.fillWidth: true - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 * scaleRatio horizontalAlignment: TextInput.AlignLeft @@ -145,7 +145,7 @@ Rectangle { TextArea { Layout.fillWidth: true - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 * scaleRatio horizontalAlignment: TextInput.AlignLeft @@ -236,7 +236,7 @@ Rectangle { TextArea { Layout.fillWidth: true - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 * scaleRatio horizontalAlignment: TextInput.AlignLeft @@ -325,7 +325,7 @@ Rectangle { TextArea { Layout.fillWidth: true - color: MoneroComponents.Style.greyFontColor + color: MoneroComponents.Style.dimmedFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 * scaleRatio horizontalAlignment: TextInput.AlignLeft From 3d7090bdbaaaa8706f4bb7bae10de237743f1fc7 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 19:36:17 +0200 Subject: [PATCH 19/27] Fixes a layout bug for SettingsLog.qml --- pages/settings/SettingsLog.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 99ba0b95..099a07f9 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -41,6 +41,7 @@ Rectangle { } GridLayout { + id: logGrid columns: appWindow.persistentSettings.logLevel === 5 ? 2 : 1 Layout.fillWidth: true columnSpacing: 32 * scaleRatio @@ -77,6 +78,7 @@ Rectangle { appWindow.persistentSettings.logLevel = currentIndex; } Layout.fillWidth: true + Layout.maximumWidth: logGrid.width / 2 shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" releasedColor: "#363636" @@ -88,9 +90,11 @@ Rectangle { id: logCategories visible: persistentSettings.logLevel === 5 Layout.fillWidth: true + Layout.maximumWidth: logGrid.width / 2 text: appWindow.persistentSettings.logCategories placeholderText: "(e.g. *:WARNING,net.p2p:DEBUG)" placeholderFontSize: 14 * scaleRatio + fontSize: 14 * scaleRatio enabled: logLevelDropdown.currentIndex === 5 onEditingFinished: { if(enabled) { @@ -191,7 +195,7 @@ Rectangle { id: sendCommandText Layout.fillWidth: true fontBold: false - placeholderText: qsTr("command + enter (e.g help)") + translationManager.emptyString + placeholderText: qsTr("command + enter (e.g 'help' or 'status')") + translationManager.emptyString placeholderFontSize: 16 * scaleRatio onAccepted: { if(text.length > 0) { From 8eee948f07259f9354559c8bac320ec5a4775270 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 20:29:35 +0200 Subject: [PATCH 20/27] Replace SettingsInfo wallet name with wallet path --- pages/settings/SettingsInfo.qml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 4492babe..8c05ffcb 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -87,13 +87,19 @@ Rectangle { MoneroComponents.TextBlock { Layout.fillWidth: true font.pixelSize: 14 - text: qsTr("Wallet name: ") + translationManager.emptyString + text: qsTr("Wallet path: ") + translationManager.emptyString } MoneroComponents.TextBlock { Layout.fillWidth: true + Layout.maximumWidth: 320 font.pixelSize: 14 - text: walletName + translationManager.emptyString + text: { + var wallet_path = walletPath(); + if(isIOS) + wallet_path = moneroAccountsDir + wallet_path; + return wallet_path; + } } Rectangle { From d5e27ff07d462a907a3d39b47201e83965e3c2b3 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 20:35:46 +0200 Subject: [PATCH 21/27] Copy to clipboard functionality for the Info page --- pages/settings/SettingsInfo.qml | 56 +++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 8c05ffcb..4ae65854 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -21,7 +21,7 @@ Rectangle { anchors.right: parent.right anchors.margins: (isMobile)? 17 : 20 anchors.topMargin: 0 - spacing: 0 + spacing: 30 GridLayout { columns: 2 @@ -92,7 +92,7 @@ Rectangle { MoneroComponents.TextBlock { Layout.fillWidth: true - Layout.maximumWidth: 320 + Layout.maximumWidth: 360 font.pixelSize: 14 text: { var wallet_path = walletPath(); @@ -214,6 +214,58 @@ Rectangle { text: walletLogPath } } + + // Copy info to clipboard + Rectangle { + color: "transparent" + Layout.preferredHeight: 24 * scaleRatio + Layout.fillWidth: true + + Rectangle { + id: rectCopy + color: MoneroComponents.Style.buttonBackgroundColorDisabled + width: btnCopy.width + 40 + height: 24 + radius: 2 + + Text { + id: btnCopy + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 14 * scaleRatio + font.bold: true + text: qsTr("Copy to clipboard") + translationManager.emptyString + } + + MouseArea { + cursorShape: Qt.PointingHandCursor + anchors.fill: parent + onClicked: { + var data = ""; + data += "GUI version: " + Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")"; + data += "\nEmbedded Monero version: " + Version.GUI_MONERO_VERSION; + data += "\nWallet path: "; + + var wallet_path = walletPath(); + if(isIOS) + wallet_path = moneroAccountsDir + wallet_path; + data += wallet_path; + + data += "\nWallet creation height: "; + if(currentWallet) + data += currentWallet.walletCreationHeight; + + data += "\nWallet log path: " + walletLogPath; + + console.log("Copied to clipboard"); + clipboard.setText(data); + appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3); + } + } + } + } } Component.onCompleted: { From 5e3a8958f31111233e6eb86a8a86b23b4167d46a Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 20:41:03 +0200 Subject: [PATCH 22/27] Disable layout options when in mobile mode --- pages/settings/SettingsLayout.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml index d0450945..8b9cc7af 100644 --- a/pages/settings/SettingsLayout.qml +++ b/pages/settings/SettingsLayout.qml @@ -30,6 +30,14 @@ Rectangle { onClicked: Windows.setCustomWindowDecorations(checked) text: qsTr("Custom decorations") + translationManager.emptyString } + + MoneroComponents.TextBlock { + visible: isMobile + font.pixelSize: 14 + textFormat: Text.RichText + Layout.fillWidth: true + text: qsTr("No Layout options exist yet in mobile mode.") + translationManager.emptyString; + } } Component.onCompleted: { From a9fa808dd136f6e95b81badb76dfcee5c18d7a1f Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 20:53:20 +0200 Subject: [PATCH 23/27] Included copyright headers --- pages/settings/SettingsInfo.qml | 28 ++++++++++++++++++++++++++++ pages/settings/SettingsLayout.qml | 28 ++++++++++++++++++++++++++++ pages/settings/SettingsLog.qml | 28 ++++++++++++++++++++++++++++ pages/settings/SettingsNode.qml | 28 ++++++++++++++++++++++++++++ pages/settings/SettingsWallet.qml | 28 ++++++++++++++++++++++++++++ 5 files changed, 140 insertions(+) diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 4ae65854..bd8847e0 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -1,3 +1,31 @@ +// Copyright (c) 2014-2018, 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.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml index 8b9cc7af..4bad9433 100644 --- a/pages/settings/SettingsLayout.qml +++ b/pages/settings/SettingsLayout.qml @@ -1,3 +1,31 @@ +// Copyright (c) 2014-2018, 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.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 099a07f9..6d05d824 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -1,3 +1,31 @@ +// Copyright (c) 2014-2018, 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.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index 0bc1f39b..d14ac4d0 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -1,3 +1,31 @@ +// Copyright (c) 2014-2018, 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.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 diff --git a/pages/settings/SettingsWallet.qml b/pages/settings/SettingsWallet.qml index 242decb2..37cce2e4 100644 --- a/pages/settings/SettingsWallet.qml +++ b/pages/settings/SettingsWallet.qml @@ -1,3 +1,31 @@ +// Copyright (c) 2014-2018, 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.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 From 0fed21d6de9a0b1b12a3512ceb14b160c63f680c Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 22:54:11 +0200 Subject: [PATCH 24/27] Added component WarningBox and added a warning to remote node page --- components/WarningBox.qml | 63 +++++++++++++++++++++++++++++++++ pages/Transfer.qml | 60 ++++++++----------------------- pages/settings/SettingsNode.qml | 24 +++---------- qml.qrc | 1 + 4 files changed, 82 insertions(+), 66 deletions(-) create mode 100644 components/WarningBox.qml diff --git a/components/WarningBox.qml b/components/WarningBox.qml new file mode 100644 index 00000000..9ea868eb --- /dev/null +++ b/components/WarningBox.qml @@ -0,0 +1,63 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 + +import "." as MoneroComponents + +Rectangle { + id: root + property alias text: content.text + property int fontSize: 15 * scaleRatio + + Layout.fillWidth: true + Layout.preferredHeight: warningLayout.height + + color: "#09FFFFFF" + radius: 4 + border.color: MoneroComponents.Style.inputBorderColorInActive + border.width: 1 + + signal linkActivated; + + RowLayout { + id: warningLayout + spacing: 0 + anchors.left: parent.left + anchors.right: parent.right + + Image { + Layout.alignment: Qt.AlignVCenter + Layout.preferredHeight: 33 + Layout.preferredWidth: 33 + Layout.rightMargin: 14 + Layout.leftMargin: 14 + Layout.topMargin: 12 + Layout.bottomMargin: 12 + source: "../images/warning.png" + } + + TextArea { + id: content + Layout.fillWidth: true + color: MoneroComponents.Style.defaultFontColor + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: root.fontSize + horizontalAlignment: TextInput.AlignLeft + selectByMouse: false + textFormat: Text.RichText + wrapMode: Text.WordWrap + textMargin: 0 + leftPadding: 0 + topPadding: 6 + readOnly: true + onLinkActivated: root.linkActivated(); + + // @TODO: Legacy. Remove after Qt 5.8. + // https://stackoverflow.com/questions/41990013 + MouseArea { + anchors.fill: parent + enabled: false + } + } + } +} diff --git a/pages/Transfer.qml b/pages/Transfer.qml index d7f009d8..c398eaf8 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -33,6 +33,7 @@ import moneroComponents.Clipboard 1.0 import moneroComponents.PendingTransaction 1.0 import moneroComponents.Wallet 1.0 import "../components" +import "../components" as MoneroComponents import "." 1.0 @@ -43,6 +44,7 @@ Rectangle { signal sweepUnmixableClicked() color: "transparent" + property string warningContent: "" property string startLinkText: qsTr(" (Start daemon)") + translationManager.emptyString property bool showAdvanced: false @@ -122,47 +124,13 @@ Rectangle { spacing: 30 * scaleRatio - RowLayout{ - visible: warningText.text !== "" + RowLayout { + visible: root.warningContent !== "" - Rectangle { - id: statusRect - Layout.preferredHeight: warningText.height + 40 - Layout.fillWidth: true - - radius: 2 - border.color: Style.inputBorderColorInActive - border.width: 1 - color: "transparent" - - GridLayout{ - Layout.fillWidth: true - Layout.preferredHeight: warningText.height + 40 - - Image { - Layout.alignment: Qt.AlignVCenter - Layout.preferredHeight: 33 - Layout.preferredWidth: 33 - Layout.leftMargin: 10 - Layout.topMargin: 10 - source: "../images/warning.png" - } - - Text { - id: warningText - Layout.topMargin: 12 * scaleRatio - Layout.preferredWidth: statusRect.width - 80 - Layout.leftMargin: 6 - text: qsTr("This page lets you sign/verify a message (or file contents) with your address.") + translationManager.emptyString - wrapMode: Text.Wrap - font.family: Style.fontRegular.name - font.pixelSize: 14 * scaleRatio - color: Style.defaultFontColor - textFormat: Text.RichText - onLinkActivated: { - appWindow.startDaemon(appWindow.persistentSettings.daemonFlags); - } - } + MoneroComponents.WarningBox { + text: warningContent + onLinkActivated: { + appWindow.startDaemon(appWindow.persistentSettings.daemonFlags); } } } @@ -356,7 +324,7 @@ Rectangle { } // There is no warning box displayed - if(warningText.text !== ''){ + if(root.warningContent !== ''){ return false; } @@ -711,7 +679,7 @@ Rectangle { function updateStatus() { pageRoot.enabled = true; if(typeof currentWallet === "undefined") { - warningText.text = qsTr("Wallet is not connected to daemon.") + root.startLinkText + root.warningContent = qsTr("Wallet is not connected to daemon.") + root.startLinkText return; } @@ -723,20 +691,20 @@ Rectangle { switch (currentWallet.connected()) { case Wallet.ConnectionStatus_Disconnected: - warningText.text = qsTr("Wallet is not connected to daemon.") + root.startLinkText + root.warningContent = qsTr("Wallet is not connected to daemon.") + root.startLinkText break case Wallet.ConnectionStatus_WrongVersion: - warningText.text = qsTr("Connected daemon is not compatible with GUI. \n" + + root.warningContent = qsTr("Connected daemon is not compatible with GUI. \n" + "Please upgrade or connect to another daemon") break default: if(!appWindow.daemonSynced){ - warningText.text = qsTr("Waiting on daemon synchronization to finish") + root.warningContent = qsTr("Waiting on daemon synchronization to finish") } else { // everything OK, enable transfer page // Light wallet is always ready pageRoot.enabled = true; - warningText.text = ""; + root.warningContent = ""; } } } diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index d14ac4d0..b5bf6d48 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -271,26 +271,10 @@ Rectangle{ Layout.topMargin: 20 visible: !isMobile && persistentSettings.useRemoteNode - TextArea { - color: MoneroComponents.Style.dimmedFontColor - font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 15 * scaleRatio - horizontalAlignment: TextInput.AlignLeft - text: qsTr("To find a remote node, type 'Monero remote node' into your favorite search engine. Please ensure the node is run by a trusted third party. For more details, view this tutorial.") + translationManager.emptyString - width: parent.width - (remoteNodeIcon.width + remoteNodeIcon.anchors.leftMargin + anchors.leftMargin) - activeFocusOnPress: false - selectByMouse: false - wrapMode: Text.WordWrap - textMargin: 0 - leftPadding: 0 - topPadding: 0 - - // @TODO: Legacy. Remove after Qt 5.8. - // https://stackoverflow.com/questions/41990013 - MouseArea { - anchors.fill: parent - enabled: false - } + MoneroComponents.WarningBox { + Layout.topMargin: 26 * scaleRatio + Layout.bottomMargin: 6 * scaleRatio + text: qsTr("To find a remote node, type 'Monero remote node' into your favorite search engine. Please ensure the node is run by a trusted third-party.") + translationManager.emptyString } MoneroComponents.RemoteNodeEdit { diff --git a/qml.qrc b/qml.qrc index 3b007013..5416a402 100644 --- a/qml.qrc +++ b/qml.qrc @@ -219,5 +219,6 @@ images/settings_navbar_side.png images/settings_navbar_side_active.png images/settings_local.png + components/WarningBox.qml From 39f2b99c7b43a0ad7c04fc60cf80abcd9cee8918 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 23:15:59 +0200 Subject: [PATCH 25/27] Settings alignment and size adjustments --- pages/settings/Navbar.qml | 12 +++++++++++- pages/settings/SettingsNode.qml | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pages/settings/Navbar.qml b/pages/settings/Navbar.qml index 5fc656ad..4f4736f3 100644 --- a/pages/settings/Navbar.qml +++ b/pages/settings/Navbar.qml @@ -58,7 +58,17 @@ Rectangle { property bool fontBold: true property var fontFamily: MoneroComponents.Style.fontRegular.name property string borderColor: "#808080" - property int textMargin: 28 // left-right margins in a given cell + property int textMargin: { + // left-right margins for a given cell + console.log(appWindow.width); + if(isMobile){ + return 18; + } else if(appWindow.width < 890){ + return 40; + } else { + return 64; + } + } Image { Layout.preferredWidth: 2 Layout.preferredHeight: 32 diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index b5bf6d48..0e9bccfb 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -110,14 +110,14 @@ Rectangle{ color: "white" font.bold: true font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 18 * scaleRatio + font.pixelSize: 16 * scaleRatio text: qsTr("Local node") + translationManager.emptyString } TextArea { id: localNodeArea anchors.top: localNodeHeader.bottom - anchors.topMargin: 2 * scaleRatio + anchors.topMargin: 4 * scaleRatio anchors.left: localNodeIcon.right anchors.leftMargin: 14 * scaleRatio color: MoneroComponents.Style.dimmedFontColor @@ -209,14 +209,14 @@ Rectangle{ color: "white" font.bold: true font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 18 * scaleRatio + font.pixelSize: 16 * scaleRatio text: qsTr("Remote node") + translationManager.emptyString } TextArea { id: remoteNodeArea anchors.top: remoteNodeHeader.bottom - anchors.topMargin: 2 * scaleRatio + anchors.topMargin: 4 * scaleRatio anchors.left: remoteNodeIcon.right anchors.leftMargin: 14 * scaleRatio color: MoneroComponents.Style.dimmedFontColor From 0a3d75d197dbc6fd8a5dfd056f3b91cb2d90791b Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 23:54:30 +0200 Subject: [PATCH 26/27] Fixes a particular hard to track bug where ColumnLayout considers MouseArea as part of its height/width after the parent StackView changed state a few times --- pages/settings/Navbar.qml | 85 +++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/pages/settings/Navbar.qml b/pages/settings/Navbar.qml index 4f4736f3..4c1c5d2a 100644 --- a/pages/settings/Navbar.qml +++ b/pages/settings/Navbar.qml @@ -60,11 +60,10 @@ Rectangle { property string borderColor: "#808080" property int textMargin: { // left-right margins for a given cell - console.log(appWindow.width); if(isMobile){ - return 18; + return 10; } else if(appWindow.width < 890){ - return 40; + return 32; } else { return 64; } @@ -109,6 +108,14 @@ Rectangle { text: qsTr("Wallet") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Wallet" } + } } Rectangle { @@ -116,14 +123,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Wallet" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -159,6 +158,14 @@ Rectangle { text: qsTr("Layout") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "UI" } + } } Rectangle { @@ -166,14 +173,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "UI" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -209,6 +208,14 @@ Rectangle { text: qsTr("Node") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Node" } + } } Rectangle { @@ -216,14 +223,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Node" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -259,6 +258,14 @@ Rectangle { text: qsTr("Log") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Log" } + } } Rectangle { @@ -266,14 +273,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Log" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -309,6 +308,14 @@ Rectangle { text: qsTr("Info") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Info" } + } } Rectangle { @@ -316,14 +323,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Info" } - } } Image { Layout.preferredWidth: 2 From 034f83bfb3982bce8203fbda933248810f673868 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Mon, 6 Aug 2018 09:57:13 +0200 Subject: [PATCH 27/27] Fixes a SettingsLog layout bug --- pages/settings/SettingsLog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml index 6d05d824..d43c1dd1 100644 --- a/pages/settings/SettingsLog.qml +++ b/pages/settings/SettingsLog.qml @@ -106,7 +106,7 @@ Rectangle { appWindow.persistentSettings.logLevel = currentIndex; } Layout.fillWidth: true - Layout.maximumWidth: logGrid.width / 2 + Layout.preferredWidth: logGrid.width / 2 shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" releasedColor: "#363636" @@ -118,7 +118,7 @@ Rectangle { id: logCategories visible: persistentSettings.logLevel === 5 Layout.fillWidth: true - Layout.maximumWidth: logGrid.width / 2 + Layout.preferredWidth: logGrid.width / 2 text: appWindow.persistentSettings.logCategories placeholderText: "(e.g. *:WARNING,net.p2p:DEBUG)" placeholderFontSize: 14 * scaleRatio