Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
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
Evert Mouw
gajim-plugins
Commits
2e2a5472
Commit
2e2a5472
authored
14 years ago
by
Michael Kainer
Browse files
Options
Downloads
Patches
Plain Diff
PEP8 compilant
parent
67ce6b8f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ubuntu_integration/manifest.ini
+1
-1
1 addition, 1 deletion
ubuntu_integration/manifest.ini
ubuntu_integration/plugin.py
+15
-14
15 additions, 14 deletions
ubuntu_integration/plugin.py
with
16 additions
and
15 deletions
ubuntu_integration/manifest.ini
+
1
−
1
View file @
2e2a5472
...
...
@@ -7,7 +7,7 @@ description: This plugin integrates Gajim with the Ubuntu Messaging Menu.
You
must
have
python-indicate
and
python-xdg
(and
Gajim
obviously)
installed
to
enable
this
plugin.
Many
thanks
to
the
guys
from
gajim@conference.gajim.org
for
answering
my
questions
:)
authors:
Michael
Kainer
<kaini@
jabber.hot-chilli.ne
t>
authors:
Michael
Kainer
<kaini@
linuxlovers.a
t>
homepage:
http://trac-plugins.gajim.org/wiki/UbuntuIntegration
...
...
This diff is collapsed.
Click to expand it.
ubuntu_integration/plugin.py
+
15
−
14
View file @
2e2a5472
...
...
@@ -29,14 +29,15 @@ import gtkgui_helpers
try
:
import
indicate
HAS_INDICATE
=
True
except
:
except
ImportError
:
HAS_INDICATE
=
False
try
:
from
xdg.BaseDirectory
import
load_data_paths
HAS_PYXDG
=
True
except
:
except
ImportError
:
HAS_PYXDG
=
False
class
UbuntuIntegrationPlugin
(
GajimPlugin
):
"""
Class for Messaging Menu and Me Menu.
...
...
@@ -84,11 +85,11 @@ class UbuntuIntegrationPlugin(GajimPlugin):
gajim
.
events
.
event_added_unsubscribe
(
self
.
on_event_added
)
gajim
.
events
.
event_removed_unsubscribe
(
self
.
on_event_removed
)
if
hasattr
(
self
,
'
server
'
):
self
.
server
.
hide
()
if
hasattr
(
self
,
'
server
'
):
self
.
server
.
hide
()
del
self
.
server
if
hasattr
(
self
,
'
events
'
):
if
hasattr
(
self
,
'
events
'
):
for
(
_
,
event
)
in
self
.
events
:
event
[
0
].
hide
()
del
self
.
events
...
...
@@ -127,22 +128,22 @@ class UbuntuIntegrationPlugin(GajimPlugin):
else
:
contact
=
jid
elif
event
.
type_
==
"
pm
"
or
event
.
type_
==
"
printed_pm
"
:
contact
=
gajim
.
get_nick_from_jid
(
gajim
.
get_room_from_fjid
(
jid
))
+
\
contact
=
gajim
.
get_nick_from_jid
(
gajim
.
get_room_from_fjid
(
jid
))
+
\
"
/
"
+
gajim
.
get_room_and_nick_from_fjid
(
jid
)[
1
]
elif
event
.
type_
==
"
printed_marked_gc_msg
"
:
contact
=
gajim
.
get_nick_from_jid
(
gajim
.
get_room_from_fjid
(
jid
))
else
:
print
"
ignored
"
;
print
"
ignored
"
return
print
account
,
jid
,
when
,
contact
# Add a new indicator if necessary
if
not
self
.
events
.
has_key
(
key
)
:
if
key
not
in
self
.
events
:
indicator
=
indicate
.
Indicator
()
indicator
.
set_property
(
"
name
"
,
contact
)
indicator
.
set_property_time
(
"
time
"
,
when
)
indicator
.
set_property_bool
(
"
draw-attention
"
,
True
)
;
indicator
.
set_property_bool
(
"
draw-attention
"
,
True
)
if
gajim
.
config
.
get
(
"
show_avatars_in_roster
"
):
pixbuf
=
gtkgui_helpers
.
get_avatar_pixbuf_from_cache
(
jid
)
if
pixbuf
not
in
(
None
,
"
ask
"
):
...
...
@@ -154,7 +155,7 @@ class UbuntuIntegrationPlugin(GajimPlugin):
# Prepare the event and save it
event
.
time
=
when
self
.
events
[
key
][
1
].
append
(
event
)
;
self
.
events
[
key
][
1
].
append
(
event
)
def
on_event_removed
(
self
,
events
):
"""
...
...
@@ -166,14 +167,14 @@ class UbuntuIntegrationPlugin(GajimPlugin):
key
=
(
event
.
account
,
event
.
jid
)
if
self
.
events
.
has_key
(
key
)
and
\
if
key
not
in
self
.
events
and
\
event
in
self
.
events
[
key
][
1
]:
self
.
events
[
key
][
1
].
remove
(
event
)
if
len
(
self
.
events
[
key
][
1
])
==
0
:
# remove indicator
if
len
(
self
.
events
[
key
][
1
])
==
0
:
# remove indicator
self
.
events
[
key
][
0
].
hide
()
del
self
.
events
[
key
]
else
:
# set the indicator time to the text event
else
:
# set the indicator time to the text event
self
.
events
[
key
][
0
].
set_property_time
(
"
time
"
,
self
.
events
[
key
][
1
][
0
].
time
)
else
:
...
...
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