diff --git a/plugins/WebUi/__init__.py b/plugins/WebUi/__init__.py
index c0a44655f..4202d21ba 100644
--- a/plugins/WebUi/__init__.py
+++ b/plugins/WebUi/__init__.py
@@ -45,20 +45,13 @@ Other contributors:
"""
import deluge.common
-try:
- import deluge.pref
- from deluge.dialogs import show_popup_warning
- import webserver_common
-except ImportError:
- print 'WebUi:not imported as a plugin'
-
-
-
+import deluge.pref
+from deluge.dialogs import show_popup_warning
try:
from dbus_interface import get_dbus_manager
except:
pass #for unit-test.
-
+import webserver_common
import time
import gtk
@@ -124,9 +117,6 @@ class plugin_WebUi(object):
else:
self.config.set("run_in_thread", False)
- if self.config.get("use_https") == None:
- self.config.set("use_https", False)
-
self.dbus_manager = get_dbus_manager(deluge_core, deluge_interface,
self.config, self.config_file)
@@ -177,6 +167,8 @@ class plugin_WebUi(object):
def __del__(self):
self.kill_server()
+
+
class ConfigDialog(gtk.Dialog):
"""
sorry, can't get used to gui builders.
@@ -203,12 +195,6 @@ 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://'),
- gtk.CheckButton())
- """
-
#self.share_downloads = self.add_widget(_('Share Download Directory'),
# gtk.CheckButton())
@@ -236,7 +222,6 @@ 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.vbox.pack_start(self.vb, True, True, 0)
self.vb.show_all()
@@ -272,7 +257,6 @@ 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("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/dbus_interface.py b/plugins/WebUi/dbus_interface.py
index 9f0f826bc..f14a382e0 100644
--- a/plugins/WebUi/dbus_interface.py
+++ b/plugins/WebUi/dbus_interface.py
@@ -95,8 +95,7 @@ class DbusManager(dbus.service.Object):
"total_size": state["total_size"],
"num_pieces": state["num_pieces"],
"state": state['state'],
- "user_paused": self.core.is_user_paused(torrent_id),
- "paused":state['is_paused'],
+ "paused": self.core.is_user_paused(torrent_id),
"progress": int(state["progress"] * 100),
"next_announce": state["next_announce"],
"total_payload_download":state["total_payload_download"],
@@ -154,22 +153,16 @@ class DbusManager(dbus.service.Object):
self.core.update_tracker(torrent_id)
@dbus.service.method(dbus_interface=dbus_interface,
- in_signature="asbb", out_signature="")
- def remove_torrent(self, torrent_ids, data_also, torrent_also):
+ in_signature="sbb", out_signature="")
+ def remove_torrent(self, torrent_id, data_also, torrent_also):
"""remove a torrent,and optionally data and torrent
additions compared to 0.6 interface: (data_also, torrent_also)
"""
- for torrent_id in torrent_ids:
- torrent_id = int(torrent_id)
- self.core.remove_torrent(torrent_id, bool(data_also)
- ,bool( torrent_also))
-
- #this should not be needed:
- gtk.gdk.threads_enter()
- try:
- self.interface.torrent_model_remove(torrent_id)
- except:
- pass
+ torrent_id = int(torrent_id)
+ self.core.remove_torrent(torrent_id, bool(data_also)
+ ,bool( torrent_also))
+ #this should not be needed:
+ self.interface.torrent_model_remove(torrent_id)
@dbus.service.method(dbus_interface=dbus_interface,
in_signature="s", out_signature="b")
@@ -181,6 +174,7 @@ class DbusManager(dbus.service.Object):
@dbus.service.method(dbus_interface=dbus_interface,
in_signature="s", out_signature="b")
def queue_up(self, torrent_id):
+ print 'UP!'
self.core.queue_up(int(torrent_id))
return True
diff --git a/plugins/WebUi/deluge_webserver.py b/plugins/WebUi/deluge_webserver.py
index d63ae55f9..69ddb495c 100644
--- a/plugins/WebUi/deluge_webserver.py
+++ b/plugins/WebUi/deluge_webserver.py
@@ -46,9 +46,7 @@ urls = (
"/login", "login",
"/index", "index",
"/torrent/info/(.*)", "torrent_info",
- "/torrent/info_inner/(.*)", "torrent_info_inner",
- "/torrent/stop/(.*)", "torrent_stop",
- "/torrent/start/(.*)", "torrent_start",
+ "/torrent/pause", "torrent_pause",
"/torrent/reannounce/(.*)", "torrent_reannounce",
"/torrent/add", "torrent_add",
"/torrent/delete/(.*)", "torrent_delete",
@@ -117,38 +115,19 @@ class index:
class torrent_info:
@deluge_page
@auto_refreshed
- def GET(self, name):
- torrent_id = name.split(',')[0]
+ def GET(self, torrent_id):
return ws.render.torrent_info(get_torrent_status(torrent_id))
-class torrent_info_inner:
- @deluge_page
- def GET(self, torrent_ids):
- torrent_ids = torrent_ids.split(',')
- info = get_torrent_status(torrent_ids[0])
- if len(torrent_ids) > 1:
- #todo : hmm, lots of manual stuff here :(
- pass
-
-
- return ws.render.torrent_info_inner(info)
-
-class torrent_start:
+class torrent_pause:
@check_session
def POST(self, name):
- torrent_ids = name.split(',')
- ws.proxy.resume_torrent(torrent_ids)
+ vars = web.input(stop = None, start = None, redir = None)
+ if vars.stop:
+ ws.proxy.pause_torrent([vars.stop])
+ elif vars.start:
+ ws.proxy.resume_torrent([vars.start])
do_redirect()
-class torrent_stop:
- @check_session
- def POST(self, name):
- torrent_ids = name.split(',')
- ws.proxy.pause_torrent(torrent_ids)
- do_redirect()
-
-
-
class torrent_reannounce:
@check_session
def POST(self, torrent_id):
@@ -196,32 +175,27 @@ class remote_torrent_add:
class torrent_delete:
@deluge_page
- def GET(self, name):
- torrent_ids = name.split(',')
- torrent_list = [get_torrent_status(id) for id in torrent_ids]
- return ws.render.torrent_delete(name, torrent_list)
+ def GET(self, torrent_id):
+ return ws.render.torrent_delete(get_torrent_status(torrent_id))
@check_session
- def POST(self, name):
- torrent_ids = name.split(',')
+ def POST(self, torrent_id):
vars = web.input(data_also = None, torrent_also = None)
data_also = bool(vars.data_also)
torrent_also = bool(vars.torrent_also)
- ws.proxy.remove_torrent(torrent_ids, data_also, torrent_also)
+ ws.proxy.remove_torrent(torrent_id, data_also, torrent_also)
do_redirect()
class torrent_queue_up:
@check_session
- def POST(self, name):
- for torrent_id in sorted(name.split(',')):
- ws.proxy.queue_up(torrent_id)
+ def POST(self, torrent_id):
+ 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(','))):
- ws.proxy.queue_down(torrent_id)
+ def POST(self, torrent_id):
+ ws.proxy.queue_down(torrent_id)
do_redirect()
class pause_all:
diff --git a/plugins/WebUi/revno b/plugins/WebUi/revno
index fba7ed526..c75acbe2f 100644
--- a/plugins/WebUi/revno
+++ b/plugins/WebUi/revno
@@ -1 +1 @@
-143
+127
diff --git a/plugins/WebUi/static/simple_site_style.css b/plugins/WebUi/static/simple_site_style.css
index a3ba439d6..16d65480e 100755
--- a/plugins/WebUi/static/simple_site_style.css
+++ b/plugins/WebUi/static/simple_site_style.css
@@ -26,16 +26,11 @@ form.deluge_button {
}
button.deluge_button {
background-color: #37506f;
- border:1px solid #68a;
-
+ border:1px solid #23344b;
background: #99acc3;
color: #000;
- vertical-align:middle;
- -moz-border-radius:7px;
-}
-button.deluge_button:hover {
- background-color:#68a;
}
+
div.error {
background-color:#FFFFFF;
color:#AA0000;
@@ -47,28 +42,4 @@ div.error {
}
-/*tr.torrent_table:hover {
- background-color:#68a;
-}*/
-
-tr.torrent_table_selected {
- background-color:#900;
-}
-
-th.torrent_table:hover {
- background-color:#68a;
-}
-
-img.button {
- margin-bottom:0px;
- padding:0px;
- position:relative;
- top:2px;
-}
-
-body.inner {
- background:none;
-}
-
-
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */
\ No newline at end of file
diff --git a/plugins/WebUi/templates/deluge/index.html b/plugins/WebUi/templates/deluge/index.html
index 1dad40b9b..b177c7b8c 100644
--- a/plugins/WebUi/templates/deluge/index.html
+++ b/plugins/WebUi/templates/deluge/index.html
@@ -1,6 +1,7 @@
$def with (torrent_list)
$:render.header(_('Torrent list'))
+
$:render.part_button('GET', '/torrent/add', _('Add torrent'), 'tango/list-add.png')
diff --git a/plugins/WebUi/templates/deluge/part_stats.html b/plugins/WebUi/templates/deluge/part_stats.html
index 342b8049f..55a2a74b5 100644
--- a/plugins/WebUi/templates/deluge/part_stats.html
+++ b/plugins/WebUi/templates/deluge/part_stats.html
@@ -14,7 +14,7 @@ $else:
$#end
-
+
$_('Connections') : $stats.num_connections ($stats.max_num_connections)
@@ -26,9 +26,8 @@ $#end
-
- ($_('About'))
-
+
+ (
$_('About'))
diff --git a/plugins/WebUi/templates/deluge/sort_column_head.html b/plugins/WebUi/templates/deluge/sort_column_head.html
index c18a50004..1de008a79 100644
--- a/plugins/WebUi/templates/deluge/sort_column_head.html
+++ b/plugins/WebUi/templates/deluge/sort_column_head.html
@@ -1,5 +1,5 @@
$def with (column_id, column_name, order, active_up, active_down)
-
+ |
$column_name\
$if active_up:
diff --git a/plugins/WebUi/templates/deluge/tab_meta.html b/plugins/WebUi/templates/deluge/tab_meta.html
index 6a1de18de..e69de29bb 100644
--- a/plugins/WebUi/templates/deluge/tab_meta.html
+++ b/plugins/WebUi/templates/deluge/tab_meta.html
@@ -1,85 +0,0 @@
-$def with (torrent)
-
-
-
-
-
- $torrent.progress %
- |
-
-
-
-$_('Downloaded'): |
-$torrent.calc_total_downloaded |
-
-$_('Uploaded'): |
-$torrent.calc_total_uploaded |
-
-
-$_('Seeders'): |
-$torrent.num_seeds ($torrent.total_seeds ) |
-
-$_('Share Ratio'): |
-$("%.3f" % torrent.ratio) |
-
-$_('Pieces'): |
-$torrent.num_pieces x $fsize(torrent.piece_length) |
-
-
- |
- |
-
-
-
- |
-
-
-$_('Speed'): |
-$fspeed(torrent.download_rate) |
-
-$_('Speed'): |
-$fspeed(torrent.upload_rate) |
-
-$_('Peers'): |
-$torrent.num_peers ($torrent.total_peers ) |
-
-$_('ETA'): |
-$torrent.eta |
-
-$_('Availability'): |
-$("%.3f" % torrent.distributed_copies) |
-
- |
- |
-
-
-
-
-
- |
-
-
-
-$_('Total Size'): |
-$fspeed(torrent.total_size) |
-
-$_('# Of Files'): |
-$torrent.num_files |
-
-$_('Tracker'): |
-$(crop(torrent.tracker, 30)) |
-
-$_('Tracker Status'): |
-$torrent.tracker_status |
-
-$_('Next Announce'): |
-$torrent.next_announce |
-
-
-$_('Queue Position'): |
-$torrent.queue_pos |
-
-
-
- |
diff --git a/plugins/WebUi/templates/deluge/torrent_delete.html b/plugins/WebUi/templates/deluge/torrent_delete.html
index a9aceb551..77f32949a 100644
--- a/plugins/WebUi/templates/deluge/torrent_delete.html
+++ b/plugins/WebUi/templates/deluge/torrent_delete.html
@@ -1,15 +1,10 @@
-$def with (torrent_ids, torrent_list)
-$:render.header(_("Remove torrent"))
+$def with (torrent)
+$:render.header(_("Remove %s ") % torrent.name)
- |