Skip to content
Snippets Groups Projects
Commit 47a72996 authored by Dicson's avatar Dicson
Browse files

PluginInstallerPlugin. xhtml in plugin description

parent ecba3290
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ import zipfile
from common import gajim
from plugins import GajimPlugin
from plugins.helpers import log_calls, log
from conversation_textview import ConversationTextview
from dialogs import WarningDialog, HigDialog, YesNoDialog
from plugins.gui import GajimPluginConfigDialog
......@@ -185,7 +186,7 @@ class PluginInstaller(GajimPlugin):
widgets_to_extract = ('plugin_name_label1',
'available_treeview', 'progressbar', 'inslall_upgrade_button',
'plugin_authors_label1', 'plugin_authors_label1',
'plugin_homepage_linkbutton1', 'plugin_description_textview1')
'plugin_homepage_linkbutton1')
for widget_name in widgets_to_extract:
setattr(self, widget_name, self.xml.get_object(widget_name))
......@@ -248,6 +249,11 @@ class PluginInstaller(GajimPlugin):
selection.set_mode(gtk.SELECTION_SINGLE)
self._clear_available_plugin_info()
self.plugin_description_textview = ConversationTextview(None)
sw = self.xml.get_object('scrolledwindow1')
sw.add(self.plugin_description_textview.tv)
self.xml.connect_signals(self)
self.window.show_all()
......@@ -353,6 +359,11 @@ class PluginInstaller(GajimPlugin):
def available_plugins_treeview_selection_changed(self, treeview_selection):
model, iter = treeview_selection.get_selected()
self.xml.get_object('scrolledwindow1').get_children()[0].destroy()
self.plugin_description_textview = ConversationTextview(None)
sw = self.xml.get_object('scrolledwindow1')
sw.add(self.plugin_description_textview.tv)
sw.show_all()
if iter:
self.plugin_name_label1.set_text(model.get_value(iter, C_NAME))
self.plugin_authors_label1.set_text(model.get_value(iter, C_AUTHORS))
......@@ -363,9 +374,13 @@ class PluginInstaller(GajimPlugin):
label = self.plugin_homepage_linkbutton1.get_children()[0]
label.set_ellipsize(pango.ELLIPSIZE_END)
self.plugin_homepage_linkbutton1.set_property('sensitive', True)
desc_textbuffer = self.plugin_description_textview1.get_buffer()
desc_textbuffer.set_text(_(model.get_value(iter, C_DESCRIPTION)))
self.plugin_description_textview1.set_property('sensitive', True)
desc = _(model.get_value(iter, C_DESCRIPTION))
if not desc.startswith('<body '):
desc = '<body xmlns=\'http://www.w3.org/1999/xhtml\'>' + \
desc + ' </body>'
self.plugin_description_textview.tv.display_html(
desc, self.plugin_description_textview)
self.plugin_description_textview.tv.set_property('sensitive', True)
else:
self._clear_available_plugin_info()
......@@ -376,10 +391,6 @@ class PluginInstaller(GajimPlugin):
self.plugin_homepage_linkbutton1.set_label('')
self.plugin_homepage_linkbutton1.set_property('sensitive', False)
desc_textbuffer = self.plugin_description_textview1.get_buffer()
desc_textbuffer.set_text('')
self.plugin_description_textview1.set_property('sensitive', False)
def scan_dir_for_plugin(self, path):
plugins_found = []
conf = ConfigParser.ConfigParser()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment