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 371e5a83..7292b66e 100644
Binary files a/i18n/translation_de.qm and b/i18n/translation_de.qm differ
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
+ Server
-
Group name label
- Gruppenname
+ Gruppenname
-
default suggested group name
- Tolle Gruppe
+ Tolle Gruppe
-
create group button
- Anlegen
+ Anlegen
+
+
+
+ AddPeerGroupPane
+
+
+
+ Send this address to peers you want to connect with
+
+
+
+
+
+ Kopieren
+
+
+
+
+ notification: copied to clipboard
+ in die Zwischenablage kopiert
+
+
+
+
+ Add a peer
+
+
+
+
+
+ Create a group
+
+
+
+
+
+ Join a group
+
+
+
+
+
+ Address
+
+
+
+
+
+ Name
+
+
+
+
+
+
+ Group Name
+----------
+Name
+
+
+
+
+
+ Server
+
+
+
+
+
+ Invitation
+
+
+
+
+
+ Address
+
+
+
+
+
+ Add Peer | Create Group | Join Group
+
+
+
+
+
+
+
+
+
+
+
@@ -270,17 +359,17 @@
Ablehnen
-
+
Chat
-
+
Listen
-
+
Meldungen
@@ -347,11 +436,6 @@
ProfileAddEditPane
-
-
-
-
-
@@ -364,13 +448,13 @@
in die Zwischenablage kopiert
-
+
Password
-
+
Unencrypted (No password)
@@ -399,73 +483,73 @@
-
+
Your Display Name
-
+
Current Password
-
+
Password
-
+
Reenter password
-
+
Create || Save
-
+
-
+
Passwords do not match
-
+
Error changing password: Supplied password rejected
-
+
Delete Profile
-
-
+
+
Type DELETE to confirm
-
+
Really Delete Profile
-
+
DELETE
@@ -638,4 +722,13 @@
+
+ main
+
+
+
+ New Connection
+
+
+
diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm
index 96ee0bd8..1af0d504 100644
Binary files a/i18n/translation_en.qm and b/i18n/translation_en.qm differ
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
+ Server
-
Group name label
+ Group name
+
+
+
+ default suggested group name
+ Awesome Group
+
+
+
+ create group button
+ Create
+
+
+
+ AddPeerGroupPane
+
+
+
+ Send this address to peers you want to connect with
+ Send this address to peers you want to connect with
+
+
+
+
+ Copy
+
+
+
+
+ notification: copied to clipboard
+ Copied to Clipboard
+
+
+
+
+ Add a peer
+ Add a peer
+
+
+
+
+ Create a group
+ Create a group
+
+
+
+
+ Join a group
+ Join a group
+
+
+
+
+ Address
+ Address
+
+
+
+
+ Name
+ Name
+
+
+
+
+
+ Group Name
+----------
+Name
Group name
-
-
- default suggested group name
- Awesome Group
+
+
+ Server
+ Server
-
-
- create group button
- Create
+
+
+ Invitation
+ Invitation
+
+
+
+
+ Address
+ Address
+
+
+
+
+ Add Peer | Create Group | Join Group
+ Add Peer
+
+
+
+
+ Create group
+
+
+
+
+ Join group
@@ -350,17 +439,17 @@ Right-click to reset.
Reject
-
+
Chat
-
+
Lists
-
+
Bulletins
@@ -445,9 +534,8 @@ Right-click to reset.
Display name
-
- Alice
+ Alice
@@ -477,13 +565,13 @@ Right-click to reset.
Copied to Clipboard
-
+
Password
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
-
+
Current Password
Current Password
-
+
Password
Password
-
+
Reenter password
Reenter password
-
+
Create || Save
Create Profile
-
+
Save Profile
-
+
Passwords do not match
Passwords do not match
-
+
Error changing password: Supplied password rejected
Error changing password: Supplied password rejected
-
+
Delete Profile
Delete Profile
-
-
+
+
Type DELETE to confirm
Type DELETE to confirm
-
+
Really Delete Profile
Really Delete Profile
-
+
DELETE
DELETE
@@ -697,7 +785,7 @@ Right-click to reset.
Theme
-
+ Experiments enabled
@@ -757,4 +845,13 @@ Right-click to reset.
Online
+
+ main
+
+
+
+ New Connection
+ New Connection
+
+
diff --git a/i18n/translation_fr.qm b/i18n/translation_fr.qm
index 42e1df36..766fe009 100644
Binary files a/i18n/translation_fr.qm and b/i18n/translation_fr.qm differ
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
- Serveur
+ Serveur
-
Group name label
- Groupe
+ Groupe
-
default suggested group name
- Un super groupe
+ Un super groupe
-
create group button
- Créer
+ Créer
+
+
+
+ AddPeerGroupPane
+
+
+
+ Send this address to peers you want to connect with
+
+
+
+
+
+ Copier
+
+
+
+
+ notification: copied to clipboard
+ Copié dans le presse-papier
+
+
+
+
+ Add a peer
+
+
+
+
+
+ Create a group
+
+
+
+
+
+ Join a group
+
+
+
+
+
+ Address
+
+
+
+
+
+ Name
+
+
+
+
+
+
+ Group Name
+----------
+Name
+
+
+
+
+
+ Server
+
+
+
+
+
+ Invitation
+
+
+
+
+
+ Address
+
+
+
+
+
+ Add Peer | Create Group | Join Group
+
+
+
+
+
+
+
+
+
+
+
@@ -270,17 +359,17 @@
Refuser
-
+
Discuter
-
+
Listes
-
+
Bulletins
@@ -347,11 +436,6 @@
ProfileAddEditPane
-
-
-
-
-
@@ -364,13 +448,13 @@
Copié dans le presse-papier
-
+
Password
-
+
Unencrypted (No password)
@@ -399,73 +483,73 @@
-
+
Your Display Name
-
+
Current Password
-
+
Password
-
+
Reenter password
-
+
Create || Save
-
+
-
+
Passwords do not match
-
+
Error changing password: Supplied password rejected
-
+
Delete Profile
-
-
+
+
Type DELETE to confirm
-
+
Really Delete Profile
-
+
DELETE
@@ -638,4 +722,13 @@
+
+ main
+
+
+
+ New Connection
+
+
+
diff --git a/i18n/translation_pt.qm b/i18n/translation_pt.qm
index f0ec2470..3f79a093 100644
Binary files a/i18n/translation_pt.qm and b/i18n/translation_pt.qm differ
diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts
index 6a0fb62b..6bc36e0f 100644
--- a/i18n/translation_pt.ts
+++ b/i18n/translation_pt.ts
@@ -8,28 +8,117 @@
Criar Grupo
-
Server label
- Servidor
+ Servidor
-
Group name label
- Nome do grupo
+ Nome do grupo
-
default suggested group name
- Grupo incrível
+ Grupo incrível
-
create group button
- Criar
+ Criar
+
+
+
+ AddPeerGroupPane
+
+
+
+ Send this address to peers you want to connect with
+
+
+
+
+
+ Copiar
+
+
+
+
+ notification: copied to clipboard
+ Copiado
+
+
+
+
+ Add a peer
+
+
+
+
+
+ Create a group
+
+
+
+
+
+ Join a group
+
+
+
+
+
+ Address
+
+
+
+
+
+ Name
+
+
+
+
+
+
+ Group Name
+----------
+Name
+
+
+
+
+
+ Server
+
+
+
+
+
+ Invitation
+
+
+
+
+
+ Address
+
+
+
+
+
+ Add Peer | Create Group | Join Group
+
+
+
+
+
+
+
+
+
+
+
@@ -270,17 +359,17 @@
Recusar
-
+
Chat
-
+
Listas
-
+
Boletins
@@ -347,11 +436,6 @@
ProfileAddEditPane
-
-
-
-
-
@@ -364,13 +448,13 @@
Copiado
-
+
Password
-
+
Unencrypted (No password)
@@ -399,73 +483,73 @@
-
+
Your Display Name
-
+
Current Password
-
+
Password
-
+
Reenter password
-
+
Create || Save
-
+
-
+
Passwords do not match
-
+
Error changing password: Supplied password rejected
-
+
Delete Profile
-
-
+
+
Type DELETE to confirm
-
+
Really Delete Profile
-
+
DELETE
@@ -638,4 +722,13 @@
+
+ main
+
+
+
+ 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
}
}
}