+ size_t size(Protocol const&) const { return sizeof(m_value); }
+ int m_value;
+ };
+
}
#endif // TORRENT_SOCKET_HPP_INCLUDED
diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp
index 9b3e667a5..69f2c1bc1 100755
--- a/libtorrent/src/session_impl.cpp
+++ b/libtorrent/src/session_impl.cpp
@@ -814,13 +814,15 @@ namespace detail
return m_ipv6_interface;
}
- session_impl::listen_socket_t session_impl::setup_listener(tcp::endpoint ep, int retries)
+ session_impl::listen_socket_t session_impl::setup_listener(tcp::endpoint ep
+ , int retries, bool v6_only)
{
asio::error_code ec;
listen_socket_t s;
s.sock.reset(new socket_acceptor(m_io_service));
s.sock->open(ep.protocol(), ec);
s.sock->set_option(socket_acceptor::reuse_address(true), ec);
+ if (ep.protocol() == tcp::v6()) s.sock->set_option(v6only(v6_only), ec);
s.sock->bind(ep, ec);
while (ec && retries > 0)
{
@@ -913,7 +915,7 @@ namespace detail
s = setup_listener(
tcp::endpoint(address_v6::any(), m_listen_interface.port())
- , m_listen_port_retries);
+ , m_listen_port_retries, true);
if (s.sock)
{
@@ -2279,6 +2281,8 @@ namespace detail
INVARIANT_CHECK;
+ if (m_lsd) return;
+
m_lsd = new lsd(m_io_service
, m_listen_interface.address()
, bind(&session_impl::on_lsd_peer, this, _1, _2));
@@ -2290,6 +2294,8 @@ namespace detail
INVARIANT_CHECK;
+ if (m_natpmp) return;
+
m_natpmp = new natpmp(m_io_service
, m_listen_interface.address()
, bind(&session_impl::on_port_mapping
@@ -2308,6 +2314,8 @@ namespace detail
INVARIANT_CHECK;
+ if (m_upnp) return;
+
m_upnp = new upnp(m_io_service, m_half_open
, m_listen_interface.address()
, m_settings.user_agent
diff --git a/plugins/MoveTorrent/__init__.py b/plugins/MoveTorrent/__init__.py
index 4a48e920d..e4efcc34a 100644
--- a/plugins/MoveTorrent/__init__.py
+++ b/plugins/MoveTorrent/__init__.py
@@ -96,12 +96,7 @@ class movetorrentMenu:
if path:
self.paused_or_not = {}
for unique_id in unique_ids:
- self.paused_or_not[unique_id] = self.core.is_user_paused(unique_id)
- if not self.paused_or_not[unique_id]:
- self.core.set_user_pause(unique_id, True, enforce_queue=False)
self.core.move_storage(unique_id, path)
- if not self.paused_or_not[unique_id]:
- self.core.set_user_pause(unique_id, False, enforce_queue=False)
def configure(self, window):
import os.path
diff --git a/plugins/TorrentSearch/plugin.py b/plugins/TorrentSearch/plugin.py
index 76a26a408..e6c83c7d6 100644
--- a/plugins/TorrentSearch/plugin.py
+++ b/plugins/TorrentSearch/plugin.py
@@ -63,7 +63,7 @@ class plugin_Search:
### Note: All other plugins should use self.interface.toolbar
### when adding items to the toolbar
self.se = ''
- self.toolbar = self.interface.wtree.get_widget("tb_right")
+ self.toolbar = self.interface.wtree.get_widget("tb_left")
self.engines = deluge.pref.Preferences(self.conf_file, False)
self.search_entry = gtk.Entry()
self.search_entry.connect("activate", self.torrent_search)
diff --git a/plugins/WebUi/__init__.py b/plugins/WebUi/__init__.py
index c0a44655f..2d6f3ad4a 100644
--- a/plugins/WebUi/__init__.py
+++ b/plugins/WebUi/__init__.py
@@ -37,7 +37,9 @@ Firefox greasemonkey script: http://userscripts.org/scripts/show/12639
Remotely add a file: "curl -F torrent=@./test1.torrent -F pwd=deluge http://localhost:8112/remote/torrent/add"
-There is support for multiple templates, but just one is included.
+Advanced template is only tested on firefox and garanteed not to work in IE6
+
+ssl keys are located in WebUi/ssl/
Other contributors:
*somedude : template enhancements.
@@ -203,11 +205,8 @@ class ConfigDialog(gtk.Dialog):
gtk.combo_box_new_text())
self.cache_templates = self.add_widget(_('Cache Templates'),
gtk.CheckButton())
- """
- temporary disable for 0.5.7
- self.use_https = self.add_widget(_('Use https://'),
+ self.use_https = self.add_widget(_('https://'),
gtk.CheckButton())
- """
#self.share_downloads = self.add_widget(_('Share Download Directory'),
# gtk.CheckButton())
@@ -236,7 +235,7 @@ class ConfigDialog(gtk.Dialog):
# bool(self.config.get("share_downloads")))
self.cache_templates.set_active(self.config.get("cache_templates"))
- """0.5.7.. self.use_https.set_active(self.config.get("use_https"))"""
+ self.use_https.set_active(self.config.get("use_https"))
self.vbox.pack_start(self.vb, True, True, 0)
self.vb.show_all()
@@ -272,7 +271,7 @@ class ConfigDialog(gtk.Dialog):
self.config.set("template", self.template.get_active_text())
self.config.set("button_style", self.button_style.get_active())
self.config.set("cache_templates", self.cache_templates.get_active())
- #0.5.7.. self.config.set("use_https", self.use_https.get_active())
+ self.config.set("use_https", self.use_https.get_active())
#self.config.set("share_downloads", self.share_downloads.get_active())
self.config.save(self.plugin.config_file)
self.plugin.start_server() #restarts server
diff --git a/plugins/WebUi/deluge_webserver.py b/plugins/WebUi/deluge_webserver.py
index d63ae55f9..618802143 100644
--- a/plugins/WebUi/deluge_webserver.py
+++ b/plugins/WebUi/deluge_webserver.py
@@ -50,7 +50,7 @@ urls = (
"/torrent/stop/(.*)", "torrent_stop",
"/torrent/start/(.*)", "torrent_start",
"/torrent/reannounce/(.*)", "torrent_reannounce",
- "/torrent/add", "torrent_add",
+ "/torrent/add(.*)", "torrent_add",
"/torrent/delete/(.*)", "torrent_delete",
"/torrent/queue/up/(.*)", "torrent_queue_up",
"/torrent/queue/down/(.*)", "torrent_queue_down",
@@ -98,21 +98,36 @@ class index:
@deluge_page
@auto_refreshed
def GET(self, name):
- vars = web.input(sort=None, order=None)
+ vars = web.input(sort=None, order=None ,filter=None , category=None)
- status_rows = [get_torrent_status(torrent_id)
+ torrent_list = [get_torrent_status(torrent_id)
for torrent_id in ws.proxy.get_session_state()]
+ all_torrents = torrent_list[:]
+
+ #filter-state
+ if vars.filter:
+ torrent_list = filter_torrent_state(torrent_list, vars.filter)
+ setcookie("filter", vars.filter)
+ else:
+ setcookie("filter", "")
+
+ #filter-cat
+ if vars.category:
+ torrent_list = [t for t in torrent_list if t.category == vars.category]
+ setcookie("category", vars.category)
+ else:
+ setcookie("category", "")
#sorting:
if vars.sort:
- status_rows.sort(key=attrgetter(vars.sort))
+ torrent_list.sort(key=attrgetter(vars.sort))
if vars.order == 'up':
- status_rows = reversed(status_rows)
+ torrent_list = reversed(torrent_list)
setcookie("order", vars.order)
setcookie("sort", vars.sort)
- return ws.render.index(status_rows)
+ return ws.render.index(torrent_list, all_torrents)
class torrent_info:
@deluge_page
@@ -213,14 +228,24 @@ class torrent_delete:
class torrent_queue_up:
@check_session
def POST(self, name):
- for torrent_id in sorted(name.split(',')):
+ #a bit too verbose..
+ torrent_ids = name.split(',')
+ torrents = [get_torrent_status(id) for id in torrent_ids]
+ torrents.sort(lambda x, y : x.queue_pos - y.queue_pos)
+ torrent_ids = [t.id for t in torrents]
+ for torrent_id in torrent_ids:
ws.proxy.queue_up(torrent_id)
do_redirect()
class torrent_queue_down:
@check_session
def POST(self, name):
- for torrent_id in reversed(sorted(name.split(','))):
+ #a bit too verbose..
+ torrent_ids = name.split(',')
+ torrents = [get_torrent_status(id) for id in torrent_ids]
+ torrents.sort(lambda x, y : x.queue_pos - y.queue_pos)
+ torrent_ids = [t.id for t in torrents]
+ for torrent_id in reversed(torrent_ids):
ws.proxy.queue_down(torrent_id)
do_redirect()
diff --git a/plugins/WebUi/revno b/plugins/WebUi/revno
index fba7ed526..bb7936535 100644
--- a/plugins/WebUi/revno
+++ b/plugins/WebUi/revno
@@ -1 +1 @@
-143
+155
diff --git a/plugins/WebUi/ssl/deluge.key b/plugins/WebUi/ssl/deluge.key
new file mode 100644
index 000000000..a9d5db5ce
--- /dev/null
+++ b/plugins/WebUi/ssl/deluge.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEogIBAAKCAQEA1sPXr1O6l2J9NAEvEYQ/JFDSVcJHh9YxP7kPdjsu7k9Ih845
+BHMX52A3Ypbe5MHe2bCj/8dRYCixRdF1KUTAKXdzc7mw9prgf3sS3RvmfcRsln6u
+x7XRg7YprZJ46hFmcHiUPRgtTFLuFO2YWBnqxu/caTtAxx3PdoK6LDVnuVjHYofC
+8uD4A9k6yL/jj3Yrkf8WYQqJ6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pDgps4G8+hGoUqc7Bd+OjpzsQh4rcI
+k+4U+7847zkvJolJBK3hw3tu53FAL2OXOhJVqQgO9B+p9XcGAaTTh6X7IgDb5bok
+DJanPMHq+/hcNGssnNbFhXQEyF2U7X8XaEuCh2ZURR5SUUq7BlX0dmp4P84NyHXC
+4Vh5AoGAZYWkXxQUGzVm+H3fPpmETWGRNFDTimzi+6N+/uHkqkiDa3LGSnabmKh+
+voKm//DUjEVGlAZ3CGOjO/5SlZc/zjkgh1vg7KOU4x7DqVOuZjom5Tx3ZI4xVVVt
+tVtvK0qjzUTVcwAQALN/PNak+gs9534e954rmA9kmc3xBe4ho9M=
+-----END RSA PRIVATE KEY-----
diff --git a/plugins/WebUi/ssl/deluge.pem b/plugins/WebUi/ssl/deluge.pem
new file mode 100644
index 000000000..effef476e
--- /dev/null
+++ b/plugins/WebUi/ssl/deluge.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDlzCCAn+gAwIBAgIJAPnW/GEzRy8xMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNV
+BAYTAkFVMRUwEwYDVQQIEwxUaGUgSW50ZXJuZXQxFTATBgNVBAoTDERlbHVnZSBX
+ZWJ1aTAeFw0wNzExMjQxMDAzNDRaFw0wODExMjMxMDAzNDRaMDsxCzAJBgNVBAYT
+AkFVMRUwEwYDVQQIEwxUaGUgSW50ZXJuZXQxFTATBgNVBAoTDERlbHVnZSBXZWJ1
+aTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANbD169TupdifTQBLxGE
+PyRQ0lXCR4fWMT+5D3Y7Lu5PSIfOOQRzF+dgN2KW3uTB3tmwo//HUWAosUXRdSlE
+wCl3c3O5sPaa4H97Et0b5n3EbJZ+rse10YO2Ka2SeOoRZnB4lD0YLUxS7hTtmFgZ
+6sbv3Gk7QMcdz3aCuiw1Z7lYx2KHwvLg+APZOsi/4492K5H/FmEKieqSXDAM/9nP
+GV5QbolAm/Y+cSk82KCWolJCjdmKwIaMUcXyO2XOzB9slsPP302SWxl6PJ633pO3
+KEhO8kEtTOnIsJGJOVTtpgVSQSYAE0FEf4xny8xKjSl4IUOeuL/cJrhZlDHffWtL
+ZFcCAwEAAaOBnTCBmjAdBgNVHQ4EFgQU1BbX1/4WtAKRKmWI1gqryIoj7BQwawYD
+VR0jBGQwYoAU1BbX1/4WtAKRKmWI1gqryIoj7BShP6Q9MDsxCzAJBgNVBAYTAkFV
+MRUwEwYDVQQIEwxUaGUgSW50ZXJuZXQxFTATBgNVBAoTDERlbHVnZSBXZWJ1aYIJ
+APnW/GEzRy8xMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAEoiSz5x
+hRCplxUG34g3F5yJe0QboqzJ/XmECfO80a980C/WVeivM2Kb1uafsKNp+WK7wD8g
+mei+todYXG+fD8WmG41LG87Xi2Xe4SlAcemEpGcC5F1bpCdvqnVAWFnqoF88FOHx
+NDlrq5H5lhMH9wVrX9qJvxL+StaDJ0sFk4kMGWEN+bdSYfFdBQzF903nPtm+PlvO
+1Uo6gCuRTMYM5J1DC/GpNpo/Fzrkgm8mMf1MYy3rljiNgMt2rnxhtwi6jugwyMui
+id6Of6gYAtvhi7kmaUpdI5PHO35dqRK7pHXH+YXaulosCPw/+bSRptFTykeEMrBj
+CzotqJ+74MwXZyM=
+-----END CERTIFICATE-----
diff --git a/plugins/WebUi/static/images/tango/details.png b/plugins/WebUi/static/images/tango/details.png
new file mode 100644
index 000000000..8dd48c494
Binary files /dev/null and b/plugins/WebUi/static/images/tango/details.png differ
diff --git a/plugins/WebUi/static/simple_site_style.css b/plugins/WebUi/static/simple_site_style.css
index a3ba439d6..3776994e8 100755
--- a/plugins/WebUi/static/simple_site_style.css
+++ b/plugins/WebUi/static/simple_site_style.css
@@ -4,7 +4,10 @@
div.progress_bar_outer { /*used in table-view*/
width:150px;
}
-
td.progress_bar {
white-space: nowrap;
}
td.info_label {
font-weight: bold;
}
td {
font-size: 10pt;
color: #d1dae5;
white-space: nowrap;
}
tr {
font-size: 10pt;
color: #d1dae5;
}
+
td.progress_bar {
white-space: nowrap;
}
td.info_label {
font-weight: bold;
}
td {
font-size: 10pt;
color: #d1dae5;
white-space: nowrap;
}
tr {
+ font-size: 10pt;
+ color: #d1dae5;
+}
div.panel {
padding:10px;
@@ -55,9 +58,6 @@ tr.torrent_table_selected {
background-color:#900;
}
-th.torrent_table:hover {
- background-color:#68a;
-}
img.button {
margin-bottom:0px;
@@ -71,4 +71,21 @@ body.inner {
}
-
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */
\ No newline at end of file
+form.pause_resume {
+ margin:0;
+ padding:0;
+ border:0;
+}
+
+th {
+ background: #1f3044;
+ font-size: 14px;
+ border: 0px;
+ white-space: nowrap;
+}
+
+#torrent_table {
+ border: #2a425c 1px solid;
+}
+
+
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */
diff --git a/plugins/WebUi/templates/advanced/index.html b/plugins/WebUi/templates/advanced/index.html
index 637aa6bdc..0bdd937ea 100644
--- a/plugins/WebUi/templates/advanced/index.html
+++ b/plugins/WebUi/templates/advanced/index.html
@@ -1,14 +1,49 @@
-$def with (torrent_list)
+$def with (torrent_list, all_torrents)
$:render.header(_('Torrent list'))
+
-