[Label] Update gtkui from libglade to gtkbuilder

This commit is contained in:
Calum Lind 2017-03-17 17:18:42 +00:00
parent 939835cef1
commit 665c047541
5 changed files with 407 additions and 370 deletions

View File

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="dlg_label_add">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Add Label</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">mouse</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button2">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_add_cancel" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_add_ok" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-add</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="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Add Label&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</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>
<child>
<object class="GtkHSeparator" id="hseparator2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Name:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="txt_add">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</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">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">button2</action-widget>
<action-widget response="0">button1</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -1,172 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<glade-interface> <interface>
<!-- interface-requires gtk+ 2.24 --> <requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="dlg_label_add"> <object class="GtkAdjustment" id="adjustment1">
<property name="can_focus">False</property> <property name="lower">-1</property>
<property name="border_width">5</property> <property name="upper">9999</property>
<property name="title" translatable="yes">Add Label</property> <property name="value">-1</property>
<property name="resizable">False</property> <property name="step_increment">1</property>
<property name="modal">True</property> <property name="page_increment">10</property>
<property name="window_position">mouse</property> </object>
<property name="destroy_with_parent">True</property> <object class="GtkAdjustment" id="adjustment2">
<property name="type_hint">dialog</property> <property name="lower">-1</property>
<property name="skip_taskbar_hint">True</property> <property name="upper">9999</property>
<signal name="close" handler="on_label_cancel"/> <property name="value">-1</property>
<child internal-child="vbox"> <property name="step_increment">1</property>
<widget class="GtkVBox" id="dialog-vbox2"> <property name="page_increment">10</property>
<property name="visible">True</property> </object>
<property name="can_focus">False</property> <object class="GtkAdjustment" id="adjustment3">
<property name="spacing">2</property> <property name="lower">-1</property>
<child internal-child="action_area"> <property name="upper">9999</property>
<widget class="GtkHButtonBox" id="dialog-action_area2"> <property name="value">-1</property>
<property name="visible">True</property> <property name="step_increment">1</property>
<property name="can_focus">False</property> <property name="page_increment">10</property>
<property name="layout_style">end</property> </object>
<child> <object class="GtkAdjustment" id="adjustment4">
<widget class="GtkButton" id="button2"> <property name="lower">-1</property>
<property name="label">gtk-cancel</property> <property name="upper">9999</property>
<property name="visible">True</property> <property name="value">-1</property>
<property name="can_focus">True</property> <property name="step_increment">1</property>
<property name="receives_default">True</property> <property name="page_increment">10</property>
<property name="use_stock">True</property> </object>
<signal name="clicked" handler="on_add_cancel"/> <object class="GtkAdjustment" id="adjustment5">
</widget> <property name="lower">0.10000000000000001</property>
<packing> <property name="upper">100</property>
<property name="expand">False</property> <property name="value">2</property>
<property name="fill">False</property> <property name="step_increment">1</property>
<property name="position">0</property> <property name="page_increment">10</property>
</packing> </object>
</child> <object class="GtkDialog" id="dlg_label_options">
<child>
<widget class="GtkButton" id="button1">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_add_ok"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-add</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Add Label&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Name:</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="txt_add">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="dlg_label_options">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">Label Options</property> <property name="title" translatable="yes">Label Options</property>
@ -176,24 +47,25 @@
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property> <property name="skip_taskbar_hint">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1"> <object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1"> <object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<widget class="GtkButton" id="button4"> <object class="GtkButton" id="button4">
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="clicked" handler="on_options_cancel"/> <signal name="clicked" handler="on_options_cancel" swapped="no"/>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -201,21 +73,22 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button3"> <object class="GtkButton" id="button3">
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="clicked" handler="on_options_ok"/> <signal name="clicked" handler="on_options_ok" swapped="no"/>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
@ -224,16 +97,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox3"> <object class="GtkHBox" id="hbox3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkImage" id="image2"> <object class="GtkImage" id="image2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="stock">gtk-preferences</property> <property name="stock">gtk-preferences</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -241,20 +114,20 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label_header"> <object class="GtkLabel" id="label_header">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Label Options&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Label Options&lt;/b&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -262,10 +135,10 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHSeparator" id="hseparator1"> <object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -273,23 +146,23 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkNotebook" id="notebook2"> <object class="GtkNotebook" id="notebook2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<child> <child>
<widget class="GtkFrame" id="frame1"> <object class="GtkFrame" id="frame1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment1"> <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<widget class="GtkTable" id="table1"> <object class="GtkTable" id="table1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="n_rows">5</property> <property name="n_rows">5</property>
@ -297,10 +170,10 @@
<property name="column_spacing">5</property> <property name="column_spacing">5</property>
<property name="row_spacing">5</property> <property name="row_spacing">5</property>
<child> <child>
<widget class="GtkLabel" id="label1"> <object class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">3</property> <property name="left_attach">3</property>
<property name="right_attach">4</property> <property name="right_attach">4</property>
@ -308,15 +181,15 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="max_upload_speed"> <object class="GtkSpinButton" id="max_upload_speed">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property> <property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property> <property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property>
<property name="adjustment">-1 -1 9999 1 10 0</property> <property name="adjustment">adjustment1</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -327,11 +200,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label24"> <object class="GtkLabel" id="label24">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">KiB/s</property> <property name="label" translatable="yes">KiB/s</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
@ -340,15 +213,15 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="max_download_speed"> <object class="GtkSpinButton" id="max_download_speed">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property> <property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property> <property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property>
<property name="adjustment">-1 -1 9999 1 10 0</property> <property name="adjustment">adjustment2</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -357,12 +230,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label6"> <object class="GtkLabel" id="label6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Upload Slots:</property> <property name="label" translatable="yes">Upload Slots:</property>
</widget> </object>
<packing> <packing>
<property name="top_attach">2</property> <property name="top_attach">2</property>
<property name="bottom_attach">3</property> <property name="bottom_attach">3</property>
@ -371,12 +244,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label5"> <object class="GtkLabel" id="label5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Upload Speed:</property> <property name="label" translatable="yes">Upload Speed:</property>
</widget> </object>
<packing> <packing>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
@ -385,24 +258,24 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label4"> <object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Download Speed:</property> <property name="label" translatable="yes">Download Speed:</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property> <property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label3"> <object class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">KiB/s</property> <property name="label" translatable="yes">KiB/s</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
@ -413,16 +286,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="max_upload_slots"> <object class="GtkSpinButton" id="max_upload_slots">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property> <property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property> <property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property>
<property name="adjustment">-1 -1 9999 1 10 0</property> <property name="adjustment">adjustment3</property>
<property name="numeric">True</property> <property name="numeric">True</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -433,12 +306,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label2"> <object class="GtkLabel" id="label2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Connections:</property> <property name="label" translatable="yes">Connections:</property>
</widget> </object>
<packing> <packing>
<property name="top_attach">3</property> <property name="top_attach">3</property>
<property name="bottom_attach">4</property> <property name="bottom_attach">4</property>
@ -447,16 +320,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="max_connections"> <object class="GtkSpinButton" id="max_connections">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property> <property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property> <property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property>
<property name="adjustment">-1 -1 9999 1 10 0</property> <property name="adjustment">adjustment4</property>
<property name="numeric">True</property> <property name="numeric">True</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -467,10 +340,10 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label14"> <object class="GtkLabel" id="label14">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </object>
<packing> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">4</property> <property name="top_attach">4</property>
@ -499,58 +372,55 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="label">
<widget class="GtkCheckButton" id="apply_max"> <object class="GtkCheckButton" id="apply_max">
<property name="label" translatable="yes">Apply per torrent max settings:</property> <property name="label" translatable="yes">Apply per torrent max settings:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing>
<property name="type">label_item</property>
</packing>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="tab">
<widget class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Maximum</property> <property name="label" translatable="yes">Maximum</property>
</widget> </object>
<packing> <packing>
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
<property name="type">tab</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame2"> <object class="GtkFrame" id="frame2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment2"> <object class="GtkAlignment" id="alignment2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<widget class="GtkTable" id="table2"> <object class="GtkTable" id="table2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="n_rows">4</property> <property name="n_rows">4</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<child> <child>
<widget class="GtkLabel" id="label16"> <object class="GtkLabel" id="label16">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
@ -560,26 +430,28 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="is_auto_managed"> <object class="GtkCheckButton" id="is_auto_managed">
<property name="label" translatable="yes">Auto Managed</property> <property name="label" translatable="yes">Auto Managed</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing> <packing>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="stop_at_ratio"> <object class="GtkCheckButton" id="stop_at_ratio">
<property name="label" translatable="yes">Stop seed at ratio:</property> <property name="label" translatable="yes">Stop seed at ratio:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing> <packing>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
@ -588,13 +460,14 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="remove_at_ratio"> <object class="GtkCheckButton" id="remove_at_ratio">
<property name="label" translatable="yes">Remove at ratio</property> <property name="label" translatable="yes">Remove at ratio</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing> <packing>
<property name="top_attach">2</property> <property name="top_attach">2</property>
<property name="bottom_attach">3</property> <property name="bottom_attach">3</property>
@ -603,16 +476,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="stop_ratio"> <object class="GtkSpinButton" id="stop_ratio">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property> <property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property> <property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property>
<property name="adjustment">2 0.10000000000000001 100 1 10 0</property> <property name="adjustment">adjustment5</property>
<property name="digits">2</property> <property name="digits">2</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -623,10 +496,10 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label13"> <object class="GtkLabel" id="label13">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </object>
<packing> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">3</property> <property name="top_attach">3</property>
@ -649,65 +522,63 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="label">
<widget class="GtkCheckButton" id="apply_queue"> <object class="GtkCheckButton" id="apply_queue">
<property name="label" translatable="yes">Apply Queue settings:</property> <property name="label" translatable="yes">Apply Queue settings:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing>
<property name="type">label_item</property>
</packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child type="tab">
<widget class="GtkLabel" id="label8"> <object class="GtkLabel" id="label8">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Queue</property> <property name="label" translatable="yes">Queue</property>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
<property name="type">tab</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame3"> <object class="GtkFrame" id="frame3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment3"> <object class="GtkAlignment" id="alignment3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<widget class="GtkTable" id="table3"> <object class="GtkTable" id="table3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="n_rows">3</property> <property name="n_rows">3</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child> <child>
<widget class="GtkCheckButton" id="move_completed"> <object class="GtkCheckButton" id="move_completed">
<property name="label" translatable="yes">Move completed to:</property> <property name="label" translatable="yes">Move completed to:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
@ -715,10 +586,10 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label9"> <object class="GtkLabel" id="label9">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </object>
<packing> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">2</property> <property name="top_attach">2</property>
@ -726,11 +597,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkFileChooserButton" id="move_completed_path"> <object class="GtkFileChooserButton" id="move_completed_path">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="action">select-folder</property> <property name="action">select-folder</property>
</widget> </object>
<packing> <packing>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
@ -738,13 +609,13 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkEntry" id="move_completed_path_entry"> <object class="GtkEntry" id="move_completed_path_entry">
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property> <property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property> <property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -753,70 +624,67 @@
<property name="y_options">GTK_FILL</property> <property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="label">
<widget class="GtkCheckButton" id="apply_move_completed"> <object class="GtkCheckButton" id="apply_move_completed">
<property name="label" translatable="yes">Apply folder settings:</property> <property name="label" translatable="yes">Apply folder settings:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing>
<property name="type">label_item</property>
</packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child type="tab">
<widget class="GtkLabel" id="label21"> <object class="GtkLabel" id="label21">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Folders</property> <property name="label" translatable="yes">Folders</property>
</widget> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
<property name="type">tab</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame4"> <object class="GtkFrame" id="frame4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">2</property> <property name="border_width">2</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment4"> <object class="GtkAlignment" id="alignment4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<widget class="GtkVBox" id="vbox2"> <object class="GtkVBox" id="vbox2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property> <property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property> <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<widget class="GtkTextView" id="auto_add_trackers"> <object class="GtkTextView" id="auto_add_trackers">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="text">tracker1.org</property> <property name="buffer">textbuffer1</property>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
@ -824,60 +692,64 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label23"> <object class="GtkLabel" id="label23">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;i&gt;(1 line per tracker)&lt;/i&gt;</property> <property name="label" translatable="yes">&lt;i&gt;(1 line per tracker)&lt;/i&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="label">
<widget class="GtkCheckButton" id="auto_add"> <object class="GtkCheckButton" id="auto_add">
<property name="label" translatable="yes">Automatically apply label:</property> <property name="label" translatable="yes">Automatically apply label:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </object>
<packing>
<property name="type">label_item</property>
</packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child> <child type="tab">
<widget class="GtkLabel" id="label99"> <object class="GtkLabel" id="label99">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Trackers</property> <property name="label" translatable="yes">Trackers</property>
</widget> </object>
<packing> <packing>
<property name="position">3</property> <property name="position">3</property>
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
<property name="type">tab</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> <action-widgets>
</glade-interface> <action-widget response="0">button4</action-widget>
<action-widget response="0">button3</action-widget>
</action-widgets>
</object>
<object class="GtkTextBuffer" id="textbuffer1">
<property name="text" translatable="yes">tracker1.org</property>
</object>
</interface>

