From 5694dfe23edccdeac0a3fb2fa192cc0d5f0a059d Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 23 Jun 2020 16:42:51 -0700 Subject: [PATCH 1/2] Migrate to new peer authorization levels, add new peer approval workflow, add blocked peers to contact list in seperate section --- qml/widgets/ContactList.qml | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/qml/widgets/ContactList.qml b/qml/widgets/ContactList.qml index 157f9b56..6e5acbca 100644 --- a/qml/widgets/ContactList.qml +++ b/qml/widgets/ContactList.qml @@ -102,11 +102,13 @@ ColumnLayout { target: gcd onAddContact: function(handle, displayName, image, badge, status, authorization, loading, lastMsgTs) { + var model = contactsModel if (authorization == Const.auth_blocked) { model = blockedContactsModel } + for (var i = 0; i < model.count; i++) { if (model.get(i)["_handle"] == handle) { return @@ -184,7 +186,10 @@ ColumnLayout { authorization: _authorization loading: _loading rowColor: (_authorization == Const.auth_unknown) ? Theme.backgroundHilightElementColor : Theme.backgroundMainColor +<<<<<<< HEAD Layout.fillWidth: true +======= +>>>>>>> Migrate to new peer authorization levels, add new peer approval } } @@ -203,6 +208,7 @@ ColumnLayout { onClicked: { blockedToggle.showing = !blockedToggle.showing +<<<<<<< HEAD blockedContacts.visible = blockedToggle.showing if (blockedToggle.showing) { gcd.storeSetting(Const.show_blocked, "true") @@ -269,6 +275,65 @@ ColumnLayout { blockedToggle.showing = (_showBlocked == "true") blockedContacts.visible = (_showBlocked == "true") } +======= + if (blockedToggle.showing) { + hideBlocked.stop() + openBlocked.start() + } else { + openBlocked.stop() + hideBlocked.start() + } + } + + SequentialAnimation { id: openBlocked + PropertyAnimation {target: blockedContacts; property: "implicitHeight"; to: blockedContacts.childrenRect.height; duration: 100 } + PropertyAnimation {target: sv; property: "contentY"; to: sv.contentY + (40 * logscale); duration: 200} + } + + PropertyAnimation { id: hideBlocked; target: blockedContacts; property: "implicitHeight"; to: 0; duration: 200 } + + onEntered: { + blockedBG.color = Theme.backgroundPaneColor + } + + onExited: { + blockedBG.color = Theme.backgroundMainColor + } + } + + Rectangle { + id: blockedBG + property bool isHover: false + + anchors.fill: blockItem + color: Theme.backgroundMainColor + } + + Row { + id: blockedToggle + property bool showing: true + + leftPadding: 32 * logscale + topPadding: 16 * logscale + bottomPadding: 8 * logscale + spacing: 5 * logscale + + Opaque.ScalingLabel { + id: blockLbl + + text: qsTr("blocked") + size: Theme.chatMetaTextSize + color: Theme.portraitBlockedTextColor + } + + Opaque.ScalingLabel { + id: blockBtn + + text: blockedToggle.showing ? "▲" : "▼" + size: Theme.chatMetaTextSize + color: Theme.portraitBlockedTextColor + } +>>>>>>> Migrate to new peer authorization levels, add new peer approval } } @@ -277,10 +342,22 @@ ColumnLayout { id: blockedContactsModel } +<<<<<<< HEAD ColumnLayout { id: blockedContacts Layout.fillWidth: true spacing: 0 +======= + Item { + id: blockedContacts + + anchors.left: parent.left + anchors.right: parent.right + height: childrenRect.height + implicitHeight: childrenRect.height + + property real logscale: 4 * Math.log10(gcd.themeScale + 1) +>>>>>>> Migrate to new peer authorization levels, add new peer approval Repeater { id: blockedContactsRepeater @@ -293,7 +370,11 @@ ColumnLayout { status: _status authorization: _authorization loading: _loading +<<<<<<< HEAD Layout.fillWidth: true +======= + rowColor: Theme.backgroundHilightElementColor +>>>>>>> Migrate to new peer authorization levels, add new peer approval } } } From 66676076e947c9232f4e0e91ba3e30227e110150 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 7 Jul 2020 13:57:38 -0700 Subject: [PATCH 2/2] Fixes on List Overlay. Connection Error Sketch.Peer Save --- assets/core/negative_heart_24px.svg | 13 +++ go.mod | 7 +- go.sum | 6 ++ go/ui/gcd.go | 22 +++- i18n/translation_de.qm | Bin 3612 -> 3327 bytes i18n/translation_de.ts | 61 ++++++++--- i18n/translation_en.qm | Bin 7019 -> 7486 bytes i18n/translation_en.ts | 58 +++++++---- i18n/translation_fr.qm | Bin 3566 -> 3263 bytes i18n/translation_fr.ts | 61 ++++++++--- i18n/translation_pt.qm | Bin 3386 -> 3113 bytes i18n/translation_pt.ts | 61 ++++++++--- qml/overlays/ListOverlay.qml | 150 +++++++++++++--------------- qml/panes/PeerSettingsPane.qml | 42 +++++++- qml/widgets/ContactList.qml | 81 --------------- 15 files changed, 335 insertions(+), 227 deletions(-) create mode 100644 assets/core/negative_heart_24px.svg diff --git a/assets/core/negative_heart_24px.svg b/assets/core/negative_heart_24px.svg new file mode 100644 index 00000000..05f00c83 --- /dev/null +++ b/assets/core/negative_heart_24px.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/go.mod b/go.mod index c53c6bc6..cd49716d 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,12 @@ module cwtch.im/ui go 1.12 require ( - cwtch.im/cwtch v0.3.15 - git.openprivacy.ca/openprivacy/connectivity v1.1.4 + cwtch.im/cwtch v0.3.16 + git.openprivacy.ca/openprivacy/connectivity v1.2.0 git.openprivacy.ca/openprivacy/log v1.0.1 github.com/gopherjs/gopherjs v0.0.0-20200209183636-89e6cbcd0b6d // indirect github.com/therecipe/qt v0.0.0-20200126204426-5074eb6d8c41 github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20200126204426-5074eb6d8c41 // indirect github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200126204426-5074eb6d8c41 // indirect golang.org/x/crypto v0.0.0-20200420104511-884d27f42877 // indirect -) - +) \ No newline at end of file diff --git a/go.sum b/go.sum index e6e5746f..12bdad00 100644 --- a/go.sum +++ b/go.sum @@ -21,6 +21,8 @@ git.openprivacy.ca/openprivacy/connectivity v1.1.3 h1:iRGHS8RB4SZ9cjYK/yXt4R8PqQ git.openprivacy.ca/openprivacy/connectivity v1.1.3/go.mod h1:4P8mirZZslKbo2zBrXXVjgEdqGwHo/6qoFBwFQW6d6E= git.openprivacy.ca/openprivacy/connectivity v1.1.4 h1:/I9epvNNjM8rR/q5y9Y63D9/aPXpBFvngwNGLD8mvUk= git.openprivacy.ca/openprivacy/connectivity v1.1.4/go.mod h1:4P8mirZZslKbo2zBrXXVjgEdqGwHo/6qoFBwFQW6d6E= +git.openprivacy.ca/openprivacy/connectivity v1.2.0 h1:dbZ5CRl11vg3BNHdzRKSlDP8OUtDB+mf6FkxMVf73qw= +git.openprivacy.ca/openprivacy/connectivity v1.2.0/go.mod h1:B7vzuVmChJtSKoh0ezph5vu6DQ0gIk0zHUNG6IgXCcA= git.openprivacy.ca/openprivacy/libricochet-go v1.0.11 h1:C7QFFzG0p5XKu0zcOIdLGwEpA9uU0BceBM7CfVK5D40= git.openprivacy.ca/openprivacy/libricochet-go v1.0.11/go.mod h1:yTMps/ZpYS+BNBBvANsNAft28FXrBvFHQauMYNWPrwE= git.openprivacy.ca/openprivacy/libricochet-go v1.0.13 h1:Z86uL9K47onznY1wP1P/wWfWMbbyvk6xnCp94R180os= @@ -32,6 +34,7 @@ git.openprivacy.ca/openprivacy/log v1.0.1/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQN github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/c-bata/go-prompt v0.2.3/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cretz/bine v0.1.1-0.20200124154328-f9f678b84cca h1:Q2r7AxHdJwWfLtBZwvW621M3sPqxPc6ITv2j1FGsYpw= github.com/cretz/bine v0.1.1-0.20200124154328-f9f678b84cca/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw= @@ -49,6 +52,7 @@ github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de h1:F7WD09S8QB4Lr github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200209183636-89e6cbcd0b6d h1:vr95xIx8Eg3vCzZPxY3rCwTfkjqNDt/FgVqTOk0WByk= github.com/gopherjs/gopherjs v0.0.0-20200209183636-89e6cbcd0b6d/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= @@ -63,6 +67,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -159,6 +164,7 @@ golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200420001825-978e26b7c37c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200625195345-7480c7b4547d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go/ui/gcd.go b/go/ui/gcd.go index f70ae3e0..e6b4b229 100644 --- a/go/ui/gcd.go +++ b/go/ui/gcd.go @@ -79,7 +79,7 @@ type GrandCentralDispatcher struct { _ func(str string) `signal:"InvokePopup"` _ func(locale string, zoom float32, theme string) `signal:"SupplySettings"` _ func(groupID, name, server, invitation string, accepted bool, addrbooknames, addrbookaddrs []string) `signal:"SupplyGroupSettings"` - _ func(onion, nick string, authorization string) `signal:"SupplyPeerSettings"` + _ func(onion, nick string, authorization string, storage string) `signal:"SupplyPeerSettings"` // signals emitted from the ui (written in go, below) // ui @@ -113,6 +113,8 @@ type GrandCentralDispatcher struct { _ func(onion string) `signal:"deleteContact,auto"` _ func() `signal:"allowUnknownPeers,auto"` _ func() `signal:"blockUnknownPeers,auto"` + _ func(onion string) `signal:"storeHistoryForPeer,auto"` + _ func(onion string) `signal:"deleteHistoryForPeer,auto"` _ func() `constructor:"init"` } @@ -339,7 +341,7 @@ func (this *GrandCentralDispatcher) requestPeerSettings() { contact := the.Peer.GetContact(this.SelectedConversation()) if contact == nil { log.Errorf("error: requested settings for unknown contact %v?", this.SelectedConversation()) - this.SupplyPeerSettings(this.SelectedConversation(), this.SelectedConversation(), string(contact.Authorization)) + this.SupplyPeerSettings(this.SelectedConversation(), this.SelectedConversation(), string(contact.Authorization), "") return } @@ -348,7 +350,13 @@ func (this *GrandCentralDispatcher) requestPeerSettings() { // Todo: Move to profile settings //blockunkownpeers, _ := the.Peer.GetAttribute(attr.GetPeerScope(constants.BlockUnknownPeersSetting)) - this.SupplyPeerSettings(contact.Onion, name, string(contact.Authorization)) + // Whether Cwtch should save the history of the peer + saveHistory,exists := contact.GetAttribute(event.SaveHistoryKey) + if !exists { + saveHistory = event.DeleteHistoryDefault + } + + this.SupplyPeerSettings(contact.Onion, name, string(contact.Authorization), saveHistory) } func (this *GrandCentralDispatcher) savePeerSettings(onion, nick string) { @@ -356,6 +364,14 @@ func (this *GrandCentralDispatcher) savePeerSettings(onion, nick string) { this.UpdateContactDisplayName(onion, nick) } +func (this *GrandCentralDispatcher) storeHistoryForPeer(onion string) { + the.Peer.SetContactAttribute(onion, event.SaveHistoryKey, event.SaveHistoryConfirmed) +} + +func (this *GrandCentralDispatcher) deleteHistoryForPeer(onion string) { + the.Peer.SetContactAttribute(onion, event.SaveHistoryKey, event.DeleteHistoryConfirmed) +} + func (this *GrandCentralDispatcher) requestGroupSettings(groupID string) { group := the.Peer.GetGroup(groupID) diff --git a/i18n/translation_de.qm b/i18n/translation_de.qm index c442202fe493f0294ce6eb77dab3b47b50cb7630..c40eed580cb94cdd9f046a194d9407b5ce96c27d 100644 GIT binary patch delta 264 zcmbOu^Ivj;h@}LB*zFt!1{OAkg*J5z49v$E*-rdnU|{cM)Y-j;fq^lCaqVRtpm-hQ zR^}K61`Z|Wm0xNY7&x0J`pVU_yk@;veuja8yPK`Xo{xcnX&Z#*a$@_w7s%&4%syQ- z52$NCM>n?+0|VQ3juUovK-+R5G`BDpPx@2_1_paBvzb8Kxb|>usp|vU{)lUv*E*nn zKJJum2O!^^yZA#6P=7g($n`fs^<7|k;x9pSu6mw>e?U$M;!W%Z8qMj3zbcz69 nj37{)k&7>J{X3u*2EKNCpghODOrYXpo4pv{v23H@YbM^6lj3gSIrsZlLj8 z9=umQ?*grPJ(-tLj-B&yCQ$D5W+TRTEIbSf3_c8*48;s345^djnZ@ckfYvgw0Woi4 zN{VhyW^svbW=U!;J5Yq%2gvg;OD)PttYl;c3Rp4tF{Cn-0&y|2IShF~ksKh-1>!uQ z$qEb^Ks)jnsu=z-q%ov}MB&!(fUL<&Er;5YfW;ampw@hbWS}7mKqE?lWGX`u*n$+G gv8cugl;o%6>lWlBCZ}fP=cJ?-p*wuD4BKNi0K#2(Z~y=R diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 5e0ea234..42e5eb7e 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -114,22 +114,35 @@ ListOverlay - add-list-item Add a New List Item - Liste hinzufügen + Liste hinzufügen - add-new-item Add a new item to the list - Neues Listenelement hinzüfgen + Neues Listenelement hinzüfgen - todo-placeholder Todo... placeholder text - noch zu erledigen + noch zu erledigen + + + + search-list + ex: "... paste an address here to add a contact ..." + + + + + peer-not-online + + + + + add-list-item-btn + @@ -232,38 +245,60 @@ PeerSettingsPane - + address-label Adresse - + copy-btn Kopieren - + copied-to-clipboard-notification notification: copied to clipboard in die Zwischenablage kopiert - + display-name-label Angezeigter Name - + save-btn speichern - + + + save-peer-history + Save Peer History + + + + + save-peer-history-description + + + + + dont-save-peer-history-default + + + + + dont-save-peer-history + + + + delete-btn löschen - + block-btn diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index 295db41bb087d625d60951b6ace442ed548469fa..8d7495038de9278e0841208028a598dd2c863efc 100644 GIT binary patch delta 1230 zcma)3e`u6-9Dd%r-QD}^?sn(xwzgu2loazOf!iOVOUuY?>A+AC6JGD$d9U5xJKy(p zV_>^A`X@(G9U^8)QzVtSqU!<~E+m5)HmF5OMiCAyHfm9!!a$$*4%Q(5h%fK^@cI3G zp3iLi#F{r_g+WB}Wx%%#@#|Tj#)px$1AzC6;GbLo#Cl=n_$VN37hc)z1L{u-qb=V8 zp>g5-^h)LxgtB)x^9~D>zfJ+mW<9H;jK@xSc5d7OJh0wVyvF+IX>ZH^(?H`M@2mdj zfQCBn*}o3~9_f#_UT-e^>1%3gW7aO;iLMiXyvp}=-&Icg!GGw95VJn7qWq)()RA>5XRYKMUM`^4Xg8R9?0R%xjIVd6Du zdXD~@Z=~5Xw0$4R-l+%&4an-gBLLRPkG%5}puQ%zAEOLPr##x-2}CC3PX^wgY+K|{ zH;!N(Zw}5d$2N}{U zoGhm9L#7gQbNbM_$S<7Nbt`G+oMg_-8m4|S4Cp?|SOJe@P0q^thbg#|S=!i2Ul{qQ- z(@+$Hm>GsjPt+eXtjG`xG)yRaK}7fntt5mB(-hivL+B$8=d5$i-e<41_UT&vCF6oU z=!WB+7l<&RaZLrl^)Y3!s9F8RncAhwx1!*2x~`?y=*%K=k2H^G+z7wZ=V zdkk@LPD;IMXxP~Rh>YQRSwE%5^X2Qz0NbOZ*v3yiq_dc1JX%O`Y06j|T}%>2j2$@v zqJZ&P-0LT_d! z_28h6Qjy8oNM4wqrmDy)!2Xf&D`6|)4?@4GDrPwmEH!m@4g-d2ksGiQL60aOt^u%C z%%~&p(lW87Fqe#R;+=}~Bs4+1n?nLjyTqp=#pOD2>fR`Vu%?MK6?0T*g`|eold@LH zKj{VdIqBvkOU-1ZQ5!k1UXtx^CWzpyj+|3=lq8blZ*o%&5wO!biX(EzWGrC0B6rXB zli*c~#otArSFdcV-Aux-E3Ob3HdQO3#xZJeK#~F?;(*G%0{I{e>FGM8+@cmic6giLp zug ListOverlay - - add-list-item - Add a New List Item - Add a New List Item + + search-list + ex: "... paste an address here to add a contact ..." + Search List - - add-new-item - Add a new item to the list - Add a new item to the list + + peer-not-online + Peer is Offline. Applications cannot be used right now. - - todo-placeholder - Todo... placeholder text - Todo... + + add-list-item-btn + Add Item @@ -327,42 +325,64 @@ Right-click to reset. PeerSettingsPane - + address-label Address - + copy-btn Copy - + copied-to-clipboard-notification notification: copied to clipboard Copied to Clipboard - + display-name-label Display Name - + save-btn Save - + block-btn Block Peer + + + + save-peer-history + Save Peer History + Save Peer History + + + + save-peer-history-description + Determines whether or not to delete any history associated with the peer. + + + + dont-save-peer-history-default + + + + + dont-save-peer-history + Delete Peer History + unblock-btn Unblock Peer - + delete-btn Delete diff --git a/i18n/translation_fr.qm b/i18n/translation_fr.qm index 3026fc599c3daacbcf66653e6860b66e9e8a702e..3b814608bc1ff67a5fe2561ac073ec5988d8cab3 100644 GIT binary patch delta 264 zcmaDSy&X)Y-j;fq^lKaqVRtpm-hQ zR^}L>_ygvZUuqZ_I3p+e%GI;HWxZH_hJk_Go2|y4kAZ<{8-(T(Vf(%p$mg8NK3z1A zfq^5RqnlfZfq`u{#|b+-plz8Dn(HhVPx@2_1_o;`vzb8KxVpHu)b#;vS-`c;YaLME zGwzgb2Oyu9yZA#6P=73s$n`fs^*vyE;x9pSE?=I5e?U$U;7#lX8qF!qXA>3zbcz69 nj37{)k%cdD{X3u*2EKNCpghOAOrYYn&0dTjST+Z;&t(Gu8Aw9| delta 529 zcmaKnPbdUo7{;G5Yi4%-NU{pG?Lj%%mG+=SiyI<$xePNHjoEE?5NY=2vL%w_;IK!9 z=^L_98d%la>*ZSq^wieVpn1Dw{y2An3 z48vuLfH2Pl&$a<(h}pRdlI}1^>@evCcI#~c5MwI?{v_uqzn#4SoAl zS2(9y+~e1M7T{eJQc@Mb?+ckoglNWBmY%(*r%yonr6`ZD0caOnH;5{w#Y1O_XeZ)v z-!Ao+#CNAe@A@Sz)kS)Pl*pT4!P_fYf1RYsS4G!GqoSs0yckyQd$WXjSydQ6@4YtY zZu20_ ListOverlay - add-list-item Add a New List Item - Ajouter un nouvel élément + Ajouter un nouvel élément - add-new-item Add a new item to the list - Ajouter un nouvel élément à la liste + Ajouter un nouvel élément à la liste - todo-placeholder Todo... placeholder text - A faire... + A faire... + + + + search-list + ex: "... paste an address here to add a contact ..." + + + + + peer-not-online + + + + + add-list-item-btn + @@ -232,38 +245,60 @@ PeerSettingsPane - + address-label Adresse - + copy-btn Copier - + copied-to-clipboard-notification notification: copied to clipboard Copié dans le presse-papier - + display-name-label Pseudo - + save-btn Sauvegarder - + + + save-peer-history + Save Peer History + + + + + save-peer-history-description + + + + + dont-save-peer-history-default + + + + + dont-save-peer-history + + + + delete-btn Effacer - + block-btn diff --git a/i18n/translation_pt.qm b/i18n/translation_pt.qm index 39f9c4bdb09fd3d13dd067a7ca57e7d71184fe5d..b6c2805f8590eb340d01e82b038ec2d113e87bc7 100644 GIT binary patch delta 264 zcmdlbwNhe&h@}LB*zFt!2Idb83vKFv^ae(@6Mq;O*f|+>cCTSzU`$|Kdszo4p2N76 zIR+@+z`XKH4Fdzm&56Ep^(-e@FP5KSVBp%wR%6e{z`(QwLUZP^ecub@b4s&M7tI6e z`pMDFEyTdU7RYhJ&W?eB#TP)^f3{Es|E6{J5O9`~!-UbIhr;bF?j*)^_7=B@4+N z<%W>*Bay-twHxG0E4g#Gq?9O+)Nahh)AK&x=Y77P?^fGs`(kr%7g`@JK&W7&FGqc! ziPxWiT*m@uI{+JJyY~UoEp{Y~lAaN^-m-vlSB!b{t}EB=Yza`e#q2->P`CNpd0c!y zr;8VAKK9$y9_8fZ8F0;WcYFmvn1|Mg%FFyPw?KDcemuNK zv@!mX`=Wmxs$Li*p9?iru^>Q_i)C*+Uw2=A{=`Ulv;x^H%btfwnJ_m?9_E#lPLp;o z2i>expGN>g&|zYN%7G0HN%#;!8U_;ddZLQbE=7taQznR19!=MSmYGTi&9sq_NKvCS zjm#KHOUp2UgiuXmn;3+nD_y(LjhvN<2qdlRkenU1QqOo#3>k UO&C*-r5njw0U4+313~nQ-yg?z#Q*>R diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index 0f7938bc..7f3910f1 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -114,22 +114,35 @@ ListOverlay - add-list-item Add a New List Item - Adicionar Item à Lista + Adicionar Item à Lista - add-new-item Add a new item to the list - Adicionar novo item à lista + Adicionar novo item à lista - todo-placeholder Todo... placeholder text - Afazer… + Afazer… + + + + search-list + ex: "... paste an address here to add a contact ..." + + + + + peer-not-online + + + + + add-list-item-btn + @@ -232,38 +245,60 @@ PeerSettingsPane - + address-label Endereço - + copy-btn Copiar - + copied-to-clipboard-notification notification: copied to clipboard Copiado - + display-name-label Nome de Exibição - + save-btn Salvar - + + + save-peer-history + Save Peer History + + + + + save-peer-history-description + + + + + dont-save-peer-history-default + + + + + dont-save-peer-history + + + + delete-btn Deletar - + block-btn diff --git a/qml/overlays/ListOverlay.qml b/qml/overlays/ListOverlay.qml index 0ed706ce..444f9696 100644 --- a/qml/overlays/ListOverlay.qml +++ b/qml/overlays/ListOverlay.qml @@ -10,38 +10,65 @@ import "../opaque/controls" as Awesome import "../opaque/fonts/Twemoji.js" as T import "../utils.js" as Utils import "../opaque/styles" +import "../opaque/theme" ColumnLayout { Layout.fillWidth: true width:parent.width + id: listpanel + property bool online: false Text { Layout.fillWidth: true } - TextField { + Opaque.IconTextField { id: filter - - placeholderText: "Search.." - - style: CwtchTextFieldStyle{} - + visible:listpanel.online anchors.left: parent.left anchors.right: parent.right - anchors.margins: 10 + //: ex: "... paste an address here to add a contact ..." + placeholderText: qsTr("search-list") + horizontalAlignment: TextInput.AlignHCenter + icon: gcd.assetPath + "core/search-24px.svg" + + onTextChanged: { - bulletinView.filter = text - if (bulletinView.model.get(bulletinView.currentIndex).title.indexOf(text) == -1) { - bulletinView.currentIndex = -1 + listView.filter = text + if (listView.model.get(listView.currentIndex).title.indexOf(text) == -1) { + listView.currentIndex = -1 } } } + + + Opaque.Icon { + visible:!listpanel.online + source: gcd.assetPath + "core/negative_heart_24px.svg" + iconColor: Theme.mainTextColor + backgroundColor: Theme.backgroundPaneColor + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + height: 150 + width: 150 + } + Opaque.EllipsisLabel { + visible:!listpanel.online + color: Theme.mainTextColor + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + size: 18 * gcd.themeScale + text: qsTr("peer-not-online") + } + + + + Flickable { // THE MESSAGE LIST ITSELF id: sv clip: true + visible:listpanel.online Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.fillHeight: true Layout.fillWidth: true @@ -87,25 +114,22 @@ ColumnLayout { }) } - /*if(msg.c != undefined) { - jsonModel4.get(msg.c).complete = true + if(msg.c != undefined) { + jsonModel4.get(msg.c).complete = true } - - if (sv.contentY + sv.height >= sv.contentHeight - colMessages.height && sv.contentHeight > sv.height) { - sv.contentY = sv.contentHeight - sv.height - }*/ } onUpdateContactStatus: function(_handle, _status, _loading) { if (gcd.selectedConversation == _handle) { - if (_loading == true) { - newposttitle.enabled = false - btnSend.enabled = false - } else { - newposttitle.enabled = true - btnSend.enabled = true - } + // Group is Synced OR p2p is Authenticated + if ( (_handle.length == 32 && _status == 4) || (_handle.length == 56 && _status == 3) ) { + newlistitem.readOnly = false + listpanel.online = true + } else { + newlistitem.readOnly = true + listpanel.online= false + } } } } @@ -115,7 +139,7 @@ ColumnLayout { } ListView { - id: bulletinView + id: listView anchors.left: parent.left anchors.leftMargin: 10 anchors.topMargin: 10 @@ -130,8 +154,8 @@ ColumnLayout { Item { width: parent.width - height: title.indexOf(bulletinView.filter) >= 0 ? texttitle.height : 0 - visible: title.indexOf(bulletinView.filter) >= 0 + height: title.indexOf(listView.filter) >= 0 ? texttitle.height : 0 + visible: title.indexOf(listView.filter) >= 0 Column { width: parent.width @@ -141,31 +165,24 @@ ColumnLayout { checked: complete onClicked: { var msg = JSON.stringify({"o":4, "c":index}) - gcd.sendMessage(msg, btnSend.nextMessageID++) + gcd.sendMessage(msg, newlistitem.nextMessageID++) } } RowLayout { Text { id: texttitle - text: '' + Utils.htmlEscaped(title) + ' by ' + from + "
" + timestamp + text: '' + Utils.htmlEscaped(title) + ' by ' + displayName + "
" + timestamp leftPadding: 10 topPadding: 5 bottomPadding:5 - color: windowItem.cwtch_dark_color + color: Theme.mainTextColor } } } - Rectangle { - height: 1 - color: windowItem.cwtch_color - anchors { - left: parent.left - right: parent.right - } - } + Opaque.HLine{} } @@ -179,55 +196,28 @@ ColumnLayout { } } - GroupBox { - //: Add a New List Item - title: qsTr("add-list-item") - Layout.fillWidth: true + Opaque.ButtonTextField { + id: newlistitem + visible:listpanel.online + readOnly: false + button_text: qsTr("add-list-item-btn") + dropShadowColor: Theme.dropShadowPaneColor + property int nextMessageID: 1 + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 10 - RowLayout { - Layout.fillWidth: true - width: parent.width - ColumnLayout { - Layout.fillWidth: true - - - Text { - //: Add a new item to the list - text: qsTr("add-new-item") - } - - TextField { - id: newposttitle - //: Todo... placeholder text - placeholderText: qsTr("todo-placeholder") - Layout.fillWidth: true - style: CwtchTextFieldStyle{} - } - - Opaque.Button { // SEND MESSAGE BUTTON - id: btnSend - icon: "regular/paper-plane" - text: "add" - anchors.right: parent.right - anchors.rightMargin: 2 - - property int nextMessageID: 1 - - onClicked: { - if (newposttitle.text != "") { - var msg = JSON.stringify({"o":4, "t":newposttitle.text}) - gcd.sendMessage(msg, nextMessageID++) - } - newposttitle.text = "" - } + onClicked: { + if (newlistitem.text != "") { + var msg = JSON.stringify({"o":4, "t":newlistitem.text}) + gcd.sendMessage(msg, nextMessageID++) } + newlistitem.text = "" } - } } - - + Opaque.HLine{} diff --git a/qml/panes/PeerSettingsPane.qml b/qml/panes/PeerSettingsPane.qml index dffded18..9bd3e755 100644 --- a/qml/panes/PeerSettingsPane.qml +++ b/qml/panes/PeerSettingsPane.qml @@ -17,6 +17,7 @@ Opaque.SettingsList { // settingsPane anchors.fill: parent property string authorization + property string saveHistory settings: Column { anchors.fill: parent @@ -84,6 +85,34 @@ Opaque.SettingsList { // settingsPane } } + Opaque.Setting { + //: Save Peer History + label: qsTr("save-peer-history") + description: qsTr("save-peer-history-description") + field: Opaque.ComboBox { + id: cbSaveHistory + anchors.right: parent.right + anchors.left: parent.left + + model: ListModel { + id: cbSaveHistoryItems + ListElement { text: qsTr("dont-save-peer-history"); value: "DeleteHistoryConfirmed" } + ListElement { text: qsTr("save-peer-history"); value: "SaveHistory" } + } + + onActivated: { + var item = cbSaveHistoryItems.get(cbSaveHistory.currentIndex) + if (item["value"] == "SaveHistory") { + gcd.storeHistoryForPeer(txtOnion.text) + } else { + gcd.deleteHistoryForPeer(txtOnion.text) + } + } + + } + } + + Column { width:parent.width * 0.95 anchors.horizontalCenter: parent.horizontalCenter @@ -106,10 +135,21 @@ Opaque.SettingsList { // settingsPane Connections { target: gcd - onSupplyPeerSettings: function(onion, nick, authorization) { + onSupplyPeerSettings: function(onion, nick, authorization, saveHistory) { txtOnion.text = onion txtDisplayName.text = nick root.authorization = authorization + root.saveHistory = saveHistory + + // This will not set the value in the default case where saveHistory = DefaultDeleteHistory and thus + // the combobox will default to showing DeleteHistoryConfirmed + for (var i=0; i < cbSaveHistoryItems.count; i++) { + var item = cbSaveHistoryItems.get(i) + if (item["value"] == root.saveHistory || (root.saveHistory == "DefaultDeleteHistory" && item["value"] == "DeleteHistoryConfirmed")) { + cbSaveHistory.currentIndex = i + break + } + } } } diff --git a/qml/widgets/ContactList.qml b/qml/widgets/ContactList.qml index 6e5acbca..157f9b56 100644 --- a/qml/widgets/ContactList.qml +++ b/qml/widgets/ContactList.qml @@ -102,13 +102,11 @@ ColumnLayout { target: gcd onAddContact: function(handle, displayName, image, badge, status, authorization, loading, lastMsgTs) { - var model = contactsModel if (authorization == Const.auth_blocked) { model = blockedContactsModel } - for (var i = 0; i < model.count; i++) { if (model.get(i)["_handle"] == handle) { return @@ -186,10 +184,7 @@ ColumnLayout { authorization: _authorization loading: _loading rowColor: (_authorization == Const.auth_unknown) ? Theme.backgroundHilightElementColor : Theme.backgroundMainColor -<<<<<<< HEAD Layout.fillWidth: true -======= ->>>>>>> Migrate to new peer authorization levels, add new peer approval } } @@ -208,7 +203,6 @@ ColumnLayout { onClicked: { blockedToggle.showing = !blockedToggle.showing -<<<<<<< HEAD blockedContacts.visible = blockedToggle.showing if (blockedToggle.showing) { gcd.storeSetting(Const.show_blocked, "true") @@ -275,65 +269,6 @@ ColumnLayout { blockedToggle.showing = (_showBlocked == "true") blockedContacts.visible = (_showBlocked == "true") } -======= - if (blockedToggle.showing) { - hideBlocked.stop() - openBlocked.start() - } else { - openBlocked.stop() - hideBlocked.start() - } - } - - SequentialAnimation { id: openBlocked - PropertyAnimation {target: blockedContacts; property: "implicitHeight"; to: blockedContacts.childrenRect.height; duration: 100 } - PropertyAnimation {target: sv; property: "contentY"; to: sv.contentY + (40 * logscale); duration: 200} - } - - PropertyAnimation { id: hideBlocked; target: blockedContacts; property: "implicitHeight"; to: 0; duration: 200 } - - onEntered: { - blockedBG.color = Theme.backgroundPaneColor - } - - onExited: { - blockedBG.color = Theme.backgroundMainColor - } - } - - Rectangle { - id: blockedBG - property bool isHover: false - - anchors.fill: blockItem - color: Theme.backgroundMainColor - } - - Row { - id: blockedToggle - property bool showing: true - - leftPadding: 32 * logscale - topPadding: 16 * logscale - bottomPadding: 8 * logscale - spacing: 5 * logscale - - Opaque.ScalingLabel { - id: blockLbl - - text: qsTr("blocked") - size: Theme.chatMetaTextSize - color: Theme.portraitBlockedTextColor - } - - Opaque.ScalingLabel { - id: blockBtn - - text: blockedToggle.showing ? "▲" : "▼" - size: Theme.chatMetaTextSize - color: Theme.portraitBlockedTextColor - } ->>>>>>> Migrate to new peer authorization levels, add new peer approval } } @@ -342,22 +277,10 @@ ColumnLayout { id: blockedContactsModel } -<<<<<<< HEAD ColumnLayout { id: blockedContacts Layout.fillWidth: true spacing: 0 -======= - Item { - id: blockedContacts - - anchors.left: parent.left - anchors.right: parent.right - height: childrenRect.height - implicitHeight: childrenRect.height - - property real logscale: 4 * Math.log10(gcd.themeScale + 1) ->>>>>>> Migrate to new peer authorization levels, add new peer approval Repeater { id: blockedContactsRepeater @@ -370,11 +293,7 @@ ColumnLayout { status: _status authorization: _authorization loading: _loading -<<<<<<< HEAD Layout.fillWidth: true -======= - rowColor: Theme.backgroundHilightElementColor ->>>>>>> Migrate to new peer authorization levels, add new peer approval } } }