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
627fe59c
Commit
627fe59c
authored
11 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
ability to show HTML in plugin descriptions
parent
bdda090d
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
data/gui/plugins_window.ui
+6
-9
6 additions, 9 deletions
data/gui/plugins_window.ui
src/plugins/gui.py
+19
-6
19 additions, 6 deletions
src/plugins/gui.py
with
25 additions
and
15 deletions
data/gui/plugins_window.ui
+
6
−
9
View file @
627fe59c
...
...
@@ -248,17 +248,14 @@
</packing>
</child>
<child>
<object
class=
"Gtk
TextView"
id=
"plugin_description_textview
"
>
<object
class=
"Gtk
ScrolledWindow"
id=
"scrolledwindow2
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"sensitive"
>
False
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"pixels_above_lines"
>
6
</property>
<property
name=
"editable"
>
False
</property>
<property
name=
"wrap_mode"
>
word
</property>
<property
name=
"left_margin"
>
6
</property>
<property
name=
"right_margin"
>
6
</property>
<property
name=
"indent"
>
1
</property>
<property
name=
"buffer"
>
textbuffer1
</property>
<property
name=
"hscrollbar_policy"
>
automatic
</property>
<property
name=
"vscrollbar_policy"
>
automatic
</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property
name=
"position"
>
1
</property>
...
...
This diff is collapsed.
Click to expand it.
src/plugins/gui.py
+
19
−
6
View file @
627fe59c
...
...
@@ -31,6 +31,7 @@ import gtk, gobject, os
import
gtkgui_helpers
from
dialogs
import
WarningDialog
,
YesNoDialog
,
ArchiveChooserDialog
from
htmltextview
import
HtmlTextView
from
common
import
gajim
from
plugins.helpers
import
log_calls
,
log
from
plugins.helpers
import
GajimPluginActivateException
...
...
@@ -57,13 +58,15 @@ class PluginsWindow(object):
widgets_to_extract
=
(
'
plugins_notebook
'
,
'
plugin_name_label
'
,
'
plugin_version_label
'
,
'
plugin_authors_label
'
,
'
plugin_homepage_linkbutton
'
,
'
plugin_description_textview
'
,
'
uninstall_plugin_button
'
,
'
configure_plugin_button
'
,
'
installed_plugins_treeview
'
)
'
plugin_homepage_linkbutton
'
,
'
uninstall_plugin_button
'
,
'
configure_plugin_button
'
,
'
installed_plugins_treeview
'
)
for
widget_name
in
widgets_to_extract
:
setattr
(
self
,
widget_name
,
self
.
xml
.
get_object
(
widget_name
))
self
.
plugin_description_textview
=
HtmlTextView
()
sw
=
self
.
xml
.
get_object
(
'
scrolledwindow2
'
)
sw
.
add
(
self
.
plugin_description_textview
)
attr_list
=
pango
.
AttrList
()
attr_list
.
insert
(
pango
.
AttrWeight
(
pango
.
WEIGHT_BOLD
,
0
,
-
1
))
self
.
plugin_name_label
.
set_attributes
(
attr_list
)
...
...
@@ -138,12 +141,22 @@ class PluginsWindow(object):
self
.
plugin_homepage_linkbutton
.
set_label
(
plugin
.
homepage
)
self
.
plugin_homepage_linkbutton
.
set_property
(
'
sensitive
'
,
True
)
desc_textbuffer
=
self
.
plugin_description_textview
.
get_buffer
()
sw
=
self
.
xml
.
get_object
(
'
scrolledwindow2
'
)
old_tv
=
sw
.
get_children
()[
0
]
old_tv
.
destroy
()
self
.
plugin_description_textview
=
HtmlTextView
()
sw
.
add
(
self
.
plugin_description_textview
)
sw
.
show_all
()
from
plugins.plugins_i18n
import
_
txt
=
plugin
.
description
txt
.
replace
(
'
</body>
'
,
''
)
if
plugin
.
available_text
:
txt
+=
'
\n\n
'
+
_
(
'
Warning: %s
'
)
%
plugin
.
available_text
desc_textbuffer
.
set_text
(
txt
)
txt
+=
'
<br/><br/>
'
+
_
(
'
Warning: %s
'
)
%
plugin
.
available_text
if
not
txt
.
startswith
(
'
<body
'
):
txt
=
'
<body xmlns=
\'
http://www.w3.org/1999/xhtml
\'
>
'
+
txt
txt
+=
'
</body>
'
self
.
plugin_description_textview
.
display_html
(
txt
,
self
.
plugin_description_textview
,
None
)
self
.
plugin_description_textview
.
set_property
(
'
sensitive
'
,
True
)
self
.
uninstall_plugin_button
.
set_property
(
'
sensitive
'
,
gajim
.
PLUGINS_DIRS
[
1
]
in
plugin
.
__path__
)
...
...
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