Merge pull request 'Peer History Save & Lists Refresh' (#315) from peer-save into master
the build was successful Details

Reviewed-on: #315
This commit is contained in:
Dan Ballard 2020-07-21 11:15:07 -07:00
commit 08722d7b97
14 changed files with 335 additions and 146 deletions

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;}
</style>
<path class="st0" d="M0,0h24v24H0V0z"/>
<path id="Subtraction_1" d="M18.5,16L18.5,16L5.3,4.4C6.3,3.5,7.6,3,9,3c1.7,0,3.3,0.7,4.4,2c1.1-1.3,2.7-2,4.4-2
C20.6,3,23,5.3,23,8.2c0,0,0,0.1,0,0.1c0,0.6-0.1,1.3-0.3,1.9c-0.2,0.7-0.5,1.3-0.9,1.9C21.1,13.2,20.1,14.4,18.5,16L18.5,16z"/>
<path d="M20.2,18.6L2.3,3.1L1,4.6l2.6,2.2C3.2,7.5,3,8.4,3,9.2c0,3.7,3.3,6.6,8.3,11.2l1.4,1.3l1.4-1.3c0.9-0.8,1.7-1.6,2.5-2.3
l2.3,2L20.2,18.6z"/>
</svg>

After

Width:  |  Height:  |  Size: 840 B

7
go.mod
View File

@ -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
)
)

6
go.sum
View File

@ -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=

View File

@ -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)

Binary file not shown.

View File

@ -114,22 +114,35 @@
<context>
<name>ListOverlay</name>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="184"/>
<source>add-list-item</source>
<extracomment>Add a New List Item</extracomment>
<translation>Liste hinzufügen</translation>
<translation type="vanished">Liste hinzufügen</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="196"/>
<source>add-new-item</source>
<extracomment>Add a new item to the list</extracomment>
<translation>Neues Listenelement hinzüfgen</translation>
<translation type="vanished">Neues Listenelement hinzüfgen</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="202"/>
<source>todo-placeholder</source>
<extracomment>Todo... placeholder text</extracomment>
<translation>noch zu erledigen</translation>
<translation type="vanished">noch zu erledigen</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="33"/>
<source>search-list</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="62"/>
<source>peer-not-online</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="203"/>
<source>add-list-item-btn</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -232,38 +245,60 @@
<context>
<name>PeerSettingsPane</name>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="26"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="27"/>
<source>address-label</source>
<translation>Adresse</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="31"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="32"/>
<source>copy-btn</source>
<translation>Kopieren</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="35"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="36"/>
<source>copied-to-clipboard-notification</source>
<extracomment>notification: copied to clipboard</extracomment>
<translation>in die Zwischenablage kopiert</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="47"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="48"/>
<source>display-name-label</source>
<translation>Angezeigter Name</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="51"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="52"/>
<source>save-btn</source>
<translation>speichern</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="92"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="90"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="103"/>
<source>save-peer-history</source>
<extracomment>Save Peer History</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="91"/>
<source>save-peer-history-description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="101"/>
<source>dont-save-peer-history-default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="102"/>
<source>dont-save-peer-history</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="129"/>
<source>delete-btn</source>
<translation>löschen</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="64"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="65"/>
<source>block-btn</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -209,22 +209,20 @@ Right-click to reset.</translation>
<context>
<name>ListOverlay</name>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="184"/>
<source>add-list-item</source>
<extracomment>Add a New List Item</extracomment>
<translation>Add a New List Item</translation>
<location filename="../qml/overlays/ListOverlay.qml" line="33"/>
<source>search-list</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation type="unfinished">Search List</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="196"/>
<source>add-new-item</source>
<extracomment>Add a new item to the list</extracomment>
<translation>Add a new item to the list</translation>
<location filename="../qml/overlays/ListOverlay.qml" line="62"/>
<source>peer-not-online</source>
<translation type="unfinished">Peer is Offline. Applications cannot be used right now.</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="202"/>
<source>todo-placeholder</source>
<extracomment>Todo... placeholder text</extracomment>
<translation>Todo...</translation>
<location filename="../qml/overlays/ListOverlay.qml" line="203"/>
<source>add-list-item-btn</source>
<translation type="unfinished">Add Item</translation>
</message>
</context>
<context>
@ -327,42 +325,64 @@ Right-click to reset.</translation>
<context>
<name>PeerSettingsPane</name>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="26"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="27"/>
<source>address-label</source>
<translation>Address</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="31"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="32"/>
<source>copy-btn</source>
<translation>Copy</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="35"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="36"/>
<source>copied-to-clipboard-notification</source>
<extracomment>notification: copied to clipboard</extracomment>
<translation>Copied to Clipboard</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="47"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="48"/>
<source>display-name-label</source>
<translation>Display Name</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="51"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="52"/>
<source>save-btn</source>
<translation>Save</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="64"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="65"/>
<source>block-btn</source>
<translation>Block Peer</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="90"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="103"/>
<source>save-peer-history</source>
<extracomment>Save Peer History</extracomment>
<translation type="unfinished">Save Peer History</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="91"/>
<source>save-peer-history-description</source>
<translation type="unfinished">Determines whether or not to delete any history associated with the peer.</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="101"/>
<source>dont-save-peer-history-default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="102"/>
<source>dont-save-peer-history</source>
<translation type="unfinished">Delete Peer History</translation>
</message>
<message>
<source>unblock-btn</source>
<translation type="vanished">Unblock Peer</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="92"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="129"/>
<source>delete-btn</source>
<translation>Delete</translation>
</message>

