mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
fix update alert
This commit is contained in:
parent
f7952eaa7f
commit
02ad4098bc
3 changed files with 35 additions and 43 deletions
|
@ -9,6 +9,7 @@ Deluge 0.5.8RC2 (25 December 2007)
|
||||||
* Set the advanced webui template as default
|
* Set the advanced webui template as default
|
||||||
* Cut down significantly on the memory usage of the blocklist plugin
|
* Cut down significantly on the memory usage of the blocklist plugin
|
||||||
* Fix some UPnP bugs
|
* Fix some UPnP bugs
|
||||||
|
* Fix "New version" alert from freezing sometimes
|
||||||
* Prioritizes local peers over non-local ones when finding connect
|
* Prioritizes local peers over non-local ones when finding connect
|
||||||
* Wish everyone a happy holiday :)
|
* Wish everyone a happy holiday :)
|
||||||
|
|
||||||
|
|
|
@ -235,35 +235,6 @@ def send_info():
|
||||||
f.close
|
f.close
|
||||||
Send_Info_Thread().start()
|
Send_Info_Thread().start()
|
||||||
|
|
||||||
def new_release_check():
|
|
||||||
import threading
|
|
||||||
class ReleaseThread(threading.Thread):
|
|
||||||
def __init__(self):
|
|
||||||
threading.Thread.__init__(self)
|
|
||||||
def run(self):
|
|
||||||
import urllib
|
|
||||||
try:
|
|
||||||
new_release = urllib.urlopen("http://download.deluge-torrent.org/\
|
|
||||||
version").read().strip()
|
|
||||||
except IOError:
|
|
||||||
print "Network error while trying to check for a newer version of \
|
|
||||||
Deluge"
|
|
||||||
new_release = ""
|
|
||||||
|
|
||||||
if new_release > PROGRAM_VERSION:
|
|
||||||
import gtk
|
|
||||||
import dialogs
|
|
||||||
gtk.gdk.threads_enter()
|
|
||||||
result = dialogs.show_popup_question(None, _("There is a newer version \
|
|
||||||
of Deluge. Would you like to be taken to our download site?"))
|
|
||||||
gtk.gdk.threads_leave()
|
|
||||||
if result:
|
|
||||||
open_url_in_browser('http://download.deluge-torrent.org/')
|
|
||||||
else:
|
|
||||||
pass
|
|
||||||
ReleaseThread().start()
|
|
||||||
return True
|
|
||||||
|
|
||||||
# Encryption States
|
# Encryption States
|
||||||
class EncState:
|
class EncState:
|
||||||
forced, enabled, disabled = range(3)
|
forced, enabled, disabled = range(3)
|
||||||
|
|
|
@ -183,15 +183,6 @@ class DelugeGTK:
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def new_release_check():
|
|
||||||
try:
|
|
||||||
common.new_release_check()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if self.config.get("new_releases"):
|
|
||||||
new_release_check()
|
|
||||||
|
|
||||||
def connect_signals(self):
|
def connect_signals(self):
|
||||||
self.wtree.signal_autoconnect({
|
self.wtree.signal_autoconnect({
|
||||||
## File Menu
|
## File Menu
|
||||||
|
@ -1036,15 +1027,15 @@ window, please enter your password"))
|
||||||
if cmd_line_torrents is None:
|
if cmd_line_torrents is None:
|
||||||
cmd_line_torrents = []
|
cmd_line_torrents = []
|
||||||
|
|
||||||
if not(self.config.get("start_in_tray") and \
|
|
||||||
self.config.get("enable_system_tray") and
|
|
||||||
self.has_tray) and not self.window.get_property("visible"):
|
|
||||||
print "Showing window"
|
|
||||||
if self.config.get("use_internal"):
|
if self.config.get("use_internal"):
|
||||||
self.browserbutton.show_all()
|
self.browserbutton.show_all()
|
||||||
else:
|
else:
|
||||||
self.browserbutton.hide_all()
|
self.browserbutton.hide_all()
|
||||||
|
|
||||||
|
if not(self.config.get("start_in_tray") and \
|
||||||
|
self.config.get("enable_system_tray") and
|
||||||
|
self.has_tray) and not self.window.get_property("visible"):
|
||||||
|
print "Showing window"
|
||||||
self.window.show()
|
self.window.show()
|
||||||
|
|
||||||
## add torrents in manager's queue to interface
|
## add torrents in manager's queue to interface
|
||||||
|
@ -1063,7 +1054,7 @@ window, please enter your password"))
|
||||||
# Load plugins after we showed main window (if not started in tray)
|
# Load plugins after we showed main window (if not started in tray)
|
||||||
self.load_plugins()
|
self.load_plugins()
|
||||||
self.load_tabs_order()
|
self.load_tabs_order()
|
||||||
|
self.new_release_check()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
|
@ -1073,6 +1064,35 @@ window, please enter your password"))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.manager.quit()
|
self.manager.quit()
|
||||||
|
|
||||||
|
def new_release_check(self):
|
||||||
|
import socket
|
||||||
|
import urllib2
|
||||||
|
timeout = 5
|
||||||
|
socket.setdefaulttimeout(timeout)
|
||||||
|
try:
|
||||||
|
gtk.gdk.threads_enter()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
req = urllib2.Request("http://download.deluge-torrent.org/version")
|
||||||
|
new_release = urllib2.urlopen(req).read().strip()
|
||||||
|
except IOError:
|
||||||
|
print "Network error while trying to check for a newer version of \
|
||||||
|
Deluge"
|
||||||
|
new_release = ""
|
||||||
|
|
||||||
|
if new_release > common.PROGRAM_VERSION:
|
||||||
|
result = dialogs.show_popup_question(None, _("There is a newer version \
|
||||||
|
of Deluge. Would you like to be taken to our download site?"))
|
||||||
|
if result:
|
||||||
|
common.open_url_in_browser('http://download.deluge-torrent.org/')
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
gtk.gdk.threads_leave()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def load_plugins(self):
|
def load_plugins(self):
|
||||||
enable_plugins = self.config.get('enabled_plugins').split(':')
|
enable_plugins = self.config.get('enabled_plugins').split(':')
|
||||||
for plugin in enable_plugins:
|
for plugin in enable_plugins:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue