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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
eta
gajim
Commits
564f35d6
Commit
564f35d6
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
[Sef] Group Chat roster has now tooltips
parent
650bbdca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/groupchat_window.py
+6
-5
6 additions, 5 deletions
src/groupchat_window.py
src/tooltips.py
+17
-2
17 additions, 2 deletions
src/tooltips.py
with
23 additions
and
7 deletions
src/groupchat_window.py
+
6
−
5
View file @
564f35d6
...
...
@@ -270,7 +270,7 @@ class GroupchatWindow(chat.Chat):
def
escape
(
self
,
s
):
return
s
.
replace
(
'
&
'
,
'
&
'
).
replace
(
'
<
'
,
'
<
'
).
replace
(
'
>
'
,
'
>
'
)
def
add_contact_to_roster
(
self
,
room_jid
,
nick
,
show
,
role
,
jid
,
affiliation
):
def
add_contact_to_roster
(
self
,
room_jid
,
nick
,
show
,
role
,
jid
,
affiliation
,
status
):
model
=
self
.
list_treeview
[
room_jid
].
get_model
()
image
=
self
.
plugin
.
roster
.
jabber_state_images
[
show
]
resource
=
''
...
...
@@ -291,7 +291,7 @@ class GroupchatWindow(chat.Chat):
iter
=
model
.
append
(
role_iter
,
(
image
,
nick
,
self
.
escape
(
nick
)))
gajim
.
gc_contacts
[
self
.
account
][
room_jid
][
nick
]
=
\
Contact
(
jid
=
j
,
name
=
nick
,
show
=
show
,
resource
=
resource
,
role
=
role
,
affiliation
=
affiliation
)
role
=
role
,
affiliation
=
affiliation
,
status
=
status
)
if
nick
==
self
.
nicks
[
room_jid
]:
# we became online
self
.
got_connected
(
room_jid
)
self
.
list_treeview
[
room_jid
].
expand_row
((
model
.
get_path
(
role_iter
)),
...
...
@@ -363,13 +363,13 @@ class GroupchatWindow(chat.Chat):
iter
=
self
.
get_contact_iter
(
room_jid
,
nick
)
if
not
iter
:
iter
=
self
.
add_contact_to_roster
(
room_jid
,
nick
,
show
,
role
,
jid
,
affiliation
)
affiliation
,
status
)
else
:
actual_role
=
self
.
get_role
(
room_jid
,
nick
)
if
role
!=
actual_role
:
self
.
remove_contact
(
room_jid
,
nick
)
self
.
add_contact_to_roster
(
room_jid
,
nick
,
show
,
role
,
jid
,
affiliation
)
affiliation
,
status
)
else
:
c
=
gajim
.
gc_contacts
[
self
.
account
][
room_jid
][
nick
]
if
c
.
show
==
show
and
c
.
status
==
status
and
\
...
...
@@ -377,6 +377,7 @@ class GroupchatWindow(chat.Chat):
return
c
.
show
=
show
c
.
affiliation
=
affiliation
c
.
status
=
status
roster
=
self
.
plugin
.
roster
state_images
=
roster
.
get_appropriate_state_images
(
jid
)
image
=
state_images
[
show
]
...
...
@@ -391,6 +392,7 @@ class GroupchatWindow(chat.Chat):
st
+=
'
(
'
+
status
+
'
)
'
self
.
print_conversation
(
st
,
room_jid
)
def
set_subject
(
self
,
room_jid
,
subject
):
self
.
subjects
[
room_jid
]
=
subject
...
...
@@ -1070,7 +1072,6 @@ class GroupchatWindow(chat.Chat):
self
.
got_disconnected
(
room_jid
)
#init some variables
conversation_textview
.
grab_focus
()
self
.
childs
[
room_jid
].
show_all
()
def
on_list_treeview_motion_notify_event
(
self
,
widget
,
event
):
model
=
widget
.
get_model
()
props
=
widget
.
get_path_at_pos
(
int
(
event
.
x
),
int
(
event
.
y
))
...
...
This diff is collapsed.
Click to expand it.
src/tooltips.py
+
17
−
2
View file @
564f35d6
...
...
@@ -248,10 +248,12 @@ class GCTooltip(BaseTooltip, StatusTable):
def
__init__
(
self
,
plugin
):
self
.
account
=
None
self
.
plugin
=
plugin
self
.
text_lable
=
gtk
.
Label
()
self
.
text_lable
.
set_line_wrap
(
True
)
self
.
text_lable
.
set_alignment
(
0.
,
0.
)
self
.
text_lable
.
set_selectable
(
False
)
BaseTooltip
.
__init__
(
self
)
def
populate
(
self
,
contact
):
...
...
@@ -259,7 +261,12 @@ class GCTooltip(BaseTooltip, StatusTable):
return
self
.
create_window
()
hbox
=
gtk
.
HBox
()
info
=
'
<span size=
"
large
"
weight=
"
bold
"
>
'
+
contact
.
name
+
'
</span>
'
if
contact
.
jid
.
strip
()
!=
''
:
info
=
'
<span size=
"
large
"
weight=
"
bold
"
>
'
+
contact
.
jid
+
'
</span>
'
else
:
info
=
'
<span size=
"
large
"
weight=
"
bold
"
>
'
+
contact
.
name
+
'
</span>
'
info
+=
'
\n
<span weight=
"
bold
"
>
'
+
_
(
'
Role:
'
)
+
'
</span>
'
+
\
helpers
.
get_uf_role
(
contact
.
role
)
...
...
@@ -274,12 +281,20 @@ class GCTooltip(BaseTooltip, StatusTable):
if
status
!=
''
:
# escape markup entities
info
+=
'
-
'
+
gtkgui_helpers
.
escape_for_pango_markup
(
status
)
if
contact
.
resource
.
strip
()
!=
''
:
info
+=
'
\n
<span weight=
"
bold
"
>
'
+
_
(
'
Resource:
'
)
+
\
'
</span>
'
+
gtkgui_helpers
.
escape_for_pango_markup
(
contact
.
resource
)
self
.
text_lable
.
set_markup
(
info
)
hbox
.
add
(
self
.
text_lable
)
self
.
win
.
add
(
hbox
)
class
RosterTooltip
(
BaseTooltip
,
StatusTable
):
'''
Tooltip that is shown in the roster treeview
'''
def
__init__
(
self
,
plugin
):
...
...
@@ -455,4 +470,4 @@ class FileTransfersTooltip(BaseTooltip):
text
+=
status
self
.
text_lable
.
set_markup
(
text
)
self
.
hbox
.
add
(
self
.
text_lable
)
self
.
win
.
add
(
self
.
hbox
)
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