This commit is contained in:
Zach Tibbitts 2007-03-26 21:09:39 +00:00
parent 286ff7dd9d
commit 4f027326be
6 changed files with 362 additions and 345 deletions

View File

@ -56,13 +56,15 @@
<property name="n_rows">2</property> <property name="n_rows">2</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child> <child>
<widget class="GtkRadioButton" id="radio_ask_save"> <widget class="GtkFileChooserButton" id="download_path_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Ask me where to save each download</property> <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
<property name="draw_indicator">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -78,15 +80,13 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkFileChooserButton" id="download_path_button"> <widget class="GtkRadioButton" id="radio_ask_save">
<property name="visible">True</property> <property name="visible">True</property>
<property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property> <property name="label" translatable="yes">Ask me where to save each download</property>
<property name="draw_indicator">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing> </packing>
</child> </child>
</widget> </widget>
@ -127,15 +127,7 @@
<property name="n_rows">1</property> <property name="n_rows">1</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child> <child>
<widget class="GtkLabel" id="label33"> <widget class="GtkSpinButton" id="spin_torrents">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum simultaneous active torrents:</property>
</widget>
</child>
<child>
<widget class="GtkSpinButton" id="spinbutton2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -150,6 +142,14 @@
<property name="x_options"></property> <property name="x_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum simultaneous active torrents:</property>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -224,29 +224,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">2</property> <property name="n_rows">2</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child>
<widget class="GtkCheckButton" id="chk_queueseeding">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Queue torrents to bottom when they begin seeding</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="chk_autoseed">
<property name="visible">True</property>
<property name="label" translatable="yes">Stop seeding torrents when their share ratio reaches:</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child> <child>
<widget class="GtkSpinButton" id="ratio_spinner"> <widget class="GtkSpinButton" id="ratio_spinner">
<property name="visible">True</property> <property name="visible">True</property>
@ -265,6 +242,29 @@
<property name="x_options"></property> <property name="x_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="chk_autoseed">
<property name="visible">True</property>
<property name="label" translatable="yes">Stop seeding torrents when their share ratio reaches:</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="chk_seedbottom">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Queue torrents to bottom when they begin seeding</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -360,13 +360,53 @@
<placeholder/> <placeholder/>
</child> </child>
<child> <child>
<widget class="GtkButton" id="btn_test_port"> <widget class="GtkLabel" id="label37">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Test Port</property> <property name="label" translatable="yes">Try from:</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="label" translatable="yes">to:</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_port_min">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="xalign">0.5</property>
<property name="adjustment">0 0 65535 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_port_max">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="xalign">0.5</property>
<property name="adjustment">0 0 65535 1 10 10</property>
</widget> </widget>
<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>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label26">
<property name="visible">True</property>
<property name="label" translatable="yes">Active port:</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
</packing> </packing>
@ -384,57 +424,17 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label26"> <widget class="GtkButton" id="btn_test_port">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Active port:</property> <property name="label" translatable="yes">Test Port</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_port_max">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="xalign">0.5</property>
<property name="adjustment">0 0 65535 1 10 10</property>
</widget> </widget>
<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>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkSpinButton" id="spin_port_min">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="xalign">0.5</property>
<property name="adjustment">0 0 65535 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="label" translatable="yes">to:</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label37">
<property name="visible">True</property>
<property name="label" translatable="yes">Try from:</property>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -456,6 +456,45 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkFrame" id="frame11">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment11">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkCheckButton" id="chk_upnp">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Enable UPnP support</property>
<property name="draw_indicator">True</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">&lt;b&gt;UPnP&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
<child> <child>
<widget class="GtkFrame" id="frame9"> <widget class="GtkFrame" id="frame9">
<property name="visible">True</property> <property name="visible">True</property>
@ -474,7 +513,7 @@
<property name="n_rows">2</property> <property name="n_rows">2</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child> <child>
<widget class="GtkSpinButton" id="spinbutton3"> <widget class="GtkSpinButton" id="spin_dht">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -490,7 +529,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label16"> <widget class="GtkLabel" id="label13">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Max number of DHT connections:</property> <property name="label" translatable="yes">Max number of DHT connections:</property>
@ -501,7 +540,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="checkbutton1"> <widget class="GtkCheckButton" id="chk_dht">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -517,7 +556,7 @@
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label13"> <widget class="GtkLabel" id="label16">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">&lt;b&gt;DHT&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;DHT&lt;/b&gt;</property>
@ -530,7 +569,7 @@
</widget> </widget>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">2</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -545,7 +584,7 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<widget class="GtkCheckButton" id="checkbutton2"> <widget class="GtkCheckButton" id="chk_pex">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -567,45 +606,6 @@
</packing> </packing>
</child> </child>
</widget> </widget>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame11">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment11">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkCheckButton" id="checkbutton3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Enable UPnP support</property>
<property name="draw_indicator">True</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">&lt;b&gt;UPnP&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">4</property> <property name="position">4</property>
@ -671,129 +671,25 @@
<property name="n_rows">5</property> <property name="n_rows">5</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<child> <child>
<widget class="GtkLabel" id="label1"> <widget class="GtkLabel" id="label9">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;i&gt;(-1 is unlimited)&lt;/i&gt;</property>
<property name="use_markup">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label2"> <widget class="GtkLabel" id="label8">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">KB/s</property> <property name="label" translatable="yes">KB/s</property>
</widget> </widget>
<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>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 1024 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Upload Rate:</property>
</widget>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_download">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 100 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Connections</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Upload Slots</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Download Rate:</property>
</widget>
<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>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 100 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options"></property> <property name="x_options"></property>
</packing> </packing>
</child> </child>
@ -814,26 +710,130 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label8"> <widget class="GtkSpinButton" id="spin_num_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 100 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Download Rate:</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Upload Slots</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Connections</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_download">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 100 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Upload Rate:</property>
</widget>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">10</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 1024 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">KB/s</property> <property name="label" translatable="yes">KB/s</property>
</widget> </widget>
<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>
<property name="top_attach">3</property> <property name="top_attach">4</property>
<property name="bottom_attach">4</property> <property name="bottom_attach">5</property>
<property name="x_options"></property> <property name="x_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label9"> <widget class="GtkLabel" id="label2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;i&gt;(-1 is unlimited)&lt;/i&gt;</property>
<property name="use_markup">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing> </packing>
</child> </child>
</widget> </widget>
@ -918,6 +918,17 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">2</property> <property name="n_rows">2</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child>
<widget class="GtkCheckButton" id="chk_use_tray">
<property name="visible">True</property>
<property name="label" translatable="yes">Enable system tray icon</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child> <child>
<widget class="GtkCheckButton" id="chk_min_on_close"> <widget class="GtkCheckButton" id="chk_min_on_close">
<property name="visible">True</property> <property name="visible">True</property>
@ -931,17 +942,6 @@
<property name="x_padding">12</property> <property name="x_padding">12</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="chk_use_tray">
<property name="visible">True</property>
<property name="label" translatable="yes">Enable system tray icon</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -980,15 +980,19 @@
<property name="n_rows">1</property> <property name="n_rows">1</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<child> <child>
<widget class="GtkLabel" id="label28"> <widget class="GtkLabel" id="label30">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property> <property name="label" translatable="yes">seconds</property>
<property name="label" translatable="yes">GUI update interval</property>
</widget> </widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="x_options"></property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="spinbutton1"> <widget class="GtkSpinButton" id="spin_gui">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -1004,16 +1008,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label30"> <widget class="GtkLabel" id="label28">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">seconds</property> <property name="xalign">0</property>
<property name="label" translatable="yes">GUI update interval</property>
</widget> </widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="x_options"></property>
</packing>
</child> </child>
</widget> </widget>
</child> </child>

