Implement update checking

This commit is contained in:
Andrew Resch 2008-07-02 01:19:43 +00:00
parent 4026ac0bf2
commit 5f1de26f58
7 changed files with 1095 additions and 808 deletions

5
TODO
View File

@ -1,11 +1,10 @@
For 0.6 release: For 0.6 release:
* Address issue where torrents will redownload if the storage is moved outside
of deluge.
* Update checking
* Translations * Translations
* Add progress bars for downloading and importing lists instead of hanging (blocklist) * Add progress bars for downloading and importing lists instead of hanging (blocklist)
After 0.6 release: After 0.6 release:
* Address issue where torrents will redownload if the storage is moved outside
of deluge.
* Implement add by hash * Implement add by hash
* Figure out easy way for user-made plugins to add i18n support. * Figure out easy way for user-made plugins to add i18n support.
* Restart daemon function * Restart daemon function

View File

@ -107,6 +107,7 @@ DEFAULT_PREFS = {
"auto_managed": True, "auto_managed": True,
"move_completed": False, "move_completed": False,
"move_completed_path": os.path.join(deluge.common.get_default_download_dir(), "completed"), "move_completed_path": os.path.join(deluge.common.get_default_download_dir(), "completed"),
"new_release_check": False,
} }
class Core( class Core(
@ -261,6 +262,10 @@ class Core(
self._on_set_dont_count_slow_torrents) self._on_set_dont_count_slow_torrents)
self.config.register_set_function("send_info", self.config.register_set_function("send_info",
self._on_send_info) self._on_send_info)
self.new_release = None
self.new_release_timer = None
self.config.register_set_function("new_release_check",
self._on_new_release_check)
self.config.register_change_callback(self._on_config_value_change) self.config.register_change_callback(self._on_config_value_change)
# Start the AlertManager # Start the AlertManager
@ -343,6 +348,8 @@ class Core(
"""Registers a client with the signal manager so that signals are """Registers a client with the signal manager so that signals are
sent to it.""" sent to it."""
self.signals.register_client(self.client_address, port) self.signals.register_client(self.client_address, port)
if self.config["new_release_check"]:
self.check_new_release()
def export_deregister_client(self): def export_deregister_client(self):
"""De-registers a client with the signal manager.""" """De-registers a client with the signal manager."""
@ -865,3 +872,36 @@ class Core(
self.config["info_sent"] = now self.config["info_sent"] = now
if value: if value:
Send_Info_Thread(self.config).start() Send_Info_Thread(self.config).start()
def get_new_release(self):
log.debug("get_new_release")
import urllib
try:
self.new_release = urllib.urlopen(
"http://download.deluge-torrent.org/version").read().strip()
except Exception, e:
log.debug("Unable to get release info from website: %s", e)
return
self.check_new_release()
def check_new_release(self):
self.new_release = "0.7.0.0"
if self.new_release:
log.debug("new_release: %s", self.new_release)
if self.new_release > deluge.common.get_version():
self.signals.emit("new_version_available", self.new_release)
return self.new_release
return False
def _on_new_release_check(self, key, value):
if value:
log.debug("Checking for new release..")
threading.Thread(target=self.get_new_release).start()
if self.new_release_timer:
gobject.source_remove(self.new_release_timer)
# Set a timer to check for a new release every 3 days
self.new_release_timer = gobject.timeout_add(
72 * 60 * 60 * 1000, self._on_new_release_check, "new_release_check", True)
else:
if self.new_release_timer:
gobject.source.remove(self.new_release_timer)

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.4 on Thu Jun 26 22:26:51 2008 --> <!--Generated with glade3 3.4.5 on Tue Jul 1 18:04:37 2008 -->
<glade-interface> <glade-interface>
<widget class="GtkDialog" id="pref_dialog"> <widget class="GtkDialog" id="pref_dialog">
<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>
@ -1162,71 +1162,40 @@ Disabled</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">15</property> <property name="column_spacing">15</property>
<child> <child>
<widget class="GtkLabel" id="label17"> <widget class="GtkSpinButton" id="spin_max_upload_slots_global">
<property name="visible">True</property> <property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum upload speed for all torrents. Set -1 for unlimited.</property> <property name="can_focus">True</property>
<property name="xalign">0</property> <property name="tooltip" translatable="yes">The maximum upload slots for all torrents. Set -1 for unlimited.</property>
<property name="label" translatable="yes">Maximum Upload Speed (KiB/s):</property> <property name="xalign">1</property>
</widget> <property name="adjustment">-1 -1 9000 1 10 10</property>
<packing> <property name="climb_rate">1</property>
<property name="top_attach">3</property> <property name="snap_to_ticks">True</property>
<property name="bottom_attach">4</property> <property name="numeric">True</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections allowed. Set -1 for unlimited.</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Connections:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum upload speed for all torrents. Set -1 for unlimited.</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Upload Slots:</property>
</widget> </widget>
<packing> <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>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="spin_max_connections_global"> <widget class="GtkSpinButton" id="spin_max_upload">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections allowed. Set -1 for unlimited.</property> <property name="tooltip" translatable="yes">The maximum upload speed for all torrents. Set -1 for unlimited.</property>
<property name="max_length">4</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property> <property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property> <property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property> <property name="digits">1</property>
<property name="numeric">True</property> <property name="numeric">True</property>
<property name="update_policy">GTK_UPDATE_IF_VALID</property>
</widget> </widget>
<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>
<property name="x_options">GTK_FILL</property> <property name="top_attach">3</property>
</packing> <property name="bottom_attach">4</property>
</child>
<child>
<widget class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum download speed for all torrents. Set -1 for unlimited.</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Download Speed (KiB/s):</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
@ -1251,43 +1220,74 @@ Disabled</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="spin_max_upload"> <widget class="GtkLabel" id="label14">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="tooltip" translatable="yes">The maximum download speed for all torrents. Set -1 for unlimited.</property>
<property name="tooltip" translatable="yes">The maximum upload speed for all torrents. Set -1 for unlimited.</property> <property name="xalign">0</property>
<property name="xalign">1</property> <property name="label" translatable="yes">Maximum Download Speed (KiB/s):</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property>
<property name="digits">1</property>
<property name="numeric">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="top_attach">2</property>
<property name="right_attach">2</property> <property name="bottom_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="spin_max_upload_slots_global"> <widget class="GtkSpinButton" id="spin_max_connections_global">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum upload slots for all torrents. Set -1 for unlimited.</property> <property name="tooltip" translatable="yes">The maximum number of connections allowed. Set -1 for unlimited.</property>
<property name="max_length">4</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property> <property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property> <property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property> <property name="snap_to_ticks">True</property>
<property name="numeric">True</property> <property name="numeric">True</property>
<property name="update_policy">GTK_UPDATE_IF_VALID</property>
</widget> </widget>
<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>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum upload speed for all torrents. Set -1 for unlimited.</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Upload Slots:</property>
</widget>
<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>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections allowed. Set -1 for unlimited.</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Connections:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label17">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">The maximum upload speed for all torrents. Set -1 for unlimited.</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Upload Speed (KiB/s):</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -1331,18 +1331,85 @@ Disabled</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">15</property> <property name="column_spacing">15</property>
<child> <child>
<widget class="GtkSpinButton" id="spin_max_upload_per_torrent"> <widget class="GtkSpinButton" id="spin_max_upload_slots_per_torrent">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections per torrent. Set -1 for unlimited.</property> <property name="tooltip" translatable="yes">The maximum upload slots per torrent. Set -1 for unlimited.</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property> <property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="digits">1</property> <property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property> <property name="numeric">True</property>
</widget> </widget>
<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>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_connections_per_torrent">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections per torrent. Set -1 for unlimited.</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label18">
<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 Connections:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label24">
<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 Upload Slots:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label31">
<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 Download Speed (KiB/s):</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label32">
<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 Upload Speed (KiB/s):</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>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
@ -1367,87 +1434,20 @@ Disabled</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label32"> <widget class="GtkSpinButton" id="spin_max_upload_per_torrent">
<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 Upload Speed (KiB/s):</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label31">
<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 Download Speed (KiB/s):</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label24">
<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 Upload Slots:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label18">
<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 Connections:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_connections_per_torrent">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections per torrent. Set -1 for unlimited.</property> <property name="tooltip" translatable="yes">The maximum number of connections per torrent. Set -1 for unlimited.</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property> <property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="snap_to_ticks">True</property> <property name="digits">1</property>
<property name="numeric">True</property> <property name="numeric">True</property>
</widget> </widget>
<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>
<property name="x_options">GTK_FILL</property> <property name="top_attach">3</property>
</packing> <property name="bottom_attach">4</property>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_upload_slots_per_torrent">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum upload slots per torrent. Set -1 for unlimited.</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">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>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
@ -1801,7 +1801,7 @@ Disabled</property>
<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>
<child> <child>
<widget class="GtkCheckButton" id="chk_new_releases"> <widget class="GtkCheckButton" id="chk_show_new_releases">
<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>
@ -2087,6 +2087,49 @@ Disabled</property>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkFrame" id="frame22">
<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="alignment27">
<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="top_padding">5</property>
<property name="left_padding">10</property>
<child>
<widget class="GtkCheckButton" id="chk_new_releases">
<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">Periodically check the website for new releases</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label56">
<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;Other&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="fill">False</property>
<property name="padding">5</property>
<property name="position">4</property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -2218,15 +2261,59 @@ Disabled</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">10</property> <property name="column_spacing">10</property>
<child> <child>
<widget class="GtkLabel" id="label42"> <widget class="GtkSpinButton" id="spin_active">
<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="xalign">1</property>
<property name="adjustment">0 -1 9999 1 10 10</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_seeding">
<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="xalign">1</property>
<property name="adjustment">0 -1 9999 1 10 10</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</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="label27">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Total active seeding:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label48">
<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="xalign">0</property>
<property name="label" translatable="yes">Total active downloading:</property> <property name="label" translatable="yes">Total active:</property>
</widget> </widget>
<packing> <packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
@ -2249,62 +2336,18 @@ Disabled</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label48"> <widget class="GtkLabel" id="label42">
<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="xalign">0</property>
<property name="label" translatable="yes">Total active:</property> <property name="label" translatable="yes">Total active downloading:</property>
</widget> </widget>
<packing> <packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Total active seeding:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_seeding">
<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="xalign">1</property>
<property name="adjustment">0 -1 9999 1 10 10</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</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_active">
<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="xalign">1</property>
<property name="adjustment">0 -1 9999 1 10 10</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options"></property>
</packing>
</child>
</widget> </widget>
</child> </child>
<child> <child>
@ -2365,18 +2408,51 @@ Disabled</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">10</property> <property name="column_spacing">10</property>
<child> <child>
<widget class="GtkSpinButton" id="spin_seed_time_limit"> <widget class="GtkLabel" id="label53">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Share Ratio Limit:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label54">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Seed Time Ratio:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label55">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Seed Time (m):</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_share_ratio_limit">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="width_chars">6</property> <property name="width_chars">6</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="adjustment">6 -1 100 1 10 10</property> <property name="adjustment">1.5 -1 100 0.10000000000000001 10 10</property>
<property name="digits">2</property>
</widget> </widget>
<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>
<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>
@ -2398,52 +2474,19 @@ Disabled</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="spin_share_ratio_limit"> <widget class="GtkSpinButton" id="spin_seed_time_limit">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="width_chars">6</property> <property name="width_chars">6</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="adjustment">1.5 -1 100 0.10000000000000001 10 10</property> <property name="adjustment">6 -1 100 1 10 10</property>
<property name="digits">2</property>
</widget> </widget>
<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>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label55">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Seed Time (m):</property>
</widget>
<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>
<property name="x_options">GTK_FILL</property> <property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label54">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Seed Time Ratio:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label53">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Share Ratio Limit:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
</widget> </widget>

View File

@ -97,7 +97,8 @@ DEFAULT_PREFS = {
"autoadd_enable": False, "autoadd_enable": False,
"autoadd_location": "", "autoadd_location": "",
"choose_directory_dialog_path": deluge.common.get_default_download_dir(), "choose_directory_dialog_path": deluge.common.get_default_download_dir(),
"classic_mode": False "classic_mode": False,
"show_new_releases": True
} }
class GtkUI: class GtkUI:

View File

@ -217,6 +217,7 @@ class Preferences(component.Component):
"chk_natpmp": ("active", self.core_config["natpmp"]), "chk_natpmp": ("active", self.core_config["natpmp"]),
"chk_utpex": ("active", self.core_config["utpex"]), "chk_utpex": ("active", self.core_config["utpex"]),
"chk_lsd": ("active", self.core_config["lsd"]), "chk_lsd": ("active", self.core_config["lsd"]),
"chk_new_releases": ("active", self.core_config["new_release_check"]),
"chk_send_info": ("active", self.core_config["send_info"]), "chk_send_info": ("active", self.core_config["send_info"]),
"combo_encin": ("active", self.core_config["enc_in_policy"]), "combo_encin": ("active", self.core_config["enc_in_policy"]),
"combo_encout": ("active", self.core_config["enc_out_policy"]), "combo_encout": ("active", self.core_config["enc_out_policy"]),
@ -338,6 +339,7 @@ class Preferences(component.Component):
"chk_utpex", "chk_utpex",
"chk_lsd", "chk_lsd",
"chk_send_info", "chk_send_info",
"chk_new_releases",
"combo_encin", "combo_encin",
"combo_encout", "combo_encout",
"combo_enclevel", "combo_enclevel",
@ -389,11 +391,11 @@ class Preferences(component.Component):
self.gtkui_config["lock_tray"]) self.gtkui_config["lock_tray"])
self.glade.get_widget("chk_classic_mode").set_active( self.glade.get_widget("chk_classic_mode").set_active(
self.gtkui_config["classic_mode"]) self.gtkui_config["classic_mode"])
## Other tab ##
self.glade.get_widget("chk_new_releases").set_active(
self.gtkui_config["check_new_releases"])
## Other tab ##
self.glade.get_widget("chk_show_new_releases").set_active(
self.gtkui_config["show_new_releases"])
## Plugins tab ## ## Plugins tab ##
all_plugins = self.all_plugins all_plugins = self.all_plugins
enabled_plugins = self.enabled_plugins enabled_plugins = self.enabled_plugins
@ -525,9 +527,8 @@ class Preferences(component.Component):
self.glade.get_widget("chk_classic_mode").get_active() self.glade.get_widget("chk_classic_mode").get_active()
## Other tab ## ## Other tab ##
new_gtkui_config["check_new_releases"] = \ new_gtkui_config["show_new_releases"] = \
self.glade.get_widget("chk_new_releases").get_active() self.glade.get_widget("chk_show_new_releases").get_active()
new_core_config["send_info"] = \ new_core_config["send_info"] = \
self.glade.get_widget("chk_send_info").get_active() self.glade.get_widget("chk_send_info").get_active()
@ -536,7 +537,9 @@ class Preferences(component.Component):
self.glade.get_widget("spin_daemon_port").get_value_as_int() self.glade.get_widget("spin_daemon_port").get_value_as_int()
new_core_config["allow_remote"] = \ new_core_config["allow_remote"] = \
self.glade.get_widget("chk_allow_remote_connections").get_active() self.glade.get_widget("chk_allow_remote_connections").get_active()
new_core_config["new_release_check"] = \
self.glade.get_widget("chk_new_releases").get_active()
## Queue tab ## ## Queue tab ##
new_core_config["queue_new_to_top"] = \ new_core_config["queue_new_to_top"] = \
self.glade.get_widget("chk_queue_new_top").get_active() self.glade.get_widget("chk_queue_new_top").get_active()

