Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
gajim-plugins
Commits
5a05b0f8
Commit
5a05b0f8
authored
Feb 28, 2017
by
Philipp Hörist
Browse files
[emoticons] Use extension point
parent
7f166dcd
Changes
1
Hide whitespace changes
Inline
Side-by-side
emoticons_pack/emoticons_pack.py
View file @
5a05b0f8
...
...
@@ -39,6 +39,7 @@ class EmoticonsPackPlugin(GajimPlugin):
self
.
description
=
_
(
'Install, update and view detailed legend '
'of emoticons'
)
self
.
config_dialog
=
None
# EmoticonsPackPluginConfigDialog(self)
self
.
gui_extension_points
=
{
'plugin_window'
:
(
self
.
on_activate
,
None
)}
self
.
window
=
None
self
.
model
=
None
self
.
connected_ids
=
{}
...
...
@@ -46,15 +47,11 @@ class EmoticonsPackPlugin(GajimPlugin):
@
log_calls
(
'EmoticonsPackPlugin'
)
def
activate
(
self
):
self
.
pl_menuitem
=
gajim
.
interface
.
roster
.
xml
.
get_object
(
'plugins_menuitem'
)
self
.
id_
=
self
.
pl_menuitem
.
connect_after
(
'activate'
,
self
.
on_activate
)
if
'plugins'
in
gajim
.
interface
.
instances
:
self
.
on_activate
(
None
)
self
.
on_activate
(
gajim
.
interface
.
instances
[
'plugins'
]
)
@
log_calls
(
'EmoticonsPackPlugin'
)
def
deactivate
(
self
):
self
.
pl_menuitem
.
disconnect
(
self
.
id_
)
if
hasattr
(
self
,
'page_num'
):
self
.
notebook
.
remove_page
(
self
.
notebook
.
page_num
(
self
.
hpaned
))
self
.
notebook
.
set_current_page
(
0
)
...
...
@@ -62,19 +59,15 @@ class EmoticonsPackPlugin(GajimPlugin):
widget
.
disconnect
(
id_
)
del
self
.
page_num
def
on_activate
(
self
,
widget
):
if
'plugins'
not
in
gajim
.
interface
.
instances
:
return
def
on_activate
(
self
,
plugin_win
):
if
hasattr
(
self
,
'page_num'
):
# 'Available' tab exists
return
self
.
installed_plugins_model
=
gajim
.
interface
.
instances
[
'plugins'
].
installed_plugins_model
self
.
notebook
=
gajim
.
interface
.
instances
[
'plugins'
].
plugins_notebook
self
.
notebook
=
plugin_win
.
plugins_notebook
id_
=
self
.
notebook
.
connect
(
'switch-page'
,
self
.
on_notebook_switch_page
)
self
.
connected_ids
[
id_
]
=
self
.
notebook
self
.
window
=
gajim
.
interface
.
instances
[
'
plugin
s'
]
.
window
self
.
window
=
plugin
_win
.
window
id_
=
self
.
window
.
connect
(
'destroy'
,
self
.
on_win_destroy
)
self
.
connected_ids
[
id_
]
=
self
.
window
self
.
Gtk_BUILDER_FILE_PATH
=
self
.
local_file_path
(
'config_dialog.ui'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment