mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
Fix #355 add python 2.4 support in systemtray too
This commit is contained in:
parent
65ccd2d7c1
commit
0add52506b
@ -336,7 +336,11 @@ class SystemTray(component.Component):
|
||||
self.build_tray_bwsetsubmenu()
|
||||
|
||||
def unlock_tray(self, is_showing_dlg=[False]):
|
||||
import hashlib
|
||||
try:
|
||||
from hashlib import sha1 as sha_hash
|
||||
except ImportError:
|
||||
from sha import new as sha_hash
|
||||
|
||||
log.debug("Show tray lock dialog")
|
||||
result = False
|
||||
|
||||
@ -363,7 +367,7 @@ window, please enter your password"))
|
||||
tray_lock.vbox.pack_start(entered_pass)
|
||||
tray_lock.show_all()
|
||||
if tray_lock.run() == gtk.RESPONSE_ACCEPT:
|
||||
if self.config["tray_password"] == hashlib.sha1(\
|
||||
if self.config["tray_password"] == sha_hash(\
|
||||
entered_pass.get_text()).hexdigest():
|
||||
result = True
|
||||
tray_lock.destroy()
|
||||
|
Loading…
x
Reference in New Issue
Block a user