diff options
author | Denis Fomin <fominde@gmail.com> | 2013-05-04 18:27:32 +0400 |
---|---|---|
committer | Denis Fomin <fominde@gmail.com> | 2013-05-04 18:27:32 +0400 |
commit | ddbac25e192823e7f5101115535aadcd9b77dce8 (patch) | |
tree | 6b113c4d3f8146c04a191a351ab9ba45e801c77d /src/plugins | |
parent | 123c6e4d534d953e50c6c1f5b3954ec87b671603 (diff) |
PluginSystem. xhtml in available tab
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gui.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/plugins/gui.py b/src/plugins/gui.py index 0d3a3d94b..b97711d9b 100644 --- a/src/plugins/gui.py +++ b/src/plugins/gui.py @@ -36,6 +36,7 @@ import gtkgui_helpers from dialogs import WarningDialog, YesNoDialog, ArchiveChooserDialog from common import gajim from plugins.helpers import log_calls, log +from conversation_textview import ConversationTextview from plugins.helpers import GajimPluginActivateException from common.exceptions import PluginsystemError @@ -99,7 +100,7 @@ class PluginsWindow(object): self.installed_plugins_treeview_selection_changed) selection.set_mode(Gtk.SelectionMode.SINGLE) - self._clear_installed_plugin_info() + #self._clear_installed_plugin_info() self.fill_installed_plugins_model() root_iter = self.installed_plugins_model.get_iter_first() @@ -121,6 +122,11 @@ class PluginsWindow(object): @log_calls('PluginsWindow') def installed_plugins_treeview_selection_changed(self, treeview_selection): model, iter = treeview_selection.get_selected() + self.xml.get_object('scrolledwindow').get_children()[0].destroy() + self.plugin_description_textview = ConversationTextview(None) + sw = self.xml.get_object('scrolledwindow') + sw.add(self.plugin_description_textview.tv) + sw.show_all() if iter: plugin = model.get_value(iter, PLUGIN) plugin_name = model.get_value(iter, NAME) @@ -131,6 +137,7 @@ class PluginsWindow(object): self._clear_installed_plugin_info() def _display_installed_plugin_info(self, plugin): + from plugins.plugins_i18n import _ self.plugin_name_label.set_text(plugin.name) self.plugin_version_label.set_text(plugin.version) self.plugin_authors_label.set_text(plugin.authors) @@ -140,19 +147,21 @@ class PluginsWindow(object): label.set_ellipsize(Pango.EllipsizeMode.END) self.plugin_homepage_linkbutton.set_property('sensitive', True) - desc_textbuffer = self.plugin_description_textview.get_buffer() - from plugins.plugins_i18n import _ txt = plugin.description if plugin.available_text: txt += '\n\n' + _('Warning: %s') % plugin.available_text - desc_textbuffer.set_text(txt) - self.plugin_description_textview.set_property('sensitive', True) + if not txt.startswith('<body '): + txt = '<body xmlns=\'http://www.w3.org/1999/xhtml\'>' + \ + txt + ' </body>' + txt = txt.replace('\n', '<br/>') + self.plugin_description_textview.tv.display_html( + txt, self.plugin_description_textview) + + self.plugin_description_textview.tv.set_property('sensitive', True) self.uninstall_plugin_button.set_property('sensitive', gajim.PLUGINS_DIRS[1] in plugin.__path__) - if plugin.config_dialog is None: - self.configure_plugin_button.set_property('sensitive', False) - else: - self.configure_plugin_button.set_property('sensitive', True) + self.configure_plugin_button.set_property( + 'sensitive', not plugin.config_dialog is None) def _clear_installed_plugin_info(self): self.plugin_name_label.set_text('') @@ -162,9 +171,7 @@ class PluginsWindow(object): self.plugin_homepage_linkbutton.set_label('') self.plugin_homepage_linkbutton.set_property('sensitive', False) - desc_textbuffer = self.plugin_description_textview.get_buffer() - desc_textbuffer.set_text('') - self.plugin_description_textview.set_property('sensitive', False) + self.plugin_description_textview.tv.set_property('sensitive', False) self.uninstall_plugin_button.set_property('sensitive', False) self.configure_plugin_button.set_property('sensitive', False) |