profile edit (name) and delete (non functioning cus cwtch doesnt support) ui

This commit is contained in:
Dan Ballard 2019-11-29 17:35:57 -08:00
parent ba14e8ad72
commit 541f4f7da4
13 changed files with 474 additions and 41 deletions

View File

@ -121,7 +121,7 @@ func App(gcd *ui.GrandCentralDispatcher, subscribed chan bool, reloadingFirst bo
if e.Data[event.Status] != "running" {
peer.Listen()
peer.StartPeersConnections()
peer.StartGroupConnections()
//peer.StartGroupConnections()
}
blockUnkownPeers, exists := peer.GetProfile().GetAttribute(constants.BlockUnknownPeersSetting)

View File

@ -41,6 +41,8 @@ type GrandCentralDispatcher struct {
_ func(handle, displayname, image string) `signal:"AddProfile"`
_ func() `signal:"ErrorLoaded0"`
_ func() `signal:"ResetProfile"`
_ func() `signal:"ResetProfileList"`
_ func(onion string) `signal:"deleteProfile"`
// contact list stuff
_ func(handle, displayName, image, server string, badge, status int, blocked bool, loading bool, lastMsgTime int) `signal:"AddContact"`
@ -72,8 +74,16 @@ type GrandCentralDispatcher struct {
_ func(onion, nick string, blocked bool) `signal:"SupplyPeerSettings"`
// signals emitted from the ui (written in go, below)
//_ func(onion string) `signal:"setSelectedProfile,auto"`
//_ func(onion string) `signal:"setSelectedConversation,auto"`
// ui
_ func() `signal:"onActivate,auto"`
_ func(locale string) `signal:"setLocale,auto"`
// profile managemenet
_ func(onion, nick string) `signal:"updateNick,auto"`
_ func(handle string) `signal:"loadProfile,auto"`
_ func(nick, password string) `signal:"createProfile,auto"`
_ func(password string) `signal:"unlockProfiles,auto"`
_ func() `signal:"reloadProfileList,auto"`
// operating a profile
_ func(message string, mid string) `signal:"sendMessage,auto"`
_ func(onion string) `signal:"blockPeer,auto"`
_ func(onion string) `signal:"unblockPeer,auto"`
@ -82,7 +92,6 @@ type GrandCentralDispatcher struct {
_ func(str string) `signal:"importString,auto"`
_ func(str string) `signal:"createContact,auto"`
_ func(str string) `signal:"popup,auto"`
_ func(nick string) `signal:"updateNick,auto"`
_ func(server, groupName string) `signal:"createGroup,auto"`
_ func(groupID string) `signal:"leaveGroup,auto"`
_ func(groupID string) `signal:"acceptGroup,auto"`
@ -95,12 +104,8 @@ type GrandCentralDispatcher struct {
_ func(onion, groupID string) `signal:"inviteToGroup,auto"`
_ func(onion, key, nick string) `signal:"setAttribute,auto"`
_ func(onion string) `signal:"deleteContact,auto"`
_ func(locale string) `signal:"setLocale,auto"`
_ func() `signal:"allowUnknownPeers,auto"`
_ func() `signal:"blockUnknownPeers,auto"`
_ func() `signal:"onActivate,auto"`
_ func(password string) `signal:"unlockProfiles,auto"`
_ func(handle string) `signal:"loadProfile,auto"`
_ func() `constructor:"init"`
}
@ -475,11 +480,14 @@ func (this *GrandCentralDispatcher) popup(str string) {
this.InvokePopup(str)
}
func (this *GrandCentralDispatcher) updateNick(nick string) {
the.Peer.GetProfile().Name = nick
the.EventBus.Publish(event.NewEvent(event.SetProfileName, map[event.Field]string{
event.ProfileName: nick,
}))
func (this *GrandCentralDispatcher) updateNick(onion, nick string) {
peer := the.CwtchApp.GetPeer(onion)
if peer != nil {
peer.GetProfile().Name = nick
the.CwtchApp.GetEventBus(onion).Publish(event.NewEvent(event.SetProfileName, map[event.Field]string{
event.ProfileName: nick,
}))
}
}
func (this *GrandCentralDispatcher) createGroup(server, groupName string) {
@ -610,3 +618,19 @@ func (this *GrandCentralDispatcher) loadProfile(onion string) {
this.SetLocale_helper(locale)
}
}
func (this *GrandCentralDispatcher) createProfile(nick, password string) {
the.CwtchApp.CreatePeer(nick, password)
}
func (this *GrandCentralDispatcher) reloadProfileList() {
this.ResetProfileList()
for onion, _ := range the.CwtchApp.ListPeers() {
AddProfile(this, onion)
}
}
func (this *GrandCentralDispatcher) deleteProfile(onion string) {
//the.CwtchApp.
}

View File

@ -164,25 +164,25 @@
<context>
<name>MyProfile</name>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="183"/>
<location filename="../qml/widgets/MyProfile.qml" line="185"/>
<source>copy-btn</source>
<extracomment>Button for copying profile onion address to clipboard</extracomment>
<translation>Kopieren</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="187"/>
<location filename="../qml/widgets/MyProfile.qml" line="189"/>
<source>copied-clipboard-notification</source>
<extracomment>Copied to clipboard</extracomment>
<translation>in die Zwischenablage kopiert</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="217"/>
<location filename="../qml/widgets/MyProfile.qml" line="219"/>
<source>new-group-btn</source>
<extracomment>create new group button</extracomment>
<translation>Neue Gruppe anlegen</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="227"/>
<location filename="../qml/widgets/MyProfile.qml" line="229"/>
<source>paste-address-to-add-contact</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation>Adresse hier hinzufügen, um einen Kontakt aufzunehmen</translation>
@ -273,6 +273,91 @@
<translation>löschen</translation>
</message>
</context>
<context>
<name>ProfileAddEditPane</name>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>add-profile-title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>edit-profile-title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="80"/>
<source>profile-name</source>
<extracomment>Profile name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="27"/>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="88"/>
<source>default-profile-name</source>
<extracomment>default suggested profile name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="69"/>
<source>profile-onion-label</source>
<extracomment>Profile Onion</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="93"/>
<source>password1-label</source>
<extracomment>Password</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="107"/>
<source>password2-label</source>
<extracomment>Reenter password</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>create-profile-btn</source>
<extracomment>Create Profile || Save Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>save-profile-btn</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="141"/>
<source>password-error-match</source>
<extracomment>Passwords do not match</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="148"/>
<source>delete-profile-btn</source>
<extracomment>Delete Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="162"/>
<source>delete-confirm-label</source>
<extracomment>Type DELETE to confirm</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="176"/>
<source>delete-profile-confirm-btn</source>
<extracomment>Really Delete Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="182"/>
<source>delete-confirm-text</source>
<extracomment>DELETE</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProfileManagerPane</name>
<message>
@ -339,7 +424,7 @@
<context>
<name>StackToolbar</name>
<message>
<location filename="../qml/widgets/StackToolbar.qml" line="52"/>
<location filename="../qml/widgets/StackToolbar.qml" line="59"/>
<source>view-group-membership-tooltip</source>
<extracomment>View Group Membership</extracomment>
<translation type="unfinished"></translation>

Binary file not shown.

View File

@ -164,25 +164,25 @@
<context>
<name>MyProfile</name>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="183"/>
<location filename="../qml/widgets/MyProfile.qml" line="185"/>
<source>copy-btn</source>
<extracomment>Button for copying profile onion address to clipboard</extracomment>
<translation>Copy</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="187"/>
<location filename="../qml/widgets/MyProfile.qml" line="189"/>
<source>copied-clipboard-notification</source>
<extracomment>Copied to clipboard</extracomment>
<translation>Copied to clipboard</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="217"/>
<location filename="../qml/widgets/MyProfile.qml" line="219"/>
<source>new-group-btn</source>
<extracomment>create new group button</extracomment>
<translation>Create new group</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="227"/>
<location filename="../qml/widgets/MyProfile.qml" line="229"/>
<source>paste-address-to-add-contact</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation>... paste an address here to add a contact...</translation>
@ -273,6 +273,91 @@
<translation>Delete</translation>
</message>
</context>
<context>
<name>ProfileAddEditPane</name>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>add-profile-title</source>
<translation>Add new profile</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>edit-profile-title</source>
<translation>Edit Profile</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="80"/>
<source>profile-name</source>
<extracomment>Profile name</extracomment>
<translation>Display name</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="27"/>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="88"/>
<source>default-profile-name</source>
<extracomment>default suggested profile name</extracomment>
<translation>Alice</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="69"/>
<source>profile-onion-label</source>
<extracomment>Profile Onion</extracomment>
<translation>Onion</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="93"/>
<source>password1-label</source>
<extracomment>Password</extracomment>
<translation>Password</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="107"/>
<source>password2-label</source>
<extracomment>Reenter password</extracomment>
<translation>Password</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>create-profile-btn</source>
<extracomment>Create Profile || Save Profile</extracomment>
<translation>Create Profile</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>save-profile-btn</source>
<translation>Save Profile</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="141"/>
<source>password-error-match</source>
<extracomment>Passwords do not match</extracomment>
<translation>Passwords do not match</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="148"/>
<source>delete-profile-btn</source>
<extracomment>Delete Profile</extracomment>
<translation>Delete Profile</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="162"/>
<source>delete-confirm-label</source>
<extracomment>Type DELETE to confirm</extracomment>
<translation>Type DELETE to confirm</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="176"/>
<source>delete-profile-confirm-btn</source>
<extracomment>Really Delete Profile</extracomment>
<translation>Really Delete Profile</translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="182"/>
<source>delete-confirm-text</source>
<extracomment>DELETE</extracomment>
<translation>DELETE</translation>
</message>
</context>
<context>
<name>ProfileManagerPane</name>
<message>
@ -339,7 +424,7 @@
<context>
<name>StackToolbar</name>
<message>
<location filename="../qml/widgets/StackToolbar.qml" line="52"/>
<location filename="../qml/widgets/StackToolbar.qml" line="59"/>
<source>view-group-membership-tooltip</source>
<extracomment>View Group Membership</extracomment>
<translation>View Group Membership</translation>

View File

@ -164,25 +164,25 @@
<context>
<name>MyProfile</name>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="183"/>
<location filename="../qml/widgets/MyProfile.qml" line="185"/>
<source>copy-btn</source>
<extracomment>Button for copying profile onion address to clipboard</extracomment>
<translation>Copier</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="187"/>
<location filename="../qml/widgets/MyProfile.qml" line="189"/>
<source>copied-clipboard-notification</source>
<extracomment>Copied to clipboard</extracomment>
<translation>Copié dans le presse-papier</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="217"/>
<location filename="../qml/widgets/MyProfile.qml" line="219"/>
<source>new-group-btn</source>
<extracomment>create new group button</extracomment>
<translation>Créer un nouveau groupe</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="227"/>
<location filename="../qml/widgets/MyProfile.qml" line="229"/>
<source>paste-address-to-add-contact</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation>... coller une adresse ici pour ajouter un contact...</translation>
@ -273,6 +273,91 @@
<translation>Effacer</translation>
</message>
</context>
<context>
<name>ProfileAddEditPane</name>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>add-profile-title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>edit-profile-title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="80"/>
<source>profile-name</source>
<extracomment>Profile name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="27"/>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="88"/>
<source>default-profile-name</source>
<extracomment>default suggested profile name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="69"/>
<source>profile-onion-label</source>
<extracomment>Profile Onion</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="93"/>
<source>password1-label</source>
<extracomment>Password</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="107"/>
<source>password2-label</source>
<extracomment>Reenter password</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>create-profile-btn</source>
<extracomment>Create Profile || Save Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>save-profile-btn</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="141"/>
<source>password-error-match</source>
<extracomment>Passwords do not match</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="148"/>
<source>delete-profile-btn</source>
<extracomment>Delete Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="162"/>
<source>delete-confirm-label</source>
<extracomment>Type DELETE to confirm</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="176"/>
<source>delete-profile-confirm-btn</source>
<extracomment>Really Delete Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="182"/>
<source>delete-confirm-text</source>
<extracomment>DELETE</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProfileManagerPane</name>
<message>
@ -339,7 +424,7 @@
<context>
<name>StackToolbar</name>
<message>
<location filename="../qml/widgets/StackToolbar.qml" line="52"/>
<location filename="../qml/widgets/StackToolbar.qml" line="59"/>
<source>view-group-membership-tooltip</source>
<extracomment>View Group Membership</extracomment>
<translation type="unfinished"></translation>

View File

@ -164,25 +164,25 @@
<context>
<name>MyProfile</name>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="183"/>
<location filename="../qml/widgets/MyProfile.qml" line="185"/>
<source>copy-btn</source>
<extracomment>Button for copying profile onion address to clipboard</extracomment>
<translation>Copiar</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="187"/>
<location filename="../qml/widgets/MyProfile.qml" line="189"/>
<source>copied-clipboard-notification</source>
<extracomment>Copied to clipboard</extracomment>
<translation>Copiado</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="217"/>
<location filename="../qml/widgets/MyProfile.qml" line="219"/>
<source>new-group-btn</source>
<extracomment>create new group button</extracomment>
<translation>Criar novo grupo</translation>
</message>
<message>
<location filename="../qml/widgets/MyProfile.qml" line="227"/>
<location filename="../qml/widgets/MyProfile.qml" line="229"/>
<source>paste-address-to-add-contact</source>
<extracomment>ex: &quot;... paste an address here to add a contact ...&quot;</extracomment>
<translation> cole um endereço aqui para adicionar um contato</translation>
@ -273,6 +273,91 @@
<translation>Deletar</translation>
</message>
</context>
<context>
<name>ProfileAddEditPane</name>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>add-profile-title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="20"/>
<source>edit-profile-title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="80"/>
<source>profile-name</source>
<extracomment>Profile name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="27"/>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="88"/>
<source>default-profile-name</source>
<extracomment>default suggested profile name</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="69"/>
<source>profile-onion-label</source>
<extracomment>Profile Onion</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="93"/>
<source>password1-label</source>
<extracomment>Password</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="107"/>
<source>password2-label</source>
<extracomment>Reenter password</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>create-profile-btn</source>
<extracomment>Create Profile || Save Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="121"/>
<source>save-profile-btn</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="141"/>
<source>password-error-match</source>
<extracomment>Passwords do not match</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="148"/>
<source>delete-profile-btn</source>
<extracomment>Delete Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="162"/>
<source>delete-confirm-label</source>
<extracomment>Type DELETE to confirm</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="176"/>
<source>delete-profile-confirm-btn</source>
<extracomment>Really Delete Profile</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/ProfileAddEditPane.qml" line="182"/>
<source>delete-confirm-text</source>
<extracomment>DELETE</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProfileManagerPane</name>
<message>
@ -339,7 +424,7 @@
<context>
<name>StackToolbar</name>
<message>
<location filename="../qml/widgets/StackToolbar.qml" line="52"/>
<location filename="../qml/widgets/StackToolbar.qml" line="59"/>
<source>view-group-membership-tooltip</source>
<extracomment>View Group Membership</extracomment>
<translation type="unfinished"></translation>

View File

@ -14,6 +14,7 @@
<file>qml/panes/SettingsPane.qml</file>
<file>qml/panes/SplashPane.qml</file>
<file>qml/panes/ProfileManagerPane.qml</file>
<file>qml/panes/ProfileAddEditPane.qml</file>
<file>qml/styles/CwtchComboBoxStyle.qml</file>
<file>qml/styles/CwtchExpandingButton.qml</file>
<file>qml/styles/CwtchTextAreaStyle.qml</file>

View File

@ -118,7 +118,8 @@ ApplicationWindow {
currentIndex: 0
readonly property int splashPane: 0
readonly property int managementPane: 1
readonly property int profilePane: 2
readonly property int addEditProfilePane: 2
readonly property int profilePane: 3
property alias pane: parentStack.currentIndex
Rectangle { // Splash pane
@ -148,6 +149,18 @@ ApplicationWindow {
}
}
Rectangle { // Profile login/management pane
anchors.fill: parent
color: "#EEEEFF"
ProfileAddEditPane{
id: profileAddEditPane
anchors.fill: parent
}
}
RowLayout { // CONTAINS EVERYTHING EXCEPT THE TOOLBAR
/* anchors.left: ratio >= 0.92 ? parent.left : toolbar.right
anchors.top: ratio >= 0.92 ? toolbar.bottom : parent.top

View File

@ -10,6 +10,7 @@ import QtQuick.Controls.Styles 1.4
Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
id: crItem
anchors.left: parent.left
anchors.right: parent.right
height: 48 * logscale + 3
@ -22,12 +23,17 @@ Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
property int badge
property bool isActive
property bool isHover
property bool background: true
property string type // profile or contact or button
// Profile
property bool defaultPassword
// Contact
property bool blocked
property bool loading
property alias status: imgProfile.status
property string server
property bool background: true
property string type
property alias status: imgProfile.status
property string server
Rectangle { // CONTACT ENTRY BACKGROUND COLOR
@ -106,6 +112,11 @@ Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
}
}
// Profile
// Contact
ProgressBar { // LOADING ?
id: loadingProgress
property bool running
@ -154,6 +165,10 @@ Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
gcd.selectedProfile = handle
gcd.loadProfile(handle)
parentStack.pane = parentStack.profilePane
} else if (type == "button") { // Add profile button
profileAddEditPane.mode = "add"
profileAddEditPane.reset()
parentStack.pane = parentStack.addEditProfilePane
}
}
@ -166,6 +181,28 @@ Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
}
}
SimpleButton {// Edit BUTTON
id: btnEdit
icon: "solid/user-edit"
anchors.right: parent.right
//rectUnread.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 1 * gcd.themeScale
anchors.rightMargin: 20 * gcd.themeScale
height: parent.height * 0.75
visible: type == "profile"
onClicked: {
profileAddEditPane.mode = "edit"
profileAddEditPane.load(handle, displayName, "")
parentStack.pane = parentStack.addEditProfilePane
}
}
Connections { // UPDATE UNREAD MESSAGES COUNTER
target: gcd

View File

@ -29,6 +29,7 @@ ColumnLayout {
anchors.topMargin: 2
onClicked: function() {
gcd.selectedProfile = "none"
gcd.reloadProfileList()
parentStack.pane = parentStack.managementPane
theStack.pane = theStack.emptyPane
}
@ -120,7 +121,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
onUpdated: {
gcd.updateNick(lblNick.text)
gcd.updateNick(onion, lblNick.text)
}
}

View File

@ -69,6 +69,16 @@ ColumnLayout {
}
}
}*/
onResetProfileList: function() {
profilesModel.clear()
profilesModel.append({
_handle: "",
_displayName: qsTr("add-new-profile-btn"),
_image: "qrc:/qml/images/fontawesome/solid/user-plus.svg",
_type: "button",
})
}
}
ListModel { // Profile OBJECTS ARE STORED HERE ...
@ -76,7 +86,7 @@ ColumnLayout {
ListElement {
_handle: ""
_displayName: qsTr("Add new profile")
_displayName: qsTr("add-new-profile-btn")
_image: "qrc:/qml/images/fontawesome/solid/user-plus.svg"
_type: "button"
}

View File

@ -21,6 +21,7 @@ Rectangle { // OVERHEAD BAR ON STACK PANE
property alias aux: btnAux
property alias back: btnBack
property alias membership: btnMembership
property string stack: "profile" // profile(theStack) or management(parentStack)
SimpleButton {// BACK BUTTON
@ -29,7 +30,13 @@ Rectangle { // OVERHEAD BAR ON STACK PANE
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 6
onClicked: theStack.pane = theStack.emptyPane
onClicked: {
if (stack == "profile") {
theStack.pane = theStack.emptyPane
} else {
parentStack.pane = parentStack.managementPane
}
}
}
ScalingLabel { // TEXT