View File

@ -156,7 +156,7 @@ class write_data_install_path(cmd.Command):
def run(self): def run(self):
conf_filename = os.path.join(self.lib_build_dir, conf_filename = os.path.join(self.lib_build_dir,
'deluge', 'dcommon.py') 'deluge', 'common.py')
conf_file = open(conf_filename, 'r') conf_file = open(conf_filename, 'r')
data = conf_file.read() data = conf_file.read()
@ -180,8 +180,8 @@ class unwrite_data_install_path(cmd.Command):
def run(self): def run(self):
dest = os.path.join(self.lib_build_dir, dest = os.path.join(self.lib_build_dir,
'deluge', 'dcommon.py') 'deluge', 'common.py')
shutil.copyfile('src/dcommon.py', dest) shutil.copyfile('src/common.py', dest)
class build_trans(cmd.Command): class build_trans(cmd.Command):
description = 'Compile .po files into .mo files' description = 'Compile .po files into .mo files'

View File

@ -18,10 +18,10 @@
# 51 Franklin Street, Fifth Floor # 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA. # Boston, MA 02110-1301, USA.
# Similar to dcommon, this contains any common functions # Similar to common, this contains any common functions
# related to gtk that are needed by the client # related to gtk that are needed by the client
import dcommon import common
import gettext import gettext
import pygtk import pygtk
pygtk.require('2.0') pygtk.require('2.0')