View File

@ -36,13 +36,15 @@ import gtk
import deluge.component as component import deluge.component as component
from deluge.ui.client import aclient as client from deluge.ui.client import aclient as client
from deluge.ui.signalreceiver import SignalReceiver from deluge.ui.signalreceiver import SignalReceiver
from deluge.configmanager import ConfigManager
from deluge.log import LOG as log from deluge.log import LOG as log
class Signals(component.Component): class Signals(component.Component):
def __init__(self): def __init__(self):
component.Component.__init__(self, "Signals") component.Component.__init__(self, "Signals")
self.receiver = SignalReceiver() self.receiver = SignalReceiver()
self.config = ConfigManager("gtkui.conf")
def start(self): def start(self):
if not client.is_localhost(): if not client.is_localhost():
self.receiver.set_remote(True) self.receiver.set_remote(True)
@ -65,7 +67,9 @@ class Signals(component.Component):
self.torrent_queue_changed) self.torrent_queue_changed)
self.receiver.connect_to_signal("torrent_resume_at_stop_ratio", self.receiver.connect_to_signal("torrent_resume_at_stop_ratio",
self.torrent_resume_at_stop_ratio) self.torrent_resume_at_stop_ratio)
self.receiver.connect_to_signal("new_version_available",
self.new_version_available)
def stop(self): def stop(self):
try: try:
self.receiver.shutdown() self.receiver.shutdown()
@ -125,3 +129,10 @@ class Signals(component.Component):
log.debug("torrent_resume_at_stop_ratio") log.debug("torrent_resume_at_stop_ratio")
component.get("StatusBar").display_warning( component.get("StatusBar").display_warning(
text=_("Torrent is past stop ratio.")) text=_("Torrent is past stop ratio."))
def new_version_available(self, value):
log.debug("new_version_available: %s", value)
if self.config["show_new_releases"]:
from deluge.ui.gtkui.new_release_dialog import NewReleaseDialog
NewReleaseDialog().show(value)