Commit 1e5c5745 authored by Dicson's avatar Dicson

EmoticonsPackPlugin.coding style

parent 9ede8bf2
......@@ -264,132 +264,105 @@
<object class="GtkHBox" id="hbox15">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkHButtonBox" id="hbuttonbox1">
<object class="GtkButton" id="inslall_upgrade_button">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_inslall_upgrade_clicked" swapped="no"/>
<child>
<object class="GtkButton" id="legend_button">
<property name="use_action_appearance">False</property>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">True</property>
<property name="margin_left">22</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_legend_button_clicked" swapped="no"/>
<child>
<object class="GtkHBox" id="hbox2">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-refresh</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-info</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Legend</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="xalign">0</property>
<property name="label" translatable="yes">Install/Upgrade</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
<property name="non_homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox3">
<object class="GtkButton" id="legend_button">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<property name="receives_default">True</property>
<property name="margin_left">22</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_legend_button_clicked" swapped="no"/>
<child>
<object class="GtkButton" id="inslall_upgrade_button">
<property name="use_action_appearance">False</property>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_inslall_upgrade_clicked" swapped="no"/>
<child>
<object class="GtkHBox" id="hbox1">
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-refresh</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Install/Upgrade</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="stock">gtk-info</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Legend</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
......
......@@ -120,8 +120,7 @@ class EmoticonsPackPlugin(GajimPlugin):
self.available_treeview.append_column(col)
selection = self.available_treeview.get_selection()
selection.connect(
'changed', self.available_emoticons_treeview_selection_changed)
selection.connect('changed', self.emoticons_treeview_selection_changed)
selection.set_mode(Gtk.SelectionMode.SINGLE)
self.emoticons_description_textview = ConversationTextview(None)
......@@ -187,14 +186,8 @@ class EmoticonsPackPlugin(GajimPlugin):
self.tmp_dir, name, 'preview.png')))
self.emoticons_description_textview.tv.display_html(
desc, self.emoticons_description_textview)
self.emoticons_description_textview.tv.set_property('sensitive', True)
def dict_to_html(self, dict_):
desc = ''
for icon in dict_:
acr = ' , '.join(dict_[icon])
desc += ' '+ icon + ' '+ acr + '\n'
return desc
self.emoticons_description_textview.tv.set_property(
'sensitive', True)
def on_inslall_upgrade_clicked(self, widget):
self.inslall_upgrade_button.set_property('sensitive', False)
......@@ -300,7 +293,7 @@ class EmoticonsPackPlugin(GajimPlugin):
conf.get(section, 'homepage'), False])
conf.remove_section(section)
def available_emoticons_treeview_selection_changed(self, treeview_selection):
def emoticons_treeview_selection_changed(self, treeview_selection):
model, iter = treeview_selection.get_selected()
label = self.xml.get_object('label2')
label.set_text(_('Legend'))
......@@ -343,7 +336,8 @@ class EmoticonsPackPlugin(GajimPlugin):
self.tmp_dir, set_name, 'preview.png')))
self.emoticons_description_textview.tv.display_html(
desc, self.emoticons_description_textview)
self.emoticons_description_textview.tv.set_property('sensitive', True)
self.emoticons_description_textview.tv.set_property(
'sensitive', True)
else:
self.set_name.set_text('')
self.authors_label.set_text('')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment