diff --git a/.gitignore b/.gitignore
index 2a7eb4d80..03b6fe47a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ dist
_trial_temp
deluge/i18n/*/
*.desktop
+.build_data
diff --git a/ChangeLog b/ChangeLog
index 1077fbfea..cc00f123a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* Implemented sequential downloads UI handling.
* #378: Allow showing a pieces bar instead of a regular progress bar in a
torrent's status tab.
+ * #2093: Make torrent opening compatible with all unicode paths.
==== Blocklist Plugin ====
* #1382: Implemented whitelist support to both core and GTK UI.
@@ -44,6 +45,58 @@
=== Deluge 1.3.6 (In Development) ===
==== Core ====
* Catch & log KeyError when removing a torrent from the queued torrents set
+ * Fix moving/renaming torrents with non-ascii characters in libtorrent 0.16
+ * Make sure queue order is preserved when restarting
+ * #2160: Disable use of python bindings for libtorrent extensions and replace with session flag
+ * #2163: Fix unable add torrent file with empty (0:) encoding tag
+ * #2201: Fix error in authmanager if auth file has extra newlines
+ * #2109: Fix the Proxy settings not being cleared by setting None
+ * #2110: Fix accepting magnet uris with xt param anywhere within them
+ * #2204: Fix daemon shutdown hang
+
+==== GtkUI ====
+ * Add move completed option to add torrent dialog
+ * Prevent jitter in torrent view
+ * Fix torrent creation with non-ascii characters
+ * Fix #2100 : Add option not to bring main window to front when adding torrents through ipcinterface
+ * Add Quit Dialog when toggling classic mode in preferences and only show connection manager when not in classic mode.
+ * #2169: Fix 'Download Location' in the Add Torrent Dialog not set correctly when folder typed into Other->Location field
+ * #2171: Fix the Add Peer dialog not responding if empty or invalid values entered
+ * #2104: Fix no title set for the appindicator
+ * #2086: Fix submenus and icons for appindicator
+ * #2146: Fix missing translations in View|Tabs submenu
+ * Fix torrent names on libtorrent 0.16 on windows
+ * #2147: Fix missing translations for plugin preferences page
+ * #1474: Fix the on_show_prefs hook not being executed immediatly after enabling a plugin
+
+==== Console ====
+ * LP#1004793: Enable use of connect command in non-interactive mode
+ * Ensure console commands are executed in order
+ * #2065: Fix crash with missing closing quote
+ * #1397: Add support for -s STATE in info command
+
+==== WebUI ====
+ * #2112: Fix world readable tmp directory in json_api
+ * #2069: Fix login window layout problem when using larger than default font size
+ * #1890: Fix columns in files and peers view could use some spacing
+ * #2103: Fix sorting by name is case-sensitive [sedulous]
+ * #2120: Fix manually entered values not being saved in spinners
+ * #2212: Fix unable to scroll in proxy preferences page
+ * Fix autoconnecting to the default host
+
+==== Windows OS ====
+ * Hide the cmd windows when running deluged.exe or deluge-web.exe
+ * Add deluged-debug.exe and deluge-web-debug.exe that still show the cmd window
+ * Add gtk locale files to fix untranslated text
+ * Fix the Open Folder option not working with non-ascii paths
+ * Fix the daemon starting with config dir containing spaces
+ * Fix Windows tray submenu items requiring right-click instead of left-click
+
+==== OS X ====
+ * Fix Open File/Folder option
+
+==== Execute ====
+ * Fix execute plugin not working with unicode torrent names
=== Deluge 1.3.5 (09 April 2012) ===
==== GtkUI ====
diff --git a/DEPENDS b/DEPENDS
index a74440609..55b915ff6 100644
--- a/DEPENDS
+++ b/DEPENDS
@@ -11,6 +11,7 @@
* chardet
* geoip-database (optional)
* setproctitle (optional)
+ * rencode >= 1.0.2 (optional), a pure python version is included
* libtorrent >= 0.16.1, or build the included version
diff --git a/deluge/_libtorrent.py b/deluge/_libtorrent.py
index ab782d67a..898cfb150 100644
--- a/deluge/_libtorrent.py
+++ b/deluge/_libtorrent.py
@@ -45,9 +45,9 @@ supports.
"""
-REQUIRED_VERSION = "0.14.9.0"
+REQUIRED_VERSION = "0.16.1.0"
-def check_version(LT):
+def check_version(lt):
from deluge.common import VersionSplit
if VersionSplit(lt.version) < VersionSplit(REQUIRED_VERSION):
raise ImportError("This version of Deluge requires libtorrent >=%s!" % REQUIRED_VERSION)
diff --git a/deluge/common.py b/deluge/common.py
index ed11741bd..b9a19eef4 100644
--- a/deluge/common.py
+++ b/deluge/common.py
@@ -68,6 +68,7 @@ if not hasattr(json, "dumps"):
import pkg_resources
import gettext
import locale
+import sys
from deluge.error import *
@@ -231,7 +232,7 @@ def open_file(path):
"""
if windows_check():
- os.startfile("%s" % path)
+ os.startfile(path.decode("utf8"))
elif osx_check():
subprocess.Popen(["open", "%s" % path])
else:
@@ -448,7 +449,9 @@ def is_magnet(uri):
True
"""
- if uri[:20] == "magnet:?xt=urn:btih:":
+ magnet_scheme = 'magnet:?'
+ xt_param = 'xt=urn:btih:'
+ if uri.startswith(magnet_scheme) and xt_param in uri:
return True
return False
@@ -542,15 +545,23 @@ def is_ip(ip):
import socket
#first we test ipv4
try:
- if socket.inet_pton(socket.AF_INET, "%s" % (ip)):
- return True
+ if windows_check():
+ if socket.inet_aton("%s" % (ip)):
+ return True
+ else:
+ if socket.inet_pton(socket.AF_INET, "%s" % (ip)):
+ return True
except socket.error:
if not socket.has_ipv6:
return False
#now test ipv6
try:
- if socket.inet_pton(socket.AF_INET6, "%s" % (ip)):
+ if windows_check():
+ log.warning("ipv6 check unavailable on windows")
return True
+ else:
+ if socket.inet_pton(socket.AF_INET6, "%s" % (ip)):
+ return True
except socket.error:
return False
@@ -757,3 +768,39 @@ def setup_translations(setup_pygtk=False):
log.exception(e)
import __builtin__
__builtin__.__dict__["_"] = lambda x: x
+
+def unicode_argv():
+ """ Gets sys.argv as list of unicode objects on any platform."""
+ if windows_check():
+ # Versions 2.x of Python don't support Unicode in sys.argv on
+ # Windows, with the underlying Windows API instead replacing multi-byte
+ # characters with '?'.
+ from ctypes import POINTER, byref, cdll, c_int, windll
+ from ctypes.wintypes import LPCWSTR, LPWSTR
+
+ GetCommandLineW = cdll.kernel32.GetCommandLineW
+ GetCommandLineW.argtypes = []
+ GetCommandLineW.restype = LPCWSTR
+
+ CommandLineToArgvW = windll.shell32.CommandLineToArgvW
+ CommandLineToArgvW.argtypes = [LPCWSTR, POINTER(c_int)]
+ CommandLineToArgvW.restype = POINTER(LPWSTR)
+
+ cmd = GetCommandLineW()
+ argc = c_int(0)
+ argv = CommandLineToArgvW(cmd, byref(argc))
+ if argc.value > 0:
+ # Remove Python executable and commands if present
+ start = argc.value - len(sys.argv)
+ return [argv[i] for i in
+ xrange(start, argc.value)]
+ else:
+ # On other platforms, we have to find the likely encoding of the args and decode
+ # First check if sys.stdout or stdin have encoding set
+ encoding = getattr(sys.stdout, "encoding") or getattr(sys.stdin, "encoding")
+ # If that fails, check what the locale is set to
+ encoding = encoding or locale.getpreferredencoding()
+ # As a last resort, just default to utf-8
+ encoding = encoding or "utf-8"
+
+ return [arg.decode(encoding) for arg in sys.argv]
diff --git a/deluge/component.py b/deluge/component.py
index 538d2f9f6..6085db277 100644
--- a/deluge/component.py
+++ b/deluge/component.py
@@ -34,6 +34,7 @@
#
import logging
+from collections import defaultdict
from twisted.internet.defer import maybeDeferred, succeed, DeferredList, fail
from twisted.internet.task import LoopingCall
@@ -225,6 +226,8 @@ class ComponentRegistry(object):
"""
def __init__(self):
self.components = {}
+ # Stores all of the components that are dependent on a particular component
+ self.dependents = defaultdict(list)
def register(self, obj):
"""
@@ -243,6 +246,9 @@ class ComponentRegistry(object):
"Component already registered with name %s" % name)
self.components[obj._component_name] = obj
+ if obj._component_depend:
+ for depend in obj._component_depend:
+ self.dependents[depend].append(name)
def deregister(self, obj):
"""
@@ -317,11 +323,23 @@ class ComponentRegistry(object):
elif isinstance(names, str):
names = [names]
+ def on_dependents_stopped(result, name):
+ return self.components[name]._component_stop()
+
+ stopped_in_deferred = set()
deferreds = []
for name in names:
+ if name in stopped_in_deferred:
+ continue
if name in self.components:
- deferreds.append(self.components[name]._component_stop())
+ if name in self.dependents:
+ # If other components depend on this component, stop them first
+ d = self.stop(self.dependents[name]).addCallback(on_dependents_stopped, name)
+ deferreds.append(d)
+ stopped_in_deferred.update(self.dependents[name])
+ else:
+ deferreds.append(self.components[name]._component_stop())
return DeferredList(deferreds)
@@ -360,7 +378,7 @@ class ComponentRegistry(object):
:param names: a list of Components to resume
:type names: list
- :returns: a Deferred object that will fire once all Components have been sucessfully resumed
+ :returns: a Deferred object that will fire once all Components have been successfully resumed
:rtype: twisted.internet.defer.Deferred
"""
@@ -384,16 +402,14 @@ class ComponentRegistry(object):
be called when the program is exiting to ensure all Components have a
chance to properly shutdown.
- :returns: a Deferred object that will fire once all Components have been sucessfully resumed
+ :returns: a Deferred object that will fire once all Components have been successfully shut down
:rtype: twisted.internet.defer.Deferred
"""
- deferreds = []
+ def on_stopped(result):
+ return DeferredList(map(lambda c: c._component_shutdown(), self.components.values()))
- for component in self.components.values():
- deferreds.append(component._component_shutdown())
-
- return DeferredList(deferreds)
+ return self.stop(self.components.keys()).addCallback(on_stopped)
def update(self):
"""
diff --git a/deluge/core/alertmanager.py b/deluge/core/alertmanager.py
index e2ff6c865..063bda723 100644
--- a/deluge/core/alertmanager.py
+++ b/deluge/core/alertmanager.py
@@ -75,7 +75,8 @@ class AlertManager(component.Component):
def stop(self):
for dc in self.delayed_calls:
- dc.cancel()
+ if dc.active():
+ dc.cancel()
self.delayed_calls = []
def register_handler(self, alert_type, handler):
diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py
index 771043e8b..f8cffbb7c 100644
--- a/deluge/core/authmanager.py
+++ b/deluge/core/authmanager.py
@@ -236,10 +236,10 @@ class AuthManager(component.Component):
f = open(auth_file, "r").readlines()
for line in f:
- if line.startswith("#"):
- # This is a comment line
- continue
line = line.strip()
+ if line.startswith("#") or not line:
+ # This line is a comment or empty
+ continue
try:
lsplit = line.split(":")
except Exception, e:
diff --git a/deluge/core/core.py b/deluge/core/core.py
index e69944790..242359a9d 100644
--- a/deluge/core/core.py
+++ b/deluge/core/core.py
@@ -94,6 +94,8 @@ class Core(component.Component):
self.settings.user_agent = "Deluge/%(deluge_version)s Libtorrent/%(lt_version)s" % \
{ 'deluge_version': deluge.common.get_version(),
'lt_version': self.get_libtorrent_version().rpartition(".")[0] }
+ # Increase the alert queue size so that alerts don't get lost
+ self.settings.alert_queue_size = 10000
# Set session settings
self.settings.send_redundant_have = True
diff --git a/deluge/core/filtermanager.py b/deluge/core/filtermanager.py
index 25ae4be1b..53e95030c 100644
--- a/deluge/core/filtermanager.py
+++ b/deluge/core/filtermanager.py
@@ -153,9 +153,8 @@ class FilterManager(component.Component):
#sanitize input: filter-value must be a list of strings
for key, value in filter_dict.items():
- if isinstance(value, str):
- filter_dict[key] = [value]
-
+ if isinstance(value, basestring):
+ filter_dict[key] = [value]
if "id"in filter_dict: #optimized filter for id:
torrent_ids = list(filter_dict["id"])
diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py
index cafec162c..ba6ec285a 100644
--- a/deluge/core/torrent.py
+++ b/deluge/core/torrent.py
@@ -37,9 +37,12 @@
import os
import time
import logging
+import re
from urllib import unquote
from urlparse import urlparse
+from twisted.internet.defer import Deferred, DeferredList
+from twisted.internet.task import LoopingCall
from deluge._libtorrent import lt
import deluge.common
@@ -116,7 +119,6 @@ class Torrent(object):
# We use this to return dicts that only contain changes from the previous
# {session_id: status_dict, ...}
self.prev_status = {}
- from twisted.internet.task import LoopingCall
self.prev_status_cleanup_loop = LoopingCall(self.cleanup_prev_status)
self.prev_status_cleanup_loop.start(10)
@@ -125,14 +127,10 @@ class Torrent(object):
# Set the torrent_id for this torrent
self.torrent_id = str(handle.info_hash())
- # Let's us know if we're waiting on a lt alert
- self.waiting_on_resume_data = False
-
- # Keep a list of file indexes we're waiting for file_rename alerts on
- # This also includes the old_folder and new_folder to know what signal to send
+ # Keep a list of Deferreds for file indexes we're waiting for file_rename alerts on
# This is so we can send one folder_renamed signal instead of multiple
# file_renamed signals.
- # [(old_folder, new_folder, [*indexes]), ...]
+ # [{index: Deferred, ...}, ...]
self.waiting_on_folder_rename = []
# We store the filename just in case we need to make a copy of the torrentfile
@@ -177,13 +175,7 @@ class Torrent(object):
# Tracker list
self.trackers = []
# Create a list of trackers
- for value in self.handle.trackers():
- if lt.version_minor < 15:
- tracker = {}
- tracker["url"] = value.url
- tracker["tier"] = value.tier
- else:
- tracker = value
+ for tracker in self.handle.trackers():
self.trackers.append(tracker)
# Various torrent options
@@ -252,7 +244,7 @@ class Torrent(object):
def get_name(self):
if self.handle.has_metadata():
- name = self.torrent_info.file_at(0).path.split("/", 1)[0]
+ name = self.torrent_info.file_at(0).path.replace("\\", "/", 1).split("/", 1)[0]
if not name:
name = self.torrent_info.name()
try:
@@ -885,31 +877,32 @@ class Torrent(object):
def move_storage(self, dest):
"""Move a torrent's storage location"""
-
- if deluge.common.windows_check():
- # Attempt to convert utf8 path to unicode
- # Note: Inconsistent encoding for 'dest', needs future investigation
- try:
- dest_u = unicode(dest, "utf-8")
- except TypeError:
- # String is already unicode
- dest_u = dest
- else:
- dest_u = dest
+ try:
+ dest = unicode(dest, "utf-8")
+ except TypeError:
+ # String is already unicode
+ pass
- if not os.path.exists(dest_u):
+ if not os.path.exists(dest):
try:
# Try to make the destination path if it doesn't exist
- os.makedirs(dest_u)
+ os.makedirs(dest)
except IOError, e:
log.exception(e)
log.error("Could not move storage for torrent %s since %s does "
"not exist and could not create the directory.",
- self.torrent_id, dest_u)
+ self.torrent_id, dest)
return False
+
+ dest_bytes = dest.encode('utf-8')
try:
- self.handle.move_storage(dest_u)
- except:
+ # libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
+ try:
+ self.handle.move_storage(dest)
+ except TypeError:
+ self.handle.move_storage(dest_bytes)
+ except Exception, e:
+ log.error("Error calling libtorrent move_storage: %s" % e)
return False
return True
@@ -918,7 +911,6 @@ class Torrent(object):
"""Signals libtorrent to build resume data for this torrent, it gets
returned in a libtorrent alert"""
self.handle.save_resume_data()
- self.waiting_on_resume_data = True
def write_torrentfile(self):
"""Writes the torrent file"""
@@ -985,12 +977,26 @@ class Torrent(object):
"""Renames files in the torrent. 'filenames' should be a list of
(index, filename) pairs."""
for index, filename in filenames:
+ # Make sure filename is a unicode object
+ try:
+ filename = unicode(filename, "utf-8")
+ except TypeError:
+ pass
filename = sanitize_filepath(filename)
- self.handle.rename_file(index, filename.encode("utf-8"))
+ # libtorrent needs unicode object if wstrings are enabled, utf8 bytestring otherwise
+ try:
+ self.handle.rename_file(index, filename)
+ except TypeError:
+ self.handle.rename_file(index, filename.encode("utf-8"))
def rename_folder(self, folder, new_folder):
- """Renames a folder within a torrent. This basically does a file rename
- on all of the folders children."""
+ """
+ Renames a folder within a torrent. This basically does a file rename
+ on all of the folders children.
+
+ :returns: A deferred which fires when the rename is complete
+ :rtype: twisted.internet.defer.Deferred
+ """
log.debug("attempting to rename folder: %s to %s", folder, new_folder)
if len(new_folder) < 1:
log.error("Attempting to rename a folder with an invalid folder name: %s", new_folder)
@@ -998,13 +1004,57 @@ class Torrent(object):
new_folder = sanitize_filepath(new_folder, folder=True)
- wait_on_folder = (folder, new_folder, [])
+ def on_file_rename_complete(result, wait_dict, index):
+ wait_dict.pop(index, None)
+
+ wait_on_folder = {}
+ self.waiting_on_folder_rename.append(wait_on_folder)
for f in self.get_files():
if f["path"].startswith(folder):
- # Keep a list of filerenames we're waiting on
- wait_on_folder[2].append(f["index"])
+ # Keep track of filerenames we're waiting on
+ wait_on_folder[f["index"]] = Deferred().addBoth(on_file_rename_complete, wait_on_folder, f["index"])
self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1).encode("utf-8"))
- self.waiting_on_folder_rename.append(wait_on_folder)
+
+ def on_folder_rename_complete(result, torrent, folder, new_folder):
+ component.get("EventManager").emit(TorrentFolderRenamedEvent(torrent.torrent_id, folder, new_folder))
+ # Empty folders are removed after libtorrent folder renames
+ self.remove_empty_folders(folder)
+ torrent.waiting_on_folder_rename = filter(None, torrent.waiting_on_folder_rename)
+ component.get("TorrentManager").save_resume_data((self.torrent_id,))
+
+ d = DeferredList(wait_on_folder.values())
+ d.addBoth(on_folder_rename_complete, self, folder, new_folder)
+ return d
+
+ def remove_empty_folders(self, folder):
+ """
+ Recursively removes folders but only if they are empty.
+ Cleans up after libtorrent folder renames.
+
+ """
+ info = self.get_status(['save_path'])
+ # Regex removes leading slashes that causes join function to ignore save_path
+ folder_full_path = os.path.join(info['save_path'], re.sub("^/*", "", folder))
+ folder_full_path = os.path.normpath(folder_full_path)
+
+ try:
+ if not os.listdir(folder_full_path):
+ os.removedirs(folder_full_path)
+ log.debug("Removed Empty Folder %s", folder_full_path)
+ else:
+ for root, dirs, files in os.walk(folder_full_path, topdown=False):
+ for name in dirs:
+ try:
+ os.removedirs(os.path.join(root, name))
+ log.debug("Removed Empty Folder %s", os.path.join(root, name))
+ except OSError as (errno, strerror):
+ from errno import ENOTEMPTY
+ if errno == ENOTEMPTY:
+ # Error raised if folder is not empty
+ log.debug("%s", strerror)
+
+ except OSError as (errno, strerror):
+ log.debug("Cannot Remove Folder: %s (ErrNo %s)", strerror, errno)
def cleanup_prev_status(self):
"""
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index b3c6d4cba..9831646b3 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -38,13 +38,12 @@
import cPickle
import os
-import time
import shutil
import operator
import logging
-import re
from twisted.internet.task import LoopingCall
+from twisted.internet.defer import Deferred, DeferredList
from deluge._libtorrent import lt
@@ -133,7 +132,7 @@ class TorrentManager(component.Component):
def __init__(self):
component.Component.__init__(self, "TorrentManager", interval=5,
- depend=["CorePluginManager"])
+ depend=["CorePluginManager", "AlertManager"])
log.debug("TorrentManager init..")
# Set the libtorrent session
self.session = component.get("Core").session
@@ -151,15 +150,11 @@ class TorrentManager(component.Component):
self.last_seen_complete_loop = None
self.queued_torrents = set()
- # This is a list of torrent_id when we shutdown the torrentmanager.
- # We use this list to determine if all active torrents have been paused
- # and that their resume data has been written.
- self.shutdown_torrent_pause_list = []
+ # This is a map of torrent_ids to Deferreds used to track needed resume data.
+ # The Deferreds will be completed when resume data has been saved.
+ self.waiting_on_resume_data = {}
- # self.num_resume_data used to save resume_data in bulk
- self.num_resume_data = 0
-
- # Keeps track of resume data that needs to be saved to disk
+ # Keeps track of resume data
self.resume_data = {}
# Register set functions
@@ -216,11 +211,14 @@ class TorrentManager(component.Component):
# Try to load the state from file
self.load_state()
- # Save the state every 5 minutes
+ # Save the state periodically
self.save_state_timer = LoopingCall(self.save_state)
self.save_state_timer.start(200, False)
self.save_resume_data_timer = LoopingCall(self.save_resume_data)
- self.save_resume_data_timer.start(190)
+ self.save_resume_data_timer.start(190, False)
+ # Force update for all resume data a bit less frequently
+ self.save_all_resume_data_timer = LoopingCall(self.save_resume_data, self.torrents.keys())
+ self.save_all_resume_data_timer.start(900, False)
if self.last_seen_complete_loop:
self.last_seen_complete_loop.start(60)
@@ -233,45 +231,21 @@ class TorrentManager(component.Component):
if self.save_resume_data_timer.running:
self.save_resume_data_timer.stop()
+ if self.save_all_resume_data_timer.running:
+ self.save_all_resume_data_timer.stop()
+
if self.last_seen_complete_loop:
self.last_seen_complete_loop.stop()
# Save state on shutdown
self.save_state()
- # Make another list just to make sure all paused torrents will be
- # passed to self.save_resume_data(). With
- # self.shutdown_torrent_pause_list it is possible to have a case when
- # torrent_id is removed from it in self.on_alert_torrent_paused()
- # before we call self.save_resume_data() here.
- save_resume_data_list = []
+ self.session.pause()
for key in self.torrents:
# Stop the status cleanup LoopingCall here
self.torrents[key].prev_status_cleanup_loop.stop()
- if not self.torrents[key].handle.is_paused():
- # We set auto_managed false to prevent lt from resuming the torrent
- self.torrents[key].handle.auto_managed(False)
- self.torrents[key].handle.pause()
- self.shutdown_torrent_pause_list.append(key)
- save_resume_data_list.append(key)
- self.save_resume_data(save_resume_data_list)
-
- # We have to wait for all torrents to pause and write their resume data
- wait = True
- while wait:
- if self.shutdown_torrent_pause_list:
- wait = True
- else:
- wait = False
- for torrent in self.torrents.values():
- if torrent.waiting_on_resume_data:
- wait = True
- break
-
- time.sleep(0.01)
- # Wait for all alerts
- self.alerts.handle_alerts(True)
+ return self.save_resume_data(self.torrents.keys())
def update(self):
for torrent_id, torrent in self.torrents.items():
@@ -452,9 +426,16 @@ class TorrentManager(component.Component):
# before adding to the session.
if options["mapped_files"]:
for index, fname in options["mapped_files"].items():
+ try:
+ fname = unicode(fname, "utf-8")
+ except TypeError:
+ pass
fname = deluge.core.torrent.sanitize_filepath(fname)
log.debug("renaming file index %s to %s", index, fname)
- torrent_info.rename_file(index, utf8_encoded(fname))
+ try:
+ torrent_info.rename_file(index, fname)
+ except TypeError:
+ torrent_info.rename_file(index, fname.encode("utf-8"))
add_torrent_params["ti"] = torrent_info
@@ -589,12 +570,11 @@ class TorrentManager(component.Component):
:raises InvalidTorrentError: if the torrent_id is not in the session
"""
-
- if torrent_id not in self.torrents:
+ try:
+ torrent_name = self.torrents[torrent_id].get_status(["name"])["name"]
+ except KeyError:
raise InvalidTorrentError("torrent_id not in session")
- torrent_name = self.torrents[torrent_id].get_status(["name"])["name"]
-
# Emit the signal to the clients
component.get("EventManager").emit(PreTorrentRemovedEvent(torrent_id))
@@ -606,9 +586,7 @@ class TorrentManager(component.Component):
return False
# Remove fastresume data if it is exists
- resume_data = self.load_resume_data_file()
- resume_data.pop(torrent_id, None)
- self.save_resume_data_file(resume_data)
+ self.resume_data.pop(torrent_id, None)
# Remove the .torrent file in the state
self.torrents[torrent_id].delete_torrentfile()
@@ -678,7 +656,7 @@ class TorrentManager(component.Component):
# Reorder the state.torrents list to add torrents in the correct queue
# order.
- state.torrents.sort(key=operator.attrgetter("queue"))
+ state.torrents.sort(key=operator.attrgetter("queue"), reverse=self.config["queue_new_to_top"])
resume_data = self.load_resume_data_file()
@@ -770,17 +748,34 @@ class TorrentManager(component.Component):
def save_resume_data(self, torrent_ids=None):
"""
- Saves resume data for list of torrent_ids or for all torrents if
- torrent_ids is None
+ Saves resume data for list of torrent_ids or for all torrents
+ needing resume data updated if torrent_ids is None
+
+ :returns: A Deferred whose callback will be invoked when save is complete
+ :rtype: twisted.internet.defer.Deferred
"""
if torrent_ids is None:
- torrent_ids = self.torrents.keys()
+ torrent_ids = (t[0] for t in self.torrents.iteritems() if t[1].handle.need_save_resume_data())
+
+ deferreds = []
+
+ def on_torrent_resume_save(result, torrent_id):
+ self.waiting_on_resume_data.pop(torrent_id, None)
for torrent_id in torrent_ids:
+ d = self.waiting_on_resume_data.get(torrent_id)
+ if not d:
+ d = Deferred().addBoth(on_torrent_resume_save, torrent_id)
+ self.waiting_on_resume_data[torrent_id] = d
+ deferreds.append(d)
self.torrents[torrent_id].save_resume_data()
- self.num_resume_data = len(torrent_ids)
+ def on_all_resume_data_finished(result):
+ if result:
+ self.save_resume_data_file()
+
+ return DeferredList(deferreds).addBoth(on_all_resume_data_finished)
def load_resume_data_file(self):
resume_data = {}
@@ -800,73 +795,22 @@ class TorrentManager(component.Component):
return resume_data
- def save_resume_data_file(self, resume_data=None):
+ def save_resume_data_file(self):
"""
- Saves the resume data file with the contents of self.resume_data. If
- `resume_data` is None, then we grab the resume_data from the file on
- disk, else, we update `resume_data` with self.resume_data and save
- that to disk.
-
- :param resume_data: the current resume_data, this will be loaded from disk if not provided
- :type resume_data: dict
-
+ Saves the resume data file with the contents of self.resume_data.
"""
- # Check to see if we're waiting on more resume data
- if self.num_resume_data or not self.resume_data:
- return
-
path = os.path.join(get_config_dir(), "state", "torrents.fastresume")
- # First step is to load the existing file and update the dictionary
- if resume_data is None:
- resume_data = self.load_resume_data_file()
-
- resume_data.update(self.resume_data)
- self.resume_data = {}
-
try:
log.debug("Saving fastresume file: %s", path)
fastresume_file = open(path, "wb")
- fastresume_file.write(lt.bencode(resume_data))
+ fastresume_file.write(lt.bencode(self.resume_data))
fastresume_file.flush()
os.fsync(fastresume_file.fileno())
fastresume_file.close()
except IOError:
log.warning("Error trying to save fastresume file")
- def remove_empty_folders(self, torrent_id, folder):
- """
- Recursively removes folders but only if they are empty.
- Cleans up after libtorrent folder renames.
-
- """
- if torrent_id not in self.torrents:
- raise InvalidTorrentError("torrent_id is not in session")
-
- info = self.torrents[torrent_id].get_status(['save_path'])
- # Regex removes leading slashes that causes join function to ignore save_path
- folder_full_path = os.path.join(info['save_path'], re.sub("^/*", "", folder))
- folder_full_path = os.path.normpath(folder_full_path)
-
- try:
- if not os.listdir(folder_full_path):
- os.removedirs(folder_full_path)
- log.debug("Removed Empty Folder %s", folder_full_path)
- else:
- for root, dirs, files in os.walk(folder_full_path, topdown=False):
- for name in dirs:
- try:
- os.removedirs(os.path.join(root, name))
- log.debug("Removed Empty Folder %s", os.path.join(root, name))
- except OSError as (errno, strerror):
- from errno import ENOTEMPTY
- if errno == ENOTEMPTY:
- # Error raised if folder is not empty
- log.debug("%s", strerror)
-
- except OSError as (errno, strerror):
- log.debug("Cannot Remove Folder: %s (ErrNo %s)", strerror, errno)
-
def get_queue_position(self, torrent_id):
"""Get queue position of torrent"""
return self.torrents[torrent_id].get_queue_position()
@@ -981,14 +925,9 @@ class TorrentManager(component.Component):
if torrent.state != old_state:
component.get("EventManager").emit(TorrentStateChangedEvent(torrent_id, torrent.state))
- # Don't save resume data for each torrent after self.stop() was called.
- # We save resume data in bulk in self.stop() in this case.
- if self.save_resume_data_timer.running:
- # Write the fastresume file
- self.save_resume_data((torrent_id, ))
-
- if torrent_id in self.shutdown_torrent_pause_list:
- self.shutdown_torrent_pause_list.remove(torrent_id)
+ # Write the fastresume file if we are not waiting on a bulk write
+ if torrent_id not in self.waiting_on_resume_data:
+ self.save_resume_data((torrent_id,))
def on_alert_torrent_checked(self, alert):
log.debug("on_alert_torrent_checked")
@@ -1098,32 +1037,21 @@ class TorrentManager(component.Component):
def on_alert_save_resume_data(self, alert):
log.debug("on_alert_save_resume_data")
- try:
- torrent_id = str(alert.handle.info_hash())
- torrent = self.torrents[torrent_id]
- except:
- return
+ torrent_id = str(alert.handle.info_hash())
- # Libtorrent in add_torrent() expects resume_data to be bencoded
- self.resume_data[torrent_id] = lt.bencode(alert.resume_data)
- self.num_resume_data -= 1
+ if torrent_id in self.torrents:
+ # Libtorrent in add_torrent() expects resume_data to be bencoded
+ self.resume_data[torrent_id] = lt.bencode(alert.resume_data)
- torrent.waiting_on_resume_data = False
-
- self.save_resume_data_file()
+ if torrent_id in self.waiting_on_resume_data:
+ self.waiting_on_resume_data[torrent_id].callback(None)
def on_alert_save_resume_data_failed(self, alert):
log.debug("on_alert_save_resume_data_failed: %s", alert.message())
- try:
- torrent = self.torrents[str(alert.handle.info_hash())]
- except:
- return
-
- self.num_resume_data -= 1
- torrent.waiting_on_resume_data = False
-
- self.save_resume_data_file()
+ torrent_id = str(alert.handle.info_hash())
+ if torrent_id in self.waiting_on_resume_data:
+ self.waiting_on_resume_data[torrent_id].errback(Exception(alert.message()))
def on_alert_file_renamed(self, alert):
log.debug("on_alert_file_renamed")
@@ -1134,24 +1062,12 @@ class TorrentManager(component.Component):
except:
return
- # We need to see if this file index is in a waiting_on_folder list
- folder_rename = False
- for i, wait_on_folder in enumerate(torrent.waiting_on_folder_rename):
- if alert.index in wait_on_folder[2]:
- folder_rename = True
- if len(wait_on_folder[2]) == 1:
- # This is the last alert we were waiting for, time to send signal
- component.get("EventManager").emit(TorrentFolderRenamedEvent(torrent_id, wait_on_folder[0], wait_on_folder[1]))
- # Empty folders are removed after libtorrent folder renames
- self.remove_empty_folders(torrent_id, wait_on_folder[0])
- del torrent.waiting_on_folder_rename[i]
- self.save_resume_data((torrent_id,))
- break
- # This isn't the last file to be renamed in this folder, so just
- # remove the index and continue
- torrent.waiting_on_folder_rename[i][2].remove(alert.index)
-
- if not folder_rename:
+ # We need to see if this file index is in a waiting_on_folder dict
+ for wait_on_folder in torrent.waiting_on_folder_rename:
+ if alert.index in wait_on_folder:
+ wait_on_folder[alert.index].callback(None)
+ break
+ else:
# This is just a regular file rename so send the signal
component.get("EventManager").emit(TorrentFileRenamedEvent(torrent_id, alert.index, alert.name))
self.save_resume_data((torrent_id,))
diff --git a/deluge/main.py b/deluge/main.py
index a966356de..422b661fe 100644
--- a/deluge/main.py
+++ b/deluge/main.py
@@ -86,7 +86,7 @@ def start_ui():
help="Rotate logfiles.", action="store_true", default=False)
# Get the options and args from the OptionParser
- (options, args) = parser.parse_args()
+ (options, args) = parser.parse_args(deluge.common.unicode_argv()[1:])
if options.quiet:
options.loglevel = "none"
diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py
index 6803755d2..b369fc124 100644
--- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py
+++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py
@@ -403,12 +403,11 @@ class GtkUI(GtkPluginBase):
sw.add(self.treeView)
sw.show_all()
component.get("Preferences").add_page(
- "AutoAdd", self.glade.get_widget("prefs_box")
+ _("AutoAdd"), self.glade.get_widget("prefs_box")
)
- self.on_show_prefs()
def disable(self):
- component.get("Preferences").remove_page("AutoAdd")
+ component.get("Preferences").remove_page(_("AutoAdd"))
component.get("PluginManager").deregister_hook(
"on_apply_prefs", self.on_apply_prefs
)
diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py b/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py
index 6f0469200..8ee08ee92 100644
--- a/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py
+++ b/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py
@@ -54,13 +54,13 @@ class GtkUI(GtkPluginBase):
def enable(self):
self.glade = gtk.glade.XML(get_resource("extractor_prefs.glade"))
- component.get("Preferences").add_page("Extractor", self.glade.get_widget("extractor_prefs_box"))
+ component.get("Preferences").add_page(_("Extractor"), self.glade.get_widget("extractor_prefs_box"))
component.get("PluginManager").register_hook("on_apply_prefs", self.on_apply_prefs)
component.get("PluginManager").register_hook("on_show_prefs", self.on_show_prefs)
self.on_show_prefs()
def disable(self):
- component.get("Preferences").remove_page("Extractor")
+ component.get("Preferences").remove_page(_("Extractor"))
component.get("PluginManager").deregister_hook("on_apply_prefs", self.on_apply_prefs)
component.get("PluginManager").deregister_hook("on_show_prefs", self.on_show_prefs)
del self.glade
diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py b/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py
index 2400c7966..b3e5acbb3 100644
--- a/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py
+++ b/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py
@@ -287,7 +287,7 @@ class GtkUI(GtkPluginBase, GtkUiNotifications):
if parent:
parent.remove(self.prefs)
index = prefs.notebook.append_page(self.prefs)
- prefs.liststore.append([index, "Notifications"])
+ prefs.liststore.append([index, _("Notifications")])
component.get("PluginManager").register_hook("on_apply_prefs",
self.on_apply_prefs)
@@ -320,7 +320,7 @@ class GtkUI(GtkPluginBase, GtkUiNotifications):
def disable(self):
GtkUiNotifications.disable(self)
- component.get("Preferences").remove_page("Notifications")
+ component.get("Preferences").remove_page(_("Notifications"))
component.get("PluginManager").deregister_hook("on_apply_prefs",
self.on_apply_prefs)
component.get("PluginManager").deregister_hook("on_show_prefs",
diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py b/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py
index 580eba2d8..5d16e660a 100644
--- a/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py
+++ b/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py
@@ -170,7 +170,7 @@ class GtkUI(GtkPluginBase):
client.register_event_handler("SchedulerEvent", self.on_scheduler_event)
def disable(self):
- component.get("Preferences").remove_page("Scheduler")
+ component.get("Preferences").remove_page(_("Scheduler"))
# Remove status item
component.get("StatusBar").remove_item(self.status_item)
del self.status_item
@@ -294,4 +294,4 @@ class GtkUI(GtkPluginBase):
vbox.pack_start(frame, False, False)
vbox.show_all()
- component.get("Preferences").add_page("Scheduler", vbox)
+ component.get("Preferences").add_page(_("Scheduler"), vbox)
diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py b/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py
index 978ac5fe4..c13f0b755 100644
--- a/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py
+++ b/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py
@@ -53,14 +53,14 @@ class GtkUI(GtkPluginBase):
def enable(self):
self.glade = gtk.glade.XML(get_resource("config.glade"))
- component.get("Preferences").add_page("WebUi", self.glade.get_widget("prefs_box"))
+ component.get("Preferences").add_page(_("WebUi"), self.glade.get_widget("prefs_box"))
component.get("PluginManager").register_hook("on_apply_prefs", self.on_apply_prefs)
component.get("PluginManager").register_hook("on_show_prefs", self.on_show_prefs)
client.webui.get_config().addCallback(self.cb_get_config)
client.webui.got_deluge_web().addCallback(self.cb_chk_deluge_web)
def disable(self):
- component.get("Preferences").remove_page("WebUi")
+ component.get("Preferences").remove_page(_("WebUi"))
component.get("PluginManager").deregister_hook("on_apply_prefs", self.on_apply_prefs)
component.get("PluginManager").deregister_hook("on_show_prefs", self.on_show_prefs)
diff --git a/deluge/rencode.py b/deluge/rencode.py
index a0a6eec35..7c0f7d8b1 100644
--- a/deluge/rencode.py
+++ b/deluge/rencode.py
@@ -19,7 +19,7 @@ rencode module versions, so you should check that you are using the
same rencode version throughout your project.
"""
-__version__ = '1.0.1'
+__version__ = '1.0.2'
__all__ = ['dumps', 'loads']
# Original bencode module by Petru Paler, et al.
@@ -107,6 +107,9 @@ STR_FIXED_COUNT = 64
LIST_FIXED_START = STR_FIXED_START+STR_FIXED_COUNT
LIST_FIXED_COUNT = 64
+# Whether strings should be decoded when loading
+_decode_utf8 = False
+
def decode_int(x, f):
f += 1
newf = x.index(CHR_TERM, f)
@@ -159,12 +162,8 @@ def decode_string(x, f):
raise ValueError
colon += 1
s = x[colon:colon+n]
- try:
- t = s.decode("utf8")
- if len(t) != len(s):
- s = t
- except UnicodeDecodeError:
- pass
+ if _decode_utf8:
+ s = s.decode('utf8')
return (s, colon+n)
def decode_list(x, f):
@@ -218,12 +217,8 @@ def make_fixed_length_string_decoders():
def make_decoder(slen):
def f(x, f):
s = x[f+1:f+1+slen]
- try:
- t = s.decode("utf8")
- if len(t) != len(s):
- s = t
- except UnicodeDecodeError:
- pass
+ if _decode_utf8:
+ s = s.decode("utf8")
return (s, f+1+slen)
return f
for i in range(STR_FIXED_COUNT):
@@ -279,7 +274,9 @@ def encode_dict(x,r):
r.append(CHR_TERM)
-def loads(x):
+def loads(x, decode_utf8=False):
+ global _decode_utf8
+ _decode_utf8 = decode_utf8
try:
r, l = decode_func[x[0]](x, 0)
except (IndexError, KeyError):
diff --git a/deluge/tests/test_component.py b/deluge/tests/test_component.py
index ab5e4d534..6f13eeca2 100644
--- a/deluge/tests/test_component.py
+++ b/deluge/tests/test_component.py
@@ -3,8 +3,8 @@ from twisted.internet import threads
import deluge.component as component
class testcomponent(component.Component):
- def __init__(self, name):
- component.Component.__init__(self, name)
+ def __init__(self, name, depend=None):
+ component.Component.__init__(self, name, depend=depend)
self.start_count = 0
self.stop_count = 0
@@ -51,6 +51,7 @@ class testcomponent_shutdown(component.Component):
class ComponentTestClass(unittest.TestCase):
def tearDown(self):
+ component.stop()
component._ComponentRegistry.components = {}
def test_start_component(self):
@@ -63,16 +64,22 @@ class ComponentTestClass(unittest.TestCase):
d.addCallback(on_start, c)
return d
- def test_start_depends(self):
+ def test_start_stop_depends(self):
+ def on_stop(result, c1, c2):
+ self.assertEquals(c1._component_state, "Stopped")
+ self.assertEquals(c2._component_state, "Stopped")
+ self.assertEquals(c1.stop_count, 1)
+ self.assertEquals(c2.stop_count, 1)
+
def on_start(result, c1, c2):
self.assertEquals(c1._component_state, "Started")
self.assertEquals(c2._component_state, "Started")
self.assertEquals(c1.start_count, 1)
self.assertEquals(c2.start_count, 1)
+ return component.stop(["test_start_depends_c1"]).addCallback(on_stop, c1, c2)
c1 = testcomponent("test_start_depends_c1")
- c2 = testcomponent("test_start_depends_c2")
- c2._component_depend = ["test_start_depends_c1"]
+ c2 = testcomponent("test_start_depends_c2", depend=["test_start_depends_c1"])
d = component.start(["test_start_depends_c2"])
d.addCallback(on_start, c1, c2)
@@ -80,15 +87,12 @@ class ComponentTestClass(unittest.TestCase):
def start_with_depends(self):
c1 = testcomponent_delaystart("test_start_all_c1")
- c2 = testcomponent("test_start_all_c2")
- c3 = testcomponent_delaystart("test_start_all_c3")
- c4 = testcomponent("test_start_all_c4")
+ c2 = testcomponent("test_start_all_c2", depend=["test_start_all_c4"])
+ c3 = testcomponent_delaystart("test_start_all_c3",
+ depend=["test_start_all_c5", "test_start_all_c1"])
+ c4 = testcomponent("test_start_all_c4", depend=["test_start_all_c3"])
c5 = testcomponent("test_start_all_c5")
- c3._component_depend = ["test_start_all_c5", "test_start_all_c1"]
- c4._component_depend = ["test_start_all_c3"]
- c2._component_depend = ["test_start_all_c4"]
-
d = component.start()
return (d, c1, c2, c3, c4, c5)
@@ -130,15 +134,15 @@ class ComponentTestClass(unittest.TestCase):
return d
def test_stop_all(self):
- def on_stop(*args):
- for c in args[1:]:
+ def on_stop(result, *args):
+ for c in args:
self.assertEquals(c._component_state, "Stopped")
self.assertEquals(c.stop_count, 1)
- def on_start(*args):
- for c in args[1:]:
+ def on_start(result, *args):
+ for c in args:
self.assertEquals(c._component_state, "Started")
- return component.stop().addCallback(on_stop, *args[1:])
+ return component.stop().addCallback(on_stop, *args)
ret = self.start_with_depends()
ret[0].addCallback(on_start, *ret[1:])
diff --git a/deluge/transfer.py b/deluge/transfer.py
index c89f89e4f..a09ad98a5 100644
--- a/deluge/transfer.py
+++ b/deluge/transfer.py
@@ -140,7 +140,7 @@ class DelugeTransferProtocol(Protocol):
"""
try:
- self.message_received(rencode.loads(zlib.decompress(data)))
+ self.message_received(rencode.loads(zlib.decompress(data), decode_utf8=True))
except Exception, e:
log.warn("Failed to decompress (%d bytes) and load serialized data "\
"with rencode: %s" % (len(data), str(e)))
diff --git a/deluge/ui/client.py b/deluge/ui/client.py
index 3feba4c57..342480e20 100644
--- a/deluge/ui/client.py
+++ b/deluge/ui/client.py
@@ -37,17 +37,14 @@
import logging
from twisted.internet.protocol import ClientFactory
from twisted.internet import reactor, ssl, defer
+import sys
+import subprocess
import deluge.common
from deluge import error
from deluge.event import known_events
from deluge.transfer import DelugeTransferProtocol
-if deluge.common.windows_check():
- import win32api
-else:
- import subprocess
-
RPC_RESPONSE = 1
RPC_ERROR = 2
RPC_EVENT = 3
@@ -628,13 +625,10 @@ class Client(object):
:raises OSError: received from subprocess.call()
"""
+ # subprocess.popen does not work with unicode args (with non-ascii characters) on windows
+ config = config.encode(sys.getfilesystemencoding())
try:
- if deluge.common.windows_check():
- win32api.WinExec("deluged --port=%s --config=\"%s\"" % (port, config))
- elif deluge.common.osx_check():
- subprocess.call(["nohup", "deluged", "--port=%s" % port, "--config=%s" % config])
- else:
- subprocess.call(["deluged", "--port=%s" % port, "--config=%s" % config])
+ subprocess.Popen(["deluged", "--port=%s" % port, "--config=%s" % config])
except OSError, e:
from errno import ENOENT
if e.errno == ENOENT:
diff --git a/deluge/ui/common.py b/deluge/ui/common.py
index 000a85064..795fdcda8 100644
--- a/deluge/ui/common.py
+++ b/deluge/ui/common.py
@@ -106,8 +106,11 @@ class TorrentInfo(object):
else:
path = utf8_encoded(os.path.join(prefix, utf8_encoded(os.path.join(*f["path"]), self.encoding)), self.encoding)
f["index"] = index
+ if "sha1" in f and len(f["sha1"]) == 20:
+ f["sha1"] = f["sha1"].encode('hex')
+ if "ed2k" in f and len(f["ed2k"]) == 16:
+ f["ed2k"] = f["ed2k"].encode('hex')
paths[path] = f
-
dirname = os.path.dirname(path)
while dirname:
dirinfo = dirs.setdefault(dirname, {})
diff --git a/deluge/ui/console/commands/manage.py b/deluge/ui/console/commands/manage.py
index ab781b768..ef66829d4 100644
--- a/deluge/ui/console/commands/manage.py
+++ b/deluge/ui/console/commands/manage.py
@@ -133,7 +133,22 @@ class Command(BaseCommand):
deferred.callback(True)
self.console.write("Setting %s to %s for torrents %s.." % (key, val, torrent_ids))
- client.core.set_torrent_options(torrent_ids, {key: val}).addCallback(on_set_config)
+
+
+ for tid in torrent_ids:
+ if key == "move_on_completed_path":
+ client.core.set_torrent_move_completed_path(tid, val).addCallback(on_set_config)
+ elif key == "move_on_completed":
+ client.core.set_torrent_move_completed(tid, val).addCallback(on_set_config)
+ elif key == "is_auto_managed":
+ client.core.set_torrent_auto_managed(tid, val).addCallback(on_set_config)
+ elif key == "remove_at_ratio":
+ client.core.set_torrent_remove_at_ratio(tid, val).addCallback(on_set_config)
+ elif key == "prioritize_first_last":
+ client.core.set_torrent_prioritize_first_last(tid, val).addCallback(on_set_config)
+ else:
+ client.core.set_torrent_options(torrent_ids, {key: val}).addCallback(on_set_config)
+ break
return deferred
def complete(self, line):
diff --git a/deluge/ui/console/modes/torrent_actions.py b/deluge/ui/console/modes/torrent_actions.py
index 2988245e1..fb6a9f4cd 100644
--- a/deluge/ui/console/modes/torrent_actions.py
+++ b/deluge/ui/console/modes/torrent_actions.py
@@ -250,6 +250,8 @@ def torrent_action(idx, data, mode, ids):
for tid in ids:
if "move_on_completed_path" in options:
client.core.set_torrent_move_completed_path(tid, options["move_on_completed_path"])
+ if "move_on_completed" in options:
+ client.core.set_torrent_move_completed(tid, options["move_on_completed"])
if "is_auto_managed" in options:
client.core.set_torrent_auto_managed(tid, options["is_auto_managed"])
if "remove_at_ratio" in options:
diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py
index 13ec757b9..4252c4e17 100644
--- a/deluge/ui/console/modes/torrentdetail.py
+++ b/deluge/ui/console/modes/torrentdetail.py
@@ -310,6 +310,8 @@ class TorrentDetail(BaseMode, component.Component):
color_partially_selected = "magenta"
color_highlighted = "white"
for fl in files:
+ #from sys import stderr
+ #print >> stderr, fl[6]
# kick out if we're going to draw too low on the screen
if (off >= self.rows-1):
self.more_to_draw = True
@@ -317,18 +319,34 @@ class TorrentDetail(BaseMode, component.Component):
self.file_limit = idx
- if idx >= self.file_off:
- # set fg/bg colors based on if we are selected/marked or not
- # default values
- fg = "white"
- bg = "black"
+ # default color values
+ fg = "white"
+ bg = "black"
+ attr = ""
+
+ if fl[6] == -2: priority = -1 #Mixed
+ elif fl[6] == 0:
+ priority = 0 #Do Not Download
+ fg = "red"
+ elif fl[6] == 1:
+ priority = 1 #Normal
+ elif fl[6] <= 6:
+ priority = 2 #High
+ fg = "yellow"
+ elif fl[6] == 7:
+ priority = 3 #Highest
+ fg = "green"
+
+ if idx >= self.file_off:
+ # set fg/bg colors based on whether the file is selected/marked or not
if fl[1] in self.marked:
bg = color_selected
if fl[3]:
if self.marked[fl[1]] < self.__get_contained_files_count(file_list=fl[3]):
bg = color_partially_selected
+ attr = "bold"
if idx == self.current_file_idx:
self.current_file = fl
@@ -339,9 +357,14 @@ class TorrentDetail(BaseMode, component.Component):
if self.marked[fl[1]] < self.__get_contained_files_count(file_list = fl[3]):
fg = color_partially_selected
else:
- fg = "black"
+ if fg == "white":
+ fg = "black"
+ attr = "bold"
- color_string = "{!%s,%s!}"%(fg,bg)
+ if attr:
+ color_string = "{!%s,%s,%s!}"%(fg, bg, attr)
+ else:
+ color_string = "{!%s,%s!}"%(fg, bg)
#actually draw the dir/file string
if fl[3] and fl[4]: # this is an expanded directory
diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py
index 84ea16e57..976f95eaa 100644
--- a/deluge/ui/gtkui/addtorrentdialog.py
+++ b/deluge/ui/gtkui/addtorrentdialog.py
@@ -213,9 +213,6 @@ class AddTorrentDialog(component.Component):
new_row = None
for filename in filenames:
- # Convert the path to unicode
- filename = unicode(filename)
-
# Get the torrent data from the torrent file
try:
info = deluge.ui.common.TorrentInfo(filename)
@@ -825,14 +822,15 @@ class AddTorrentDialog(component.Component):
self.save_torrent_options(row)
- # The options we want all the torrents to have
- options = self.options[model.get_value(row, 0)]
+ # The options, except file renames, we want all the torrents to have
+ options = self.options[model.get_value(row, 0)].copy()
+ del options["mapped_files"]
# Set all the torrent options
row = model.get_iter_first()
while row != None:
torrent_id = model.get_value(row, 0)
- self.options[torrent_id] = options
+ self.options[torrent_id].update(options)
row = model.iter_next(row)
def _on_button_revert_clicked(self, widget):
@@ -863,7 +861,7 @@ class AddTorrentDialog(component.Component):
def _on_filename_edited(self, renderer, path, new_text):
index = self.files_treestore[path][3]
- new_text = new_text.strip(os.path.sep)
+ new_text = new_text.strip(os.path.sep).strip()
# Return if the text hasn't changed
if new_text == self.files_treestore[path][1]:
@@ -881,9 +879,14 @@ class AddTorrentDialog(component.Component):
if index > -1:
# We're renaming a file! Yay! That's easy!
+ if not new_text:
+ return
parent = self.files_treestore.iter_parent(itr)
file_path = os.path.join(self.get_file_path(parent), new_text)
-
+ # Don't rename if filename exists
+ for row in self.files_treestore[parent].iterchildren():
+ if new_text == row[1]:
+ return
if os.path.sep in new_text:
# There are folders in this path, so we need to create them
# and then move the file iter to top
diff --git a/deluge/ui/gtkui/common.py b/deluge/ui/gtkui/common.py
index 4b56048e5..088223803 100644
--- a/deluge/ui/gtkui/common.py
+++ b/deluge/ui/gtkui/common.py
@@ -111,7 +111,7 @@ def build_menu_radio_list(value_list, callback, pref_value=None,
if show_notset:
menuitem = gtk.RadioMenuItem(group, notset_label)
- menuitem.set_name(notset_label)
+ menuitem.set_name("unlimited")
if pref_value < notset_lessthan and pref_value != None:
menuitem.set_active(True)
if show_activated and pref_value == 1:
@@ -124,7 +124,7 @@ def build_menu_radio_list(value_list, callback, pref_value=None,
menuitem = gtk.SeparatorMenuItem()
menu.append(menuitem)
menuitem = gtk.MenuItem(_("Other..."))
- menuitem.set_name(_("Other..."))
+ menuitem.set_name("other")
menuitem.connect("activate", callback)
menu.append(menuitem)
diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py
index acfc06097..435cba0a6 100644
--- a/deluge/ui/gtkui/createtorrentdialog.py
+++ b/deluge/ui/gtkui/createtorrentdialog.py
@@ -174,7 +174,7 @@ class CreateTorrentDialog:
chooser.destroy()
return
- path = result.decode('utf-8').encode(sys.getfilesystemencoding())
+ path = result.decode('utf-8')
self.files_treestore.clear()
self.files_treestore.append(None, [result, gtk.STOCK_FILE, deluge.common.get_path_size(path)])
@@ -202,7 +202,7 @@ class CreateTorrentDialog:
chooser.destroy()
return
- path = result.decode('utf-8').encode(sys.getfilesystemencoding())
+ path = result.decode('utf-8')
self.files_treestore.clear()
self.files_treestore.append(None, [result, gtk.STOCK_OPEN, deluge.common.get_path_size(path)])
diff --git a/deluge/ui/gtkui/glade/preferences_dialog.ui b/deluge/ui/gtkui/glade/preferences_dialog.ui
index e9f526d38..09a6ea5de 100644
--- a/deluge/ui/gtkui/glade/preferences_dialog.ui
+++ b/deluge/ui/gtkui/glade/preferences_dialog.ui
@@ -2465,6 +2465,19 @@ used sparingly.
0
+
+
+
+ 1
+
+
diff --git a/deluge/ui/gtkui/glade/tray_menu.ui b/deluge/ui/gtkui/glade/tray_menu.ui
index c92797cd2..b621e5fd4 100644
--- a/deluge/ui/gtkui/glade/tray_menu.ui
+++ b/deluge/ui/gtkui/glade/tray_menu.ui
@@ -61,6 +61,7 @@
Truemenu-item-image1False
+ True
@@ -109,6 +110,7 @@
Truedownload-limit-imageFalse
+ True
@@ -120,6 +122,7 @@
Trueupload-limit-imageFalse
+ True
diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py
index 53072e2ac..685ed45a5 100644
--- a/deluge/ui/gtkui/gtkui.py
+++ b/deluge/ui/gtkui/gtkui.py
@@ -149,6 +149,7 @@ DEFAULT_PREFS = {
"pieces_color_waiting": [4874, 56494, 0],
"pieces_color_downloading": [65535, 55255, 0],
"pieces_color_completed": [4883, 26985, 56540],
+ "focus_main_window_on_add": True,
}
class GtkUI(object):
@@ -245,9 +246,8 @@ class GtkUI(object):
component.stop()
# Process any pending gtk events since the mainloop has been quit
- if not deluge.common.windows_check():
- while gtk.events_pending() and reactor.running:
- reactor.doIteration(0)
+ while gtk.events_pending():
+ gtk.main_iteration(0)
# Shutdown all components
component.shutdown()
diff --git a/deluge/ui/gtkui/ipcinterface.py b/deluge/ui/gtkui/ipcinterface.py
index cb7259cc5..6600e4ec2 100644
--- a/deluge/ui/gtkui/ipcinterface.py
+++ b/deluge/ui/gtkui/ipcinterface.py
@@ -59,8 +59,10 @@ log = logging.getLogger(__name__)
class IPCProtocolServer(Protocol):
def dataReceived(self, data):
- data = rencode.loads(data)
- component.get("MainWindow").present()
+ config = ConfigManager("gtkui.conf")
+ data = rencode.loads(data, decode_utf8=True)
+ if not data or config["focus_main_window_on_add"]:
+ component.get("MainWindow").present()
process_args(data)
class IPCProtocolClient(Protocol):
diff --git a/deluge/ui/gtkui/pluginmanager.py b/deluge/ui/gtkui/pluginmanager.py
index b5169977d..a5bfcc819 100644
--- a/deluge/ui/gtkui/pluginmanager.py
+++ b/deluge/ui/gtkui/pluginmanager.py
@@ -93,6 +93,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
def _on_plugin_enabled_event(self, name):
self.enable_plugin(name)
+ self.run_on_show_prefs()
def _on_plugin_disabled_event(self, name):
self.disable_plugin(name)
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index 34f8da6f0..2755a330c 100644
--- a/deluge/ui/gtkui/preferences.py
+++ b/deluge/ui/gtkui/preferences.py
@@ -121,7 +121,8 @@ class Preferences(component.Component):
self.accounts_frame = self.builder.get_object("AccountsFrame")
# Setup plugin tab listview
- self.plugin_liststore = gtk.ListStore(str, bool)
+ # The third entry is for holding translated plugin names
+ self.plugin_liststore = gtk.ListStore(str, bool, str)
self.plugin_liststore.set_sort_column_id(0, gtk.SORT_ASCENDING)
self.plugin_listview = self.builder.get_object("plugin_listview")
self.plugin_listview.set_model(self.plugin_liststore)
@@ -131,7 +132,7 @@ class Preferences(component.Component):
self.plugin_listview.append_column(
gtk.TreeViewColumn(_("Enabled"), render, active=1))
self.plugin_listview.append_column(
- gtk.TreeViewColumn(_("Plugin"), gtk.CellRendererText(), text=0))
+ gtk.TreeViewColumn(_("Plugin"), gtk.CellRendererText(), text=2))
# Connect to the 'changed' event of TreeViewSelection to get selection
# changes.
@@ -552,6 +553,8 @@ class Preferences(component.Component):
self.gtkui_config["classic_mode"])
self.builder.get_object("chk_show_rate_in_title").set_active(
self.gtkui_config["show_rate_in_title"])
+ self.builder.get_object("chk_focus_main_window_on_add").set_active(
+ self.gtkui_config["focus_main_window_on_add"])
self.builder.get_object("piecesbar_toggle").set_active(
self.gtkui_config["show_piecesbar"]
)
@@ -583,6 +586,7 @@ class Preferences(component.Component):
row = self.plugin_liststore.append()
self.plugin_liststore.set_value(row, 0, plugin)
self.plugin_liststore.set_value(row, 1, enabled)
+ self.plugin_liststore.set_value(row, 2, _(plugin))
# Now show the dialog
self.pref_dialog.show()
@@ -739,6 +743,8 @@ class Preferences(component.Component):
new_gtkui_config["show_rate_in_title"] = \
self.builder.get_object("chk_show_rate_in_title").get_active()
+ new_gtkui_config["focus_main_window_on_add"] = \
+ self.builder.get_object("chk_focus_main_window_on_add").get_active()
## Other tab ##
new_gtkui_config["show_new_releases"] = \
diff --git a/deluge/ui/gtkui/queuedtorrents.py b/deluge/ui/gtkui/queuedtorrents.py
index 3b63934c5..7eeaaa78b 100644
--- a/deluge/ui/gtkui/queuedtorrents.py
+++ b/deluge/ui/gtkui/queuedtorrents.py
@@ -173,7 +173,7 @@ class QueuedTorrents(component.Component):
def on_button_add_clicked(self, widget):
# Add all the torrents in the liststore
def add_torrent(model, path, iter, data):
- torrent_path = model.get_value(iter, 1)
+ torrent_path = model.get_value(iter, 1).decode('utf-8')
process_args([torrent_path])
self.liststore.foreach(add_torrent, None)
diff --git a/deluge/ui/gtkui/statusbar.py b/deluge/ui/gtkui/statusbar.py
index c433b2834..f4219900c 100644
--- a/deluge/ui/gtkui/statusbar.py
+++ b/deluge/ui/gtkui/statusbar.py
@@ -392,9 +392,9 @@ class StatusBar(component.Component):
def _on_set_download_speed(self, widget):
log.debug("_on_set_download_speed")
- if widget.get_name() == _("Unlimited"):
+ if widget.get_name() == "unlimited":
value = -1
- elif widget.get_name() == _("Other..."):
+ elif widget.get_name() == "other":
value = common.show_other_dialog(
_("Set Maximum Download Speed"), _("KiB/s"), None, "downloading.svg", self.max_download_speed)
if value == None:
@@ -420,9 +420,9 @@ class StatusBar(component.Component):
def _on_set_upload_speed(self, widget):
log.debug("_on_set_upload_speed")
- if widget.get_name() == _("Unlimited"):
+ if widget.get_name() == "unlimited":
value = -1
- elif widget.get_name() == _("Other..."):
+ elif widget.get_name() == "other":
value = common.show_other_dialog(
_("Set Maximum Upload Speed"), _("KiB/s"), None, "seeding.svg", self.max_upload_speed)
if value == None:
@@ -447,9 +447,9 @@ class StatusBar(component.Component):
def _on_set_connection_limit(self, widget):
log.debug("_on_set_connection_limit")
- if widget.get_name() == _("Unlimited"):
+ if widget.get_name() == "unlimited":
value = -1
- elif widget.get_name() == _("Other..."):
+ elif widget.get_name() == "other":
value = common.show_other_dialog(
_("Set Maximum Connections"), "", gtk.STOCK_NETWORK, None, self.max_connections)
if value == None:
diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py
index c54b0943a..0c5c104c1 100644
--- a/deluge/ui/gtkui/systemtray.py
+++ b/deluge/ui/gtkui/systemtray.py
@@ -138,10 +138,9 @@ class SystemTray(component.Component):
self.tray.connect("activate", self.on_tray_clicked)
self.tray.connect("popup-menu", self.on_tray_popup)
- # For some reason these icons do not display in appindicator
- self.builder.get_object("download-limit-image").set_from_file(
+ self.builder.get_object("download-limit-image").set_from_file(
deluge.common.get_pixmap("downloading16.png"))
- self.builder.get_object("upload-limit-image").set_from_file(
+ self.builder.get_object("upload-limit-image").set_from_file(
deluge.common.get_pixmap("seeding16.png"))
client.register_event_handler("ConfigValueChangedEvent", self.config_value_changed)
@@ -157,21 +156,14 @@ class SystemTray(component.Component):
if self.config["enable_system_tray"]:
if self.config["classic_mode"]:
- self.hide_widget_list.remove("menuitem_quitdaemon")
- self.hide_widget_list.remove("separatormenuitem4")
+ try:
+ self.hide_widget_list.remove("menuitem_quitdaemon")
+ self.hide_widget_list.remove("separatormenuitem4")
+ except ValueError:
+ pass
self.builder.get_object("menuitem_quitdaemon").hide()
self.builder.get_object("separatormenuitem4").hide()
- # These do not work with appindicator currently and can crash Deluge.
- # Related to Launchpad bug #608219
- if appindicator and self.config["enable_appindicator"]:
- self.hide_widget_list.remove("menuitem_download_limit")
- self.hide_widget_list.remove("menuitem_upload_limit")
- self.hide_widget_list.remove("separatormenuitem3")
- self.builder.get_object("menuitem_download_limit").hide()
- self.builder.get_object("menuitem_upload_limit").hide()
- self.builder.get_object("separatormenuitem3").hide()
-
# Show widgets in the hide list because we've connected to a host
for widget in self.hide_widget_list:
self.builder.get_object(widget).show()
@@ -266,16 +258,15 @@ class SystemTray(component.Component):
def build_tray_bwsetsubmenu(self):
# Create the Download speed list sub-menu
submenu_bwdownset = common.build_menu_radio_list(
- self.config["tray_download_speed_list"], self.tray_setbwdown,
+ self.config["tray_download_speed_list"], self.on_tray_setbwdown,
self.max_download_speed,
_("KiB/s"), show_notset=True, show_other=True)
# Create the Upload speed list sub-menu
submenu_bwupset = common.build_menu_radio_list(
- self.config["tray_upload_speed_list"], self.tray_setbwup,
+ self.config["tray_upload_speed_list"], self.on_tray_setbwup,
self.max_upload_speed,
_("KiB/s"), show_notset=True, show_other=True)
-
# Add the sub-menus to the tray menu
self.builder.get_object("menuitem_download_limit").set_submenu(
submenu_bwdownset)
@@ -286,10 +277,6 @@ class SystemTray(component.Component):
submenu_bwdownset.show_all()
submenu_bwupset.show_all()
- # Re-set the menu to partly work around Launchpad bug #608219
- if appindicator and self.config["enable_appindicator"]:
- self.indicator.set_menu(self.tray_menu)
-
def disable(self,invert_app_ind_conf=False):
"""Disables the system tray icon or appindicator."""
try:
@@ -360,6 +347,7 @@ class SystemTray(component.Component):
popup_function = gtk.status_icon_position_menu
if deluge.common.windows_check():
popup_function = None
+ button = 0
self.tray_menu.popup(None, None, popup_function,
button, activate_time, status_icon)
@@ -399,10 +387,22 @@ class SystemTray(component.Component):
self.window.quit(shutdown=True)
- def tray_setbwdown(self, widget, data=None):
+ def on_tray_setbwdown(self, widget, data=None):
+ if isinstance(widget, gtk.RadioMenuItem):
+ #ignore previous radiomenuitem value
+ if not widget.get_active():
+ return
self.setbwlimit(widget, _("Set Maximum Download Speed"), "max_download_speed",
"tray_download_speed_list", self.max_download_speed, "downloading.svg")
+ def on_tray_setbwup(self, widget, data=None):
+ if isinstance(widget, gtk.RadioMenuItem):
+ #ignore previous radiomenuitem value
+ if not widget.get_active():
+ return
+ self.setbwlimit(widget, _("Set Maximum Upload Speed"), "max_upload_speed",
+ "tray_upload_speed_list", self.max_upload_speed, "seeding.svg")
+
def _on_window_hide(self, widget, data=None):
"""_on_window_hide - update the menuitem's status"""
log.debug("_on_window_hide")
@@ -413,26 +413,21 @@ class SystemTray(component.Component):
log.debug("_on_window_show")
self.builder.get_object("menuitem_show_deluge").set_active(True)
- def tray_setbwup(self, widget, data=None):
- self.setbwlimit(widget, _("Set Maximum Upload Speed"), "max_upload_speed",
- "tray_upload_speed_list", self.max_upload_speed, "seeding.svg")
-
def setbwlimit(self, widget, string, core_key, ui_key, default, image):
"""Sets the bandwidth limit based on the user selection."""
- value = widget.get_children()[0].get_text().rstrip(" " + _("KiB/s"))
- if value == _("Unlimited"):
+ value = widget.get_children()[0].get_text().split(" ")[0]
+ log.debug('setbwlimit: %s', value)
+ if widget.get_name() == "unlimited":
value = -1
-
- if value == _("Other..."):
+ if widget.get_name() == "other":
value = common.show_other_dialog(string, _("KiB/s"), None, image, default)
if value == None:
return
-
+ elif value == 0:
+ value = -1
# Set the config in the core
client.core.set_config({core_key: value})
- self.build_tray_bwsetsubmenu()
-
def unlock_tray(self, is_showing_dlg=[False]):
try:
from hashlib import sha1 as sha_hash
diff --git a/deluge/ui/gtkui/torrentdetails.py b/deluge/ui/gtkui/torrentdetails.py
index 36fc92270..6c11af8f6 100644
--- a/deluge/ui/gtkui/torrentdetails.py
+++ b/deluge/ui/gtkui/torrentdetails.py
@@ -113,6 +113,15 @@ class TorrentDetails(component.Component):
("Options", True)
]
+ self.translate_tabs = {
+ "All" : _("_All"),
+ "Status" : _("_Status"),
+ "Details" : _("_Details"),
+ "Files" : _("_Files"),
+ "Peers" : _("_Peers"),
+ "Options" : _("_Options")
+ }
+
# Get the state from saved file
state = self.load_state()
@@ -242,8 +251,8 @@ class TorrentDetails(component.Component):
def hide_tab(self, tab_name):
"""Hides tab by name"""
- self.notebook.remove_page(self.tabs[tab_name].position)
self.tabs[tab_name].is_visible = False
+ self.notebook.remove_page(self.tabs[tab_name].position)
self.regenerate_positions()
self.generate_menu()
@@ -275,7 +284,8 @@ class TorrentDetails(component.Component):
"""Generates the checklist menu for all the tabs and attaches it"""
menu = gtk.Menu()
# Create 'All' menuitem and a separator
- menuitem = gtk.CheckMenuItem("All")
+ menuitem = gtk.CheckMenuItem(self.translate_tabs["All"], True)
+ menuitem.set_name("All")
all_tabs = True
for key in self.tabs:
@@ -297,7 +307,8 @@ class TorrentDetails(component.Component):
menuitem_list.sort()
for pos, name in menuitem_list:
- menuitem = gtk.CheckMenuItem(name)
+ menuitem = gtk.CheckMenuItem(self.translate_tabs[name], True)
+ menuitem.set_name(name)
menuitem.set_active(self.tabs[name].is_visible)
menuitem.connect("toggled", self._on_menuitem_toggled)
menu.append(menuitem)
@@ -386,7 +397,7 @@ class TorrentDetails(component.Component):
def _on_menuitem_toggled(self, widget):
# Get the tab name
- name = widget.get_child().get_text()
+ name = widget.get_name()
if name == "All":
if widget.get_active():
self.show_all_tabs()
diff --git a/deluge/ui/ui.py b/deluge/ui/ui.py
index 792f416c2..46a597a5f 100644
--- a/deluge/ui/ui.py
+++ b/deluge/ui/ui.py
@@ -107,7 +107,9 @@ class _UI(object):
return self.__args
def start(self):
- (self.__options, self.__args) = self.__parser.parse_args()
+ # Make sure all arguments are unicode
+ argv = deluge.common.unicode_argv()[1:]
+ (self.__options, self.__args) = self.__parser.parse_args(argv)
if self.__options.quiet:
self.__options.loglevel = "none"
diff --git a/deluge/ui/web/TODO b/deluge/ui/web/TODO
deleted file mode 100644
index 6861a65f1..000000000
--- a/deluge/ui/web/TODO
+++ /dev/null
@@ -1,4 +0,0 @@
-* Add Window torrent options
- - Add an options manager
-* Preferences window options
- - Add an options manager
diff --git a/deluge/ui/web/css/deluge.css b/deluge/ui/web/css/deluge.css
index 4701d7e66..ab02a4536 100644
--- a/deluge/ui/web/css/deluge.css
+++ b/deluge/ui/web/css/deluge.css
@@ -244,10 +244,57 @@ dl.singleline dd {
}
/* Files TreeGrid */
-.x-treegrid-col {
- overflow: hidden;
+.x-treegrid-root-table {
+ border-right: 1px solid;
}
+.x-treegrid-root-node {
+ overflow: auto;
+}
+
+.x-treegrid-hd-hidden {
+ visibility: hidden;
+ border: 0;
+ width: 0;
+}
+
+.x-treegrid-col {
+ border-bottom: 1px solid;
+ height: 20px;
+ overflow: hidden;
+ vertical-align: top;
+ -o-text-overflow: ellipsis;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.x-treegrid-text {
+ padding-left: 4px;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+}
+
+.x-treegrid-resizer {
+ border-left:1px solid;
+ border-right:1px solid;
+ position:absolute;
+ left:0;
+ top:0;
+}
+
+.x-treegrid-header-inner {
+ overflow: hidden;
+}
+
+.x-treegrid-root-table,
+.x-treegrid-col {
+ border-color: #ededed;
+}
+
+.x-treegrid-resizer {
+ border-left-color:#555;
+ border-right-color:#555;
+}
/* Options Tab Styles */
.x-deluge-options-label {
diff --git a/deluge/ui/web/gen_gettext.py b/deluge/ui/web/gen_gettext.py
old mode 100644
new mode 100755
index 05025aec5..b2518d74b
--- a/deluge/ui/web/gen_gettext.py
+++ b/deluge/ui/web/gen_gettext.py
@@ -2,15 +2,14 @@
"""
Script to go through the javascript files and dynamically generate gettext.js
"""
-
import os
import re
-import glob
-import cStringIO as StringIO
+output_file = "gettext.js"
string_re = re.compile('_\\(\'(.*?)\'\\)')
strings = {}
+
gettext_tpl = """## -*- coding: utf-8 -*-
/*
* Script: gettext.js
@@ -59,10 +58,10 @@ for root, dnames, files in os.walk('js/deluge-all'):
keys = strings.keys()
keys.sort()
-fp = StringIO.StringIO()
+fp = open(output_file, 'w')
fp.write(gettext_tpl)
for key in keys:
fp.write('// %s\n' % ', '.join(map(lambda x: '%s:%s' % x, strings[key])))
fp.write("GetText.add('%(key)s', '${escape(_(\"%(key)s\"))}')\n\n" % locals())
-fp.seek(0)
-print fp.read()
+fp.close()
+
diff --git a/deluge/ui/web/gettext.js b/deluge/ui/web/gettext.js
index 7bed3e588..4ac07490a 100644
--- a/deluge/ui/web/gettext.js
+++ b/deluge/ui/web/gettext.js
@@ -26,739 +26,819 @@ function _(string) {
return GetText.get(string);
}
-// Deluge.Torrents.js:117
+// TorrentGrid.js:109
GetText.add('#', '${escape(_("#"))}')
-// Deluge.Menus.js:167
+// DetailsTab.js:50
+GetText.add('# of files', '${escape(_("# of files"))}')
+
+// Menus.js:161
GetText.add('0', '${escape(_("0"))}')
-// Deluge.Menus.js:169
+// Menus.js:163
GetText.add('1', '${escape(_("1"))}')
-// Deluge.Menus.js:115, Deluge.Menus.js:133
+// Menus.js:109, Menus.js:127
GetText.add('10 KiB/s', '${escape(_("10 KiB/s"))}')
-// Deluge.Menus.js:151
+// Menus.js:145
GetText.add('100', '${escape(_("100"))}')
-// Deluge.Menus.js:171
+// Menus.js:165
GetText.add('2', '${escape(_("2"))}')
-// Deluge.Menus.js:153
+// Menus.js:147
GetText.add('200', '${escape(_("200"))}')
-// Deluge.Menus.js:173
+// Menus.js:167
GetText.add('3', '${escape(_("3"))}')
-// Deluge.Menus.js:117, Deluge.Menus.js:135
+// Menus.js:111, Menus.js:129
GetText.add('30 KiB/s', '${escape(_("30 KiB/s"))}')
-// Deluge.Menus.js:155
+// Menus.js:149
GetText.add('300', '${escape(_("300"))}')
-// Deluge.Menus.js:121, Deluge.Menus.js:139
+// Menus.js:115, Menus.js:133
GetText.add('300 KiB/s', '${escape(_("300 KiB/s"))}')
-// Deluge.Menus.js:175
+// Menus.js:169
GetText.add('5', '${escape(_("5"))}')
-// Deluge.Menus.js:113, Deluge.Menus.js:131
+// Menus.js:107, Menus.js:125
GetText.add('5 KiB/s', '${escape(_("5 KiB/s"))}')
-// Deluge.Menus.js:149
+// Menus.js:143
GetText.add('50', '${escape(_("50"))}')
-// Deluge.Menus.js:157
+// Menus.js:151
GetText.add('500', '${escape(_("500"))}')
-// Deluge.Menus.js:119, Deluge.Menus.js:137
+// Menus.js:113, Menus.js:131
GetText.add('80 KiB/s', '${escape(_("80 KiB/s"))}')
-// Deluge.Preferences.Queue.js:70
+// QueuePage.js:69
GetText.add('Active Torrents', '${escape(_("Active Torrents"))}')
-// Deluge.ConnectionManager.js:64, Deluge.ConnectionManager.js:222, Deluge.Add.Url.js:55, Deluge.Toolbar.js:51, Deluge.Add.js:384, Deluge.EditTrackers.js:58, Deluge.EditTrackers.js:237, Deluge.Add.File.js:55
+// EditTrackersWindow.js:112, ConnectionManager.js:100, AddConnectionWindow.js:56, Toolbar.js:58, AddTrackerWindow.js:57, UrlWindow.js:50, FileWindow.js:53, AddWindow.js:52
GetText.add('Add', '${escape(_("Add"))}')
-// Deluge.ConnectionManager.js:52
+// AddConnectionWindow.js:40
GetText.add('Add Connection', '${escape(_("Add Connection"))}')
-// Deluge.Add.js:184
+// OptionsTab.js:147
GetText.add('Add In Paused State', '${escape(_("Add In Paused State"))}')
-// Deluge.Add.js:366
+// AddWindow.js:37
GetText.add('Add Torrents', '${escape(_("Add Torrents"))}')
-// Deluge.EditTrackers.js:39
+// AddTrackerWindow.js:40
GetText.add('Add Tracker', '${escape(_("Add Tracker"))}')
-// Deluge.Add.File.js:47
+// FileWindow.js:40
GetText.add('Add from File', '${escape(_("Add from File"))}')
-// Deluge.Add.Url.js:47
+// UrlWindow.js:36
GetText.add('Add from Url', '${escape(_("Add from Url"))}')
-// Deluge.Preferences.Downloads.js:142
+// DownloadsPage.js:146
GetText.add('Add torrents in Paused state', '${escape(_("Add torrents in Paused state"))}')
-// Deluge.Torrents.js:184
+// TorrentGrid.js:180
GetText.add('Added', '${escape(_("Added"))}')
-// Deluge.Sidebar.js:198
+// FilterPanel.js:124
GetText.add('All', '${escape(_("All"))}')
-// Deluge.Add.js:114, Deluge.Preferences.Downloads.js:97
+// OptionsTab.js:77, DownloadsPage.js:100
GetText.add('Allocation', '${escape(_("Allocation"))}')
-// Deluge.Preferences.Daemon.js:81
+// DaemonPage.js:77
GetText.add('Allow Remote Connections', '${escape(_("Allow Remote Connections"))}')
-// Deluge.Details.Options.js:347, Deluge.Preferences.js:91
+// InterfacePage.js:78
+GetText.add('Allow the use of multiple filters at once', '${escape(_("Allow the use of multiple filters at once"))}')
+
+// OptionsTab.js:347, PreferencesWindow.js:107
GetText.add('Apply', '${escape(_("Apply"))}')
-// Deluge.Menus.js:182, Deluge.Details.Options.js:215
+// Menus.js:176, OptionsTab.js:215
GetText.add('Auto Managed', '${escape(_("Auto Managed"))}')
-// Deluge.Preferences.Downloads.js:88
+// DownloadsPage.js:91
GetText.add('Autoadd .torrent files from', '${escape(_("Autoadd .torrent files from"))}')
-// Deluge.Torrents.js:178
+// TorrentGrid.js:173
GetText.add('Avail', '${escape(_("Avail"))}')
-// Deluge.Add.js:144, Deluge.Details.Options.js:88, Deluge.Preferences.Bandwidth.js:39
+// FileBrowser.js:47
+GetText.add('Back', '${escape(_("Back"))}')
+
+// OptionsTab.js:88, OptionsTab.js:107, BandwidthPage.js:42
GetText.add('Bandwidth', '${escape(_("Bandwidth"))}')
-// Deluge.Preferences.Other.js:63
+// OtherPage.js:66
GetText.add('Be alerted about new releases', '${escape(_("Be alerted about new releases"))}')
-// Deluge.Menus.js:210
+// Menus.js:204
GetText.add('Bottom', '${escape(_("Bottom"))}')
-// Deluge.Preferences.Plugins.js:74, Deluge.Add.File.js:70
+// MoveStorage.js:73, FileWindow.js:70, InstallPluginWindow.js:69
GetText.add('Browse', '${escape(_("Browse"))}')
-// Deluge.Preferences.Cache.js:39
+// CachePage.js:41
GetText.add('Cache', '${escape(_("Cache"))}')
-// Deluge.Preferences.Cache.js:71
+// CachePage.js:69
GetText.add('Cache Expiry (seconds)', '${escape(_("Cache Expiry (seconds)"))}')
-// Deluge.Preferences.Cache.js:59
+// CachePage.js:63
GetText.add('Cache Size (16 KiB Blocks)', '${escape(_("Cache Size (16 KiB Blocks)"))}')
-// Deluge.Add.js:383, Deluge.MoveStorage.js:56, Deluge.EditTrackers.js:57, Deluge.EditTrackers.js:116, Deluge.EditTrackers.js:178, Deluge.Remove.js:53
+// EditTrackersWindow.js:56, OtherLimitWindow.js:72, RemoveWindow.js:55, MoveStorage.js:55, EditTrackerWindow.js:56, AddTrackerWindow.js:56, AddWindow.js:51
GetText.add('Cancel', '${escape(_("Cancel"))}')
-// Deluge.Preferences.js:55
+// PreferencesWindow.js:85
GetText.add('Categories', '${escape(_("Categories"))}')
-// Deluge.Preferences.Interface.js:180
+// InterfacePage.js:173
GetText.add('Certificate', '${escape(_("Certificate"))}')
-// Deluge.Preferences.Interface.js:118
+// InterfacePage.js:117
GetText.add('Change', '${escape(_("Change"))}')
-// Deluge.Preferences.Interface.js:227
+// InterfacePage.js:224
GetText.add('Change Successful', '${escape(_("Change Successful"))}')
-// Deluge.ConnectionManager.js:63, Deluge.ConnectionManager.js:171, Deluge.Preferences.js:90
+// ConnectionManager.js:54, AddConnectionWindow.js:55, PreferencesWindow.js:106
GetText.add('Close', '${escape(_("Close"))}')
-// Deluge.Add.js:137
+// DetailsTab.js:51
+GetText.add('Comment', '${escape(_("Comment"))}')
+
+// OptionsTab.js:100
GetText.add('Compact', '${escape(_("Compact"))}')
-// Deluge.Preferences.Interface.js:106
+// InterfacePage.js:105
GetText.add('Confirm Password', '${escape(_("Confirm Password"))}')
-// Deluge.ConnectionManager.js:172, Deluge.ConnectionManager.js:284
+// ConnectionManager.js:55, ConnectionManager.js:184
GetText.add('Connect', '${escape(_("Connect"))}')
-// Deluge.ConnectionManager.js:277, Deluge.ConnectionManager.js:322
+// ConnectionManager.js:177, ConnectionManager.js:225
GetText.add('Connected', '${escape(_("Connected"))}')
-// Deluge.Menus.js:145
+// Menus.js:139
GetText.add('Connection Limit', '${escape(_("Connection Limit"))}')
-// Deluge.ConnectionManager.js:159, Deluge.Toolbar.js:99
+// ConnectionManager.js:43, Toolbar.js:100
GetText.add('Connection Manager', '${escape(_("Connection Manager"))}')
-// Deluge.Statusbar.js:25, Deluge.Preferences.Daemon.js:72
+// UI.js:151
+GetText.add('Connection restored', '${escape(_("Connection restored"))}')
+
+// Statusbar.js:57, DaemonPage.js:68
GetText.add('Connections', '${escape(_("Connections"))}')
-// Deluge.Add.Url.js:73
+// UrlWindow.js:68
GetText.add('Cookies', '${escape(_("Cookies"))}')
-// Deluge.Preferences.Downloads.js:80
+// DownloadsPage.js:83
GetText.add('Copy of .torrent files to', '${escape(_("Copy of .torrent files to"))}')
-// Deluge.Toolbar.js:44
+// Toolbar.js:52
GetText.add('Create', '${escape(_("Create"))}')
-// Deluge.Menus.js:109
+// Menus.js:103
GetText.add('D/L Speed Limit', '${escape(_("D/L Speed Limit"))}')
-// Deluge.Preferences.Network.js:229, Deluge.Preferences.Proxy.js:202
+// NetworkPage.js:225, ProxyPage.js:70
GetText.add('DHT', '${escape(_("DHT"))}')
-// Deluge.Statusbar.js:52
+// Statusbar.js:210
GetText.add('DHT Nodes', '${escape(_("DHT Nodes"))}')
-// Deluge.Preferences.Daemon.js:39
+// DaemonPage.js:41
GetText.add('Daemon', '${escape(_("Daemon"))}')
-// Deluge.Preferences.Daemon.js:58
+// DaemonPage.js:57
GetText.add('Daemon port', '${escape(_("Daemon port"))}')
-// Deluge.Details.Details.js:36
+// Toolbar.js:45
+GetText.add('Deluge', '${escape(_("Deluge"))}')
+
+// DetailsTab.js:36
GetText.add('Details', '${escape(_("Details"))}')
-// Deluge.Preferences.Encryption.js:66, Deluge.Preferences.Encryption.js:82
+// EncryptionPage.js:65, EncryptionPage.js:82
GetText.add('Disabled', '${escape(_("Disabled"))}')
-// Deluge.ConnectionManager.js:279
+// ConnectionManager.js:179
GetText.add('Disconnect', '${escape(_("Disconnect"))}')
-// Deluge.Menus.js:410, Deluge.js:107
+// Menus.js:251, Deluge.js:156
GetText.add('Do Not Download', '${escape(_("Do Not Download"))}')
-// Deluge.Preferences.Queue.js:117
+// QueuePage.js:107
GetText.add('Do not count slow torrents', '${escape(_("Do not count slow torrents"))}')
-// Deluge.Toolbar.js:86, Deluge.Menus.js:204, Deluge.EditTrackers.js:231
+// EditTrackersWindow.js:107, Menus.js:198, Toolbar.js:89
GetText.add('Down', '${escape(_("Down"))}')
-// Deluge.Torrents.js:154
+// TorrentGrid.js:241
+GetText.add('Down Limit', '${escape(_("Down Limit"))}')
+
+// TorrentGrid.js:148
GetText.add('Down Speed', '${escape(_("Down Speed"))}')
-// Deluge.Add.js:94
+// FilesTab.js:63
+GetText.add('Download', '${escape(_("Download"))}')
+
+// OptionsTab.js:55
GetText.add('Download Location', '${escape(_("Download Location"))}')
-// Deluge.Statusbar.js:32
+// Statusbar.js:104
GetText.add('Download Speed', '${escape(_("Download Speed"))}')
-// Deluge.Preferences.Downloads.js:66
+// DownloadsPage.js:69
GetText.add('Download to', '${escape(_("Download to"))}')
-// Deluge.Preferences.Downloads.js:39
+// TorrentGrid.js:227
+GetText.add('Downloaded', '${escape(_("Downloaded"))}')
+
+// DownloadsPage.js:42
GetText.add('Downloads', '${escape(_("Downloads"))}')
-// Deluge.Torrents.js:166
+// TorrentGrid.js:160
GetText.add('ETA', '${escape(_("ETA"))}')
-// Deluge.EditTrackers.js:243
+// EditTrackersWindow.js:117
GetText.add('Edit', '${escape(_("Edit"))}')
-// Deluge.EditTrackers.js:98
+// EditTrackerWindow.js:40
GetText.add('Edit Tracker', '${escape(_("Edit Tracker"))}')
-// Deluge.Menus.js:224, Deluge.Details.Options.js:329, Deluge.EditTrackers.js:160
+// EditTrackersWindow.js:40, Menus.js:218, OptionsTab.js:332
GetText.add('Edit Trackers', '${escape(_("Edit Trackers"))}')
-// Deluge.Preferences.Encryption.js:98
+// EncryptionPage.js:99
GetText.add('Either', '${escape(_("Either"))}')
-// Deluge.Preferences.Plugins.js:157, Deluge.Preferences.Encryption.js:65, Deluge.Preferences.Encryption.js:81
+// EncryptionPage.js:64, EncryptionPage.js:81, PluginsPage.js:81
GetText.add('Enabled', '${escape(_("Enabled"))}')
-// Deluge.Preferences.Encryption.js:110
+// EncryptionPage.js:112
GetText.add('Encrypt entire stream', '${escape(_("Encrypt entire stream"))}')
-// Deluge.Preferences.Encryption.js:39
+// EncryptionPage.js:41
GetText.add('Encryption', '${escape(_("Encryption"))}')
-// Deluge.ConnectionManager.js:128, Deluge.ConnectionManager.js:391, Deluge.ConnectionManager.js:447, Deluge.Add.js:541
+// ConnectionManager.js:308, ConnectionManager.js:364, AddConnectionWindow.js:103, AddWindow.js:209
GetText.add('Error', '${escape(_("Error"))}')
-// Deluge.Menus.js:406
+// Menus.js:247
GetText.add('Expand All', '${escape(_("Expand All"))}')
-// Deluge.Add.js:431, Deluge.Add.File.js:67
+// FileWindow.js:67, AddWindow.js:98
GetText.add('File', '${escape(_("File"))}')
-// Deluge.Add.js:63, Deluge.Details.Files.js:53
+// FileBrowser.js:36
+GetText.add('File Browser', '${escape(_("File Browser"))}')
+
+// OptionsPanel.js:143
+GetText.add('File prioritization is unavailable when using Compact allocation. Would you like to switch to Full allocation?', '${escape(_("File prioritization is unavailable when using Compact allocation. Would you like to switch to Full allocation?"))}')
+
+// FilesTab.js:40, FilesTab.js:50
GetText.add('Filename', '${escape(_("Filename"))}')
-// Deluge.Add.js:54, Deluge.Details.Files.js:47
+// FilesTab.js:35, FilesTab.js:41
GetText.add('Files', '${escape(_("Files"))}')
-// Deluge.Sidebar.js:75
+// Sidebar.js:55
GetText.add('Filters', '${escape(_("Filters"))}')
-// Deluge.Preferences.Plugins.js:191
+// PluginsPage.js:118
GetText.add('Find More', '${escape(_("Find More"))}')
-// Deluge.Preferences.Downloads.js:54
+// DownloadsPage.js:57
GetText.add('Folders', '${escape(_("Folders"))}')
-// Deluge.Menus.js:236
+// Menus.js:230
GetText.add('Force Recheck', '${escape(_("Force Recheck"))}')
-// Deluge.Preferences.Encryption.js:64, Deluge.Preferences.Encryption.js:80
+// EncryptionPage.js:63, EncryptionPage.js:80
GetText.add('Forced', '${escape(_("Forced"))}')
-// Deluge.Statusbar.js:58
+// FileBrowser.js:50
+GetText.add('Forward', '${escape(_("Forward"))}')
+
+// Statusbar.js:216
GetText.add('Freespace in download location', '${escape(_("Freespace in download location"))}')
-// Deluge.Add.js:130
+// OptionsTab.js:93
GetText.add('Full', '${escape(_("Full"))}')
-// Deluge.Preferences.Encryption.js:97
+// EncryptionPage.js:98
GetText.add('Full Stream', '${escape(_("Full Stream"))}')
-// Deluge.Preferences.Queue.js:53, Deluge.Add.js:177, Deluge.Details.Options.js:281
+// OptionsTab.js:293, OptionsTab.js:140, QueuePage.js:52
GetText.add('General', '${escape(_("General"))}')
-// Deluge.Preferences.Other.js:94
+// OtherPage.js:97
GetText.add('GeoIP Database', '${escape(_("GeoIP Database"))}')
-// Deluge.Preferences.Bandwidth.js:53
+// BandwidthPage.js:56
GetText.add('Global Bandwidth Usage', '${escape(_("Global Bandwidth Usage"))}')
-// Deluge.Preferences.Proxy.js:61
+// ProxyField.js:59
GetText.add('HTTP', '${escape(_("HTTP"))}')
-// Deluge.Preferences.Proxy.js:62
+// ProxyField.js:60
GetText.add('HTTP with Auth', '${escape(_("HTTP with Auth"))}')
-// Deluge.Preferences.Encryption.js:96
+// EncryptionPage.js:97
GetText.add('Handshake', '${escape(_("Handshake"))}')
-// Deluge.Toolbar.js:107
+// DetailsTab.js:47
+GetText.add('Hash', '${escape(_("Hash"))}')
+
+// Toolbar.js:107
GetText.add('Help', '${escape(_("Help"))}')
-// Deluge.Menus.js:420, Deluge.js:109
+// Menus.js:261, Deluge.js:158
GetText.add('High Priority', '${escape(_("High Priority"))}')
-// Deluge.Menus.js:425, Deluge.js:110
+// Menus.js:266, Deluge.js:159
GetText.add('Highest Priority', '${escape(_("Highest Priority"))}')
-// Deluge.ConnectionManager.js:77, Deluge.ConnectionManager.js:193, Deluge.Preferences.Proxy.js:73
+// FileBrowser.js:56
+GetText.add('Home', '${escape(_("Home"))}')
+
+// ConnectionManager.js:74, AddConnectionWindow.js:66, ProxyField.js:71
GetText.add('Host', '${escape(_("Host"))}')
-// Deluge.Preferences.Bandwidth.js:145
+// BandwidthPage.js:122
GetText.add('Ignore limits on local network', '${escape(_("Ignore limits on local network"))}')
-// Deluge.Preferences.Encryption.js:58
+// EncryptionPage.js:57
GetText.add('Inbound', '${escape(_("Inbound"))}')
-// Deluge.Preferences.Network.js:53
+// NetworkPage.js:51
GetText.add('Incoming Ports', '${escape(_("Incoming Ports"))}')
-// Deluge.Preferences.Plugins.js:203
+// PluginsPage.js:135
GetText.add('Info', '${escape(_("Info"))}')
-// Deluge.Add.js:444
+// AddWindow.js:107
GetText.add('Infohash', '${escape(_("Infohash"))}')
-// Deluge.Preferences.Plugins.js:59, Deluge.Preferences.Plugins.js:186
+// InstallPluginWindow.js:54, PluginsPage.js:113
GetText.add('Install', '${escape(_("Install"))}')
-// Deluge.Preferences.Plugins.js:55
+// InstallPluginWindow.js:40
GetText.add('Install Plugin', '${escape(_("Install Plugin"))}')
-// Deluge.Preferences.Interface.js:39, Deluge.Preferences.Interface.js:54
+// InterfacePage.js:41, InterfacePage.js:53
GetText.add('Interface', '${escape(_("Interface"))}')
-// Deluge.Preferences.Interface.js:202
+// InterfacePage.js:199
GetText.add('Invalid Password', '${escape(_("Invalid Password"))}')
-// Deluge.Details.Options.js:114, Deluge.Details.Options.js:141
+// OptionsTab.js:114, OptionsTab.js:141
GetText.add('KiB/s', '${escape(_("KiB/s"))}')
-// Deluge.Preferences.Network.js:223
+// Statusbar.js:144, Statusbar.js:192
+GetText.add('Kib/s', '${escape(_("Kib/s"))}')
+
+// NetworkPage.js:219
GetText.add('LSD', '${escape(_("LSD"))}')
-// Deluge.Preferences.Encryption.js:90
+// TorrentGrid.js:187
+GetText.add('Last Seen Complete', '${escape(_("Last Seen Complete"))}')
+
+// EncryptionPage.js:91
GetText.add('Level', '${escape(_("Level"))}')
-// Deluge.Details.Status.js:57, Deluge.Details.Details.js:43
+// StatusTab.js:61
GetText.add('Loading', '${escape(_("Loading"))}')
-// Deluge.MoveStorage.js:68, Deluge.Preferences.Other.js:101
+// MoveStorage.js:67, OtherPage.js:104
GetText.add('Location', '${escape(_("Location"))}')
-// Deluge.Login.js:52, Deluge.Login.js:63
+// LoginWindow.js:45, LoginWindow.js:54
GetText.add('Login', '${escape(_("Login"))}')
-// Deluge.Login.js:139
+// LoginWindow.js:130
GetText.add('Login Failed', '${escape(_("Login Failed"))}')
-// Deluge.Toolbar.js:115
+// Toolbar.js:114
GetText.add('Logout', '${escape(_("Logout"))}')
-// Deluge.Add.js:164, Deluge.Details.Options.js:150
+// OptionsTab.js:150, OptionsTab.js:127
GetText.add('Max Connections', '${escape(_("Max Connections"))}')
-// Deluge.Add.js:152
+// OptionsTab.js:115
GetText.add('Max Down Speed', '${escape(_("Max Down Speed"))}')
-// Deluge.Details.Options.js:97
+// OptionsTab.js:97
GetText.add('Max Download Speed', '${escape(_("Max Download Speed"))}')
-// Deluge.Add.js:158
+// OptionsTab.js:121
GetText.add('Max Up Speed', '${escape(_("Max Up Speed"))}')
-// Deluge.Add.js:170, Deluge.Details.Options.js:173
+// OptionsTab.js:173, OptionsTab.js:133
GetText.add('Max Upload Slots', '${escape(_("Max Upload Slots"))}')
-// Deluge.Details.Options.js:123
+// OptionsTab.js:123
GetText.add('Max Upload Speed', '${escape(_("Max Upload Speed"))}')
-// Deluge.Preferences.Bandwidth.js:121
+// BandwidthPage.js:103
GetText.add('Maximum Connection Attempts per Second', '${escape(_("Maximum Connection Attempts per Second"))}')
-// Deluge.Preferences.Bandwidth.js:61, Deluge.Preferences.Bandwidth.js:166
+// BandwidthPage.js:68, BandwidthPage.js:147
GetText.add('Maximum Connections', '${escape(_("Maximum Connections"))}')
-// Deluge.Preferences.Bandwidth.js:85, Deluge.Preferences.Bandwidth.js:190
+// BandwidthPage.js:82, BandwidthPage.js:161
GetText.add('Maximum Download Speed (KiB/s)', '${escape(_("Maximum Download Speed (KiB/s)"))}')
-// Deluge.Preferences.Bandwidth.js:109
+// BandwidthPage.js:96
GetText.add('Maximum Half-Open Connections', '${escape(_("Maximum Half-Open Connections"))}')
-// Deluge.Preferences.Bandwidth.js:73, Deluge.Preferences.Bandwidth.js:178
+// BandwidthPage.js:75, BandwidthPage.js:154
GetText.add('Maximum Upload Slots', '${escape(_("Maximum Upload Slots"))}')
-// Deluge.Preferences.Bandwidth.js:97, Deluge.Preferences.Bandwidth.js:202
+// BandwidthPage.js:89, BandwidthPage.js:168
GetText.add('Maximum Upload Speed (KiB/s)', '${escape(_("Maximum Upload Speed (KiB/s)"))}')
-// Deluge.MoveStorage.js:57
+// MoveStorage.js:56
GetText.add('Move', '${escape(_("Move"))}')
-// Deluge.Details.Options.js:262
+// OptionsTab.js:262
GetText.add('Move Completed', '${escape(_("Move Completed"))}')
-// Deluge.Menus.js:242, Deluge.MoveStorage.js:39
+// Menus.js:236, MoveStorage.js:38
GetText.add('Move Storage', '${escape(_("Move Storage"))}')
-// Deluge.Preferences.Downloads.js:72
+// DownloadsPage.js:75
GetText.add('Move completed to', '${escape(_("Move completed to"))}')
-// Deluge.Preferences.Network.js:209
+// NetworkPage.js:205
GetText.add('NAT-PMP', '${escape(_("NAT-PMP"))}')
-// Deluge.Torrents.js:124
+// TorrentGrid.js:116, DetailsTab.js:46
GetText.add('Name', '${escape(_("Name"))}')
-// Deluge.Preferences.Network.js:40
+// NetworkPage.js:42
GetText.add('Network', '${escape(_("Network"))}')
-// Deluge.Preferences.Network.js:192
+// NetworkPage.js:188
GetText.add('Network Extras', '${escape(_("Network Extras"))}')
-// Deluge.Preferences.Network.js:161
+// NetworkPage.js:157
GetText.add('Network Interface', '${escape(_("Network Interface"))}')
-// Deluge.Preferences.Interface.js:102
+// InterfacePage.js:101
GetText.add('New Password', '${escape(_("New Password"))}')
-// Deluge.Preferences.Proxy.js:57
+// ProxyField.js:55
GetText.add('None', '${escape(_("None"))}')
-// Deluge.Menus.js:415, Deluge.js:108
+// Menus.js:256, Deluge.js:157
GetText.add('Normal Priority', '${escape(_("Normal Priority"))}')
-// Deluge.Statusbar.js:7
+// Statusbar.js:39
GetText.add('Not Connected', '${escape(_("Not Connected"))}')
-// Deluge.Add.js:542
+// AddWindow.js:210
GetText.add('Not a valid torrent', '${escape(_("Not a valid torrent"))}')
-// Deluge.Preferences.Notification.js:1
-GetText.add('Notification', '${escape(_("Notification"))}')
-
-// Deluge.ConnectionManager.js:280, Deluge.ConnectionManager.js:288
+// ConnectionManager.js:180, ConnectionManager.js:188
GetText.add('Offline', '${escape(_("Offline"))}')
-// Deluge.EditTrackers.js:179, Deluge.Preferences.js:92
+// EditTrackersWindow.js:57, OtherLimitWindow.js:73, PreferencesWindow.js:108
GetText.add('Ok', '${escape(_("Ok"))}')
-// Deluge.Preferences.Interface.js:98
+// InterfacePage.js:97
GetText.add('Old Password', '${escape(_("Old Password"))}')
-// Deluge.Add.js:85, Deluge.Menus.js:105, Deluge.Details.Options.js:50, Deluge.Preferences.Downloads.js:125
+// Menus.js:99, OptionsTab.js:49, OptionsTab.js:40, DownloadsPage.js:129
GetText.add('Options', '${escape(_("Options"))}')
-// Deluge.Menus.js:301, Deluge.Menus.js:348, Deluge.Menus.js:395, Deluge.Preferences.Daemon.js:88, Deluge.Preferences.Other.js:39
+// Statusbar.js:90, Statusbar.js:138, Statusbar.js:186, OtherPage.js:42, DaemonPage.js:84
GetText.add('Other', '${escape(_("Other"))}')
-// Deluge.Preferences.Encryption.js:74
+// EncryptionPage.js:74
GetText.add('Outbound', '${escape(_("Outbound"))}')
-// Deluge.Preferences.Network.js:108
+// NetworkPage.js:104
GetText.add('Outgoing Ports', '${escape(_("Outgoing Ports"))}')
-// Deluge.ConnectionManager.js:109, Deluge.Preferences.Interface.js:85, Deluge.Preferences.Interface.js:217, Deluge.Preferences.Proxy.js:100, Deluge.Login.js:75
+// TorrentGrid.js:207
+GetText.add('Owner', '${escape(_("Owner"))}')
+
+// AddConnectionWindow.js:88, LoginWindow.js:70, ProxyField.js:95, InterfacePage.js:84, InterfacePage.js:214
GetText.add('Password', '${escape(_("Password"))}')
-// Deluge.Toolbar.js:65, Deluge.Menus.js:93
+// DetailsTab.js:48
+GetText.add('Path', '${escape(_("Path"))}')
+
+// Menus.js:88, Toolbar.js:70
GetText.add('Pause', '${escape(_("Pause"))}')
-// Deluge.Preferences.Proxy.js:184
+// ProxyPage.js:52
GetText.add('Peer', '${escape(_("Peer"))}')
-// Deluge.Preferences.Network.js:216
+// NetworkPage.js:212
GetText.add('Peer Exchange', '${escape(_("Peer Exchange"))}')
-// Deluge.Preferences.Network.js:185
+// NetworkPage.js:181
GetText.add('Peer TOS Byte', '${escape(_("Peer TOS Byte"))}')
-// Deluge.Details.Peers.js:64, Deluge.Torrents.js:148
+// TorrentGrid.js:141, TorrentGrid.js:255, PeersTab.js:61
GetText.add('Peers', '${escape(_("Peers"))}')
-// Deluge.Preferences.Bandwidth.js:158
+// BandwidthPage.js:135
GetText.add('Per Torrent Bandwidth Usage', '${escape(_("Per Torrent Bandwidth Usage"))}')
-// Deluge.Preferences.Daemon.js:97
+// DaemonPage.js:93
GetText.add('Periodically check the website for new releases', '${escape(_("Periodically check the website for new releases"))}')
-// Deluge.Preferences.Plugins.js:164
+// PluginsPage.js:92
GetText.add('Plugin', '${escape(_("Plugin"))}')
-// Deluge.Preferences.Plugins.js:71
+// InstallPluginWindow.js:66
GetText.add('Plugin Egg', '${escape(_("Plugin Egg"))}')
-// Deluge.Preferences.Plugins.js:113
+// PluginsPage.js:41
GetText.add('Plugins', '${escape(_("Plugins"))}')
-// Deluge.ConnectionManager.js:85, Deluge.Preferences.Interface.js:151, Deluge.Preferences.Proxy.js:80, Deluge.Preferences.Daemon.js:53
+// AddConnectionWindow.js:72, ProxyField.js:78, DaemonPage.js:52, InterfacePage.js:147
GetText.add('Port', '${escape(_("Port"))}')
-// Deluge.Toolbar.js:92, Deluge.Preferences.js:50
+// QueuePage.js:114
+GetText.add('Prefer Seeding over Downloading', '${escape(_("Prefer Seeding over Downloading"))}')
+
+// Toolbar.js:94, PreferencesWindow.js:47
GetText.add('Preferences', '${escape(_("Preferences"))}')
-// Deluge.Details.Options.js:296
+// OptionsTab.js:308
GetText.add('Prioritize First/Last', '${escape(_("Prioritize First/Last"))}')
-// Deluge.Add.js:190
+// OptionsTab.js:153
GetText.add('Prioritize First/Last Pieces', '${escape(_("Prioritize First/Last Pieces"))}')
-// Deluge.Preferences.Downloads.js:136
+// DownloadsPage.js:140
GetText.add('Prioritize first and last pieces of torrent', '${escape(_("Prioritize first and last pieces of torrent"))}')
-// Deluge.Details.Files.js:67
+// FilesTab.js:60
GetText.add('Priority', '${escape(_("Priority"))}')
-// Deluge.Details.Options.js:288
+// OptionsTab.js:300
GetText.add('Private', '${escape(_("Private"))}')
-// Deluge.Preferences.Interface.js:173
+// InterfacePage.js:166
GetText.add('Private Key', '${escape(_("Private Key"))}')
-// Deluge.Details.Files.js:62, Deluge.Torrents.js:136
+// TorrentGrid.js:128, FilesTab.js:52
GetText.add('Progress', '${escape(_("Progress"))}')
-// Deluge.Statusbar.js:46
+// Statusbar.js:200
GetText.add('Protocol Traffic Download/Upload', '${escape(_("Protocol Traffic Download/Upload"))}')
-// Deluge.Preferences.Proxy.js:175
+// ProxyPage.js:42
GetText.add('Proxy', '${escape(_("Proxy"))}')
-// Deluge.Preferences.Queue.js:39, Deluge.Menus.js:187, Deluge.Details.Options.js:196
+// TorrentGrid.js:213
+GetText.add('Public', '${escape(_("Public"))}')
+
+// Menus.js:181, OptionsTab.js:196, QueuePage.js:41
GetText.add('Queue', '${escape(_("Queue"))}')
-// Deluge.Preferences.Queue.js:63
+// QueuePage.js:62
GetText.add('Queue new torrents to top', '${escape(_("Queue new torrents to top"))}')
-// Deluge.Preferences.Bandwidth.js:152
+// BandwidthPage.js:129
GetText.add('Rate limit IP overhead', '${escape(_("Rate limit IP overhead"))}')
-// Deluge.Torrents.js:172
+// TorrentGrid.js:166
GetText.add('Ratio', '${escape(_("Ratio"))}')
-// Deluge.ConnectionManager.js:229, Deluge.Toolbar.js:58, Deluge.Add.js:450, Deluge.EditTrackers.js:249
+// EditTrackersWindow.js:122, ConnectionManager.js:107, Toolbar.js:64, AddWindow.js:112
GetText.add('Remove', '${escape(_("Remove"))}')
-// Deluge.Menus.js:230, Deluge.Remove.js:38, Deluge.Remove.js:55
+// Menus.js:224, RemoveWindow.js:39, RemoveWindow.js:57
GetText.add('Remove Torrent', '${escape(_("Remove Torrent"))}')
-// Deluge.Remove.js:54
+// RemoveWindow.js:56
GetText.add('Remove With Data', '${escape(_("Remove With Data"))}')
-// Deluge.Details.Options.js:253
+// OptionsTab.js:253
GetText.add('Remove at ratio', '${escape(_("Remove at ratio"))}')
-// Deluge.Preferences.Queue.js:209
+// QueuePage.js:198
GetText.add('Remove torrent when share ratio is reached', '${escape(_("Remove torrent when share ratio is reached"))}')
-// Deluge.Toolbar.js:72, Deluge.Menus.js:99
+// Menus.js:94, Toolbar.js:76
GetText.add('Resume', '${escape(_("Resume"))}')
-// Deluge.EditTrackers.js:117
+// EditTrackerWindow.js:57
GetText.add('Save', '${escape(_("Save"))}')
-// Deluge.Preferences.Queue.js:154
+// TorrentGrid.js:200
+GetText.add('Save Path', '${escape(_("Save Path"))}')
+
+// QueuePage.js:149
GetText.add('Seed Time (m)', '${escape(_("Seed Time (m)"))}')
-// Deluge.Torrents.js:142
+// TorrentGrid.js:134, TorrentGrid.js:255
GetText.add('Seeders', '${escape(_("Seeders"))}')
-// Deluge.Preferences.Queue.js:123
+// QueuePage.js:120
GetText.add('Seeding', '${escape(_("Seeding"))}')
-// Deluge.Add.File.js:66
+// FileWindow.js:66
GetText.add('Select a torrent', '${escape(_("Select a torrent"))}')
-// Deluge.Preferences.Plugins.js:70
+// InstallPluginWindow.js:65
GetText.add('Select an egg', '${escape(_("Select an egg"))}')
-// Deluge.Preferences.Interface.js:130
+// InterfacePage.js:129
GetText.add('Server', '${escape(_("Server"))}')
-// Deluge.Preferences.Interface.js:141
+// InterfacePage.js:140
GetText.add('Session Timeout', '${escape(_("Session Timeout"))}')
-// Deluge.Preferences.Cache.js:53, Deluge.Preferences.Encryption.js:53
+// Statusbar.js:96
+GetText.add('Set Maximum Connections', '${escape(_("Set Maximum Connections"))}')
+
+// Statusbar.js:143
+GetText.add('Set Maximum Download Speed', '${escape(_("Set Maximum Download Speed"))}')
+
+// Statusbar.js:191
+GetText.add('Set Maximum Upload Speed', '${escape(_("Set Maximum Upload Speed"))}')
+
+// EncryptionPage.js:51, CachePage.js:52
GetText.add('Settings', '${escape(_("Settings"))}')
-// Deluge.Preferences.Queue.js:130
+// QueuePage.js:127
GetText.add('Share Ratio Limit', '${escape(_("Share Ratio Limit"))}')
-// Deluge.Preferences.Queue.js:142
+// QueuePage.js:138
GetText.add('Share Time Ratio', '${escape(_("Share Time Ratio"))}')
-// Deluge.Preferences.Interface.js:72
+// TorrentGrid.js:220
+GetText.add('Shared', '${escape(_("Shared"))}')
+
+// InterfacePage.js:71
GetText.add('Show filters with zero torrents', '${escape(_("Show filters with zero torrents"))}')
-// Deluge.Preferences.Interface.js:65
+// InterfacePage.js:64
GetText.add('Show session speed in titlebar', '${escape(_("Show session speed in titlebar"))}')
-// Deluge.Preferences.Interface.js:79
-GetText.add('Show trackers with zero torrents', '${escape(_("Show trackers with zero torrents"))}')
-
-// Deluge.Add.js:67, Deluge.Details.Files.js:57, Deluge.Torrents.js:130
+// TorrentGrid.js:122, FilesTab.js:44, FilesTab.js:54
GetText.add('Size', '${escape(_("Size"))}')
-// Deluge.Preferences.Proxy.js:58
+// ProxyField.js:56
GetText.add('Socksv4', '${escape(_("Socksv4"))}')
-// Deluge.Preferences.Proxy.js:59
+// ProxyField.js:57
GetText.add('Socksv5', '${escape(_("Socksv5"))}')
-// Deluge.Preferences.Proxy.js:60
+// ProxyField.js:58
GetText.add('Socksv5 with Auth', '${escape(_("Socksv5 with Auth"))}')
-// Deluge.ConnectionManager.js:291
+// ConnectionManager.js:191
GetText.add('Start Daemon', '${escape(_("Start Daemon"))}')
-// Deluge.Sidebar.js:37
+// Sidebar.js:34
GetText.add('State', '${escape(_("State"))}')
-// Deluge.ConnectionManager.js:186, Deluge.Details.Status.js:35
+// ConnectionManager.js:68, StatusTab.js:39, DetailsTab.js:52
GetText.add('Status', '${escape(_("Status"))}')
-// Deluge.ConnectionManager.js:237, Deluge.ConnectionManager.js:297, Deluge.ConnectionManager.js:415
+// ConnectionManager.js:115, ConnectionManager.js:197, ConnectionManager.js:328
GetText.add('Stop Daemon', '${escape(_("Stop Daemon"))}')
-// Deluge.Details.Options.js:225
+// OptionsTab.js:225
GetText.add('Stop seed at ratio', '${escape(_("Stop seed at ratio"))}')
-// Deluge.Preferences.Queue.js:183
+// QueuePage.js:175
GetText.add('Stop seeding when share ratio reaches:', '${escape(_("Stop seeding when share ratio reaches:"))}')
-// Deluge.Preferences.Other.js:69
+// OtherPage.js:72
GetText.add('System Information', '${escape(_("System Information"))}')
-// Deluge.Preferences.Network.js:177
+// NetworkPage.js:173
GetText.add('TOS', '${escape(_("TOS"))}')
-// Deluge.EditTrackers.js:198
+// EditTrackersWindow.js:76
GetText.add('Tier', '${escape(_("Tier"))}')
-// Deluge.Menus.js:192
+// Menus.js:186
GetText.add('Top', '${escape(_("Top"))}')
-// Deluge.Preferences.Queue.js:77
+// QueuePage.js:76
GetText.add('Total Active', '${escape(_("Total Active"))}')
-// Deluge.Preferences.Queue.js:89
+// QueuePage.js:85
GetText.add('Total Active Downloading', '${escape(_("Total Active Downloading"))}')
-// Deluge.Preferences.Queue.js:101
+// QueuePage.js:94
GetText.add('Total Active Seeding', '${escape(_("Total Active Seeding"))}')
-// Deluge.Preferences.Proxy.js:196, Deluge.Torrents.js:190, Deluge.EditTrackers.js:126, Deluge.EditTrackers.js:205
+// DetailsTab.js:49
+GetText.add('Total Size', '${escape(_("Total Size"))}')
+
+// EditTrackersWindow.js:80, TorrentGrid.js:193, EditTrackerWindow.js:66, DetailsTab.js:53, ProxyPage.js:64
GetText.add('Tracker', '${escape(_("Tracker"))}')
-// Deluge.Sidebar.js:38
+// Sidebar.js:35
GetText.add('Tracker Host', '${escape(_("Tracker Host"))}')
-// Deluge.EditTrackers.js:67
+// AddTrackerWindow.js:66
GetText.add('Trackers', '${escape(_("Trackers"))}')
-// Deluge.Preferences.Proxy.js:50
+// ProxyField.js:48
GetText.add('Type', '${escape(_("Type"))}')
-// Deluge.Menus.js:127
+// Menus.js:121
GetText.add('U/L Speed Limit', '${escape(_("U/L Speed Limit"))}')
-// Deluge.Preferences.Network.js:203
+// NetworkPage.js:199
GetText.add('UPnP', '${escape(_("UPnP"))}')
-// Deluge.Menus.js:123, Deluge.Menus.js:141, Deluge.Menus.js:159, Deluge.Menus.js:177, Deluge.Menus.js:295, Deluge.Menus.js:342, Deluge.Menus.js:389
+// OptionsPanel.js:142
+GetText.add('Unable to set file priority!', '${escape(_("Unable to set file priority!"))}')
+
+// Statusbar.js:85, Statusbar.js:133, Statusbar.js:181, Menus.js:117, Menus.js:135, Menus.js:153, Menus.js:171
GetText.add('Unlimited', '${escape(_("Unlimited"))}')
-// Deluge.Toolbar.js:79, Deluge.Menus.js:198, Deluge.EditTrackers.js:225
+// EditTrackersWindow.js:102, Menus.js:192, Toolbar.js:83, FileBrowser.js:53
GetText.add('Up', '${escape(_("Up"))}')
-// Deluge.Torrents.js:160
+// TorrentGrid.js:248
+GetText.add('Up Limit', '${escape(_("Up Limit"))}')
+
+// TorrentGrid.js:154
GetText.add('Up Speed', '${escape(_("Up Speed"))}')
-// Deluge.Menus.js:218
+// Menus.js:212
GetText.add('Update Tracker', '${escape(_("Update Tracker"))}')
-// Deluge.Preferences.Other.js:53
+// OtherPage.js:56
GetText.add('Updates', '${escape(_("Updates"))}')
-// Deluge.Menus.js:163
+// Menus.js:157
GetText.add('Upload Slot Limit', '${escape(_("Upload Slot Limit"))}')
-// Deluge.Statusbar.js:39
+// Statusbar.js:152
GetText.add('Upload Speed', '${escape(_("Upload Speed"))}')
-// Deluge.Preferences.Plugins.js:83
+// TorrentGrid.js:234
+GetText.add('Uploaded', '${escape(_("Uploaded"))}')
+
+// InstallPluginWindow.js:78
GetText.add('Uploading your plugin...', '${escape(_("Uploading your plugin..."))}')
-// Deluge.Add.File.js:81
+// FileWindow.js:82
GetText.add('Uploading your torrent...', '${escape(_("Uploading your torrent..."))}')
-// Deluge.Add.Url.js:65, Deluge.Add.js:437
+// UrlWindow.js:60, AddWindow.js:102
GetText.add('Url', '${escape(_("Url"))}')
-// Deluge.Preferences.Downloads.js:117
+// DownloadsPage.js:121
GetText.add('Use Compact', '${escape(_("Use Compact"))}')
-// Deluge.Preferences.Downloads.js:114
+// DownloadsPage.js:118
GetText.add('Use Full', '${escape(_("Use Full"))}')
-// Deluge.Preferences.Network.js:62, Deluge.Preferences.Network.js:117
+// NetworkPage.js:60, NetworkPage.js:113
GetText.add('Use Random Ports', '${escape(_("Use Random Ports"))}')
-// Deluge.Preferences.Interface.js:165
+// InterfacePage.js:158
GetText.add('Use SSL (paths relative to Deluge config folder)', '${escape(_("Use SSL (paths relative to Deluge config folder)"))}')
-// Deluge.ConnectionManager.js:101, Deluge.Preferences.Proxy.js:93
+// AddConnectionWindow.js:83, ProxyField.js:88
GetText.add('Username', '${escape(_("Username"))}')
-// Deluge.ConnectionManager.js:199
+// ConnectionManager.js:80
GetText.add('Version', '${escape(_("Version"))}')
-// Deluge.Preferences.Proxy.js:190
+// ProxyPage.js:58
GetText.add('Web Seed', '${escape(_("Web Seed"))}')
-// Deluge.Preferences.Other.js:87
+// OtherPage.js:90
GetText.add('Yes, please send anonymous statistics', '${escape(_("Yes, please send anonymous statistics"))}')
-// Deluge.Login.js:140
+// LoginWindow.js:131
GetText.add('You entered an incorrect password', '${escape(_("You entered an incorrect password"))}')
-// Deluge.Preferences.Interface.js:218
+// InterfacePage.js:215
GetText.add('Your old password was incorrect!', '${escape(_("Your old password was incorrect!"))}')
-// Deluge.Preferences.Interface.js:228
+// InterfacePage.js:225
GetText.add('Your password was successfully changed!', '${escape(_("Your password was successfully changed!"))}')
-// Deluge.Preferences.Interface.js:203
+// InterfacePage.js:200
GetText.add('Your passwords don\'t match!', '${escape(_("Your passwords don\'t match!"))}')
-
diff --git a/deluge/ui/web/icons/readme.txt b/deluge/ui/web/icons/readme.txt
deleted file mode 100644
index 66049b810..000000000
--- a/deluge/ui/web/icons/readme.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-images from the fruge icon set.
-See LICENSE for a list of icons not taken from fruge.
diff --git a/deluge/ui/web/images/debugerror.png b/deluge/ui/web/images/debugerror.png
deleted file mode 100644
index fedb1a724..000000000
Binary files a/deluge/ui/web/images/debugerror.png and /dev/null differ
diff --git a/deluge/ui/web/images/deluge-icon.png b/deluge/ui/web/images/deluge-icon.png
deleted file mode 100644
index e39cd0c7e..000000000
Binary files a/deluge/ui/web/images/deluge-icon.png and /dev/null differ
diff --git a/deluge/ui/web/images/deluge16.png b/deluge/ui/web/images/deluge16.png
deleted file mode 100644
index e39cd0c7e..000000000
Binary files a/deluge/ui/web/images/deluge16.png and /dev/null differ
diff --git a/deluge/ui/web/images/deluge32.png b/deluge/ui/web/images/deluge32.png
deleted file mode 100644
index 2d272f2ea..000000000
Binary files a/deluge/ui/web/images/deluge32.png and /dev/null differ
diff --git a/deluge/ui/web/images/deluge_icon.gif b/deluge/ui/web/images/deluge_icon.gif
deleted file mode 100644
index f00149312..000000000
Binary files a/deluge/ui/web/images/deluge_icon.gif and /dev/null differ
diff --git a/deluge/ui/web/js/deluge-all-debug.js b/deluge/ui/web/js/deluge-all-debug.js
index 390f3f970..ce56ad132 100644
--- a/deluge/ui/web/js/deluge-all-debug.js
+++ b/deluge/ui/web/js/deluge-all-debug.js
@@ -1,6 +1,6 @@
/*!
* Deluge.data.SortTypes.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -39,7 +39,7 @@ Ext.namespace('Deluge.data');
*
* @class Deluge.data.SortTypes
* @singleton
- */
+ */
Deluge.data.SortTypes = {
asIPAddress: function(value) {
var d = value.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);
@@ -48,6 +48,10 @@ Deluge.data.SortTypes = {
asQueuePosition: function(value) {
return (value > -1) ? value : Number.MAX_VALUE;
+ },
+
+ asName: function(value) {
+ return String(value).toLowerCase();
}
}
/*!
@@ -121,7 +125,7 @@ Deluge.data.Peer = Ext.data.Record.create([
]);
/*!
* Deluge.data.TorrentRecord.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -168,7 +172,8 @@ Deluge.data.Torrent = Ext.data.Record.create([{
type: 'int'
}, {
name: 'name',
- type: 'string'
+ type: 'string',
+ sortType: Deluge.data.SortTypes.asName
}, {
name: 'total_size',
type: 'int'
@@ -349,7 +354,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
title: _('Details'),
fields: {},
-
+ autoScroll: true,
queuedItems: {},
oldData: {},
@@ -428,7 +433,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
});
/*!
* Deluge.details.FilesTab.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -457,12 +462,11 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-
+
Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
title: _('Files'),
- autoScroll: true,
rootVisible: false,
columns: [{
@@ -502,7 +506,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
}
})
}],
-
+
selModel: new Ext.tree.MultiSelectionModel(),
initComponent: function() {
@@ -558,7 +562,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
this.clear();
this.torrentId = torrentId;
}
-
+
deluge.client.web.get_torrent_files(torrentId, {
success: this.onRequestComplete,
scope: this,
@@ -591,7 +595,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
folderSort: true
});
},
-
+
onContextMenu: function(node, e) {
e.stopEvent();
var selModel = this.getSelectionModel();
@@ -601,7 +605,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
}
deluge.menus.filePriorities.showAt(e.getPoint());
},
-
+
onItemClick: function(baseItem, e) {
switch (baseItem.id) {
case 'expandAll':
@@ -628,7 +632,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
return;
}
});
-
+
var priorities = new Array(Ext.keys(indexes).length);
for (var index in indexes) {
priorities[index] = indexes[index];
@@ -645,7 +649,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
break;
}
},
-
+
onRequestComplete: function(files, options) {
if (!this.getRootNode().hasChildNodes()) {
this.createFileTree(files);
@@ -1544,6 +1548,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
}, {
text: _('Infohash'),
iconCls: 'icon-add-magnet',
+ hidden: true,
disabled: true
}, '->', {
text: _('Remove'),
@@ -4392,7 +4397,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
});
/*!
* Deluge.preferences.ProxyPage.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -4432,11 +4437,12 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
config = Ext.apply({
border: false,
title: _('Proxy'),
- layout: 'form'
+ layout: 'form',
+ autoScroll: true
}, config);
Deluge.preferences.Proxy.superclass.constructor.call(this, config);
},
-
+
initComponent: function() {
Deluge.preferences.Proxy.superclass.initComponent.call(this);
this.peer = this.add(new Deluge.preferences.ProxyField({
@@ -4444,28 +4450,28 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
name: 'peer'
}));
this.peer.on('change', this.onProxyChange, this);
-
+
this.web_seed = this.add(new Deluge.preferences.ProxyField({
title: _('Web Seed'),
name: 'web_seed'
}));
this.web_seed.on('change', this.onProxyChange, this);
-
+
this.tracker = this.add(new Deluge.preferences.ProxyField({
title: _('Tracker'),
name: 'tracker'
}));
this.tracker.on('change', this.onProxyChange, this);
-
+
this.dht = this.add(new Deluge.preferences.ProxyField({
title: _('DHT'),
name: 'dht'
}));
this.dht.on('change', this.onProxyChange, this);
-
+
deluge.preferences.getOptionsManager().bind('proxies', this);
},
-
+
getValue: function() {
return {
'dht': this.dht.getValue(),
@@ -4474,18 +4480,18 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
'web_seed': this.web_seed.getValue()
}
},
-
+
setValue: function(value) {
for (var proxy in value) {
this[proxy].setValue(value[proxy]);
}
},
-
+
onProxyChange: function(field, newValue, oldValue) {
var newValues = this.getValue();
var oldValues = Ext.apply({}, newValues);
oldValues[field.getName()] = oldValue;
-
+
this.fireEvent('change', this, newValues, oldValues);
}
});
@@ -7039,7 +7045,7 @@ Ext.each(Deluge.Keys.Grid, function(key) {
});
/*!
* Deluge.LoginWindow.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -7070,7 +7076,7 @@ Ext.each(Deluge.Keys.Grid, function(key) {
*/
Deluge.LoginWindow = Ext.extend(Ext.Window, {
-
+
firstShow: true,
bodyStyle: 'padding: 10px 5px;',
buttonAlign: 'center',
@@ -7084,36 +7090,39 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
title: _('Login'),
width: 300,
height: 120,
-
+
initComponent: function() {
Deluge.LoginWindow.superclass.initComponent.call(this);
this.on('show', this.onShow, this);
-
+
this.addButton({
text: _('Login'),
handler: this.onLogin,
scope: this
});
-
+
this.form = this.add({
xtype: 'form',
baseCls: 'x-plain',
- labelWidth: 55,
- width: 300,
- defaults: {width: 200},
+ labelWidth: 120,
+ labelAlign: 'right',
+ defaults: {width: 110},
defaultType: 'textfield'
});
this.passwordField = this.form.add({
xtype: 'textfield',
fieldLabel: _('Password'),
+ grow: true,
+ growMin: '110',
+ growMax: '145',
id: '_password',
name: 'password',
inputType: 'password'
});
this.passwordField.on('specialkey', this.onSpecialKey, this);
},
-
+
logout: function() {
deluge.events.fire('logout');
deluge.client.auth.delete_session({
@@ -7123,17 +7132,17 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
scope: this
});
},
-
+
show: function(skipCheck) {
if (this.firstShow) {
deluge.client.on('error', this.onClientError, this);
this.firstShow = false;
}
-
+
if (skipCheck) {
return Deluge.LoginWindow.superclass.show.call(this);
}
-
+
deluge.client.auth.check_session({
success: function(result) {
if (result) {
@@ -7148,11 +7157,11 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
scope: this
});
},
-
+
onSpecialKey: function(field, e) {
if (e.getKey() == 13) this.onLogin();
},
-
+
onLogin: function() {
var passwordField = this.passwordField;
deluge.client.auth.login(passwordField.getValue(), {
@@ -7178,16 +7187,16 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
scope: this
});
},
-
+
onClientError: function(errorObj, response, requestOptions) {
if (errorObj.error.code == 1) {
deluge.events.fire('logout');
this.show(true);
}
},
-
+
onShow: function() {
- this.passwordField.focus(true, 100);
+ this.passwordField.focus(true, 300);
}
});
/*!
@@ -9046,7 +9055,7 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
idProperty: 'id',
fields: [
{name: 'queue', sortType: Deluge.data.SortTypes.asQueuePosition},
- {name: 'name'},
+ {name: 'name', sortType: Deluge.data.SortTypes.asName},
{name: 'total_size', type: 'int'},
{name: 'state'},
{name: 'progress', type: 'float'},
@@ -9055,7 +9064,7 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
{name: 'num_peers', type: 'int'},
{name: 'total_peers', type: 'int'},
{name: 'download_payload_rate', type: 'int'},
- {name: 'upload_payload_speed', type: 'int'},
+ {name: 'upload_payload_rate', type: 'int'},
{name: 'eta', type: 'int', sortType: etaSorter},
{name: 'ratio', type: 'float'},
{name: 'distributed_copies', type: 'float'},
diff --git a/deluge/ui/web/js/deluge-all.js b/deluge/ui/web/js/deluge-all.js
index 7348b402f..c78359c45 100644
--- a/deluge/ui/web/js/deluge-all.js
+++ b/deluge/ui/web/js/deluge-all.js
@@ -1,6 +1,6 @@
/*
* Deluge.data.SortTypes.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -29,7 +29,7 @@
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Ext.namespace("Deluge.data");Deluge.data.SortTypes={asIPAddress:function(a){var b=a.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);return((((((+b[1])*256)+(+b[2]))*256)+(+b[3]))*256)+(+b[4])},asQueuePosition:function(a){return(a>-1)?a:Number.MAX_VALUE}}
+Ext.namespace("Deluge.data");Deluge.data.SortTypes={asIPAddress:function(a){var b=a.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);return((((((+b[1])*256)+(+b[2]))*256)+(+b[3]))*256)+(+b[4])},asQueuePosition:function(a){return(a>-1)?a:Number.MAX_VALUE},asName:function(a){return String(a).toLowerCase()}}
/*
* Deluge.data.PeerRecord.js
*
@@ -64,7 +64,7 @@ Ext.namespace("Deluge.data");Deluge.data.SortTypes={asIPAddress:function(a){var
;Ext.namespace("Deluge.data");Deluge.data.Peer=Ext.data.Record.create([{name:"country",type:"string"},{name:"ip",type:"string",sortType:Deluge.data.SortTypes.asIPAddress},{name:"client",type:"string"},{name:"progress",type:"float"},{name:"down_speed",type:"int"},{name:"up_speed",type:"int"},{name:"seed",type:"int"}]);
/*
* Deluge.data.TorrentRecord.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -93,7 +93,7 @@ Ext.namespace("Deluge.data");Deluge.data.SortTypes={asIPAddress:function(a){var
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Ext.namespace("Deluge.data");Deluge.data.Torrent=Ext.data.Record.create([{name:"queue",type:"int"},{name:"name",type:"string"},{name:"total_size",type:"int"},{name:"state",type:"string"},{name:"progress",type:"int"},{name:"num_seeds",type:"int"},{name:"total_seeds",type:"int"},{name:"num_peers",type:"int"},{name:"total_peers",type:"int"},{name:"download_payload_rate",type:"int"},{name:"upload_payload_rate",type:"int"},{name:"eta",type:"int"},{name:"ratio",type:"float"},{name:"distributed_copies",type:"float"},{name:"time_added",type:"int"},{name:"tracker_host",type:"string"}]);
+Ext.namespace("Deluge.data");Deluge.data.Torrent=Ext.data.Record.create([{name:"queue",type:"int"},{name:"name",type:"string",sortType:Deluge.data.SortTypes.asName},{name:"total_size",type:"int"},{name:"state",type:"string"},{name:"progress",type:"int"},{name:"num_seeds",type:"int"},{name:"total_seeds",type:"int"},{name:"num_peers",type:"int"},{name:"total_peers",type:"int"},{name:"download_payload_rate",type:"int"},{name:"upload_payload_rate",type:"int"},{name:"eta",type:"int"},{name:"ratio",type:"float"},{name:"distributed_copies",type:"float"},{name:"time_added",type:"int"},{name:"tracker_host",type:"string"}]);
/*
* Deluge.details.DetailsPanel.js
*
@@ -125,10 +125,10 @@ Ext.namespace("Deluge.data");Deluge.data.Torrent=Ext.data.Record.create([{name:"
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Ext.namespace("Deluge.details");Deluge.details.DetailsPanel=Ext.extend(Ext.TabPanel,{id:"torrentDetails",activeTab:0,initComponent:function(){Deluge.details.DetailsPanel.superclass.initComponent.call(this);this.add(new Deluge.details.StatusTab());this.add(new Deluge.details.DetailsTab());this.add(new Deluge.details.FilesTab());this.add(new Deluge.details.PeersTab());this.add(new Deluge.details.OptionsTab())},clear:function(){this.items.each(function(a){if(a.clear){a.clear.defer(100,a);a.disable()}})},update:function(a){var b=deluge.torrents.getSelected();if(!b){this.clear();return}this.items.each(function(c){if(c.disabled){c.enable()}});a=a||this.getActiveTab();if(a.update){a.update(b.id)}},onRender:function(b,a){Deluge.details.DetailsPanel.superclass.onRender.call(this,b,a);deluge.events.on("disconnect",this.clear,this);deluge.torrents.on("rowclick",this.onTorrentsClick,this);this.on("tabchange",this.onTabChange,this);deluge.torrents.getSelectionModel().on("selectionchange",function(c){if(!c.hasSelection()){this.clear()}},this)},onTabChange:function(a,b){this.update(b)},onTorrentsClick:function(a,c,b){this.update()}});Deluge.details.DetailsTab=Ext.extend(Ext.Panel,{title:_("Details"),fields:{},queuedItems:{},oldData:{},initComponent:function(){Deluge.details.DetailsTab.superclass.initComponent.call(this);this.addItem("torrent_name",_("Name"));this.addItem("hash",_("Hash"));this.addItem("path",_("Path"));this.addItem("size",_("Total Size"));this.addItem("files",_("# of files"));this.addItem("comment",_("Comment"));this.addItem("status",_("Status"));this.addItem("tracker",_("Tracker"))},onRender:function(b,a){Deluge.details.DetailsTab.superclass.onRender.call(this,b,a);this.body.setStyle("padding","10px");this.dl=Ext.DomHelper.append(this.body,{tag:"dl"},true);for(var c in this.queuedItems){this.doAddItem(c,this.queuedItems[c])}},addItem:function(b,a){if(!this.rendered){this.queuedItems[b]=a}else{this.doAddItem(b,a)}},doAddItem:function(b,a){Ext.DomHelper.append(this.dl,{tag:"dt",cls:b,html:a+":"});this.fields[b]=Ext.DomHelper.append(this.dl,{tag:"dd",cls:b,html:""},true)},clear:function(){if(!this.fields){return}for(var a in this.fields){this.fields[a].dom.innerHTML=""}this.oldData={}},update:function(a){deluge.client.web.get_torrent_status(a,Deluge.Keys.Details,{success:this.onRequestComplete,scope:this,torrentId:a})},onRequestComplete:function(e,c,a,b){var d={torrent_name:e.name,hash:b.options.torrentId,path:e.save_path,size:fsize(e.total_size),files:e.num_files,status:e.message,tracker:e.tracker,comment:e.comment};for(var f in this.fields){if(!Ext.isDefined(d[f])){continue}if(d[f]==this.oldData[f]){continue}this.fields[f].dom.innerHTML=Ext.escapeHTML(d[f])}this.oldData=d}});
+Ext.namespace("Deluge.details");Deluge.details.DetailsPanel=Ext.extend(Ext.TabPanel,{id:"torrentDetails",activeTab:0,initComponent:function(){Deluge.details.DetailsPanel.superclass.initComponent.call(this);this.add(new Deluge.details.StatusTab());this.add(new Deluge.details.DetailsTab());this.add(new Deluge.details.FilesTab());this.add(new Deluge.details.PeersTab());this.add(new Deluge.details.OptionsTab())},clear:function(){this.items.each(function(a){if(a.clear){a.clear.defer(100,a);a.disable()}})},update:function(a){var b=deluge.torrents.getSelected();if(!b){this.clear();return}this.items.each(function(c){if(c.disabled){c.enable()}});a=a||this.getActiveTab();if(a.update){a.update(b.id)}},onRender:function(b,a){Deluge.details.DetailsPanel.superclass.onRender.call(this,b,a);deluge.events.on("disconnect",this.clear,this);deluge.torrents.on("rowclick",this.onTorrentsClick,this);this.on("tabchange",this.onTabChange,this);deluge.torrents.getSelectionModel().on("selectionchange",function(c){if(!c.hasSelection()){this.clear()}},this)},onTabChange:function(a,b){this.update(b)},onTorrentsClick:function(a,c,b){this.update()}});Deluge.details.DetailsTab=Ext.extend(Ext.Panel,{title:_("Details"),fields:{},autoScroll:true,queuedItems:{},oldData:{},initComponent:function(){Deluge.details.DetailsTab.superclass.initComponent.call(this);this.addItem("torrent_name",_("Name"));this.addItem("hash",_("Hash"));this.addItem("path",_("Path"));this.addItem("size",_("Total Size"));this.addItem("files",_("# of files"));this.addItem("comment",_("Comment"));this.addItem("status",_("Status"));this.addItem("tracker",_("Tracker"))},onRender:function(b,a){Deluge.details.DetailsTab.superclass.onRender.call(this,b,a);this.body.setStyle("padding","10px");this.dl=Ext.DomHelper.append(this.body,{tag:"dl"},true);for(var c in this.queuedItems){this.doAddItem(c,this.queuedItems[c])}},addItem:function(b,a){if(!this.rendered){this.queuedItems[b]=a}else{this.doAddItem(b,a)}},doAddItem:function(b,a){Ext.DomHelper.append(this.dl,{tag:"dt",cls:b,html:a+":"});this.fields[b]=Ext.DomHelper.append(this.dl,{tag:"dd",cls:b,html:""},true)},clear:function(){if(!this.fields){return}for(var a in this.fields){this.fields[a].dom.innerHTML=""}this.oldData={}},update:function(a){deluge.client.web.get_torrent_status(a,Deluge.Keys.Details,{success:this.onRequestComplete,scope:this,torrentId:a})},onRequestComplete:function(e,c,a,b){var d={torrent_name:e.name,hash:b.options.torrentId,path:e.save_path,size:fsize(e.total_size),files:e.num_files,status:e.message,tracker:e.tracker,comment:e.comment};for(var f in this.fields){if(!Ext.isDefined(d[f])){continue}if(d[f]==this.oldData[f]){continue}this.fields[f].dom.innerHTML=Ext.escapeHTML(d[f])}this.oldData=d}});
/*
* Deluge.details.FilesTab.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -157,7 +157,7 @@ Ext.namespace("Deluge.details");Deluge.details.DetailsPanel=Ext.extend(Ext.TabPa
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Deluge.details.FilesTab=Ext.extend(Ext.ux.tree.TreeGrid,{title:_("Files"),autoScroll:true,rootVisible:false,columns:[{header:_("Filename"),width:330,dataIndex:"filename"},{header:_("Size"),width:150,dataIndex:"size",tpl:new Ext.XTemplate("{size:this.fsize}",{fsize:function(a){return fsize(a)}})},{xtype:"tgrendercolumn",header:_("Progress"),width:150,dataIndex:"progress",renderer:function(a){var b=a*100;return Deluge.progressBar(b,this.col.width,b.toFixed(2)+"%",0)}},{header:_("Priority"),width:150,dataIndex:"priority",tpl:new Ext.XTemplate('
{priority:this.getName}
',{getClass:function(a){return FILE_PRIORITY_CSS[a]},getName:function(a){return _(FILE_PRIORITY[a])}})}],selModel:new Ext.tree.MultiSelectionModel(),initComponent:function(){Deluge.details.FilesTab.superclass.initComponent.call(this);this.setRootNode(new Ext.tree.TreeNode({text:"Files"}))},clear:function(){var a=this.getRootNode();if(!a.hasChildNodes()){return}a.cascade(function(c){var b=c.parentNode;if(!b){return}if(!b.ownerTree){return}b.removeChild(c)})},createFileTree:function(c){function b(g,d){for(var e in g.contents){var f=g.contents[e];if(f.type=="dir"){b(f,d.appendChild(new Ext.tree.TreeNode({text:e,filename:e,size:f.size,progress:f.progress,priority:f.priority})))}else{d.appendChild(new Ext.tree.TreeNode({text:e,filename:e,fileIndex:f.index,size:f.size,progress:f.progress,priority:f.priority,leaf:true,iconCls:"x-deluge-file",uiProvider:Ext.ux.tree.TreeGridNodeUI}))}}}var a=this.getRootNode();b(c,a);a.firstChild.expand()},update:function(a){if(this.torrentId!=a){this.clear();this.torrentId=a}deluge.client.web.get_torrent_files(a,{success:this.onRequestComplete,scope:this,torrentId:a})},updateFileTree:function(b){function a(g,c){for(var d in g.contents){var f=g.contents[d];var e=c.findChild("filename",d);e.attributes.size=f.size;e.attributes.progress=f.progress;e.attributes.priority=f.priority;e.ui.updateColumns();if(f.type=="dir"){a(f,e)}}}a(b,this.getRootNode())},onRender:function(b,a){Deluge.details.FilesTab.superclass.onRender.call(this,b,a);deluge.menus.filePriorities.on("itemclick",this.onItemClick,this);this.on("contextmenu",this.onContextMenu,this);this.sorter=new Ext.tree.TreeSorter(this,{folderSort:true})},onContextMenu:function(b,c){c.stopEvent();var a=this.getSelectionModel();if(a.getSelectedNodes().length<2){a.clearSelections();b.select()}deluge.menus.filePriorities.showAt(c.getPoint())},onItemClick:function(h,g){switch(h.id){case"expandAll":this.expandAll();break;default:var f={};function a(e){if(Ext.isEmpty(e.attributes.fileIndex)){return}f[e.attributes.fileIndex]=e.attributes.priority}this.getRootNode().cascade(a);var b=this.getSelectionModel().getSelectedNodes();Ext.each(b,function(i){if(!i.isLeaf()){function e(j){if(Ext.isEmpty(j.attributes.fileIndex)){return}f[j.attributes.fileIndex]=h.filePriority}i.cascade(e)}else{if(!Ext.isEmpty(i.attributes.fileIndex)){f[i.attributes.fileIndex]=h.filePriority;return}}});var d=new Array(Ext.keys(f).length);for(var c in f){d[c]=f[c]}deluge.client.core.set_torrent_file_priorities(this.torrentId,d,{success:function(){Ext.each(b,function(e){e.setColumnValue(3,h.filePriority)})},scope:this});break}},onRequestComplete:function(b,a){if(!this.getRootNode().hasChildNodes()){this.createFileTree(b)}else{this.updateFileTree(b)}}});
+Deluge.details.FilesTab=Ext.extend(Ext.ux.tree.TreeGrid,{title:_("Files"),rootVisible:false,columns:[{header:_("Filename"),width:330,dataIndex:"filename"},{header:_("Size"),width:150,dataIndex:"size",tpl:new Ext.XTemplate("{size:this.fsize}",{fsize:function(a){return fsize(a)}})},{xtype:"tgrendercolumn",header:_("Progress"),width:150,dataIndex:"progress",renderer:function(a){var b=a*100;return Deluge.progressBar(b,this.col.width,b.toFixed(2)+"%",0)}},{header:_("Priority"),width:150,dataIndex:"priority",tpl:new Ext.XTemplate('
{priority:this.getName}
',{getClass:function(a){return FILE_PRIORITY_CSS[a]},getName:function(a){return _(FILE_PRIORITY[a])}})}],selModel:new Ext.tree.MultiSelectionModel(),initComponent:function(){Deluge.details.FilesTab.superclass.initComponent.call(this);this.setRootNode(new Ext.tree.TreeNode({text:"Files"}))},clear:function(){var a=this.getRootNode();if(!a.hasChildNodes()){return}a.cascade(function(c){var b=c.parentNode;if(!b){return}if(!b.ownerTree){return}b.removeChild(c)})},createFileTree:function(c){function b(g,d){for(var e in g.contents){var f=g.contents[e];if(f.type=="dir"){b(f,d.appendChild(new Ext.tree.TreeNode({text:e,filename:e,size:f.size,progress:f.progress,priority:f.priority})))}else{d.appendChild(new Ext.tree.TreeNode({text:e,filename:e,fileIndex:f.index,size:f.size,progress:f.progress,priority:f.priority,leaf:true,iconCls:"x-deluge-file",uiProvider:Ext.ux.tree.TreeGridNodeUI}))}}}var a=this.getRootNode();b(c,a);a.firstChild.expand()},update:function(a){if(this.torrentId!=a){this.clear();this.torrentId=a}deluge.client.web.get_torrent_files(a,{success:this.onRequestComplete,scope:this,torrentId:a})},updateFileTree:function(b){function a(g,c){for(var d in g.contents){var f=g.contents[d];var e=c.findChild("filename",d);e.attributes.size=f.size;e.attributes.progress=f.progress;e.attributes.priority=f.priority;e.ui.updateColumns();if(f.type=="dir"){a(f,e)}}}a(b,this.getRootNode())},onRender:function(b,a){Deluge.details.FilesTab.superclass.onRender.call(this,b,a);deluge.menus.filePriorities.on("itemclick",this.onItemClick,this);this.on("contextmenu",this.onContextMenu,this);this.sorter=new Ext.tree.TreeSorter(this,{folderSort:true})},onContextMenu:function(b,c){c.stopEvent();var a=this.getSelectionModel();if(a.getSelectedNodes().length<2){a.clearSelections();b.select()}deluge.menus.filePriorities.showAt(c.getPoint())},onItemClick:function(h,g){switch(h.id){case"expandAll":this.expandAll();break;default:var f={};function a(e){if(Ext.isEmpty(e.attributes.fileIndex)){return}f[e.attributes.fileIndex]=e.attributes.priority}this.getRootNode().cascade(a);var b=this.getSelectionModel().getSelectedNodes();Ext.each(b,function(i){if(!i.isLeaf()){function e(j){if(Ext.isEmpty(j.attributes.fileIndex)){return}f[j.attributes.fileIndex]=h.filePriority}i.cascade(e)}else{if(!Ext.isEmpty(i.attributes.fileIndex)){f[i.attributes.fileIndex]=h.filePriority;return}}});var d=new Array(Ext.keys(f).length);for(var c in f){d[c]=f[c]}deluge.client.core.set_torrent_file_priorities(this.torrentId,d,{success:function(){Ext.each(b,function(e){e.setColumnValue(3,h.filePriority)})},scope:this});break}},onRequestComplete:function(b,a){if(!this.getRootNode().hasChildNodes()){this.createFileTree(b)}else{this.updateFileTree(b)}}});
/*
* Deluge.details.OptionsTab.js
*
@@ -317,7 +317,7 @@ Ext.ns("Deluge.add");Deluge.add.Window=Ext.extend(Ext.Window,{initComponent:func
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Ext.namespace("Deluge.add");Deluge.add.AddWindow=Ext.extend(Deluge.add.Window,{title:_("Add Torrents"),layout:"border",width:470,height:450,bodyStyle:"padding: 10px 5px;",buttonAlign:"right",closeAction:"hide",closable:true,plain:true,iconCls:"x-deluge-add-window-icon",initComponent:function(){Deluge.add.AddWindow.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancelClick,this);this.addButton(_("Add"),this.onAddClick,this);function a(c,d,b){if(b.data.info_hash){return String.format('
',c)}}this.list=new Ext.list.ListView({store:new Ext.data.SimpleStore({fields:[{name:"info_hash",mapping:1},{name:"text",mapping:2}],id:0}),columns:[{id:"torrent",width:150,sortable:true,renderer:a,dataIndex:"text"}],stripeRows:true,singleSelect:true,listeners:{selectionchange:{fn:this.onSelect,scope:this}},hideHeaders:true,autoExpandColumn:"torrent",height:"100%",autoScroll:true});this.add({region:"center",items:[this.list],margins:"5 5 5 5",bbar:new Ext.Toolbar({items:[{iconCls:"x-deluge-add-file",text:_("File"),handler:this.onFile,scope:this},{text:_("Url"),iconCls:"icon-add-url",handler:this.onUrl,scope:this},{text:_("Infohash"),iconCls:"icon-add-magnet",hidden:true,disabled:true},"->",{text:_("Remove"),iconCls:"icon-remove",handler:this.onRemove,scope:this}]})});this.optionsPanel=this.add(new Deluge.add.OptionsPanel());this.on("hide",this.onHide,this);this.on("show",this.onShow,this)},clear:function(){this.list.getStore().removeAll();this.optionsPanel.clear()},onAddClick:function(){var a=[];if(!this.list){return}this.list.getStore().each(function(b){var c=b.get("info_hash");a.push({path:this.optionsPanel.getFilename(c),options:this.optionsPanel.getOptions(c)})},this);deluge.client.web.add_torrents(a,{success:function(b){}});this.clear();this.hide()},onCancelClick:function(){this.clear();this.hide()},onFile:function(){if(!this.file){this.file=new Deluge.add.FileWindow()}this.file.show()},onHide:function(){this.optionsPanel.setActiveTab(0);this.optionsPanel.files.setDisabled(true);this.optionsPanel.form.setDisabled(true)},onRemove:function(){if(!this.list.getSelectionCount()){return}var a=this.list.getSelectedRecords()[0];this.list.getStore().remove(a);this.optionsPanel.clear();if(this.torrents&&this.torrents[a.id]){delete this.torrents[a.id]}},onSelect:function(c,b){if(b.length){var a=this.list.getRecord(b[0]);this.optionsPanel.setTorrent(a.get("info_hash"))}else{this.optionsPanel.files.setDisabled(true);this.optionsPanel.form.setDisabled(true)}},onShow:function(){if(!this.url){this.url=new Deluge.add.UrlWindow();this.url.on("beforeadd",this.onTorrentBeforeAdd,this);this.url.on("add",this.onTorrentAdd,this)}if(!this.file){this.file=new Deluge.add.FileWindow();this.file.on("beforeadd",this.onTorrentBeforeAdd,this);this.file.on("add",this.onTorrentAdd,this)}this.optionsPanel.form.getDefaults()},onTorrentBeforeAdd:function(b,c){var a=this.list.getStore();a.loadData([[b,null,c]],true)},onTorrentAdd:function(a,c){var b=this.list.getStore().getById(a);if(!c){Ext.MessageBox.show({title:_("Error"),msg:_("Not a valid torrent"),buttons:Ext.MessageBox.OK,modal:false,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});this.list.getStore().remove(b)}else{b.set("info_hash",c.info_hash);b.set("text",c.name);this.list.getStore().commitChanges();this.optionsPanel.addTorrent(c);this.list.select(b)}},onUrl:function(a,b){this.url.show()}});
/*
* Deluge.add.File.js
*
@@ -896,7 +896,7 @@ Ext.namespace("Deluge.preferences");PreferencesRecord=Ext.data.Record.create([{n
Ext.ns("Deluge.preferences");Deluge.preferences.ProxyField=Ext.extend(Ext.form.FieldSet,{border:false,autoHeight:true,labelWidth:70,initComponent:function(){Deluge.preferences.ProxyField.superclass.initComponent.call(this);this.proxyType=this.add({xtype:"combo",fieldLabel:_("Type"),name:"proxytype",mode:"local",width:150,store:new Ext.data.ArrayStore({fields:["id","text"],data:[[0,_("None")],[1,_("Socksv4")],[2,_("Socksv5")],[3,_("Socksv5 with Auth")],[4,_("HTTP")],[5,_("HTTP with Auth")]]}),editable:false,triggerAction:"all",valueField:"id",displayField:"text"});this.hostname=this.add({xtype:"textfield",name:"hostname",fieldLabel:_("Host"),width:220});this.port=this.add({xtype:"spinnerfield",name:"port",fieldLabel:_("Port"),width:80,decimalPrecision:0,minValue:-1,maxValue:99999});this.username=this.add({xtype:"textfield",name:"username",fieldLabel:_("Username"),width:220});this.password=this.add({xtype:"textfield",name:"password",fieldLabel:_("Password"),inputType:"password",width:220});this.proxyType.on("change",this.onFieldChange,this);this.proxyType.on("select",this.onTypeSelect,this);this.setting=false},getName:function(){return this.initialConfig.name},getValue:function(){return{type:this.proxyType.getValue(),hostname:this.hostname.getValue(),port:Number(this.port.getValue()),username:this.username.getValue(),password:this.password.getValue()}},setValue:function(c){this.setting=true;this.proxyType.setValue(c.type);var b=this.proxyType.getStore().find("id",c.type);var a=this.proxyType.getStore().getAt(b);this.hostname.setValue(c.hostname);this.port.setValue(c.port);this.username.setValue(c.username);this.password.setValue(c.password);this.onTypeSelect(this.type,a,b);this.setting=false},onFieldChange:function(e,d,c){if(this.setting){return}var b=this.getValue();var a=Ext.apply({},b);a[e.getName()]=c;this.fireEvent("change",this,b,a)},onTypeSelect:function(d,a,b){var c=a.get("id");if(c>0){this.hostname.show();this.port.show()}else{this.hostname.hide();this.port.hide()}if(c==3||c==5){this.username.show();this.password.show()}else{this.username.hide();this.password.hide()}}});
/*
* Deluge.preferences.ProxyPage.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -925,7 +925,7 @@ Ext.ns("Deluge.preferences");Deluge.preferences.ProxyField=Ext.extend(Ext.form.F
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Ext.namespace("Deluge.preferences");Deluge.preferences.Proxy=Ext.extend(Ext.form.FormPanel,{constructor:function(a){a=Ext.apply({border:false,title:_("Proxy"),layout:"form"},a);Deluge.preferences.Proxy.superclass.constructor.call(this,a)},initComponent:function(){Deluge.preferences.Proxy.superclass.initComponent.call(this);this.peer=this.add(new Deluge.preferences.ProxyField({title:_("Peer"),name:"peer"}));this.peer.on("change",this.onProxyChange,this);this.web_seed=this.add(new Deluge.preferences.ProxyField({title:_("Web Seed"),name:"web_seed"}));this.web_seed.on("change",this.onProxyChange,this);this.tracker=this.add(new Deluge.preferences.ProxyField({title:_("Tracker"),name:"tracker"}));this.tracker.on("change",this.onProxyChange,this);this.dht=this.add(new Deluge.preferences.ProxyField({title:_("DHT"),name:"dht"}));this.dht.on("change",this.onProxyChange,this);deluge.preferences.getOptionsManager().bind("proxies",this)},getValue:function(){return{dht:this.dht.getValue(),peer:this.peer.getValue(),tracker:this.tracker.getValue(),web_seed:this.web_seed.getValue()}},setValue:function(b){for(var a in b){this[a].setValue(b[a])}},onProxyChange:function(e,d,c){var b=this.getValue();var a=Ext.apply({},b);a[e.getName()]=c;this.fireEvent("change",this,b,a)}});
+Ext.namespace("Deluge.preferences");Deluge.preferences.Proxy=Ext.extend(Ext.form.FormPanel,{constructor:function(a){a=Ext.apply({border:false,title:_("Proxy"),layout:"form",autoScroll:true},a);Deluge.preferences.Proxy.superclass.constructor.call(this,a)},initComponent:function(){Deluge.preferences.Proxy.superclass.initComponent.call(this);this.peer=this.add(new Deluge.preferences.ProxyField({title:_("Peer"),name:"peer"}));this.peer.on("change",this.onProxyChange,this);this.web_seed=this.add(new Deluge.preferences.ProxyField({title:_("Web Seed"),name:"web_seed"}));this.web_seed.on("change",this.onProxyChange,this);this.tracker=this.add(new Deluge.preferences.ProxyField({title:_("Tracker"),name:"tracker"}));this.tracker.on("change",this.onProxyChange,this);this.dht=this.add(new Deluge.preferences.ProxyField({title:_("DHT"),name:"dht"}));this.dht.on("change",this.onProxyChange,this);deluge.preferences.getOptionsManager().bind("proxies",this)},getValue:function(){return{dht:this.dht.getValue(),peer:this.peer.getValue(),tracker:this.tracker.getValue(),web_seed:this.web_seed.getValue()}},setValue:function(b){for(var a in b){this[a].setValue(b[a])}},onProxyChange:function(e,d,c){var b=this.getValue();var a=Ext.apply({},b);a[e.getName()]=c;this.fireEvent("change",this,b,a)}});
/*
* Deluge.preferences.QueuePage.js
*
@@ -1408,7 +1408,7 @@ Ext.ns("Deluge");Deluge.FilterPanel=Ext.extend(Ext.Panel,{autoScroll:true,border
Deluge.Keys={Grid:["queue","name","total_size","state","progress","num_seeds","total_seeds","num_peers","total_peers","download_payload_rate","upload_payload_rate","eta","ratio","distributed_copies","is_auto_managed","time_added","tracker_host","save_path","last_seen_complete","total_done","total_uploaded","max_download_speed","max_upload_speed","seeds_peers_ratio"],Status:["total_done","total_payload_download","total_uploaded","total_payload_upload","next_announce","tracker_status","num_pieces","piece_length","is_auto_managed","active_time","seeding_time","seed_rank","last_seen_complete","owner","public","shared"],Files:["files","file_progress","file_priorities"],Peers:["peers"],Details:["name","save_path","total_size","num_files","message","tracker","comment"],Options:["max_download_speed","max_upload_speed","max_connections","max_upload_slots","is_auto_managed","stop_at_ratio","stop_ratio","remove_at_ratio","private","prioritize_first_last","move_completed","move_completed_path"]};Ext.each(Deluge.Keys.Grid,function(a){Deluge.Keys.Status.push(a)});
/*
* Deluge.LoginWindow.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010
*
* This program is free software; you can redistribute it and/or modify
@@ -1437,7 +1437,7 @@ Deluge.Keys={Grid:["queue","name","total_size","state","progress","num_seeds","t
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Deluge.LoginWindow=Ext.extend(Ext.Window,{firstShow:true,bodyStyle:"padding: 10px 5px;",buttonAlign:"center",closable:false,closeAction:"hide",iconCls:"x-deluge-login-window-icon",layout:"fit",modal:true,plain:true,resizable:false,title:_("Login"),width:300,height:120,initComponent:function(){Deluge.LoginWindow.superclass.initComponent.call(this);this.on("show",this.onShow,this);this.addButton({text:_("Login"),handler:this.onLogin,scope:this});this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:55,width:300,defaults:{width:200},defaultType:"textfield"});this.passwordField=this.form.add({xtype:"textfield",fieldLabel:_("Password"),id:"_password",name:"password",inputType:"password"});this.passwordField.on("specialkey",this.onSpecialKey,this)},logout:function(){deluge.events.fire("logout");deluge.client.auth.delete_session({success:function(a){this.show(true)},scope:this})},show:function(a){if(this.firstShow){deluge.client.on("error",this.onClientError,this);this.firstShow=false}if(a){return Deluge.LoginWindow.superclass.show.call(this)}deluge.client.auth.check_session({success:function(b){if(b){deluge.events.fire("login")}else{this.show(true)}},failure:function(b){this.show(true)},scope:this})},onSpecialKey:function(b,a){if(a.getKey()==13){this.onLogin()}},onLogin:function(){var a=this.passwordField;deluge.client.auth.login(a.getValue(),{success:function(b){if(b){deluge.events.fire("login");this.hide();a.setRawValue("")}else{Ext.MessageBox.show({title:_("Login Failed"),msg:_("You entered an incorrect password"),buttons:Ext.MessageBox.OK,modal:false,fn:function(){a.focus(true,10)},icon:Ext.MessageBox.WARNING,iconCls:"x-deluge-icon-warning"})}},scope:this})},onClientError:function(c,b,a){if(c.error.code==1){deluge.events.fire("logout");this.show(true)}},onShow:function(){this.passwordField.focus(true,100)}});
+Deluge.LoginWindow=Ext.extend(Ext.Window,{firstShow:true,bodyStyle:"padding: 10px 5px;",buttonAlign:"center",closable:false,closeAction:"hide",iconCls:"x-deluge-login-window-icon",layout:"fit",modal:true,plain:true,resizable:false,title:_("Login"),width:300,height:120,initComponent:function(){Deluge.LoginWindow.superclass.initComponent.call(this);this.on("show",this.onShow,this);this.addButton({text:_("Login"),handler:this.onLogin,scope:this});this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:120,labelAlign:"right",defaults:{width:110},defaultType:"textfield"});this.passwordField=this.form.add({xtype:"textfield",fieldLabel:_("Password"),grow:true,growMin:"110",growMax:"145",id:"_password",name:"password",inputType:"password"});this.passwordField.on("specialkey",this.onSpecialKey,this)},logout:function(){deluge.events.fire("logout");deluge.client.auth.delete_session({success:function(a){this.show(true)},scope:this})},show:function(a){if(this.firstShow){deluge.client.on("error",this.onClientError,this);this.firstShow=false}if(a){return Deluge.LoginWindow.superclass.show.call(this)}deluge.client.auth.check_session({success:function(b){if(b){deluge.events.fire("login")}else{this.show(true)}},failure:function(b){this.show(true)},scope:this})},onSpecialKey:function(b,a){if(a.getKey()==13){this.onLogin()}},onLogin:function(){var a=this.passwordField;deluge.client.auth.login(a.getValue(),{success:function(b){if(b){deluge.events.fire("login");this.hide();a.setRawValue("")}else{Ext.MessageBox.show({title:_("Login Failed"),msg:_("You entered an incorrect password"),buttons:Ext.MessageBox.OK,modal:false,fn:function(){a.focus(true,10)},icon:Ext.MessageBox.WARNING,iconCls:"x-deluge-icon-warning"})}},scope:this})},onClientError:function(c,b,a){if(c.error.code==1){deluge.events.fire("logout");this.show(true)}},onShow:function(){this.passwordField.focus(true,300)}});
/*
* Deluge.Menus.js
*
@@ -1757,7 +1757,7 @@ Deluge.Toolbar=Ext.extend(Ext.Toolbar,{constructor:function(a){a=Ext.apply({item
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-(function(){function c(l){return(l==-1)?"":l+1}function f(m,n,l){return String.format('