View File

@ -18,7 +18,7 @@
# 51 Franklin Street, Fifth Floor # 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA. # Boston, MA 02110-1301, USA.
import dcommon, dgtk import common, dgtk
import gtk, gtk.glade import gtk, gtk.glade
import os, os.path import os, os.path
@ -26,9 +26,9 @@ import os, os.path
class PreferencesDlg: class PreferencesDlg:
def __init__(self, parent, preferences): def __init__(self, parent, preferences):
self.glade = gtk.glade.XML(dcommon.get_glade_file("preferences_dialog.glade"), domain='deluge') self.glade = gtk.glade.XML(common.get_glade_file("preferences_dialog.glade"), domain='deluge')
self.dialog = self.glade.get_widget("pref_dialog") self.dialog = self.glade.get_widget("pref_dialog")
self.dialog.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) self.dialog.set_icon_from_file(common.get_pixmap("deluge32.png"))
self.glade.signal_autoconnect({ self.glade.signal_autoconnect({
'tray_toggle': self.tray_toggle, 'tray_toggle': self.tray_toggle,
}) })
@ -37,6 +37,7 @@ class PreferencesDlg:
def show(self): def show(self):
# Load settings into dialog # Load settings into dialog
try:
self.glade.get_widget("chk_use_tray").set_active(self.preferences.get("enable_system_tray", bool, default=True)) self.glade.get_widget("chk_use_tray").set_active(self.preferences.get("enable_system_tray", bool, default=True))
self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray", bool, default=False)) self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray", bool, default=False))
if(self.preferences.get("use_default_dir", bool, False)): if(self.preferences.get("use_default_dir", bool, False)):
@ -54,6 +55,16 @@ class PreferencesDlg:
self.glade.get_widget("spin_num_upload").set_value(self.preferences.get("max_number_uploads", int, default=-1)) self.glade.get_widget("spin_num_upload").set_value(self.preferences.get("max_number_uploads", int, default=-1))
self.glade.get_widget("spin_max_download").set_value(self.preferences.get("max_download_rate", int, default=-1)) self.glade.get_widget("spin_max_download").set_value(self.preferences.get("max_download_rate", int, default=-1))
self.glade.get_widget("spin_num_download").set_value(self.preferences.get("max_number_downloads", int, default=-1)) self.glade.get_widget("spin_num_download").set_value(self.preferences.get("max_number_downloads", int, default=-1))
self.glade.get_widget("spin_torrents").set_value(self.preferences.get("max_number_torrents", int, default=-1))
self.glade.get_widget("chk_seedbottom").set_active(self.preferences.get("queue_seeds_to_bottom", bool, default=False))
self.glade.get_widget("chk_upnp").set_active(self.preferences.get("enable_upnp", bool, default=True))
self.glade.get_widget("chk_dht").set_active(self.preferences.get("enable_dht", bool, default=True))
self.glade.get_widget("spin_dht").set_value(self.preferences.get("dht_connections", int, default=80))
self.glade.get_widget("chk_pex").set_active(self.preferences.get("enable_pex", bool, default=True))
self.glade.get_widget("spin_gui").set_value(self.preferences.get("gui_update_interval", float, default=1.0))
except KeyError:
pass
# Now, show the dialog # Now, show the dialog
self.dialog.show() self.dialog.show()
r = self.dialog.run() r = self.dialog.run()
@ -73,7 +84,13 @@ class PreferencesDlg:
self.preferences.set("max_number_uploads", self.glade.get_widget("spin_num_upload").get_value()) self.preferences.set("max_number_uploads", self.glade.get_widget("spin_num_upload").get_value())
self.preferences.set("max_download_rate", self.glade.get_widget("spin_max_download").get_value()) self.preferences.set("max_download_rate", self.glade.get_widget("spin_max_download").get_value())
self.preferences.set("max_number_downloads", self.glade.get_widget("spin_num_download").get_value()) self.preferences.set("max_number_downloads", self.glade.get_widget("spin_num_download").get_value())
self.preferences.set("max_number_torrents", self.glade.get_widget("spin_torrents").get_value())
self.preferences.set("queue_seeds_to_bottom", self.glade.get_widget("chk_seedbottom").get_active())
self.preferences.set("enable_upnp", self.glade.get_widget("chk_upnp").get_active())
self.preferences.set("enable_dht", self.glade.get_widget("chk_dht").get_active())
self.preferences.set("dht_connections", self.glade.get_widget("spin_dht").get_value())
self.preferences.set("enable_pex", self.glade.get_widget("chk_pex").get_active())
self.preferences.set("gui_update_interval", self.glade.get_widget("spin_gui").get_value())
def tray_toggle(self, obj): def tray_toggle(self, obj):
if obj.get_active(): if obj.get_active():
@ -86,9 +103,9 @@ class PreferencesDlg:
class PluginDlg: class PluginDlg:
def __init__(self, parent, plugins): def __init__(self, parent, plugins):
self.glade = gtk.glade.XML(dcommon.get_glade_file("plugin_dialog.glade"), domain='deluge') self.glade = gtk.glade.XML(common.get_glade_file("plugin_dialog.glade"), domain='deluge')
self.dialog = self.glade.get_widget("plugin_dialog") self.dialog = self.glade.get_widget("plugin_dialog")
self.dialog.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) self.dialog.set_icon_from_file(common.get_pixmap("deluge32.png"))
self.view = self.glade.get_widget("plugin_view") self.view = self.glade.get_widget("plugin_view")
self.store = gtk.ListStore(str, bool) self.store = gtk.ListStore(str, bool)
self.view.set_model(self.store) self.view.set_model(self.store)
@ -159,16 +176,16 @@ class PluginDlg:
def show_about_dialog(parent=None): def show_about_dialog(parent=None):
gtk.about_dialog_set_url_hook(dcommon.open_url_in_browser) gtk.about_dialog_set_url_hook(common.open_url_in_browser)
abt = gtk.glade.XML(dcommon.get_glade_file("aboutdialog.glade")).get_widget("aboutdialog") abt = gtk.glade.XML(common.get_glade_file("aboutdialog.glade")).get_widget("aboutdialog")
abt.set_name(dcommon.PROGRAM_NAME) abt.set_name(common.PROGRAM_NAME)
abt.set_version(dcommon.PROGRAM_VERSION) abt.set_version(common.PROGRAM_VERSION)
abt.set_authors(["Zach Tibbits", "A. Zakai"]) abt.set_authors(["Zach Tibbits", "A. Zakai"])
abt.set_artists(["Andrew Wedderburn"]) abt.set_artists(["Andrew Wedderburn"])
abt.set_website("http://deluge-torrent.org") abt.set_website("http://deluge-torrent.org")
abt.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) abt.set_icon_from_file(common.get_pixmap("deluge32.png"))
abt.set_logo(gtk.gdk.pixbuf_new_from_file( abt.set_logo(gtk.gdk.pixbuf_new_from_file(
dcommon.get_pixmap("deluge-about.png"))) common.get_pixmap("deluge-about.png")))
abt.show_all() abt.show_all()
abt.run() abt.run()
abt.hide_all() abt.hide_all()
@ -216,7 +233,7 @@ def show_file_open_dialog(parent=None, title=None):
f1.add_pattern("*") f1.add_pattern("*")
chooser.add_filter(f1) chooser.add_filter(f1)
chooser.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) chooser.set_icon_from_file(common.get_pixmap("deluge32.png"))
chooser.set_property("skip-taskbar-hint", True) chooser.set_property("skip-taskbar-hint", True)
response = chooser.run() response = chooser.run()
@ -232,7 +249,7 @@ def show_directory_chooser_dialog(parent=None, title=None):
title = _("Choose a download directory") title = _("Choose a download directory")
chooser = gtk.FileChooserDialog(title, parent, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, chooser = gtk.FileChooserDialog(title, parent, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK)) buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK))
chooser.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) chooser.set_icon_from_file(common.get_pixmap("deluge32.png"))
chooser.set_property("skip-taskbar-hint", True) chooser.set_property("skip-taskbar-hint", True)
if chooser.run() == gtk.RESPONSE_OK: if chooser.run() == gtk.RESPONSE_OK:
result = chooser.get_filename() result = chooser.get_filename()

