From 6117486808fafb94481739b34890e98d8f601b85 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 2 Nov 2020 14:44:45 -0800 Subject: [PATCH] add name on profile create --- go.mod | 4 +-- go.sum | 2 ++ go/handlers/appHandler.go | 8 ++++- i18n/translation_de.qm | Bin 3221 -> 3211 bytes i18n/translation_de.ts | 56 ++++++++++++++++++------------- i18n/translation_en.qm | Bin 8499 -> 8599 bytes i18n/translation_en.ts | 53 ++++++++++++++++++----------- i18n/translation_fr.qm | Bin 3135 -> 3125 bytes i18n/translation_fr.ts | 56 ++++++++++++++++++------------- i18n/translation_pt.qm | Bin 2933 -> 2923 bytes i18n/translation_pt.ts | 56 ++++++++++++++++++------------- qml/panes/ProfileAddEditPane.qml | 9 +++-- qml/panes/ProfileManagerPane.qml | 2 +- 13 files changed, 149 insertions(+), 97 deletions(-) diff --git a/go.mod b/go.mod index 8964e3a8..42000d2f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module cwtch.im/ui go 1.12 require ( - cwtch.im/cwtch v0.4.5 + cwtch.im/cwtch v0.4.6 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 @@ -20,4 +20,4 @@ require ( golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect golang.org/x/net v0.0.0-20201022231255-08b38378de70 // indirect golang.org/x/sys v0.0.0-20201022201747-fb209a7c41cd // indirect -) \ No newline at end of file +) diff --git a/go.sum b/go.sum index 83fc3264..40e915e9 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,8 @@ cwtch.im/cwtch v0.4.4 h1:LC9SngDx+iLXFiDK8GUkSxaWqloXQcPijvMPmwt9h80= cwtch.im/cwtch v0.4.4/go.mod h1:10gBkMSqAH95Pz4jTx5mpIHE+dkn+4kRC4BFTxWuQK8= cwtch.im/cwtch v0.4.5 h1:BK4IMqCMf9xNmeLzaVDUbl2bnXdw5fOWXvEGBMTOjXM= cwtch.im/cwtch v0.4.5/go.mod h1:Mh7vQQ3z55+prpX6EuUkg4QNQkBACMoDcgCNBeAH2EY= +cwtch.im/cwtch v0.4.6 h1:jQT0WZY0BGS/EKZrtvL48kMYoed00/q1ycvI0u7Dez4= +cwtch.im/cwtch v0.4.6/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/handlers/appHandler.go b/go/handlers/appHandler.go index c999e888..af743fb2 100644 --- a/go/handlers/appHandler.go +++ b/go/handlers/appHandler.go @@ -4,6 +4,7 @@ import ( "cwtch.im/cwtch/app" "cwtch.im/cwtch/app/plugins" "cwtch.im/cwtch/event" + "cwtch.im/cwtch/model/attr" "cwtch.im/ui/go/constants" "cwtch.im/ui/go/features/groups" "cwtch.im/ui/go/the" @@ -75,6 +76,11 @@ func App(gcd *ui.GrandCentralDispatcher, subscribed chan bool, reloadingAccounts p.SetAttribute(app.AttributeTag, constants.ProfileTypeV1DefaultPassword) } + if e.Data[event.Created] == event.True { + p.SetAttribute(attr.GetPublicScope(constants.Name), p.GetName()) + p.SetAttribute(attr.GetPublicScope(constants.Picture), ui.ImageToString(ui.NewImage(ui.RandomProfileImage(onion), ui.TypeImageDistro))) + } + log.Infof("NewPeer for %v\n", onion) ui.AddProfile(gcd, onion) @@ -88,7 +94,7 @@ func App(gcd *ui.GrandCentralDispatcher, subscribed chan bool, reloadingAccounts if e.Data[event.Status] != "running" { p.Listen() p.StartPeersConnections() - if _,err := groups.ExperimentGate(gcd.GlobalSettings.Experiments); err == nil { + if _, err := groups.ExperimentGate(gcd.GlobalSettings.Experiments); err == nil { p.StartServerConnections() } } diff --git a/i18n/translation_de.qm b/i18n/translation_de.qm index 9ec5da3e8635a0e59f8dcdc2c3921865a0c80bb0..371e5a8364da467ae9ee9152dca9bdce9795fee1 100644 GIT binary patch delta 25 hcmbO#*)1txvm-^~)cZM8&nn97PguD3?nbF<9srHA3v&Pf delta 35 rcmeB{oGK}0vm-^~)cZM8&nn97PguD3?s5hO2G*3+co)}=0@XYK37QSi diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 40bee578..f825070c 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -349,15 +349,7 @@ ProfileAddEditPane - default-profile-name - default suggested profile name - - - - - profile-onion-label - Send this address to peers you want to connect with @@ -400,6 +392,18 @@ edit-profile + + + profile-oniblon-label + Send this address to peers you want to connect with + + + + + your-display-name + Your Display Name + + current-password-label @@ -495,13 +499,13 @@ - + your-profiles Your Profiles - + your-servers Your Profiles @@ -526,66 +530,72 @@ Benutzeroberflächen-Zoom (betriftt hauptsächlich Text- und Knopgrößen) - + setting-language Language - + locale-en - + locale-fr - + locale-pt - + locale-de - + setting-interface-zoom Interface Zoom - + large-text-label Groß - + setting-theme Theme - + theme-light - + theme-dark - + + experiments-enabled + Theme + + + + version %1 Version %1 - + builddate %2 Built on: %2 @@ -596,7 +606,7 @@ defaultmäßige Textgröße (Skalierungsfaktor: - + small-text-label Klein diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index 5a0195a72bc93856d46f05034b5cbc20b8673c8f..96ee0bd80a9a968ec0a2a35d11acaccacf85fcfb 100644 GIT binary patch delta 365 zcmdn&G~IcE2;+r`qUxTj8P{lEVPFu{WL$e$hk=3lHRFjF=NK5oqZ!Y0US?pB%waMS z0?JDWGex+BGcd?{GVPt?!@wXK%dDNXlz~AmowB6z< z;S->~Ws`jw<(wqtI87G>Qt0gAIN z<$S#Y$Y*cnVm>DbG`@ZET1Iom|C66GD#}mkbp=|?$i3nN6Hw+D_t`B#hp?REej)^P zh*;)iStfDD?UPNJ)EWOwjs>!_CYLhhFfQBti0PszpJ+i*ep+Tus&0N>W>U`P{Ss=7 x+)50Q4EYSD3`GnIlmGH73JF%`mlo-!WEL0XBv$I?CFZ71z9=rU`KhEII{<`3Xn6nt delta 352 zcmbR4yxD1j2;+%~qUxUhjBB*7Ffa&eGOoR>!@$7&n(@Soa|{e({~6D7US?pB6kswD z0?LbTXNqtMXJC+d%QX4M8U_Z@SZ3|4r3?&m+{`U(-V6-VhbFd~Gqz9M>+hJse$;d} z1A{~-`iEi$A+io=(*}-iZXpH+P8W_< z51#<_c}@0Zlyj0e#A&(^Xffjt&L)8-pfSEc`W=uK1=3%E4!h0SB(4JFw{l*70~BXl z%K3T)kk8)C#e7Z>=uqv+YZ=WM|4x3&sHnf<0~1gri~H;rpaWRWaX%3PIzTL)N96h& z1_p*M2+h2ZN31{zXma#qTPAhM1-$J3Ux2E!dHIX?0R!j=ukUnMptJcV*D~cWdToBi ebWxN?xS%LMEi)%oH$N|P^GOLc#?78me(V5ir(zud diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index 75a00117..e1ca35ea 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -446,9 +446,7 @@ Right-click to reset. - default-profile-name - default suggested profile name Alice @@ -463,10 +461,9 @@ Right-click to reset. Edit Profille - profile-onion-label Send this address to peers you want to connect with - Send this address to peers you want to connect with + Send this address to peers you want to connect with @@ -497,6 +494,18 @@ Right-click to reset. Not using a password on this account means that all data stored locally will not be encrypted Not using a password on this account means that all data stored locally will not be encrypted + + + profile-oniblon-label + Send this address to peers you want to connect with + Send this address to peers you want to connect with + + + + your-display-name + Your Display Name + Your Display Name + current-password-label @@ -592,13 +601,13 @@ Right-click to reset. 0 profiles loaded with that password - + your-profiles Your Profiles Your Profiles - + your-servers Your Profiles Your Servers @@ -632,66 +641,72 @@ Right-click to reset. Block Unknown Peers - + setting-language Language Language - + locale-en English - + locale-fr Frances - + locale-pt Portuguesa - + locale-de Deutsche - + setting-interface-zoom Interface Zoom Zoom level - + large-text-label Large - + setting-theme Theme Theme - + theme-light Light - + theme-dark Dark - + + experiments-enabled + Theme + + + + version %1 Version %1 Version %1 - + builddate %2 Built on: %2 Built on: %2 @@ -702,7 +717,7 @@ Right-click to reset. Default size text (scale factor: - + small-text-label Small diff --git a/i18n/translation_fr.qm b/i18n/translation_fr.qm index e13d08626af42d5bbe2a2b8850d81a9098ddfa18..42e1df36cf2b6a7e640c4cff2a4dbca8740d16a2 100644 GIT binary patch delta 25 hcmdllu~kCAW=D#|srPfHo>i3DpRjQ6-HlSJJOGrr3vU1b delta 35 rcmdlgv0p;UW=D#|srPfHo>i3DpRjQ6-Q^4n46JEI@oqsI1yp$e6q^m| diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index bab389d5..1a539e31 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -349,15 +349,7 @@ ProfileAddEditPane - default-profile-name - default suggested profile name - - - - - profile-onion-label - Send this address to peers you want to connect with @@ -400,6 +392,18 @@ edit-profile + + + profile-oniblon-label + Send this address to peers you want to connect with + + + + + your-display-name + Your Display Name + + current-password-label @@ -495,13 +499,13 @@ - + your-profiles Your Profiles - + your-servers Your Profiles @@ -526,66 +530,72 @@ Interface zoom (essentiellement la taille du texte et des composants de l'interface) - + setting-language Language - + locale-en - + locale-fr - + locale-pt - + locale-de - + setting-interface-zoom Interface Zoom - + large-text-label Large - + setting-theme Theme - + theme-light - + theme-dark - + + experiments-enabled + Theme + + + + version %1 Version %1 - + builddate %2 Built on: %2 @@ -596,7 +606,7 @@ Taille par défaut du texte (échelle: - + small-text-label Petit diff --git a/i18n/translation_pt.qm b/i18n/translation_pt.qm index 8c6f6d5924f6021ff4ad7f7e12d4cdee240f1822..f0ec24706be7a09648130b9059bb25e1e9f6e956 100644 GIT binary patch delta 25 hcmew=_F7E9W=D#|srPfHo>i3DpRjQ6-HlSw+yI{F3=9AO delta 35 rcmaDY_Ek*EW=D#|srPfHo>i3DpRjQ6-Q^4n46Fqu@lHV-1){kDBPProfileAddEditPane - default-profile-name - default suggested profile name - - - - - profile-onion-label - Send this address to peers you want to connect with @@ -400,6 +392,18 @@ edit-profile + + + profile-oniblon-label + Send this address to peers you want to connect with + + + + + your-display-name + Your Display Name + + current-password-label @@ -495,13 +499,13 @@ - + your-profiles Your Profiles - + your-servers Your Profiles @@ -526,66 +530,72 @@ Zoom da interface (afeta principalmente tamanho de texto e botões) - + setting-language Language - + locale-en - + locale-fr - + locale-pt - + locale-de - + setting-interface-zoom Interface Zoom - + large-text-label Grande - + setting-theme Theme - + theme-light - + theme-dark - + + experiments-enabled + Theme + + + + version %1 Version %1 - + builddate %2 Built on: %2 @@ -596,7 +606,7 @@ Texto tamanho padrão (fator de escala: - + small-text-label Pequeno diff --git a/qml/panes/ProfileAddEditPane.qml b/qml/panes/ProfileAddEditPane.qml index 4f94076c..4c80de0c 100644 --- a/qml/panes/ProfileAddEditPane.qml +++ b/qml/panes/ProfileAddEditPane.qml @@ -32,7 +32,7 @@ Opaque.Flickable { flickRoot.contentY = 0 mode = mode_add reset_errors() - txtProfileName.text = qsTr("default-profile-name") + txtProfileName.text = "" changingPassword = false txtPassword1.text = "" txtPassword2.text = "" @@ -250,14 +250,13 @@ Opaque.Flickable { Opaque.UnderlineTextField { id: txtProfileName - visible: mode == mode_edit - //Layout.fillWidth: true + backgroundColor: Theme.backgroundPaneColor width: parent.width - (40*gcd.themeScale) anchors.horizontalCenter: parent.horizontalCenter - //: default suggested profile name - text: qsTr("default-profile-name") + //: Your Display Name + placeholderText: qsTr("your-display-name") } diff --git a/qml/panes/ProfileManagerPane.qml b/qml/panes/ProfileManagerPane.qml index 0cea77ce..572d7c2a 100644 --- a/qml/panes/ProfileManagerPane.qml +++ b/qml/panes/ProfileManagerPane.qml @@ -78,7 +78,7 @@ ColumnLayout { Opaque.ScalingLabel { id: error anchors.horizontalCenter: parent.horizontalCenter - color: "red" + color: Theme.textfieldErrorColor //: 0 profiles loaded with that password text: qsTr("error-0-profiles-loaded-for-password") visible: false -- 2.25.1