Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
de5b5c02
Commit
de5b5c02
authored
4 years ago
by
Daniel Brötzmann
Committed by
Philipp Hörist
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
AccountPage: Add avatar and profile button
parent
707286c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gajim/common/const.py
+1
-0
1 addition, 0 deletions
gajim/common/const.py
gajim/data/gui/account_page.ui
+64
-7
64 additions, 7 deletions
gajim/data/gui/account_page.ui
gajim/gtk/account_page.py
+14
-1
14 additions, 1 deletion
gajim/gtk/account_page.py
with
79 additions
and
8 deletions
gajim/common/const.py
+
1
−
0
View file @
de5b5c02
...
...
@@ -33,6 +33,7 @@ class AvatarSize(IntEnum):
NOTIFICATION
=
48
GROUP_INFO
=
100
TOOLTIP
=
100
ACCOUNT_PAGE
=
150
VCARD
=
200
PUBLISH
=
200
...
...
This diff is collapsed.
Click to expand it.
gajim/data/gui/account_page.ui
+
64
−
7
View file @
de5b5c02
...
...
@@ -128,11 +128,54 @@
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"spacing"
>
12
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
6
</property>
<child>
<object
class=
"GtkOverlay"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<child>
<object
class=
"GtkImage"
id=
"avatar_image"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"icon-name"
>
missging-image
</property>
<property
name=
"icon_size"
>
6
</property>
</object>
<packing>
<property
name=
"index"
>
-1
</property>
</packing>
</child>
<child
type=
"overlay"
>
<object
class=
"GtkButton"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
True
</property>
<property
name=
"receives-default"
>
True
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Edit Profile…
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"valign"
>
start
</property>
<signal
name=
"clicked"
handler=
"_on_edit_profile"
swapped=
"no"
/>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"icon-name"
>
document-edit-symbolic
</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"account_label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"label"
>
<
name
>
</property>
<style>
<class
name=
"large-header"
/>
</style>
...
...
@@ -140,15 +183,29 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkBox"
id=
"account_action_box"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<object
class=
"GtkButton"
id=
"account_settings"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
True
</property>
<property
name=
"receives-default"
>
True
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Account Settings…
</property>
<property
name=
"halign"
>
end
</property>
<signal
name=
"clicked"
handler=
"_on_account_settings"
swapped=
"no"
/>
<child>
<object
class=
"GtkImage"
>
...
...
@@ -161,19 +218,19 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<style>
<class
name=
"account-page-box"
/>
</style>
...
...
This diff is collapsed.
Click to expand it.
gajim/gtk/account_page.py
+
14
−
1
View file @
de5b5c02
...
...
@@ -16,6 +16,7 @@
from
gi.repository
import
Gtk
from
gajim.common
import
app
from
gajim.common.const
import
AvatarSize
from
gajim.common.i18n
import
_
from
.roster
import
Roster
...
...
@@ -32,13 +33,16 @@ class AccountPage(Gtk.Box):
def
__init__
(
self
,
account
):
Gtk
.
Box
.
__init__
(
self
)
self
.
_account
=
account
self
.
_jid
=
app
.
get_jid_from_account
(
account
)
client
=
app
.
get_client
(
account
)
self
.
_contact
=
client
.
get_module
(
'
Contacts
'
).
get_contact
(
self
.
_jid
)
self
.
_ui
=
get_builder
(
'
account_page.ui
'
)
self
.
add
(
self
.
_ui
.
paned
)
self
.
_status_selector
=
StatusSelector
()
self
.
_status_selector
.
set_halign
(
Gtk
.
Align
.
CENTER
)
self
.
_ui
.
account_box
.
add
(
self
.
_status_selector
)
self
.
_ui
.
account_
action_
box
.
add
(
self
.
_status_selector
)
self
.
_roster
=
Roster
(
account
)
self
.
_ui
.
roster_box
.
add
(
self
.
_roster
)
...
...
@@ -56,6 +60,9 @@ def __init__(self, account):
self
.
update
()
def
_on_edit_profile
(
self
,
_button
):
open_window
(
'
ProfileWindow
'
,
account
=
self
.
_account
)
def
_on_account_settings
(
self
,
_button
):
window
=
open_window
(
'
AccountsWindow
'
)
window
.
select_account
(
self
.
_account
)
...
...
@@ -78,6 +85,12 @@ def update(self):
account_label
=
app
.
settings
.
get_account_setting
(
self
.
_account
,
'
account_label
'
)
self
.
_ui
.
account_label
.
set_text
(
account_label
)
surface
=
self
.
_contact
.
get_avatar
(
AvatarSize
.
ACCOUNT_PAGE
,
self
.
get_scale_factor
(),
add_show
=
False
)
self
.
_ui
.
avatar_image
.
set_from_surface
(
surface
)
self
.
_status_selector
.
update
()
def
process_event
(
self
,
event
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment