From 0e5d78cbb983bd26f0fdd228e0e180934b3c1a59 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 10 Nov 2020 17:42:33 -0800 Subject: [PATCH] add peer / group pane --- go.mod | 2 +- go.sum | 2 + go/ui/gcd.go | 111 ++++++++----- i18n/translation_de.qm | Bin 3211 -> 3117 bytes i18n/translation_de.ts | 155 ++++++++++++++---- i18n/translation_en.qm | Bin 8599 -> 9643 bytes i18n/translation_en.ts | 161 +++++++++++++++---- i18n/translation_fr.qm | Bin 3125 -> 3029 bytes i18n/translation_fr.ts | 155 ++++++++++++++---- i18n/translation_pt.qm | Bin 2923 -> 2773 bytes i18n/translation_pt.ts | 155 ++++++++++++++---- qml.qrc | 2 +- qml/main.qml | 14 +- qml/opaque | 2 +- qml/panes/AddGroupPane.qml | 63 -------- qml/panes/AddPeerGroupPane.qml | 283 +++++++++++++++++++++++++++++++++ qml/panes/OverlayPane.qml | 31 ---- qml/widgets/MyProfile.qml | 2 +- 18 files changed, 871 insertions(+), 267 deletions(-) delete mode 100644 qml/panes/AddGroupPane.qml create mode 100644 qml/panes/AddPeerGroupPane.qml diff --git a/go.mod b/go.mod index e9acf02e..03c5c4ae 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module cwtch.im/ui go 1.12 require ( - cwtch.im/cwtch v0.4.7 + cwtch.im/cwtch v0.4.8 git.openprivacy.ca/openprivacy/connectivity v1.3.1 git.openprivacy.ca/openprivacy/log v1.0.1 github.com/c-bata/go-prompt v0.2.3 // indirect diff --git a/go.sum b/go.sum index 8c5b5771..77bdc4bb 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ cwtch.im/cwtch v0.4.5 h1:BK4IMqCMf9xNmeLzaVDUbl2bnXdw5fOWXvEGBMTOjXM= cwtch.im/cwtch v0.4.5/go.mod h1:Mh7vQQ3z55+prpX6EuUkg4QNQkBACMoDcgCNBeAH2EY= cwtch.im/cwtch v0.4.7 h1:y8Roq1L1PAs0FkBDdk+7EUVLCHwyzl+dOEfVu4VX0Ic= cwtch.im/cwtch v0.4.7/go.mod h1:Mh7vQQ3z55+prpX6EuUkg4QNQkBACMoDcgCNBeAH2EY= +cwtch.im/cwtch v0.4.8 h1:f/FIek3PkJMskLT+f7SpIjpjlp5hMspAnGguXC3SA8s= +cwtch.im/cwtch v0.4.8/go.mod h1:Mh7vQQ3z55+prpX6EuUkg4QNQkBACMoDcgCNBeAH2EY= cwtch.im/tapir v0.2.0 h1:7MkoR5+uEuPW34/O0GZRidnIjq/01Cfm8nl5IRuqpGc= cwtch.im/tapir v0.2.0/go.mod h1:xzzZ28adyUXNkYL1YodcHsAiTt3IJ8Loc29YVn9mIEQ= cwtch.im/tapir v0.2.1 h1:t1YJB9q5sV1A9xwiiwL6WVfw3dwQWLoecunuzT1PQtw= diff --git a/go/ui/gcd.go b/go/ui/gcd.go index 8f853217..0e169d9c 100644 --- a/go/ui/gcd.go +++ b/go/ui/gcd.go @@ -25,7 +25,7 @@ type GrandCentralDispatcher struct { QMLEngine *qml.QQmlApplicationEngine Translator, OpaqueTranslator *core.QTranslator - uIManagers map[string]Manager // profile-onion : Manager + uIManagers map[string]Manager // profile-onion : Manager TimelineInterface *MessageModel GlobalSettings *GlobalSettings @@ -36,16 +36,16 @@ type GrandCentralDispatcher struct { m_selectedProfile string m_selectedConversation string - _ string `property:"os"` - _ float32 `property:"themeScale,auto,changed"` - _ string `property:"theme,auto,changed"` - _ string `property:"locale,auto,changed"` - _ string `property:"version"` - _ string `property:"buildDate"` - _ string `property:"assetPath"` - _ string `property:"selectedProfile,auto"` - _ string `property:"selectedConversation,auto"` - _ bool `property:experimentsEnabled,auto,changed` + _ string `property:"os"` + _ float32 `property:"themeScale,auto,changed"` + _ string `property:"theme,auto,changed"` + _ string `property:"locale,auto,changed"` + _ string `property:"version"` + _ string `property:"buildDate"` + _ string `property:"assetPath"` + _ string `property:"selectedProfile,auto"` + _ string `property:"selectedConversation,auto"` + _ bool `property:experimentsEnabled,auto,changed` _ map[string]bool `property:experiments,auto,changed` // profile management stuff @@ -58,12 +58,12 @@ type GrandCentralDispatcher struct { // server management _ func(handle, displayname, image string, status int, autostart bool, bundle string, messages int, key_types []string, keys []string) `signal:"AddServer"` - _ func() `signal:"requestServers,auto"` - _ func() `signal:"newServer,auto"` - _ func(server string) `signal:"startServer,auto"` - _ func(server string) `signal:"stopServer,auto"` - _ func(server string) `signal:"checkServer,auto"` - _ func(server string, enabled bool) `signal:"autostartServer",auto` + _ func() `signal:"requestServers,auto"` + _ func() `signal:"newServer,auto"` + _ func(server string) `signal:"startServer,auto"` + _ func(server string) `signal:"stopServer,auto"` + _ func(server string) `signal:"checkServer,auto"` + _ func(server string, enabled bool) `signal:"autostartServer",auto` // contact list stuff _ func(handle, displayName, image string, badge, status int, authorization string, loading bool, lastMsgTime int) `signal:"AddContact"` @@ -75,12 +75,12 @@ type GrandCentralDispatcher struct { _ func(handle, key, value string) `signal:"UpdateContactAttribute"` // messages pane stuff - _ func() `signal:"ClearMessages"` - _ func() `signal:"ResetMessagePane"` - _ func(mID string) `signal:"Acknowledged"` - _ func(title string) `signal:"SetToolbarTitle"` - _ func(signature string, err string) `signal:"GroupSendError"` - _ func(loading bool) `signal:"SetLoadingState"` + _ func() `signal:"ClearMessages"` + _ func() `signal:"ResetMessagePane"` + _ func(mID string) `signal:"Acknowledged"` + _ func(title string) `signal:"SetToolbarTitle"` + _ func(signature string, err string) `signal:"GroupSendError"` + _ func(loading bool) `signal:"SetLoadingState"` // profile-area stuff _ func(name, onion, image, tag, showBlocked string) `signal:"UpdateMyProfile"` @@ -111,6 +111,7 @@ type GrandCentralDispatcher struct { _ func(onion string) `signal:"loadMessagesPane,auto"` _ func(signal string) `signal:"broadcast,auto"` // convenience relay signal _ func(str string) `signal:"importString,auto"` + _ func(name, address string) `signal:"addPeer,auto"` _ func(str string) `signal:"createContact,auto"` _ func(str string) `signal:"popup,auto"` _ func(server, groupName string) `signal:"createGroup,auto"` @@ -128,7 +129,7 @@ type GrandCentralDispatcher struct { _ func(onion string) `signal:"storeHistoryForPeer,auto"` _ func(onion string) `signal:"deleteHistoryForPeer,auto"` // chat - _ func(mID string) `slot:"peerAckAlert,auto"` + _ func(mID string) `slot:"peerAckAlert,auto"` _ func(handle string) `signal:"requestServerSettings,auto"` @@ -251,7 +252,7 @@ func (this *GrandCentralDispatcher) sendMessage(message string) { } if isGroup(this.SelectedConversation()) { - if gf,err := groups.ExperimentGate(this.GlobalSettings.Experiments); err == nil { + if gf, err := groups.ExperimentGate(this.GlobalSettings.Experiments); err == nil { groupHandle := this.SelectedConversation() this.TimelineInterface.AddMessage(this.TimelineInterface.num()) err := gf.SendMessage(groupHandle, message) @@ -351,7 +352,8 @@ func (this *GrandCentralDispatcher) requestPeerSettings(handle string) { func (this *GrandCentralDispatcher) savePeerSettings(onion, nick string) { the.Peer.SetContactAttribute(onion, attr.GetLocalScope(constants.Name), nick) - this.UpdateContactDisplayName(onion, nick) + newNick := GetNick(onion) + this.UpdateContactDisplayName(onion, newNick) } func (this *GrandCentralDispatcher) storeHistoryForPeer(onion string) { @@ -388,15 +390,11 @@ func (this *GrandCentralDispatcher) requestServerSettings(groupID string) { } func (this *GrandCentralDispatcher) requestServers() { - the.AppBus.Publish(event.NewEvent(constants.ListServers, map[event.Field]string{ - - })) + the.AppBus.Publish(event.NewEvent(constants.ListServers, map[event.Field]string{})) } func (this *GrandCentralDispatcher) newServer() { - the.AppBus.Publish(event.NewEvent(constants.NewServer, map[event.Field]string{ - - })) + the.AppBus.Publish(event.NewEvent(constants.NewServer, map[event.Field]string{})) } func (this *GrandCentralDispatcher) startServer(onion string) { @@ -427,7 +425,7 @@ func (this *GrandCentralDispatcher) autostartServer(onion string, enabled bool) value = event.True } the.AppBus.Publish(event.NewEvent(constants.AutoStart, map[event.Field]string{ - event.Onion: onion, + event.Onion: onion, constants.AutoStartEnabled: value, })) } @@ -478,13 +476,49 @@ func (this *GrandCentralDispatcher) createContact(onion string) { the.Peer.PeerWithOnion(onion) } +func (this *GrandCentralDispatcher) addPeer(name, address string) { + + log.Debugf("importing peer: %s\n", address) + name = strings.TrimSpace(name) + address = strings.TrimSpace(address) + + if len(address) != 56 { + this.InvokePopup("invalid peer onion format") + return + } + + name = strings.TrimSpace(name) + + _, err := base32.StdEncoding.DecodeString(strings.ToUpper(address[:56])) + if err != nil { + log.Debugln(err) + this.InvokePopup("bad format. missing handlers?") + return + } + + checkc := the.Peer.GetContact(address) + if checkc != nil { + this.InvokePopup("already have this contact") + return //TODO: bring them to the duplicate + } else { + the.Peer.AddContact(name, address, model.AuthApproved) + if name != "" { + the.Peer.SetContactAttribute(address, attr.GetLocalScope(constants.Name), name) + } + the.Peer.PeerWithOnion(address) + } + + this.GetUiManager(this.selectedProfile()).AddContact(address) +} + +// Deprecated TODO: delete when gcd.addGroup is implemented from this func (this *GrandCentralDispatcher) importString(str string) { if len(str) < 5 { log.Debugf("ignoring short string") return } - if gf,err := groups.ExperimentGate(this.GlobalSettings.Experiments); err == nil { + if gf, err := groups.ExperimentGate(this.GlobalSettings.Experiments); err == nil { if gf.ValidPrefix(str) { err = gf.HandleImportString(str) if err == nil { @@ -492,7 +526,7 @@ func (this *GrandCentralDispatcher) importString(str string) { this.InvokePopup("successfully imported") return } - this.InvokePopup("failed import: " + err.Error()) + this.InvokePopup("failed import: " + err.Error()) return } // drop through to peer import strings @@ -503,8 +537,6 @@ func (this *GrandCentralDispatcher) importString(str string) { name := onion str = strings.TrimSpace(str) - - if strings.Contains(str, " ") { // usually people prepend spaces and we don't want it going into the name (use ~ for that) parts := strings.Split(strings.TrimSpace(str), " ") str = parts[len(parts)-1] @@ -732,9 +764,8 @@ func (this *GrandCentralDispatcher) loadProfile(onion string) { } } - // Groups Gating - if _,err := groups.ExperimentGate(this.GlobalSettings.Experiments); err == nil { + if _, err := groups.ExperimentGate(this.GlobalSettings.Experiments); err == nil { the.Peer.StartServerConnections() groups := the.Peer.GetGroups() for i := range groups { @@ -795,4 +826,4 @@ func (this *GrandCentralDispatcher) deleteProfile(onion string) { func (this *GrandCentralDispatcher) peerAckAlert(mID string) { idx, _ := strconv.Atoi(mID) this.TimelineInterface.EditMessage(idx) -} \ No newline at end of file +} diff --git a/i18n/translation_de.qm b/i18n/translation_de.qm index 371e5a8364da467ae9ee9152dca9bdce9795fee1..7292b66e680a686a17ed7a84934f1e016c26d790 100644 GIT binary patch delta 316 zcmeB{Tq{v;vm-^~)cZM8&nn97PguD3t`h?T!w*Kb6Mq;O*d-WscCTSzVB}(4ds&Bp zfq4V-$}cqx3><>YZ`g`};}iZTyVn5u5sYgu>o71d z|6^YHrG|llBcAyUTMAv6^&keve24&-9{Y6BJfOw9Il8%p7#P?laGbES0~+WCp*i1k z@uW`$T4>K@HWTPD&KX?Wyw(BrYjLM^I{@_wa2J2b0qP6j5xM>bsICh_GjHNqG_?=t zkP-;Z8O?L>572>J@A&F%!a{&95#Wmv1PU;6@g=T*2h_;G*KQBAnEh8K&>Kn2AOQwP zhCGHGhE#@hAkO0eDPjX+f#jmp#FA9q^rHOI0^OvNJa(WUk7G)TJ4hfPF)x)7q+Nm` zgdrcO9b|w4gF8bJLn%W65Nf5uO%h5;O-n4zDS;Z5mzbN1V%FqB7CTP3$&+1K4Ol?D J%|{qBxd0LCcJcrK diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index f825070c..16d4c781 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -8,28 +8,117 @@ Gruppe Anlegen - server-label Server label - Server + Server - group-name-label Group name label - Gruppenname + Gruppenname - default-group-name default suggested group name - Tolle Gruppe + Tolle Gruppe - create-group-btn create group button - Anlegen + Anlegen + + + + AddPeerGroupPane + + + profile-oniblon-label + Send this address to peers you want to connect with + + + + + copy-btn + Kopieren + + + + copied-to-clipboard-notification + notification: copied to clipboard + in die Zwischenablage kopiert + + + + add-peer-tab + Add a peer + + + + + create-group-tab + Create a group + + + + + join-group-tab + Join a group + + + + + peer-address + Address + + + + + peer-name + Name + + + + + + group-name + Group Name +---------- +Name + + + + + server + Server + + + + + invitation + Invitation + + + + + group-addr + Address + + + + + add-peer + Add Peer | Create Group | Join Group + + + + + create-group + + + + + join-group + @@ -270,17 +359,17 @@ Ablehnen - + chat-btn Chat - + lists-btn Listen - + bulletins-btn Meldungen @@ -347,11 +436,6 @@ ProfileAddEditPane - - - default-profile-name - - copy-btn @@ -364,13 +448,13 @@ in die Zwischenablage kopiert - + radio-use-password Password - + radio-no-password Unencrypted (No password) @@ -399,73 +483,73 @@ - + your-display-name Your Display Name - + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn Create || Save - + save-profile-btn - + password-error-match Passwords do not match - + password-change-error Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile - - + + delete-confirm-label Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile - + delete-confirm-text DELETE @@ -638,4 +722,13 @@ + + main + + + new-connection-pane-title + New Connection + + + diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index 96ee0bd80a9a968ec0a2a35d11acaccacf85fcfb..1af0d5044ff104a1c9f9032ce1e07361ca35d7fb 100644 GIT binary patch delta 1662 zcmZ`%eM}p57=EwUUhk`S^aChc2b4_B1~to+`7vY;wk&jv@dwjsmdHVm?)W%rdkhk% z-RjUK=n_+rOp%CjGB+H{5S($aIdNgjU?_|Hqh>}H7iEfWN=%l__gYsPfn3_>e((L> z_kEt{eLISeZw(im_Bk*8-q}9pcAc&49{RorfLsICzyJXI2=pC41YjtDb0txXTVN#g z4W7>v)aV@m%X%X3^IiaB5AoQ0=P({7$}Y+Psq2aTyG#ICR-!leDu5%O_;@l8z+6C# z-WUg1<|nQ&lK`$3!^2@4URa)G*tzLxfb2fQTV<61M2=yovlJUf;^(A{I6RGU`kL|91#HBnno{|d04r!yS9urS_nN+L zzKr=LRHoqy0CS8A@7*8(z)dQK)V?^1b8)m?r{;$A?~yoCjyQ_1#nIMcuB*X<_UFwV zsVac5+uYfC9v#Us4|p{syxRO#{yQk}5A#gVivXFeG(qVO9i*4J9O%U9Ful_{f{Z?; zcRNl1WDL`7oDG0)r;q(Ojftn|(ZWKs?v*%N)9LHq8j*P>vu5xiv~V?(-;EBMN|;DW z1RIEmzoFtO#J>>VWg_Y5K;{-^at7nf-^{N^@yuRj$#E<84c}z%d;13f>j&(*!@U40 zepYKZg^Gdgt-%qbkFkSZBqmI;mstF6A7|%2Lt+^m=e)ZL^GZ4Q8%?+i7dT(rlSuq7 z7n-d{+|IrE`esyU;f~H4aI|^c*e9r%&f=zRBbeXBJEmp;!qlI9S|A6Ne97lWak+>y z{JOp!i2v~3Z6YSL@fB-ZaTiMY_uCHvP=j$y$>RrRok*~T|KiSNR9a;*Z@-OBow10a zVO+Wi%eD?AkU3%Tw_=>Bv$S>pjMh(BPE;O2!a>W~LK}nuo)8{X4x{oxq2Q?swDKik zmlX>dpAn?*)*_KQ;nfW|0-;B^sEwloE@5mRqT>aT|EUNdZA6SY<+LlfiO-T~T?%Xj zA3oVo4l+JLS~rx!A1(QOo`5U|&HA;CK3`cm9<~G2u%=3kmaj`vZTo#zfNyq ztCO~jM|Fk^6H}5C7w6d}xYOBKVGjyQ*rD@|){=Ry|GueGgS@cw1oc3eRn$F-CTU8e zy5K@WqXWFCNda|Hnrv;OqAsB>QNo#2B1vs-l25{Xoh8Lq@Bx$-(<+BTOEadS3@6e6 za$*WhEOBuoikwke-=dgpedJ0z6_SH{=C@0a_un927W+@yA7?h*51XMSwoySe1)HET z8idds{Y`=@sK+;7qP1Oa3CKaEK~}YpM^>e(df6A#>!txv`iz@_$RidG++qOn0zRN^4!83^KEAnd0& delta 994 zcmZuvZETZe6g^Kr-tV_vOS_G+&COtxz{Es`3Ev+x;9!E$OjI-!`fe7=TDvy<87T|} zmViOxBAik_{_x|?d7t~-d+xdC zxhK}NtxPWJ4;G%gda!l4y!fk49Rt6v0BqmG6YT}0KZGk*)|-u`w{S_2f9+K*jt0`yb%2`R=#J&x1kJYzJ6&JP^d21zVuoQKvQV%|;X z4?E6Nz(uLlHcFwdNKH#!6fif3MrRJ)2c#PVjN87+p|LQB?#JbAb*#@Tlap=!1`-y? zz149l%*fwXeoV!e#``p*zLm}_)*k!lH^B9xHorX$nE6_|j@J6lXnoZb zrtj6xX^iK6t=%|9Vg6fs;jLNB`%f?bFac-@J=n60!js*4<7606{?`xef0h#py=&6O zMuYnB=bYFvqK|tsoHS(kex6|C_i||OF!H01a-uJc>KZpETwok-eVSK{av|@9-LC)qb4+d9d1M33~ zmdI8YVL5iNx)BjKeO zGgDQD=gy(0UEbqvYKPQm9Rc E+XVptwg3PC diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index e1ca35ea..a70d2884 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -8,28 +8,117 @@ Create Group - server-label Server label - Server + Server - group-name-label Group name label + Group name + + + default-group-name + default suggested group name + Awesome Group + + + create-group-btn + create group button + Create + + + + AddPeerGroupPane + + + profile-oniblon-label + Send this address to peers you want to connect with + Send this address to peers you want to connect with + + + + copy-btn + Copy + + + + copied-to-clipboard-notification + notification: copied to clipboard + Copied to Clipboard + + + + add-peer-tab + Add a peer + Add a peer + + + + create-group-tab + Create a group + Create a group + + + + join-group-tab + Join a group + Join a group + + + + peer-address + Address + Address + + + + peer-name + Name + Name + + + + + group-name + Group Name +---------- +Name Group name - - default-group-name - default suggested group name - Awesome Group + + server + Server + Server - - create-group-btn - create group button - Create + + invitation + Invitation + Invitation + + + + group-addr + Address + Address + + + + add-peer + Add Peer | Create Group | Join Group + Add Peer + + + + create-group + Create group + + + + join-group + Join group @@ -350,17 +439,17 @@ Right-click to reset. Reject - + chat-btn Chat - + lists-btn Lists - + bulletins-btn Bulletins @@ -445,9 +534,8 @@ Right-click to reset. Display name - default-profile-name - Alice + Alice @@ -477,13 +565,13 @@ Right-click to reset. Copied to Clipboard - + radio-use-password Password Password - + radio-no-password Unencrypted (No password) Unencrypted (No password) @@ -501,73 +589,73 @@ Right-click to reset. Send this address to peers you want to connect with - + your-display-name Your Display Name Your Display Name - + current-password-label Current Password Current Password - + password1-label Password Password - + password2-label Reenter password Reenter password - + create-profile-btn Create || Save Create Profile - + save-profile-btn Save Profile - + password-error-match Passwords do not match Passwords do not match - + password-change-error Error changing password: Supplied password rejected Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile Delete Profile - - + + delete-confirm-label Type DELETE to confirm Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile Really Delete Profile - + delete-confirm-text DELETE DELETE @@ -697,7 +785,7 @@ Right-click to reset. experiments-enabled Theme - + Experiments enabled @@ -757,4 +845,13 @@ Right-click to reset. Online + + main + + + new-connection-pane-title + New Connection + New Connection + + diff --git a/i18n/translation_fr.qm b/i18n/translation_fr.qm index 42e1df36cf2b6a7e640c4cff2a4dbca8740d16a2..766fe0093fac87a426cab555c6832a5c4b1a89af 100644 GIT binary patch delta 315 zcmdlgaaFwDW=D#|srPfHo>i3DpRjQ6T_*+xh98V>QA;V7*v=hJk^rk*&s_4`@y`gl2jK zp*bc&XfAHH?|VV=3~b-)K@6rehyaH;gy!sHpDvmQv`Cwyn_CE|OpW7&ogL5tUm!H6 zH<#H=pu;#hxVCw%1FBoZozm?9R5ydW_(Ki@1M3SOk?U`O>Z5oTP3;5HG7y^MG|$05 zAP2hf*@T4vJ#c_eBt{S@z_5j{-5zKGdsZe;cF!d4OkM%Ul$3zf)FSty{L+HS|2cKp Lp#qy_m?XIXyPH?a delta 465 zcmcaAzEz^$W=D#|srPfHo>i3DpRjQ6T_*+xMh-@{6Mq;O*zFi~cCP{QqZrp-)?r{^ z{>8lVOAP}9hdT2cwj!YTX_kFYfP99N5Spcf<@2#~3=AwMSTB~JVPN38$W~*|2h?W- zp*bEwXs&3s?|XsbOxxJL*Mk@w=@0?Vd+gIi^MDptb98eHF)*-|ah$NT0~+W8p*d%B z@uW`$T4>E>HWTPD&Iqn;Uh9DBKXIpYI{?+c;4c1<1Eei@M6SO9s_TK!%&T}7P3;3Z zBnLusO7k5219IRrzIvOm5THv0_+kWs0*owtiR<41H8SwE+XF3T-<8S0z|F%96yRcT zW+-BK$&kuW!~s&k2E+o%MX8A;sk-S!`K1NANhNvgKtUeIloWT6KtN(%DkDg%978BW z9)kiyF+(Xs0muL#I~_>o1NoCXSa@`VQc}|rOLIz~2IVE@reZgVhrxYvBZ~$n+>Xhv OtVS##-sU}wl3V~mI(l#b diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index 1a539e31..084342b7 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -8,28 +8,117 @@ Créer un groupe - server-label Server label - Serveur + Serveur - group-name-label Group name label - Groupe + Groupe - default-group-name default suggested group name - Un super groupe + Un super groupe - create-group-btn create group button - Créer + Créer + + + + AddPeerGroupPane + + + profile-oniblon-label + Send this address to peers you want to connect with + + + + + copy-btn + Copier + + + + copied-to-clipboard-notification + notification: copied to clipboard + Copié dans le presse-papier + + + + add-peer-tab + Add a peer + + + + + create-group-tab + Create a group + + + + + join-group-tab + Join a group + + + + + peer-address + Address + + + + + peer-name + Name + + + + + + group-name + Group Name +---------- +Name + + + + + server + Server + + + + + invitation + Invitation + + + + + group-addr + Address + + + + + add-peer + Add Peer | Create Group | Join Group + + + + + create-group + + + + + join-group + @@ -270,17 +359,17 @@ Refuser - + chat-btn Discuter - + lists-btn Listes - + bulletins-btn Bulletins @@ -347,11 +436,6 @@ ProfileAddEditPane - - - default-profile-name - - copy-btn @@ -364,13 +448,13 @@ Copié dans le presse-papier - + radio-use-password Password - + radio-no-password Unencrypted (No password) @@ -399,73 +483,73 @@ - + your-display-name Your Display Name - + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn Create || Save - + save-profile-btn - + password-error-match Passwords do not match - + password-change-error Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile - - + + delete-confirm-label Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile - + delete-confirm-text DELETE @@ -638,4 +722,13 @@ + + main + + + new-connection-pane-title + New Connection + + + diff --git a/i18n/translation_pt.qm b/i18n/translation_pt.qm index f0ec24706be7a09648130b9059bb25e1e9f6e956..3f79a09319ca57a82240a040f2544aa42f681d30 100644 GIT binary patch delta 315 zcmaDYc2%_AW=D#|srPfHo>i3DpRjQ6T_*+xh98V|O)p-(p;QS%-mv z*@}7Pml_5Jc2VXxY()$VjMgmso&fpGJ6Jv+I|rnHv0f}c!@$5<%T{C02hS1sr;FwRrHeVbxrG=QSerOb*x3OssDscP zYnfezzP;M(T34yf({cS^SdP~8vi;tx4M+JQ&p`Wv9RuXq+s?E}(lAT;}9o`Zit z4s_tN2@3&wppH)@Mi3~#(8Jem543=7Lncsm&*c9cPCSk&DFLaeMearUr3I6HId$2g K0-Lp%9615Um{{Tf delta 487 zcmcaA`dX~sW=D#|srPfHo>i3DpRjQ6T_*+xMh-@{6Mq;O*bXr2>|O)pCorzPti!;- ze1Li7ml_5J_SwvD*ouJS2U+$#0rDBHLTDB{me0q|F)*++uwE=b!@$7B%vNL1$H2h! z1445cKxocxw(omE;!D`R*Mk`BcOe3tX6(~N^MDrrCriar Grupo - server-label Server label - Servidor + Servidor - group-name-label Group name label - Nome do grupo + Nome do grupo - default-group-name default suggested group name - Grupo incrível + Grupo incrível - create-group-btn create group button - Criar + Criar + + + + AddPeerGroupPane + + + profile-oniblon-label + Send this address to peers you want to connect with + + + + + copy-btn + Copiar + + + + copied-to-clipboard-notification + notification: copied to clipboard + Copiado + + + + add-peer-tab + Add a peer + + + + + create-group-tab + Create a group + + + + + join-group-tab + Join a group + + + + + peer-address + Address + + + + + peer-name + Name + + + + + + group-name + Group Name +---------- +Name + + + + + server + Server + + + + + invitation + Invitation + + + + + group-addr + Address + + + + + add-peer + Add Peer | Create Group | Join Group + + + + + create-group + + + + + join-group + @@ -270,17 +359,17 @@ Recusar - + chat-btn Chat - + lists-btn Listas - + bulletins-btn Boletins @@ -347,11 +436,6 @@ ProfileAddEditPane - - - default-profile-name - - copy-btn @@ -364,13 +448,13 @@ Copiado - + radio-use-password Password - + radio-no-password Unencrypted (No password) @@ -399,73 +483,73 @@ - + your-display-name Your Display Name - + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn Create || Save - + save-profile-btn - + password-error-match Passwords do not match - + password-change-error Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile - - + + delete-confirm-label Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile - + delete-confirm-text DELETE @@ -638,4 +722,13 @@ + + main + + + new-connection-pane-title + New Connection + + + diff --git a/qml.qrc b/qml.qrc index 8dd66745..74382f52 100644 --- a/qml.qrc +++ b/qml.qrc @@ -5,7 +5,7 @@ qml/overlays/ListOverlay.qml qml/overlays/MembershipOverlay.qml qml/main.qml - qml/panes/AddGroupPane.qml + qml/panes/AddPeerGroupPane.qml qml/panes/GroupSettingsPane.qml qml/panes/OverlayPane.qml qml/panes/PeerSettingsPane.qml diff --git a/qml/main.qml b/qml/main.qml index 567d6f69..f8d6b884 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -214,7 +214,7 @@ ApplicationWindow { readonly property int messagePane: 1 readonly property int userProfilePane: 2 readonly property int groupProfilePane: 3 - readonly property int addGroupPane: 4 + readonly property int addPeerGroupPane: 4 readonly property int serverInfoPane: 5 Item { anchors.fill: parent } // empty @@ -234,7 +234,10 @@ ApplicationWindow { GroupSettingsPane{ anchors.fill: parent } - AddGroupPane { anchors.fill: parent } + AddPeerGroupPane { + id: addPeerGroupPaneInstance + anchors.fill: parent + } ServerInfoPane { anchors.fill: parent } @@ -243,6 +246,11 @@ ApplicationWindow { if (currentIndex == emptyPane) { toolbar.hideTitle() toolbar.rightMenuVisible = false + } else if (currentIndex == addPeerGroupPane) { + //: New Connection + toolbar.setTitle(qsTr('new-connection-pane-title')) + toolbar.rightMenuVisible = false + addPeerGroupPaneInstance.reset() } } @@ -275,8 +283,6 @@ ApplicationWindow { function updateToolbar() { - - if (currentIndex == splashPane) { toolbar.hideTitle() toolbar.rightMenuVisible = false diff --git a/qml/opaque b/qml/opaque index 15e3f5ab..80eaf1a0 160000 --- a/qml/opaque +++ b/qml/opaque @@ -1 +1 @@ -Subproject commit 15e3f5ab84473070d16238f36fa04584d46f0bcb +Subproject commit 80eaf1a0d22efb3b6835599368bc288a9e0aa592 diff --git a/qml/panes/AddGroupPane.qml b/qml/panes/AddGroupPane.qml deleted file mode 100644 index 78b5f6b2..00000000 --- a/qml/panes/AddGroupPane.qml +++ /dev/null @@ -1,63 +0,0 @@ -import QtGraphicalEffects 1.0 -import QtQuick 2.7 -import QtQuick.Controls 2.4 -import QtQuick.Controls.Material 2.0 -import QtQuick.Layouts 1.3 -import QtQuick.Window 2.11 -import QtQuick.Controls 1.4 - -import "../opaque" as Opaque -import "../opaque/styles" - -ColumnLayout { // settingsPane - id: root - anchors.fill: parent - - Flickable { - anchors.fill: parent - boundsBehavior: Flickable.StopAtBounds - clip:true - contentWidth: tehcol.width - contentHeight: tehcol.height - - Column { - id: tehcol - leftPadding: 10 - spacing: 5 - width: root.width - - Opaque.ScalingLabel { - //: Server label - text: qsTr("server-label") + ":" - } - - TextField { - id: txtServer - style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - text: "2c3kmoobnyghj2zw6pwv7d57yzld753auo3ugauezzpvfak3ahc4bdyd" - } - - Opaque.ScalingLabel{ - //: Group name label - text: qsTr("group-name-label") + ":" - } - - TextField { - id: txtGroupName - style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - //: default suggested group name - text: qsTr("default-group-name") - } - - Opaque.Button { - //: create group button - text: qsTr("create-group-btn") - - onClicked: { - gcd.createGroup(txtServer.text, txtGroupName.text) - } - } - - }//end of column with padding - }//end of flickable -} diff --git a/qml/panes/AddPeerGroupPane.qml b/qml/panes/AddPeerGroupPane.qml new file mode 100644 index 00000000..17708d6d --- /dev/null +++ b/qml/panes/AddPeerGroupPane.qml @@ -0,0 +1,283 @@ +import QtGraphicalEffects 1.0 +import QtQuick 2.7 +import QtQuick.Controls 2.4 +import QtQuick.Controls.Material 2.0 +import QtQuick.Layouts 1.3 +import QtQuick.Window 2.11 +import QtQuick.Controls 1.4 + +import "../opaque" as Opaque +import "../opaque/styles" +import "../utils.js" as Utils +import "../opaque/theme" +import "../const" + + +Rectangle { + id: root + color: Theme.backgroundPaneColor + + function reset() { + addStack.currentIndex = addStack.addPeer + + peerAddr.text = "" + peerName.text = "" + + groupNameCreate.text = "" + + groupAddr.text = "" + groupNameJoin.text = "" + + onionLabel.text = gcd.selectedProfile + } + + Column { + anchors.fill: parent + spacing: 25 * gcd.themeScale + leftPadding: 20 * gcd.themeScale + rightPadding: 20 * gcd.themeScale + + Opaque.ScalingLabel { + id: shareLabel + anchors { + left: parent.left + right: parent.right + } + horizontalAlignment:Text.AlignHCenter + size: Theme.secondaryTextSize + wrapMode: Text.Wrap + + //: Send this address to peers you want to connect with + text: qsTr("profile-oniblon-label") + } + + Opaque.ButtonTextField { + id: onionLabel + anchors.horizontalCenter: parent.horizontalCenter + readOnly: true + + width: parent.width - (40*gcd.themeScale) + + button_text: qsTr("copy-btn") + dropShadowColor: Theme.dropShadowPaneColor + onClicked: { + //: notification: copied to clipboard + gcd.popup(qsTr("copied-to-clipboard-notification")) + onionLabel.selectAll() + onionLabel.copy() + } + } + + Rectangle { // Spacer + width: 1 + height: 25 * gcd.themeScale + color: root.color + } + + RowLayout { + id: switcher + visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") + + height: addPeerTab.height + implicitHeight: height + anchors.left: parent.left + anchors.right: parent.right + + Opaque.Tab { + id: addPeerTab + Layout.fillWidth: true + active: addStack.currentIndex == addStack.addPeer + //: Add a peer + text: qsTr("add-peer-tab") + + size: Theme.chatMetaTextSize + + onClicked: { addStack.currentIndex = addStack.addPeer; } + } + + Rectangle { + width: 2 + height: parent.height + color: Theme.dividerColor + } + + Opaque.Tab { + Layout.fillWidth: true + active: addStack.currentIndex == addStack.createGroup + //: Create a group + text: qsTr("create-group-tab") + + size: Theme.chatMetaTextSize + + onClicked: { addStack.currentIndex = addStack.createGroup } + } + + Rectangle { + width: 2 + height: parent.height + color: Theme.dividerColor + } + + Opaque.Tab { + Layout.fillWidth: true + active: addStack.currentIndex == addStack.joinGroup + //: Join a group + text: qsTr("join-group-tab") + + size: Theme.chatMetaTextSize + + onClicked: { addStack.currentIndex = addStack.joinGroup} + } + + } + + + StackLayout { + id: addStack + anchors.left: parent.left + anchors.right: parent.right + + implicitHeight: height + currentIndex: addPeer + + readonly property int addPeer: 0 + readonly property int createGroup: 1 + readonly property int joinGroup: 2 + + Column { // Add a peer + Layout.fillWidth: true + leftPadding: 20 * gcd.themeScale + rightPadding: 20 * gcd.themeScale + spacing: 25 * gcd.themeScale + + + Opaque.UnderlineTextField { + id: peerAddr + + backgroundColor: Theme.backgroundPaneColor + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Address + placeholderText: qsTr("peer-address") + + } + + Opaque.UnderlineTextField { + id: peerName + + backgroundColor: Theme.backgroundPaneColor + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Name + placeholderText: qsTr("peer-name") + + } + } + + Column { + Layout.fillWidth: true + leftPadding: 20 * gcd.themeScale + rightPadding: 20 * gcd.themeScale + spacing: 25 * gcd.themeScale + + + Opaque.UnderlineTextField { + visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") + id: groupNameCreate + + backgroundColor: Theme.backgroundPaneColor + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Group Name + placeholderText: qsTr("group-name") + + } + + Row { + width: parent.width - (40*gcd.themeScale) + + Column { + visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") + width: parent.width / 2 + Opaque.ScalingLabel { + //: Server + text: qsTr("server") + } + } + + Column { + visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") + width: parent.width / 2 + Opaque.ScalingLabel { + //: Invitation + text: qsTr("invitation") + } + } + } + } + + Column { + Layout.fillWidth: true + leftPadding: 20 * gcd.themeScale + rightPadding: 20 * gcd.themeScale + spacing: 25 * gcd.themeScale + + + Opaque.UnderlineTextField { + visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") + id: groupAddr + + backgroundColor: Theme.backgroundPaneColor + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Address + placeholderText: qsTr("group-addr") + + } + + Opaque.UnderlineTextField { + visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment") + id: groupNameJoin + + backgroundColor: Theme.backgroundPaneColor + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Name + placeholderText: qsTr("group-name") + } + } + + } + + Rectangle { // Spacer + width: 1 + height: 25 * gcd.themeScale + color: root.color + } + + + Opaque.Button { + anchors.horizontalCenter: parent.horizontalCenter + + height: 40 * gcd.themeScale + + //: Add Peer | Create Group | Join Group + text: addStack.currentIndex == addStack.addPeer ? qsTr("add-peer") : addStack.currentIndex == addStack.createGroup ? qsTr("create-group") : qsTr("join-group") + + onClicked: { + if (addStack.currentIndex == addStack.addPeer) { + gcd.addPeer(peerName.text, peerAddr.text) + theStack.currentIndex = theStack.emptyPane + } // Else Group stuff + } + } + + } + + +} diff --git a/qml/panes/OverlayPane.qml b/qml/panes/OverlayPane.qml index 24b8a204..6d5c3881 100644 --- a/qml/panes/OverlayPane.qml +++ b/qml/panes/OverlayPane.qml @@ -19,37 +19,6 @@ ColumnLayout { property bool accepted property bool inGroup - // TODO: this isn't needed now right? the peer approval flow can be addapted for groups too? - /* RowLayout { - visible:!overlay.accepted && (gcd.selectedConversation.length == 32) - - - Text { - //: Do you want to accept the invitation to $GROUP - text: qsTr("accept-group-invite-label") + " " + overlay.name + "?" - } - - Opaque.Button { - //: Accept group invite button - text: qsTr("accept-group-btn") - icon: "regular/heart" - onClicked: { - gcd.acceptGroup(gcd.selectedConversation) - gcd.requestGroupSettings(gcd.selectedConversation) - } - } - - Opaque.Button { - //: Reject Group invite button - text: qsTr("reject-group-btn") - icon: "regular/trash-alt" - onClicked: { - gcd.leaveGroup(gcd.selectedConversation) - theStack.pane = theStack.emptyPane - } - } - }*/ - RowLayout { id: switcher diff --git a/qml/widgets/MyProfile.qml b/qml/widgets/MyProfile.qml index c39966b1..a7048bf5 100644 --- a/qml/widgets/MyProfile.qml +++ b/qml/widgets/MyProfile.qml @@ -130,7 +130,7 @@ Item { width: height radius: width * 0.3 onClicked: { - + theStack.currentIndex = theStack.addPeerGroupPane } } }