PluginInstallerPlugin. xhtml in plugin description
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<object class="GtkTextBuffer" id="textbuffer1">
|
||||
<property name="text">Plug-in decription should be displayed here. This text will be erased during PluginsWindow initialization.</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
@@ -30,9 +27,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="search_column">1</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection1">
|
||||
<property name="mode">none</property>
|
||||
</object>
|
||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@@ -46,9 +41,6 @@
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="progressbar">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">6</property>
|
||||
<property name="margin_right">6</property>
|
||||
<property name="show_text">True</property>
|
||||
<property name="ellipsize">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -74,12 +66,9 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label">empty</property>
|
||||
<property name="label"><empty></property>
|
||||
<property name="selectable">True</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -210,14 +199,13 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTextView" id="plugin_description_textview1">
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="pixels_above_lines">6</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="shadow_type">in</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
@@ -309,7 +297,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">False</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@@ -366,7 +354,7 @@
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="on_check_update_toggled" swapped="no"/>
|
||||
</object>
|
||||
@@ -385,7 +373,7 @@
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="on_tls_toggled" swapped="no"/>
|
||||
</object>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[info]
|
||||
name: Plugin Installer
|
||||
short_name: plugin_installer
|
||||
version: 0.11.2
|
||||
version: 0.11.3
|
||||
description: Install and upgrade plugins from ftp
|
||||
authors: Denis Fomin <fominde@gmail.com>
|
||||
Yann Leboulanger <asterix@lagaule.org>
|
||||
|
||||
@@ -35,6 +35,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
|
||||
|
||||
@@ -188,7 +189,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))
|
||||
@@ -247,6 +248,11 @@ class PluginInstaller(GajimPlugin):
|
||||
selection.set_mode(Gtk.SelectionMode.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()
|
||||
|
||||
@@ -349,6 +355,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))
|
||||
@@ -359,9 +370,13 @@ class PluginInstaller(GajimPlugin):
|
||||
label = self.plugin_homepage_linkbutton1.get_children()[0]
|
||||
label.set_ellipsize(Pango.EllipsizeMode.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()
|
||||
|
||||
@@ -372,10 +387,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()
|
||||
|
||||
Reference in New Issue
Block a user