Binary file not shown.

View File

@ -114,22 +114,35 @@
<context>
<name>ListOverlay</name>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="184"/>
<source>add-list-item</source>
<extracomment>Add a New List Item</extracomment>
<translation>Ajouter un nouvel élément</translation>
<translation type="vanished">Ajouter un nouvel élément</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="196"/>
<source>add-new-item</source>
<extracomment>Add a new item to the list</extracomment>
<translation>Ajouter un nouvel élément à la liste</translation>
<translation type="vanished">Ajouter un nouvel élément à la liste</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="202"/>
<source>todo-placeholder</source>
<extracomment>Todo... placeholder text</extracomment>
<translation>A faire...</translation>
<translation type="vanished">A faire...</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="33"/>
<source>search-list</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="62"/>
<source>peer-not-online</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="203"/>
<source>add-list-item-btn</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -232,38 +245,60 @@
<context>
<name>PeerSettingsPane</name>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="26"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="27"/>
<source>address-label</source>
<translation>Adresse</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="31"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="32"/>
<source>copy-btn</source>
<translation>Copier</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="35"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="36"/>
<source>copied-to-clipboard-notification</source>
<extracomment>notification: copied to clipboard</extracomment>
<translation>Copié dans le presse-papier</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="47"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="48"/>
<source>display-name-label</source>
<translation>Pseudo</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="51"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="52"/>
<source>save-btn</source>
<translation>Sauvegarder</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="92"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="90"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="103"/>
<source>save-peer-history</source>
<extracomment>Save Peer History</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="91"/>
<source>save-peer-history-description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="101"/>
<source>dont-save-peer-history-default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="102"/>
<source>dont-save-peer-history</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="129"/>
<source>delete-btn</source>
<translation>Effacer</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="64"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="65"/>
<source>block-btn</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -114,22 +114,35 @@
<context>
<name>ListOverlay</name>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="184"/>
<source>add-list-item</source>
<extracomment>Add a New List Item</extracomment>
<translation>Adicionar Item à Lista</translation>
<translation type="vanished">Adicionar Item à Lista</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="196"/>
<source>add-new-item</source>
<extracomment>Add a new item to the list</extracomment>
<translation>Adicionar novo item à lista</translation>
<translation type="vanished">Adicionar novo item à lista</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="202"/>
<source>todo-placeholder</source>
<extracomment>Todo... placeholder text</extracomment>
<translation>Afazer</translation>
<translation type="vanished">Afazer</translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="33"/>
<source>search-list</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="62"/>
<source>peer-not-online</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/overlays/ListOverlay.qml" line="203"/>
<source>add-list-item-btn</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@ -232,38 +245,60 @@
<context>
<name>PeerSettingsPane</name>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="26"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="27"/>
<source>address-label</source>
<translation>Endereço</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="31"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="32"/>
<source>copy-btn</source>
<translation>Copiar</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="35"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="36"/>
<source>copied-to-clipboard-notification</source>
<extracomment>notification: copied to clipboard</extracomment>
<translation>Copiado</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="47"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="48"/>
<source>display-name-label</source>
<translation>Nome de Exibição</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="51"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="52"/>
<source>save-btn</source>
<translation>Salvar</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="92"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="90"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="103"/>
<source>save-peer-history</source>
<extracomment>Save Peer History</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="91"/>
<source>save-peer-history-description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="101"/>
<source>dont-save-peer-history-default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="102"/>
<source>dont-save-peer-history</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="129"/>
<source>delete-btn</source>
<translation>Deletar</translation>
</message>
<message>
<location filename="../qml/panes/PeerSettingsPane.qml" line="64"/>
<location filename="../qml/panes/PeerSettingsPane.qml" line="65"/>
<source>block-btn</source>
<translation type="unfinished"></translation>
</message>

View File

@ -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: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + from + "<br/>" + timestamp
text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + displayName + "<br/>" + 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{}

View File

@ -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
}
}
}
}