From a6d75eb32494e757e84f23d78ef71cdf3865163d Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 24 Jul 2017 15:18:28 +0200 Subject: [PATCH 1/6] Add shortcut on sidebar to share RS link --- retroshare-qml-app/src/components/SideBar.qml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index ac901b423..7e7c536fc 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -194,6 +194,26 @@ Drawer ClipboardWrapper.getFromClipBoard(), handleIntentUri); }, + "Share identity": function() + { + rsApi.request( + "/peers/self/certificate/", "", + function(par) + { + var radix = JSON.parse(par.response).data.cert_string + var name = mainWindow.user_name + var encodedName = UriJs.URI.encode(name) + var nodeUrl = ( + "retroshare://certificate?" + + "name=" + encodedName + + "&radix=" + UriJs.URI.encode(radix) + + "&location=" + encodedName ) + ClipboardWrapper.postToClipBoard(nodeUrl) + linkCopiedPopup.itemName = name + linkCopiedPopup.open() + platformGW.shareUrl(nodeUrl); + }) + }, "Terminate Core": function() { rsApi.request("/control/shutdown"); @@ -219,6 +239,12 @@ Drawer icon: "/icons/add.svg" } ListElement + { + title: "Share identity" + showOnCoreReady: true + icon: "/icons/share.svg" + } + ListElement { title: "Terminate Core" showOnOsAndroid: false From 89034d27551616b06585d96ed6ee41d0bf1741b2 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 24 Jul 2017 16:23:32 +0200 Subject: [PATCH 2/6] Add info icon --- retroshare-qml-app/src/icons/info.svg | 60 +++++++++++++++++++++++++++ retroshare-qml-app/src/qml.qrc | 1 + 2 files changed, 61 insertions(+) create mode 100644 retroshare-qml-app/src/icons/info.svg diff --git a/retroshare-qml-app/src/icons/info.svg b/retroshare-qml-app/src/icons/info.svg new file mode 100644 index 000000000..a83e6d67a --- /dev/null +++ b/retroshare-qml-app/src/icons/info.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/retroshare-qml-app/src/qml.qrc b/retroshare-qml-app/src/qml.qrc index bb8c5d51e..bc1534b43 100644 --- a/retroshare-qml-app/src/qml.qrc +++ b/retroshare-qml-app/src/qml.qrc @@ -62,5 +62,6 @@ icons/leave.svg icons/paste.svg icons/share.svg + icons/info.svg From 731a10a6a5c9a4fca841dd4fc990b93d1a123b78 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 24 Jul 2017 16:25:08 +0200 Subject: [PATCH 3/6] Add info tooltip for each option --- retroshare-qml-app/src/AddTrustedNode.qml | 240 +++++++++++++++------- 1 file changed, 163 insertions(+), 77 deletions(-) diff --git a/retroshare-qml-app/src/AddTrustedNode.qml b/retroshare-qml-app/src/AddTrustedNode.qml index f2757aa58..d7913bede 100644 --- a/retroshare-qml-app/src/AddTrustedNode.qml +++ b/retroshare-qml-app/src/AddTrustedNode.qml @@ -27,6 +27,8 @@ Item { property ApplicationWindow mW + property int infoIconHeight: 20 + Column { anchors.fill: parent @@ -62,51 +64,70 @@ Item } } } - - ButtonText + Row { - id: importButton - text: qsTr("Import trusted node") anchors.horizontalCenter: parent.horizontalCenter - iconUrl: "/icons/paste.svg" - fontSize: 14 + spacing: 5 - onClicked: + ButtonIcon { - var cptext = ClipboardWrapper.getFromClipBoard() + height: infoIconHeight + anchors.verticalCenter: importButton.verticalCenter + width: height + imgUrl: "/icons/info.svg" + onClicked: + { + tooltipSpace.show(qsTr("Import a friend certificate from your clipboard.
"+ + "This will add him as trusted node.")) - console.log("typeof(cptext)", typeof(cptext)) - if(cptext.search("://") > 0) - mainWindow.handleIntentUri(cptext) - else - rsApi.request( - "/peers/examine_cert/", - JSON.stringify({cert_string: cptext}), - function(par) - { - console.log("/peers/examine_cert/ CB", - par.response) - var resp = JSON.parse(par.response) - if(resp.returncode === "fail") + } + } + + ButtonText + { + id: importButton + text: qsTr("Import trusted node") +// anchors.horizontalCenter: parent.horizontalCenter + iconUrl: "/icons/paste.svg" + fontSize: 14 + + onClicked: + { + var cptext = ClipboardWrapper.getFromClipBoard() + + console.log("typeof(cptext)", typeof(cptext)) + if(cptext.search("://") > 0) + mainWindow.handleIntentUri(cptext) + else + rsApi.request( + "/peers/examine_cert/", + JSON.stringify({cert_string: cptext}), + function(par) { - importErrorPop.text = resp.debug_msg - importErrorPop.open() - return - } + console.log("/peers/examine_cert/ CB", + par.response) + var resp = JSON.parse(par.response) + if(resp.returncode === "fail") + { + importErrorPop.text = resp.debug_msg + importErrorPop.open() + return + } - var jData = resp.data - stackView.push( - "qrc:/TrustedNodeDetails.qml", - { - nodeCert: cptext, - pgpName: jData.name, - pgpId: jData.pgp_id, - locationName: jData.location, - sslIdTxt: jData.peer_id - } - ) - } - ) + var jData = resp.data + stackView.push( + "qrc:/TrustedNodeDetails.qml", + { + nodeCert: cptext, + pgpName: jData.name, + pgpId: jData.pgp_id, + locationName: jData.location, + sslIdTxt: jData.peer_id + } + ) + } + ) + } } } @@ -139,55 +160,120 @@ Item } } - ButtonText + Row { anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("Export own certificate link") - iconUrl: "/icons/share.svg" - fontSize: 14 - onClicked: + spacing: 5 + + ButtonIcon { - console.log("onClicked", text) - rsApi.request( - "/peers/self/certificate/", "", - function(par) - { - var radix = JSON.parse(par.response).data.cert_string - var name = mainWindow.user_name - var encodedName = UriJs.URI.encode(name) - var nodeUrl = ( - "retroshare://certificate?" + - "name=" + encodedName + - "&radix=" + UriJs.URI.encode(radix) + - "&location=" + encodedName ) - ClipboardWrapper.postToClipBoard(nodeUrl) - linkCopiedPopup.itemName = name - linkCopiedPopup.open() - platformGW.shareUrl(nodeUrl); - }) + height: infoIconHeight + anchors.verticalCenter: btRsCert.verticalCenter + width: height + imgUrl: "/icons/info.svg" + onClicked: + { + tooltipSpace.show(qsTr("Share your RetroShare link!
"+ + "Send it to a friend and start talk!")) + + } + } + + ButtonText + { + id: btRsCert +// anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Export own certificate link") + iconUrl: "/icons/share.svg" + fontSize: 14 + onClicked: + { + console.log("onClicked", text) + rsApi.request( + "/peers/self/certificate/", "", + function(par) + { + var radix = JSON.parse(par.response).data.cert_string + var name = mainWindow.user_name + var encodedName = UriJs.URI.encode(name) + var nodeUrl = ( + "retroshare://certificate?" + + "name=" + encodedName + + "&radix=" + UriJs.URI.encode(radix) + + "&location=" + encodedName ) + ClipboardWrapper.postToClipBoard(nodeUrl) + linkCopiedPopup.itemName = name + linkCopiedPopup.open() + platformGW.shareUrl(nodeUrl); + }) + } } } - ButtonText + Row { + id: plainCertificateRow anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("Export own plain certificate") - fontSize: 14 - iconUrl: "/icons/share.svg" - onClicked: - { - rsApi.request( - "/peers/self/certificate/", "", - function(par) - { - var radix = JSON.parse(par.response).data.cert_string - var name = mainWindow.user_name - ClipboardWrapper.postToClipBoard(radix) + spacing: 5 + visible: false - linkCopiedPopup.itemName = name - linkCopiedPopup.open() - }) + ButtonIcon + { + height: infoIconHeight + anchors.verticalCenter: btPlainCert.verticalCenter + width: height + imgUrl: "/icons/info.svg" + onClicked: + { + tooltipSpace.show(qsTr("This will copy your RetroShare plain certificate.
"+ + "Add it manually to your friend client.")) + + } } + + ButtonText + { + id: btPlainCert + text: qsTr("Export own plain certificate") + fontSize: 14 + iconUrl: "/icons/share.svg" + onClicked: + { + rsApi.request( + "/peers/self/certificate/", "", + function(par) + { + var radix = JSON.parse(par.response).data.cert_string + var name = mainWindow.user_name + ClipboardWrapper.postToClipBoard(radix) + + linkCopiedPopup.itemName = name + linkCopiedPopup.open() + }) + + } + } + } + + + } + + Rectangle + { + id: tooltipSpace + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + + ToolTip + { + id: infoTooltip + timeout: 5000 + Component.onCompleted: show("afafsaf",0) + } + function show (infoText) + { + infoTooltip.text = infoText + infoTooltip.open() } } From 4747e163d50126b0e10b12db661ccd80330ed39f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 24 Jul 2017 16:25:38 +0200 Subject: [PATCH 4/6] Set button to open and close advanced options --- retroshare-qml-app/src/AddTrustedNode.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/retroshare-qml-app/src/AddTrustedNode.qml b/retroshare-qml-app/src/AddTrustedNode.qml index d7913bede..615acc4c0 100644 --- a/retroshare-qml-app/src/AddTrustedNode.qml +++ b/retroshare-qml-app/src/AddTrustedNode.qml @@ -210,6 +210,17 @@ Item } } + ButtonText + { + onClicked: plainCertificateRow.visible = !plainCertificateRow.visible + iconUrl: "/icons/options.svg" + anchors.horizontalCenter: parent.horizontalCenter + color: "white" + borderWidth: 1 + text: qsTr("Advanced") + + } + Row { id: plainCertificateRow From cf91bbbf0bcb1922f647b4b532611760ac316131 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 24 Jul 2017 16:28:04 +0200 Subject: [PATCH 5/6] Change button text to be more specific --- retroshare-qml-app/src/TrustedNodesView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-qml-app/src/TrustedNodesView.qml b/retroshare-qml-app/src/TrustedNodesView.qml index c53cb3bed..b1778d3d4 100644 --- a/retroshare-qml-app/src/TrustedNodesView.qml +++ b/retroshare-qml-app/src/TrustedNodesView.qml @@ -109,7 +109,7 @@ Item ButtonText { id: bottomButton - text: qsTr("Add Trusted Node") + text: qsTr("Add/Share Trusted Node") anchors.bottom: parent.bottom onClicked: stackView.push("qrc:/AddTrustedNode.qml") anchors.horizontalCenter: parent.horizontalCenter From ca1b692a82ebe511c8c6cd9c3e98cdbba29cc616 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Mon, 24 Jul 2017 16:30:40 +0200 Subject: [PATCH 6/6] Delete icon of buttons --- retroshare-qml-app/src/AddTrustedNode.qml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/retroshare-qml-app/src/AddTrustedNode.qml b/retroshare-qml-app/src/AddTrustedNode.qml index 615acc4c0..666265f7d 100644 --- a/retroshare-qml-app/src/AddTrustedNode.qml +++ b/retroshare-qml-app/src/AddTrustedNode.qml @@ -87,8 +87,6 @@ Item { id: importButton text: qsTr("Import trusted node") -// anchors.horizontalCenter: parent.horizontalCenter - iconUrl: "/icons/paste.svg" fontSize: 14 onClicked: @@ -182,9 +180,7 @@ Item ButtonText { id: btRsCert -// anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Export own certificate link") - iconUrl: "/icons/share.svg" fontSize: 14 onClicked: { @@ -247,7 +243,6 @@ Item id: btPlainCert text: qsTr("Export own plain certificate") fontSize: 14 - iconUrl: "/icons/share.svg" onClicked: { rsApi.request(