View File

@ -1,55 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<glade-interface> <interface>
<!-- interface-requires gtk+ 2.24 --> <requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="window1"> <object class="GtkWindow" id="window1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<widget class="GtkVBox" id="label_prefs_box"> <object class="GtkVBox" id="label_prefs_box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkFrame" id="frame3"> <object class="GtkFrame" id="frame3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment3"> <object class="GtkAlignment" id="alignment3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<widget class="GtkLabel" id="label6"> <object class="GtkLabel" id="label6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;i&gt;Use the sidebar to add,edit and remove labels. &lt;/i&gt; <property name="label" translatable="yes">&lt;i&gt;Use the sidebar to add,edit and remove labels. &lt;/i&gt;
</property> </property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="label">
<widget class="GtkLabel" id="label"> <object class="GtkLabel" id="label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Labels&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Labels&lt;/b&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing>
<property name="type">label_item</property>
</packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</glade-interface> </interface>

View File

@ -12,9 +12,8 @@ from __future__ import unicode_literals
import logging import logging
import os import os
import gtk
import gtk.glade
import pkg_resources # access plugin egg import pkg_resources # access plugin egg
from gtk import Builder
from deluge.ui.client import client from deluge.ui.client import client
@ -31,9 +30,10 @@ class LabelConfig(object):
def load(self): def load(self):
log.debug('Adding Label Preferences page') log.debug('Adding Label Preferences page')
self.glade = gtk.glade.XML(self.get_resource('label_pref.glade')) builder = Builder()
builder.add_from_file(self.get_resource('label_pref.glade'))
self.plugin.add_preferences_page(_('Label'), self.glade.get_widget('label_prefs_box')) self.plugin.add_preferences_page(_('Label'), builder.get_object('label_prefs_box'))
self.plugin.register_hook('on_show_prefs', self.load_settings) self.plugin.register_hook('on_show_prefs', self.load_settings)
self.plugin.register_hook('on_apply_prefs', self.on_apply_prefs) self.plugin.register_hook('on_apply_prefs', self.on_apply_prefs)

