diff --git a/emoticons_pack/emoticons_pack.py b/emoticons_pack/emoticons_pack.py index f4c9813..79bb496 100644 --- a/emoticons_pack/emoticons_pack.py +++ b/emoticons_pack/emoticons_pack.py @@ -19,7 +19,6 @@ from common import gajim from plugins import GajimPlugin from plugins.helpers import log_calls from htmltextview import HtmlTextView -from conversation_textview import ConversationTextview from dialogs import WarningDialog, HigDialog @@ -119,19 +118,19 @@ class EmoticonsPackPlugin(GajimPlugin): selection.connect('changed', self.emoticons_treeview_selection_changed) selection.set_mode(Gtk.SelectionMode.SINGLE) - self.emoticons_description_textview = ConversationTextview(None) + self.emoticons_description_textview = HtmlTextView() sw = self.xml.get_object('scrolledwindow1') - sw.add(self.emoticons_description_textview.tv) + sw.add(self.emoticons_description_textview) self.xml.connect_signals(self) self.window.show_all() def on_legend_button_clicked(self, widget): - self.xml.get_object('scrolledwindow1').get_children()[0].destroy() - treeview_selection = self.available_treeview.get_selection() model, iter = treeview_selection.get_selected() name = model.get_value(iter, Column.NAME) + self.emoticons_description_textview.get_buffer().set_text('') + label = self.xml.get_object('label2') if label.get_text() == _('Legend'): label.set_text(_('Description')) @@ -140,11 +139,6 @@ class EmoticonsPackPlugin(GajimPlugin): import emoticons imp.reload(emoticons) - self.emoticons_description_textview = Gtk.TextView() - sw = self.xml.get_object('scrolledwindow1') - sw.add(self.emoticons_description_textview) - sw.show_all() - buff = self.emoticons_description_textview.get_buffer() for icon in emoticons.emoticons: icon_file = os.path.join(self.tmp_dir, name, icon) @@ -169,10 +163,6 @@ class EmoticonsPackPlugin(GajimPlugin): sys.path.remove(os.path.join(self.tmp_dir, name)) else: - self.emoticons_description_textview = ConversationTextview(None) - sw = self.xml.get_object('scrolledwindow1') - sw.add(self.emoticons_description_textview.tv) - sw.show_all() label.set_text(_('Legend')) desc = _(model.get_value(iter, Column.DESCRIPTION)) if not desc.startswith('
' desc = desc.replace('preview.image', ('file:' + os.path.join( self.tmp_dir, name, 'preview.png'))).replace('\n', '