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
Weblate
gajim
Commits
74b6ba5c
Commit
74b6ba5c
authored
12 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
coding style
parent
3b860457
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/gui.py
+26
-16
26 additions, 16 deletions
src/plugins/gui.py
with
26 additions
and
16 deletions
src/plugins/gui.py
+
26
−
16
View file @
74b6ba5c
...
...
@@ -36,6 +36,15 @@ from plugins.helpers import log_calls, log
from
plugins.helpers
import
GajimPluginActivateException
from
common.exceptions
import
PluginsystemError
(
PLUGIN
,
NAME
,
ACTIVE
,
ACTIVATABLE
,
ICON
,
)
=
range
(
5
)
class
PluginsWindow
(
object
):
'''
Class for Plugins window
'''
...
...
@@ -65,12 +74,13 @@ class PluginsWindow(object):
self
.
installed_plugins_treeview
.
set_rules_hint
(
True
)
renderer
=
gtk
.
CellRendererText
()
col
=
gtk
.
TreeViewColumn
(
_
(
'
Plugin
'
),
renderer
,
text
=
1
)
col
=
gtk
.
TreeViewColumn
(
_
(
'
Plugin
'
),
renderer
,
text
=
NAME
)
self
.
installed_plugins_treeview
.
append_column
(
col
)
renderer
=
gtk
.
CellRendererToggle
()
renderer
.
connect
(
'
toggled
'
,
self
.
installed_plugins_toggled_cb
)
col
=
gtk
.
TreeViewColumn
(
_
(
'
Active
'
),
renderer
,
active
=
2
,
activatable
=
3
)
col
=
gtk
.
TreeViewColumn
(
_
(
'
Active
'
),
renderer
,
active
=
ACTIVE
,
activatable
=
ACTIVATABLE
)
self
.
installed_plugins_treeview
.
append_column
(
col
)
# connect signal for selection change
...
...
@@ -99,9 +109,9 @@ class PluginsWindow(object):
def
installed_plugins_treeview_selection_changed
(
self
,
treeview_selection
):
model
,
iter
=
treeview_selection
.
get_selected
()
if
iter
:
plugin
=
model
.
get_value
(
iter
,
0
)
plugin_name
=
model
.
get_value
(
iter
,
1
)
is_active
=
model
.
get_value
(
iter
,
2
)
plugin
=
model
.
get_value
(
iter
,
PLUGIN
)
plugin_name
=
model
.
get_value
(
iter
,
NAME
)
is_active
=
model
.
get_value
(
iter
,
ACTIVE
)
self
.
_display_installed_plugin_info
(
plugin
)
else
:
...
...
@@ -157,8 +167,8 @@ class PluginsWindow(object):
@log_calls
(
'
PluginsWindow
'
)
def
installed_plugins_toggled_cb
(
self
,
cell
,
path
):
is_active
=
self
.
installed_plugins_model
[
path
][
2
]
plugin
=
self
.
installed_plugins_model
[
path
][
0
]
is_active
=
self
.
installed_plugins_model
[
path
][
ACTIVE
]
plugin
=
self
.
installed_plugins_model
[
path
][
PLUGIN
]
if
is_active
:
gajim
.
plugin_manager
.
deactivate_plugin
(
plugin
)
...
...
@@ -170,7 +180,7 @@ class PluginsWindow(object):
transient_for
=
self
.
window
)
return
self
.
installed_plugins_model
[
path
][
2
]
=
not
is_active
self
.
installed_plugins_model
[
path
][
ACTIVE
]
=
not
is_active
@log_calls
(
'
PluginsWindow
'
)
def
on_plugins_window_destroy
(
self
,
widget
):
...
...
@@ -187,9 +197,9 @@ class PluginsWindow(object):
selection
=
self
.
installed_plugins_treeview
.
get_selection
()
model
,
iter
=
selection
.
get_selected
()
if
iter
:
plugin
=
model
.
get_value
(
iter
,
0
)
plugin_name
=
model
.
get_value
(
iter
,
1
)
is_active
=
model
.
get_value
(
iter
,
2
)
plugin
=
model
.
get_value
(
iter
,
PLUGIN
)
plugin_name
=
model
.
get_value
(
iter
,
NAME
)
is_active
=
model
.
get_value
(
iter
,
ACTIVE
)
result
=
plugin
.
config_dialog
.
run
(
self
.
window
)
...
...
@@ -205,9 +215,9 @@ class PluginsWindow(object):
selection
=
self
.
installed_plugins_treeview
.
get_selection
()
model
,
iter
=
selection
.
get_selected
()
if
iter
:
plugin
=
model
.
get_value
(
iter
,
0
)
plugin_name
=
model
.
get_value
(
iter
,
1
).
decode
(
'
utf-8
'
)
is_active
=
model
.
get_value
(
iter
,
2
)
plugin
=
model
.
get_value
(
iter
,
PLUGIN
)
plugin_name
=
model
.
get_value
(
iter
,
NAME
).
decode
(
'
utf-8
'
)
is_active
=
model
.
get_value
(
iter
,
ACTIVE
)
try
:
gajim
.
plugin_manager
.
remove_plugin
(
plugin
)
except
PluginsystemError
,
e
:
...
...
@@ -234,8 +244,8 @@ class PluginsWindow(object):
model
=
self
.
installed_plugins_model
for
row
in
xrange
(
len
(
model
)):
if
plugin
==
model
[
row
][
0
]:
model
.
remove
(
model
.
get_iter
((
row
,
0
)))
if
plugin
==
model
[
row
][
PLUGIN
]:
model
.
remove
(
model
.
get_iter
((
row
,
PLUGIN
)))
break
iter_
=
model
.
append
([
plugin
,
plugin
.
name
,
False
,
...
...
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