View File

@ -21,7 +21,7 @@
# Boston, MA 02110-1301, USA. # Boston, MA 02110-1301, USA.
import sys, os, os.path, urllib import sys, os, os.path, urllib
import core, dcommon, dgtk, ipc_manager, dialogs import core, common, dgtk, ipc_manager, dialogs
import plugins, pref import plugins, pref
import pygtk import pygtk
pygtk.require('2.0') pygtk.require('2.0')
@ -63,7 +63,7 @@ DEFAULT_PREFS = {
class DelugeGTK: class DelugeGTK:
def __init__(self): def __init__(self):
APP = 'deluge' APP = 'deluge'
DIR = os.path.join(dcommon.INSTALL_PREFIX, 'share', 'locale') DIR = os.path.join(common.INSTALL_PREFIX, 'share', 'locale')
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
locale.bindtextdomain(APP, DIR) locale.bindtextdomain(APP, DIR)
locale.textdomain(APP) locale.textdomain(APP)
@ -75,7 +75,7 @@ class DelugeGTK:
self.ipc_manager = ipc_manager.Manager(self) self.ipc_manager = ipc_manager.Manager(self)
self.torrent_file_queue = [] self.torrent_file_queue = []
#Load up a config file: #Load up a config file:
self.conf_file = os.path.join(dcommon.CONFIG_DIR, 'deluge.conf') self.conf_file = os.path.join(common.CONFIG_DIR, 'deluge.conf')
if os.path.isdir(self.conf_file): if os.path.isdir(self.conf_file):
print 'Weird, the file I was trying to write to, %s, is an existing directory'%(self.conf_file) print 'Weird, the file I was trying to write to, %s, is an existing directory'%(self.conf_file)
sys.exit(0) sys.exit(0)
@ -86,33 +86,33 @@ class DelugeGTK:
#Start the Deluge Manager: #Start the Deluge Manager:
p = "DE" p = "DE"
v = "0500" v = "0500"
s = "%s %s"%(dcommon.PROGRAM_NAME, dcommon.PROGRAM_VERSION) s = "%s %s"%(common.PROGRAM_NAME, common.PROGRAM_VERSION)
#try: #try:
# self.manager = core.Manager(p, v, s, dcommon.CONFIG_DIR) # self.manager = core.Manager(p, v, s, common.CONFIG_DIR)
#except: #except:
# # If something goes wrong while restoring the session, then load # # If something goes wrong while restoring the session, then load
# # a blank state rather than crash and exit # # a blank state rather than crash and exit
# self.manager = core.Manager(p, v, s, dcommon.CONFIG_DIR, blank_slate=True) # self.manager = core.Manager(p, v, s, common.CONFIG_DIR, blank_slate=True)
# self.something_screwed_up = True # self.something_screwed_up = True
self.manager = core.Manager(p, v, s, dcommon.CONFIG_DIR) self.manager = core.Manager(p, v, s, common.CONFIG_DIR)
self.something_screwed_up = False self.something_screwed_up = False
#else: self.something_screwed_up = False #else: self.something_screwed_up = False
self.plugins = plugins.PluginManager(self.manager, self) self.plugins = plugins.PluginManager(self.manager, self)
self.plugins.add_plugin_dir(dcommon.PLUGIN_DIR) self.plugins.add_plugin_dir(common.PLUGIN_DIR)
if os.path.isdir(os.path.join(dcommon.CONFIG_DIR , 'plugins')): if os.path.isdir(os.path.join(common.CONFIG_DIR , 'plugins')):
self.plugins.add_plugin_dir(os.path.join(dcommon.CONFIG_DIR, 'plugins')) self.plugins.add_plugin_dir(os.path.join(common.CONFIG_DIR, 'plugins'))
self.plugins.scan_for_plugins() self.plugins.scan_for_plugins()
self.config = pref.Preferences(self.conf_file, DEFAULT_PREFS) self.config = pref.Preferences(self.conf_file, DEFAULT_PREFS)
#Set up the interface: #Set up the interface:
self.wtree = gtk.glade.XML(dcommon.get_glade_file("delugegtk.glade"), domain=APP) self.wtree = gtk.glade.XML(common.get_glade_file("delugegtk.glade"), domain=APP)
self.window = self.wtree.get_widget("main_window") self.window = self.wtree.get_widget("main_window")
self.window.hide() self.window.hide()
self.toolbar = self.wtree.get_widget("tb_middle") self.toolbar = self.wtree.get_widget("tb_middle")
self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL,[('text/uri-list', 0, 80)], gtk.gdk.ACTION_COPY) self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL,[('text/uri-list', 0, 80)], gtk.gdk.ACTION_COPY)
self.window.connect("delete_event", self.close) self.window.connect("delete_event", self.close)
self.window.connect("drag_data_received", self.on_drag_data) self.window.connect("drag_data_received", self.on_drag_data)
self.window.set_title(dcommon.PROGRAM_NAME) self.window.set_title(common.PROGRAM_NAME)
self.window.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) self.window.set_icon_from_file(common.get_pixmap("deluge32.png"))
self.notebook = self.wtree.get_widget("torrent_info") self.notebook = self.wtree.get_widget("torrent_info")
self.statusbar = self.wtree.get_widget("statusbar") self.statusbar = self.wtree.get_widget("statusbar")
@ -198,7 +198,7 @@ class DelugeGTK:
}) })
def build_tray_icon(self): def build_tray_icon(self):
self.tray_icon = gtk.status_icon_new_from_file(dcommon.get_pixmap("deluge32.png")) self.tray_icon = gtk.status_icon_new_from_file(common.get_pixmap("deluge32.png"))
self.tray_menu = gtk.Menu() self.tray_menu = gtk.Menu()
item_show = gtk.MenuItem(_("Show / Hide Window")) item_show = gtk.MenuItem(_("Show / Hide Window"))
@ -255,7 +255,7 @@ class DelugeGTK:
def build_torrent_table(self): def build_torrent_table(self):
## Create the torrent listview ## Create the torrent listview
self.torrent_view = self.wtree.get_widget("torrent_view") self.torrent_view = self.wtree.get_widget("torrent_view")
self.torrent_glade = gtk.glade.XML(dcommon.get_glade_file("torrent_menu.glade"), domain='deluge') self.torrent_glade = gtk.glade.XML(common.get_glade_file("torrent_menu.glade"), domain='deluge')
self.torrent_menu = self.torrent_glade.get_widget("torrent_menu") self.torrent_menu = self.torrent_glade.get_widget("torrent_menu")
self.torrent_glade.signal_autoconnect({ "start_pause": self.start_pause, self.torrent_glade.signal_autoconnect({ "start_pause": self.start_pause,
"update_tracker": self.update_tracker, "update_tracker": self.update_tracker,
@ -272,12 +272,12 @@ class DelugeGTK:
def size(column, cell, model, iter, data): def size(column, cell, model, iter, data):
size = long(model.get_value(iter, data)) size = long(model.get_value(iter, data))
size_str = dcommon.fsize(size) size_str = common.fsize(size)
cell.set_property('text', size_str) cell.set_property('text', size_str)
def rate(column, cell, model, iter, data): def rate(column, cell, model, iter, data):
rate = int(model.get_value(iter, data)) rate = int(model.get_value(iter, data))
rate_str = dcommon.frate(rate) rate_str = common.frate(rate)
cell.set_property('text', rate_str) cell.set_property('text', rate_str)
def peer(column, cell, model, iter, data): def peer(column, cell, model, iter, data):
@ -293,7 +293,7 @@ class DelugeGTK:
elif time == 0: elif time == 0:
time_str = "-" time_str = "-"
else: else:
time_str = dcommon.ftime(time) time_str = common.ftime(time)
cell.set_property('text', time_str) cell.set_property('text', time_str)
def ratio(column, cell, model, iter, data): def ratio(column, cell, model, iter, data):
@ -349,7 +349,7 @@ class DelugeGTK:
unique_id = model.get_value(model.get_iter(path), 0) unique_id = model.get_value(model.get_iter(path), 0)
state = self.manager.get_torrent_state(unique_id) state = self.manager.get_torrent_state(unique_id)
# A new torrent has been selected, need to update parts of interface # A new torrent has been selected, need to update parts of interface
self.text_summary_total_size.set_text(dcommon.fsize(state["total_size"])) self.text_summary_total_size.set_text(common.fsize(state["total_size"]))
self.text_summary_pieces.set_text(str(state["pieces"])) self.text_summary_pieces.set_text(str(state["pieces"]))
self.text_summary_tracker.set_text(str(state["tracker"])) self.text_summary_tracker.set_text(str(state["tracker"]))
#self.text_summary_compact_allocation.set_text(str(state[""])) #self.text_summary_compact_allocation.set_text(str(state[""]))
@ -362,7 +362,7 @@ class DelugeGTK:
assert(len(all_files) == len(file_filter)) assert(len(all_files) == len(file_filter))
i=0 i=0
for f in all_files: for f in all_files:
self.file_store.append([not file_filter[i], f['path'], dcommon.fsize(f['size']), self.file_store.append([not file_filter[i], f['path'], common.fsize(f['size']),
f['offset'], '%.2f%%'%f['progress']]) f['offset'], '%.2f%%'%f['progress']])
i=i+1 i=i+1
@ -527,7 +527,7 @@ class DelugeGTK:
dlrate = int(state['download_rate']) dlrate = int(state['download_rate'])
ulrate = int(state['upload_rate']) ulrate = int(state['upload_rate'])
try: try:
eta = dcommon.get_eta(state["total_size"], state["total_done"], state["download_rate"]) eta = common.get_eta(state["total_size"], state["total_done"], state["download_rate"])
except ZeroDivisionError: except ZeroDivisionError:
eta = -1 eta = -1
share = float(self.calc_share_ratio(unique_id, state)) share = float(self.calc_share_ratio(unique_id, state))
@ -585,8 +585,8 @@ class DelugeGTK:
# Update Statusbar and Tray Tips # Update Statusbar and Tray Tips
core_state = self.manager.get_state() core_state = self.manager.get_state()
connections = core_state['num_peers'] connections = core_state['num_peers']
dlrate = dcommon.frate(core_state['download_rate']) dlrate = common.frate(core_state['download_rate'])
ulrate = dcommon.frate(core_state['upload_rate']) ulrate = common.frate(core_state['upload_rate'])
self.statusbar_temp_msg = '%s: %s %s: %s %s: %s'%( self.statusbar_temp_msg = '%s: %s %s: %s %s: %s'%(
_('Connections'), connections, _('Download'), _('Connections'), connections, _('Download'),
@ -655,25 +655,25 @@ class DelugeGTK:
if tab == 0: #Details Pane if tab == 0: #Details Pane
self.wtree.get_widget("summary_name").set_text(state['name']) self.wtree.get_widget("summary_name").set_text(state['name'])
self.text_summary_total_size.set_text(dcommon.fsize(state["total_size"])) self.text_summary_total_size.set_text(common.fsize(state["total_size"]))
self.text_summary_pieces.set_text(str(state["pieces"])) self.text_summary_pieces.set_text(str(state["pieces"]))
self.text_summary_total_downloaded.set_text(dcommon.fsize(state["total_done"])) self.text_summary_total_downloaded.set_text(common.fsize(state["total_done"]))
#self.text_summary_total_uploaded.set_text() #self.text_summary_total_uploaded.set_text()
self.text_summary_download_rate.set_text(dcommon.frate(state["download_rate"])) self.text_summary_download_rate.set_text(common.frate(state["download_rate"]))
self.text_summary_upload_rate.set_text(dcommon.frate(state["upload_rate"])) self.text_summary_upload_rate.set_text(common.frate(state["upload_rate"]))
self.text_summary_seeders.set_text(dcommon.fseed(state)) self.text_summary_seeders.set_text(common.fseed(state))
self.text_summary_peers.set_text(dcommon.fpeer(state)) self.text_summary_peers.set_text(common.fpeer(state))
self.wtree.get_widget("progressbar").set_fraction(float(state['progress'])) self.wtree.get_widget("progressbar").set_fraction(float(state['progress']))
self.wtree.get_widget("progressbar").set_text(dcommon.fpcnt(state["progress"])) self.wtree.get_widget("progressbar").set_text(common.fpcnt(state["progress"]))
self.text_summary_share_ratio.set_text('%.3f'%(self.calc_share_ratio(self.get_selected_torrent(), state))) self.text_summary_share_ratio.set_text('%.3f'%(self.calc_share_ratio(self.get_selected_torrent(), state)))
self.text_summary_downloaded_this_session.set_text(dcommon.fsize(state["total_download"])) self.text_summary_downloaded_this_session.set_text(common.fsize(state["total_download"]))
self.text_summary_uploaded_this_session.set_text(dcommon.fsize(state["total_upload"])) self.text_summary_uploaded_this_session.set_text(common.fsize(state["total_upload"]))
self.text_summary_tracker.set_text(str(state["tracker"])) self.text_summary_tracker.set_text(str(state["tracker"]))
#self.text_summary_tracker_response.set_text(str(state[""])) #self.text_summary_tracker_response.set_text(str(state[""]))
self.text_summary_tracker_status.set_text(str(state["tracker_ok"])) self.text_summary_tracker_status.set_text(str(state["tracker_ok"]))
self.text_summary_next_announce.set_text(str(state["next_announce"])) self.text_summary_next_announce.set_text(str(state["next_announce"]))
#self.text_summary_compact_allocation.set_text(str(state[""])) #self.text_summary_compact_allocation.set_text(str(state[""]))
self.text_summary_eta.set_text(dcommon.estimate_eta(state)) self.text_summary_eta.set_text(common.estimate_eta(state))
elif tab == 1: #Peers List elif tab == 1: #Peers List
def biographer(model, path, iter, dictionary): def biographer(model, path, iter, dictionary):
assert(model.get_value(iter, 0) not in dictionary.keys()) assert(model.get_value(iter, 0) not in dictionary.keys())
@ -720,15 +720,15 @@ class DelugeGTK:
self.peer_store.set(self.peer_store.get_iter_from_string(curr_ips[peer['ip']]), self.peer_store.set(self.peer_store.get_iter_from_string(curr_ips[peer['ip']]),
1, unicode(peer['client'], 'Latin-1'), 1, unicode(peer['client'], 'Latin-1'),
2, '%.2f%%'%peer["peer_has"], 2, '%.2f%%'%peer["peer_has"],
3, dcommon.frate(peer["download_speed"]), 3, common.frate(peer["download_speed"]),
4, dcommon.frate(peer["upload_speed"])) 4, common.frate(peer["upload_speed"]))
for peer in new_peer_info: for peer in new_peer_info:
if peer['ip'] not in curr_ips.keys() and peer['client'] is not "": if peer['ip'] not in curr_ips.keys() and peer['client'] is not "":
self.peer_store.append([peer["ip"], self.peer_store.append([peer["ip"],
unicode(peer["client"], 'Latin-1'), unicode(peer["client"], 'Latin-1'),
'%.2f%%'%peer["peer_has"], '%.2f%%'%peer["peer_has"],
dcommon.frate(peer["download_speed"]), common.frate(peer["download_speed"]),
dcommon.frate(peer["upload_speed"])]) common.frate(peer["upload_speed"])])
#print new_ips #print new_ips
#print curr_ips #print curr_ips
#print new_peer_info #print new_peer_info
@ -781,8 +781,8 @@ class DelugeGTK:
try: try:
unique_id = self.manager.add_torrent(torrent, path, self.config.get('use_compact_storage', bool, default=False)) unique_id = self.manager.add_torrent(torrent, path, self.config.get('use_compact_storage', bool, default=False))
except core.InsufficientFreeSpaceError, err: except core.InsufficientFreeSpaceError, err:
nice_need = dcommon.fsize(err.needed_space) nice_need = common.fsize(err.needed_space)
nice_free = dcommon.fsize(err.free_space) nice_free = common.fsize(err.free_space)
if append: if append:
@ -798,7 +798,7 @@ class DelugeGTK:
def add_torrent_url_clicked(self, obj=None): def add_torrent_url_clicked(self, obj=None):
dlg = gtk.Dialog(title=_("Add torrent from URL"), parent=self.window, dlg = gtk.Dialog(title=_("Add torrent from URL"), parent=self.window,
buttons=(gtk.STOCK_CANCEL, 0, gtk.STOCK_OK, 1)) buttons=(gtk.STOCK_CANCEL, 0, gtk.STOCK_OK, 1))
dlg.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) dlg.set_icon_from_file(common.get_pixmap("deluge32.png"))
label = gtk.Label(_("Enter the URL of the .torrent to download")) label = gtk.Label(_("Enter the URL of the .torrent to download"))
entry = gtk.Entry() entry = gtk.Entry()
@ -819,10 +819,10 @@ class DelugeGTK:
def remove_torrent_clicked(self, obj=None): def remove_torrent_clicked(self, obj=None):
torrent = self.get_selected_torrent() torrent = self.get_selected_torrent()
if torrent is not None: if torrent is not None:
glade = gtk.glade.XML(dcommon.get_glade_file("dgtkpopups.glade"), domain='deluge') glade = gtk.glade.XML(common.get_glade_file("dgtkpopups.glade"), domain='deluge')
asker = glade.get_widget("remove_torrent_dlg") asker = glade.get_widget("remove_torrent_dlg")
asker.set_icon_from_file(dcommon.get_pixmap("deluge32.png")) asker.set_icon_from_file(common.get_pixmap("deluge32.png"))
warning = glade.get_widget("warning") warning = glade.get_widget("warning")
warning.set_text(" ") warning.set_text(" ")