This commit is contained in:
Zach Tibbitts 2007-02-16 04:30:49 +00:00
parent d7eda4ba53
commit 6bd089dcf9
3 changed files with 194 additions and 185 deletions

View File

@ -44,18 +44,6 @@
<child>
<placeholder/>
</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>
<signal name="toggled" handler="tray_toggle"/>
</widget>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="chk_min_on_close">
<property name="visible">True</property>
@ -69,6 +57,18 @@
<property name="x_padding">12</property>
</packing>
</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>
<signal name="toggled" handler="tray_toggle"/>
</widget>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
</widget>
</child>
<child>
@ -95,15 +95,13 @@
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<child>
<widget class="GtkFileChooserButton" id="download_path_button">
<widget class="GtkRadioButton" id="radio_ask_save">
<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>
<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>
@ -119,13 +117,15 @@
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="radio_ask_save">
<widget class="GtkFileChooserButton" id="download_path_button">
<property name="visible">True</property>
<property name="label" translatable="yes">Ask me where to save each download</property>
<property name="draw_indicator">True</property>
<property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</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>
</widget>
@ -154,6 +154,14 @@
<property name="visible">True</property>
<property name="n_rows">1</property>
<property name="n_columns">2</property>
<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>
</child>
<child>
<widget class="GtkSpinButton" id="ratio_spinner">
<property name="visible">True</property>
@ -171,14 +179,6 @@
<property name="x_options"></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>
</child>
</widget>
</child>
<child>
@ -272,53 +272,13 @@ their share ratio reaches:</property>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="label25">
<widget class="GtkButton" id="btn_test_port">
<property name="visible">True</property>
<property name="label" translatable="yes">Try from:</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label26">
<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>
<property name="label" translatable="yes">Test Port</property>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label27">
<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="bottom_attach">2</property>
</packing>
@ -336,17 +296,57 @@ their share ratio reaches:</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="btn_test_port">
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="label" translatable="yes">Test Port</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="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>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</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="GtkLabel" id="label26">
<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="label25">
<property name="visible">True</property>
<property name="label" translatable="yes">Try from:</property>
</widget>
</child>
</widget>
</child>
<child>
@ -373,37 +373,122 @@ their share ratio reaches:</property>
<property name="n_rows">5</property>
<property name="n_columns">3</property>
<child>
<widget class="GtkLabel" id="label9">
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;i&gt;(0 is unlimited)&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Upload Rate:</property>
</widget>
<packing>
<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="label8">
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">KB/s</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum number of Uploads:</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>
</child>
<child>
<widget class="GtkLabel" id="label2">
<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="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum number of Downloads:</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">0 -1 1024 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="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">0 -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="GtkSpinButton" id="spin_max_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">0 -1 2048 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label7">
<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">0 -1 100 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="label5">
<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>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options"></property>
</packing>
</child>
@ -421,123 +506,38 @@ their share ratio reaches:</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label5">
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">2</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_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">0 0 100 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="GtkSpinButton" id="spin_max_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">0 0 100 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options"></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">0 0 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="GtkSpinButton" id="spin_max_upload">
<widget class="GtkLabel" id="label8">
<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">0 0 100 1 10 10</property>
<property name="label" translatable="yes">KB/s</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="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label1">
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum number of Downloads:</property>
<property name="label" translatable="yes">&lt;i&gt;(0 is unlimited)&lt;/i&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label2">
<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="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum number of Uploads:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</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">1</property>
<property name="bottom_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
</widget>

View File

@ -21,6 +21,8 @@
import sys, os, os.path, webbrowser
import xdg, xdg.BaseDirectory
import gettext
PROGRAM_NAME = "Deluge"
PROGRAM_VERSION = "0.4.90.0"
@ -50,15 +52,17 @@ class DelugePreferences:
return not (result == 0)
else:
return False
elif kind == str:
return str(result)
elif kind == int:
try:
return int(result)
except ValueError:
return int(float(result))
except:
return 0
elif kind == float:
return float(result)
elif kind == str:
return str(result)
else:
return result

View File

@ -94,7 +94,7 @@ class DelugeGTK(dbus.service.Object):
self.connect_signals()
self.apply_prefs()
try:
self.load_window_settings()
@ -108,6 +108,7 @@ class DelugeGTK(dbus.service.Object):
self.plugins.enable_plugin(plugin)
except KeyError:
pass
self.apply_prefs()
def connect_signals(self):
self.wtree.signal_autoconnect({
@ -414,7 +415,11 @@ class DelugeGTK(dbus.service.Object):
def apply_prefs(self):
pass
self.tray.set_visible(self.pref.get("enable_system_tray", bool))
self.manager.set_pref("listen_on", [self.pref.get("tcp_port_range_lower", int), self.pref.get("tcp_port_range_upper", int)])
self.manager.set_pref("max_uploads", self.pref.get("max_number_uploads", int))
self.manager.set_pref("max_download_rate", self.pref.get("max_download_rate", int))
self.manager.set_pref("max_connections", self.pref.get("max_number_downloads", int))
# UID, Q#, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share