View File

@ -13,7 +13,6 @@ from __future__ import unicode_literals
import logging import logging
import gtk import gtk
import gtk.glade
import deluge.component as component import deluge.component as component
from deluge.ui.client import client from deluge.ui.client import client
@ -114,22 +113,20 @@ class AddDialog(object):
pass pass
def show(self): def show(self):
self.glade = gtk.glade.XML(get_resource('label_options.glade')) self.builder = gtk.Builder()
self.dialog = self.glade.get_widget('dlg_label_add') self.builder.add_from_file(get_resource('label_add.ui'))
self.dialog = self.builder.get_object('dlg_label_add')
self.dialog.set_transient_for(component.get('MainWindow').window) self.dialog.set_transient_for(component.get('MainWindow').window)
self.glade.signal_autoconnect({ self.builder.connect_signals(self)
'on_add_ok': self.on_ok,
'on_add_cancel': self.on_cancel,
})
self.dialog.run() self.dialog.run()
def on_ok(self, event=None): def on_add_ok(self, event=None):
value = self.glade.get_widget('txt_add').get_text() value = self.builder.get_object('txt_add').get_text()
client.label.add(value) client.label.add(value)
self.dialog.destroy() self.dialog.destroy()
def on_cancel(self, event=None): def on_add_cancel(self, event=None):
self.dialog.destroy() self.dialog.destroy()
@ -154,19 +151,16 @@ class OptionsDialog(object):
def show(self, label): def show(self, label):
self.label = label self.label = label
self.glade = gtk.glade.XML(get_resource('label_options.glade')) self.builder = gtk.Builder()
self.dialog = self.glade.get_widget('dlg_label_options') self.builder.add_from_file(get_resource('label_options.ui'))
self.dialog = self.builder.get_object('dlg_label_options')
self.dialog.set_transient_for(component.get('MainWindow').window) self.dialog.set_transient_for(component.get('MainWindow').window)
self.glade.signal_autoconnect({ self.builder.connect_signals(self)
'on_options_ok': self.on_ok,
'on_options_cancel': self.on_cancel,
})
# Show the label name in the header label # Show the label name in the header label
self.glade.get_widget('label_header').set_markup('<b>%s:</b> %s' % (_('Label Options'), self.label)) self.builder.get_object('label_header').set_markup('<b>%s:</b> %s' % (_('Label Options'), self.label))
for chk_id, group in self.sensitive_groups: for chk_id, group in self.sensitive_groups:
chk = self.glade.get_widget(chk_id) chk = self.builder.get_object(chk_id)
chk.connect('toggled', self.apply_sensitivity) chk.connect('toggled', self.apply_sensitivity)
client.label.get_options(self.label).addCallback(self.load_options) client.label.get_options(self.label).addCallback(self.load_options)
@ -177,40 +171,40 @@ class OptionsDialog(object):
log.debug(list(options)) log.debug(list(options))
for spin_id in self.spin_ids + self.spin_int_ids: for spin_id in self.spin_ids + self.spin_int_ids:
self.glade.get_widget(spin_id).set_value(options[spin_id]) self.builder.get_object(spin_id).set_value(options[spin_id])
for chk_id in self.chk_ids: for chk_id in self.chk_ids:
self.glade.get_widget(chk_id).set_active(bool(options[chk_id])) self.builder.get_object(chk_id).set_active(bool(options[chk_id]))
if client.is_localhost(): if client.is_localhost():
self.glade.get_widget('move_completed_path').set_filename(options['move_completed_path']) self.builder.get_object('move_completed_path').set_filename(options['move_completed_path'])
self.glade.get_widget('move_completed_path').show() self.builder.get_object('move_completed_path').show()
self.glade.get_widget('move_completed_path_entry').hide() self.builder.get_object('move_completed_path_entry').hide()
else: else:
self.glade.get_widget('move_completed_path_entry').set_text(options['move_completed_path']) self.builder.get_object('move_completed_path_entry').set_text(options['move_completed_path'])
self.glade.get_widget('move_completed_path_entry').show() self.builder.get_object('move_completed_path_entry').show()
self.glade.get_widget('move_completed_path').hide() self.builder.get_object('move_completed_path').hide()
self.glade.get_widget('auto_add_trackers').get_buffer().set_text('\n'.join(options['auto_add_trackers'])) self.builder.get_object('auto_add_trackers').get_buffer().set_text('\n'.join(options['auto_add_trackers']))
self.apply_sensitivity() self.apply_sensitivity()
def on_ok(self, event=None): def on_options_ok(self, event=None):
'save options..' 'save options..'
options = {} options = {}
for spin_id in self.spin_ids: for spin_id in self.spin_ids:
options[spin_id] = self.glade.get_widget(spin_id).get_value() options[spin_id] = self.builder.get_object(spin_id).get_value()
for spin_int_id in self.spin_int_ids: for spin_int_id in self.spin_int_ids:
options[spin_int_id] = self.glade.get_widget(spin_int_id).get_value_as_int() options[spin_int_id] = self.builder.get_object(spin_int_id).get_value_as_int()
for chk_id in self.chk_ids: for chk_id in self.chk_ids:
options[chk_id] = self.glade.get_widget(chk_id).get_active() options[chk_id] = self.builder.get_object(chk_id).get_active()
if client.is_localhost(): if client.is_localhost():
options['move_completed_path'] = self.glade.get_widget('move_completed_path').get_filename() options['move_completed_path'] = self.builder.get_object('move_completed_path').get_filename()
else: else:
options['move_completed_path'] = self.glade.get_widget('move_completed_path_entry').get_text() options['move_completed_path'] = self.builder.get_object('move_completed_path_entry').get_text()
buff = self.glade.get_widget('auto_add_trackers').get_buffer() # sometimes I hate gtk... buff = self.builder.get_object('auto_add_trackers').get_buffer() # sometimes I hate gtk...
tracker_lst = buff.get_text(buff.get_start_iter(), buff.get_end_iter()).strip().split('\n') tracker_lst = buff.get_text(buff.get_start_iter(), buff.get_end_iter()).strip().split('\n')
options['auto_add_trackers'] = [x for x in tracker_lst if x] # filter out empty lines. options['auto_add_trackers'] = [x for x in tracker_lst if x] # filter out empty lines.
@ -220,10 +214,10 @@ class OptionsDialog(object):
def apply_sensitivity(self, event=None): def apply_sensitivity(self, event=None):
for chk_id, sensitive_list in self.sensitive_groups: for chk_id, sensitive_list in self.sensitive_groups:
chk = self.glade.get_widget(chk_id) chk = self.builder.get_object(chk_id)
sens = chk.get_active() and chk.get_property('sensitive') sens = chk.get_active() and chk.get_property('sensitive')
for widget_id in sensitive_list: for widget_id in sensitive_list:
self.glade.get_widget(widget_id).set_sensitive(sens) self.builder.get_object(widget_id).set_sensitive(sens)
def on_cancel(self, event=None): def on_options_cancel(self, event=None):
self.dialog.destroy() self.dialog.destroy()