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
a7adf92a
Commit
a7adf92a
authored
11 years ago
by
bdenis
Browse files
Options
Downloads
Patches
Plain Diff
[appindicator_integration] add connect menu item
parent
1bacbdbd
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
appindicator_integration/manifest.ini
+1
-1
1 addition, 1 deletion
appindicator_integration/manifest.ini
appindicator_integration/plugin.py
+15
-2
15 additions, 2 deletions
appindicator_integration/plugin.py
with
16 additions
and
3 deletions
appindicator_integration/manifest.ini
+
1
−
1
View file @
a7adf92a
[info]
[info]
name:
Appindicator
integration
name:
Appindicator
integration
short_name:
appindicator_integration
short_name:
appindicator_integration
version:
0.1.
3
version:
0.1.
4
description:
This
plugin
integrates
Gajim
with
the
appindicator.
You
must
have
python-appindicator
(and
Gajim
obviously)
installed
to
enable
this
plugin.
description:
This
plugin
integrates
Gajim
with
the
appindicator.
You
must
have
python-appindicator
(and
Gajim
obviously)
installed
to
enable
this
plugin.
Rewriten
from
Ubuntu
Ayatana
Integration
plugin
Rewriten
from
Ubuntu
Ayatana
Integration
plugin
homepage:
http://trac-plugins.gajim.org/wiki/AppindicatorSupportPlugin
homepage:
http://trac-plugins.gajim.org/wiki/AppindicatorSupportPlugin
...
...
This diff is collapsed.
Click to expand it.
appindicator_integration/plugin.py
+
15
−
2
View file @
a7adf92a
...
@@ -51,13 +51,16 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
...
@@ -51,13 +51,16 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
self
.
online_icon
=
"
tray-online
"
self
.
online_icon
=
"
tray-online
"
self
.
offline_icon
=
"
tray-offline
"
self
.
offline_icon
=
"
tray-offline
"
self
.
connected
=
0
self
.
connected
=
0
self
.
connect_menu_item
=
gtk
.
MenuItem
(
'
Connect
'
)
self
.
connect_menu_item
.
connect
(
"
activate
"
,
self
.
connect
)
self
.
show_gajim_menu_item
=
gtk
.
MenuItem
(
'
Show/hide roster
'
)
self
.
show_gajim_menu_item
=
gtk
.
MenuItem
(
'
Show/hide roster
'
)
self
.
show_gajim_menu_item
.
connect
(
"
activate
"
,
self
.
roster_raise
)
self
.
show_gajim_menu_item
.
connect
(
"
activate
"
,
self
.
roster_raise
)
self
.
show_gajim_menu_item
.
show
()
self
.
show_gajim_menu_item
.
show
()
self
.
event_separator
=
gtk
.
SeparatorMenuItem
()
self
.
event_separator
=
gtk
.
SeparatorMenuItem
()
self
.
menuEventInsertIndex
=
2
self
.
menuEventInsertIndex
=
3
itemExitSeparator
=
gtk
.
SeparatorMenuItem
()
itemExitSeparator
=
gtk
.
SeparatorMenuItem
()
itemExitSeparator
.
show
()
itemExitSeparator
.
show
()
...
@@ -67,6 +70,7 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
...
@@ -67,6 +70,7 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
itemExit
.
show
()
itemExit
.
show
()
self
.
menu
=
gtk
.
Menu
()
self
.
menu
=
gtk
.
Menu
()
self
.
menu
.
append
(
self
.
connect_menu_item
)
self
.
menu
.
append
(
self
.
show_gajim_menu_item
)
self
.
menu
.
append
(
self
.
show_gajim_menu_item
)
self
.
menu
.
append
(
self
.
event_separator
)
self
.
menu
.
append
(
self
.
event_separator
)
self
.
menu
.
append
(
itemExitSeparator
)
self
.
menu
.
append
(
itemExitSeparator
)
...
@@ -83,6 +87,13 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
...
@@ -83,6 +87,13 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
gajim
.
events
.
event_added_subscribe
(
self
.
on_event_added
)
gajim
.
events
.
event_added_subscribe
(
self
.
on_event_added
)
gajim
.
events
.
event_removed_subscribe
(
self
.
on_event_removed
)
gajim
.
events
.
event_removed_subscribe
(
self
.
on_event_removed
)
def
connect
(
self
,
widget
,
data
=
None
):
for
account
in
gajim
.
connections
:
if
gajim
.
config
.
get_per
(
'
accounts
'
,
account
,
'
sync_with_global_status
'
):
gajim
.
connections
[
account
].
change_status
(
'
online
'
,
'
online
'
)
def
set_indicator_icon
(
self
,
obj
=
''
):
def
set_indicator_icon
(
self
,
obj
=
''
):
is_connected
=
0
is_connected
=
0
...
@@ -97,8 +108,10 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
...
@@ -97,8 +108,10 @@ class AppindicatorIntegrationPlugin(GajimPlugin):
self
.
connected
=
is_connected
self
.
connected
=
is_connected
if
self
.
connected
==
1
:
if
self
.
connected
==
1
:
self
.
indicator
.
set_icon
(
self
.
online_icon
)
self
.
indicator
.
set_icon
(
self
.
online_icon
)
self
.
connect_menu_item
.
hide
()
else
:
else
:
self
.
indicator
.
set_icon
(
self
.
offline_icon
)
self
.
indicator
.
set_icon
(
self
.
offline_icon
)
self
.
connect_menu_item
.
show
()
@log_calls
(
"
AppindicatorPlugin
"
)
@log_calls
(
"
AppindicatorPlugin
"
)
def
deactivate
(
self
):
def
deactivate
(
self
):
...
...
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