mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-14 05:26:28 +00:00
add new "automatically check for new deluge version" feature :-D
This commit is contained in:
parent
865c826b60
commit
756dcd294b
@ -1617,6 +1617,56 @@ HTTP W/ Auth</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame4">
|
||||
<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="alignment5">
|
||||
<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="GtkVBox" id="vbox15">
|
||||
<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>
|
||||
<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="tooltip" translatable="yes">Deluge will check our servers and will tell you if a newer version has been released</property>
|
||||
<property name="label" translatable="yes">Be alerted about new releases</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label19">
|
||||
<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"><b>Updates</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -67,6 +67,7 @@ class PreferencesDlg:
|
||||
self.glade.get_widget("chk_random_port").set_active(self.preferences.get("random_port"))
|
||||
self.glade.get_widget("chk_natpmp").set_active(self.preferences.get("use_natpmp"))
|
||||
self.glade.get_widget("chk_utpex").set_active(self.preferences.get("use_utpex"))
|
||||
self.glade.get_widget("chk_new_releases").set_active(self.preferences.get("new_releases"))
|
||||
self.glade.get_widget("chk_use_tray").set_active(self.preferences.get("enable_system_tray"))
|
||||
self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray"))
|
||||
self.glade.get_widget("chk_lock_tray").set_active(self.preferences.get("lock_tray"))
|
||||
@ -143,6 +144,7 @@ class PreferencesDlg:
|
||||
self.preferences.set("tracker_proxy", self.glade.get_widget("chk_tracker_proxy").get_active())
|
||||
self.preferences.set("dht_proxy", self.glade.get_widget("chk_dht_proxy").get_active())
|
||||
self.preferences.set("use_upnp", self.glade.get_widget("chk_upnp").get_active())
|
||||
self.preferences.set("new_releases", self.glade.get_widget("chk_new_releases").get_active())
|
||||
self.preferences.set("random_port", self.glade.get_widget("chk_random_port").get_active())
|
||||
self.preferences.set("use_natpmp", self.glade.get_widget("chk_natpmp").get_active())
|
||||
self.preferences.set("use_utpex", self.glade.get_widget("chk_utpex").get_active())
|
||||
|
@ -119,6 +119,16 @@ class DelugeGTK:
|
||||
|
||||
# Boolean set to true if window is not minimized and is "visible"
|
||||
self.update_interface = True
|
||||
|
||||
def new_release_check():
|
||||
import os, sys
|
||||
py_version = sys.version[:3]
|
||||
file = '/usr/lib/python' + py_version + '/site-packages/deluge/update.py'
|
||||
os.spawnlp(os.P_NOWAIT, 'python', 'python', file, '0.5.3')
|
||||
|
||||
if self.config.get("new_releases"):
|
||||
new_release_check()
|
||||
|
||||
|
||||
def connect_signals(self):
|
||||
self.wtree.signal_autoconnect({
|
||||
@ -153,7 +163,7 @@ class DelugeGTK:
|
||||
"queue_up": self.q_torrent_up,
|
||||
"queue_down": self.q_torrent_down
|
||||
})
|
||||
|
||||
|
||||
def notebook_switch_page(self, notebook, page, page_num):
|
||||
# Force an update when user changes the notebook tab
|
||||
self.update_torrent_info_widget(None, page_num)
|
||||
@ -1309,7 +1319,6 @@ class DelugeGTK:
|
||||
self.update()
|
||||
return False
|
||||
|
||||
|
||||
def load_window_geometry(self):
|
||||
x = self.config.get('window_x_pos')
|
||||
y = self.config.get('window_y_pos')
|
||||
@ -1347,7 +1356,6 @@ class DelugeGTK:
|
||||
self.manager.quit()
|
||||
gtk.main_quit()
|
||||
|
||||
|
||||
## For testing purposes, create a copy of the interface
|
||||
if __name__ == "__main__":
|
||||
interface = DelugeGTK()
|
||||
|
@ -98,6 +98,7 @@ DEFAULT_PREFS = {
|
||||
"use_natpmp" : False,
|
||||
"use_upnp" : False,
|
||||
"use_utpex" : True,
|
||||
"new_releases" : True,
|
||||
"window_height" : 480,
|
||||
"window_maximized" : False,
|
||||
"window_pane_position" : -1,
|
||||
|
27
src/update.py
Normal file
27
src/update.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import urllib
|
||||
import sys
|
||||
|
||||
new_release = urllib.urlopen("http://download.deluge-torrent.org/version").read().strip()
|
||||
if new_release > sys.argv[1]:
|
||||
import gtk
|
||||
import pygtk
|
||||
dialog = gtk.MessageDialog(parent = None,
|
||||
flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
buttons = gtk.BUTTONS_YES_NO,
|
||||
message_format="There is a newer version of Deluge. Would you like to be taken to our download site?",
|
||||
type=gtk.MESSAGE_QUESTION)
|
||||
dialog.set_title('New Release!')
|
||||
import time
|
||||
#give main client time to get up and running so we dont get placed in the
|
||||
#background and hidden. also sleep this long for blocklist import
|
||||
time.sleep(20)
|
||||
result = dialog.run()
|
||||
dialog.destroy()
|
||||
if result == gtk.RESPONSE_YES:
|
||||
import os
|
||||
os.spawnlp(os.P_NOWAIT, 'python', 'python', '-c', "import webbrowser; webbrowser.open('http://download.deluge-torrent.org/')")
|
||||
elif result == gtk.RESPONSE_NO:
|
||||
pass
|
Loading…
x
Reference in New Issue
Block a user