use data/pixmaps instead of copied images

This commit is contained in:
Martijn Voncken 2008-03-11 18:40:04 +00:00
commit 1872a2634a
11 changed files with 22 additions and 24 deletions

View file

@ -39,6 +39,8 @@ from config import config_page
from torrent_options import torrent_options from torrent_options import torrent_options
from torrent_move import torrent_move from torrent_move import torrent_move
from deluge.common import get_pixmap
#debugerror #debugerror
from debugerror import deluge_debugerror from debugerror import deluge_debugerror
web.webapi.internalerror = deluge_debugerror web.webapi.internalerror = deluge_debugerror
@ -134,7 +136,8 @@ urls = [
"/", "home", "/", "home",
"", "home", "", "home",
"/robots.txt","robots", "/robots.txt","robots",
"/template_style.css","template_style" "/template_style.css","template_style",
"/pixmaps/(.*)","pixmaps"
] ]
#/routing #/routing
@ -472,10 +475,18 @@ class template_style:
style = Storage() style = Storage()
print render.template_style(style) print render.template_style(style)
class pixmaps:
"use the deluge-images. located in data/pixmaps"
def GET(self, name):
web.header("Content-Type", "image/png")
f = open(get_pixmap(name) ,'rb')
print f.read()
f.close()
#/pages #/pages
#for plugins.. #for plugins:
page_classes = dict(globals()) #test-1 page_classes = dict(globals())
def register_page(url, klass): def register_page(url, klass):
urls.append(url) urls.append(url)
@ -486,17 +497,3 @@ def unregister_page(url):
raise NotImplemenetedError() raise NotImplemenetedError()
#page_classes[klass.__name__] = None #page_classes[klass.__name__] = None
"""
class test:
@deco.deluge_page
def GET(self, name):
return "HI"
register_page('/test(.*)', test)
print urls
print page_classes['index']
print page_classes['test']
"""

View file

@ -162,6 +162,7 @@ template.Template.globals.update({
'_': _ , #gettext/translations '_': _ , #gettext/translations
'str': str, #because % in templetor is broken. 'str': str, #because % in templetor is broken.
'int':int, 'int':int,
'len':len,
'deluge_int':deluge_int, 'deluge_int':deluge_int,
'sorted': sorted, 'sorted': sorted,
'altrow':altrow, 'altrow':altrow,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 B

View file

@ -7,11 +7,11 @@ $def with (stats)
<img src="/static/images/tango/connections.png" title="$_('Connections')">$stats.num_connections ($deluge_int(stats.max_num_connections)) <img src="/static/images/tango/connections.png" title="$_('Connections')">$stats.num_connections ($deluge_int(stats.max_num_connections))
<img src="/static/images/downloading16.png" title="$_('Down Speed')">$stats.download_rate ($deluge_int(stats.max_download)) <img src="/pixmaps/downloading16.png" title="$_('Down Speed')">$stats.download_rate ($deluge_int(stats.max_download))
<img src="/static/images/seeding16.png" title="$_('Up Speed')">$stats.upload_rate ($deluge_int(stats.max_upload)) <img src="/pixmaps/seeding16.png" title="$_('Up Speed')">$stats.upload_rate ($deluge_int(stats.max_upload))
<img src="/static/images/dht16.png" title="$_('DHT Nodes')">$stats.dht_nodes <img src="/pixmaps/dht16.png" title="$_('DHT Nodes')">$stats.dht_nodes

View file

@ -42,7 +42,7 @@ $for torrent in torrent_list:
<form action="/torrent/$torrent.action/$torrent.id" method="POST" <form action="/torrent/$torrent.action/$torrent.id" method="POST"
class="pause_resume"> class="pause_resume">
<input type="image" <input type="image"
src="/static/images/$(torrent.calc_state_str)16.png" src="/pixmaps/$(torrent.calc_state_str)16.png"
name="pauseresume" value="submit" /> name="pauseresume" value="submit" />
</form> </form>
</td> </td>

View file

@ -26,7 +26,7 @@ $for torrent in torrent_list:
<td> <td>
<form action="/torrent/$torrent.action/$torrent.id" method="POST" class="pause_resume"> <form action="/torrent/$torrent.action/$torrent.id" method="POST" class="pause_resume">
<input type="image" <input type="image"
src="/static/images/$(torrent.calc_state_str)16.png" src="/pixmaps/$(torrent.calc_state_str)16.png"
name="pauseresume" value="submit" /></form></td> name="pauseresume" value="submit" /></form></td>
<td>$torrent.queue</td> <td>$torrent.queue</td>
<td style="width:100px; overflow:hidden;white-space: nowrap"> <td style="width:100px; overflow:hidden;white-space: nowrap">

View file

@ -61,7 +61,7 @@ $if organize_filters:
<br /> <br />
<img src="/pixmaps/deluge.png">
<script language='javascript'> <script language='javascript'>
/*on_click_action = open_details;*/ /*on_click_action = open_details;*/

View file

@ -80,7 +80,7 @@ XX#torrent_table td {
} }
tr.altrow1 { tr.altrow1 {
background-color:#F0F0F0; background-color:#FAFAFA; /*offf-topic-hint:allo allo*/
} }