diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-06 12:01:56 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-06 12:01:56 +0200 |
commit | 55f6f6386f169409477fd31a72f89de6f7192b86 (patch) | |
tree | 450e2da539153bc780597a3c238f7d4385d2da54 /module | |
parent | order and priority preperations (diff) | |
download | pyload-55f6f6386f169409477fd31a72f89de6f7192b86.tar.xz |
Gregy's settings page + TheBrayns new icons
Diffstat (limited to 'module')
-rw-r--r-- | module/PluginManager.py | 4 | ||||
-rw-r--r-- | module/plugins/hooks/MultiHome.py | 2 | ||||
-rw-r--r-- | module/setup.py | 85 | ||||
-rw-r--r-- | module/web/media/default/css/default.css | 120 | ||||
-rw-r--r-- | module/web/media/default/img/control_add.png | bin | 0 -> 446 bytes | |||
-rw-r--r-- | module/web/media/default/img/control_add_blue.png | bin | 0 -> 845 bytes | |||
-rw-r--r-- | module/web/templates/default/base.html | 6 | ||||
-rw-r--r-- | module/web/templates/default/settings.html | 101 |
8 files changed, 218 insertions, 100 deletions
diff --git a/module/PluginManager.py b/module/PluginManager.py index e2e3c934b..6cff2d50f 100644 --- a/module/PluginManager.py +++ b/module/PluginManager.py @@ -129,8 +129,8 @@ class PluginManager(): config = self.reConfig.findall(content) if config: - config = [ [y.strip() for y in x.replace("'","").replace('"',"").replace(")","").split(",") if y.strip()] for x in config[0].split("(") if x.strip()] - + config = [ [y.strip() for y in x.replace("'","").replace('"',"").replace(")","").split(",")] for x in config[0].split("(") if x.strip()] + for item in config: self.core.config.addPluginConfig([name]+item) diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 023a282bb..9e2bcbe5f 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -24,7 +24,7 @@ class MultiHome(Hook): __name__ = "MultiHome" __version__ = "0.1" __description__ = """ip address changer""" - __config__ = [ ("activated", "bool", "Activated" , "True"), + __config__ = [ ("activated", "bool", "Activated" , "False"), ("interfaces", "str", "Interfaces" , "") ] __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") diff --git a/module/setup.py b/module/setup.py index 93cde8a0d..ac2bb57c2 100644 --- a/module/setup.py +++ b/module/setup.py @@ -58,12 +58,12 @@ class Setup(): print "" print _("When you are ready for system check, hit enter.") raw_input() - + basic, ssl, captcha, gui, web = self.system_check() print "" if not basic: - print _("You need pycurl and python 2.5 or 2.6 to run pyLoad.") + print _("You need pycurl, sqlite and python 2.5, 2.6 or 2.7 to run pyLoad.") print _("Please correct this and re run pyLoad.") print _("Setup will now close.") raw_input() @@ -72,24 +72,55 @@ class Setup(): raw_input(_("System check finished, hit enter to see your status report.")) print "" print _("## Status ##") - - print _("py-crypto available") if self.check_module("Crypto") else _("no py-crypto available") - print _("You need this if you want to decrypt container files.") - print "" - print _("SSL available") if ssl else _("no SSL available") - print _("This is needed if you want to establish a secure connection to core or webinterface.") - print _("If you only want to access locally to pyLoad ssl is not usefull.") print "" - print _("Captcha Recognition available") if captcha else _("no Captcha Recognition available") - print _("Only needed for some hosters and as freeuser.") - print "" - print _("Gui available") if gui else _("Gui not available") - print _("The Graphical User Interface.") - print "" - print _("Webinterface available") if web else _("no Webinterface available") - print _("Gives abillity to control pyLoad with your webbrowser.") + + + avail = [] + if self.check_module("Crypto"): avail.append(_("container decrypting")) + if ssl: avail.append(_("ssl connection")) + if captcha: avail.append(_("automatic captcha decryption")) + if gui: avail.append(_("GUI")) + if web: avail.append(_("Webinterface")) + + string = "" + + for av in avail: + string += ", "+av + + print _("Features available:") + string[1:] print "" - print _("You can abort the setup now and fix some dependicies if you want.") + + if len(avail) < 5: + print _("Featues missing: ") + print + + if not self.check_module("Crypto"): + print _("no py-crypto available") + print _("You need this if you want to decrypt container files.") + print "" + + if not ssl: + print _("no SSL available") + print _("This is needed if you want to establish a secure connection to core or webinterface.") + print _("If you only want to access locally to pyLoad ssl is not usefull.") + print "" + + if not captcha: + print _("no Captcha Recognition available") + print _("Only needed for some hosters and as freeuser.") + print "" + + if not gui: + print _("Gui not available") + print _("The Graphical User Interface.") + print "" + + if not web: + print _("no Webinterface available") + print _("Gives abillity to control pyLoad with your webbrowser.") + print "" + + print _("You can abort the setup now and fix some dependicies if you want.") con = self.ask(_("Continue with setup?"), "y", bool=True) @@ -146,11 +177,16 @@ class Setup(): curl = self.check_module("pycurl") self.print_dep("pycurl", curl) - crypto = self.check_module("Crypto") - self.print_dep("pycrypto", crypto) + sqlite = self.check_module("sqlite3") + self.print_dep("sqlite3", sqlite) - basic = python and curl + basic = python and curl and sqlite + print "" + + crypto = self.check_module("Crypto") + self.print_dep("pycrypto", crypto) + ssl = self.check_module("OpenSSL") self.print_dep("OpenSSL", ssl) @@ -162,8 +198,8 @@ class Setup(): tesser = self.check_prog(["tesseract", "-v"]) self.print_dep("tesseract", tesser) - gocr = self.check_prog(["gocr", "-h"]) - self.print_dep("gocr", gocr) + #gocr = self.check_prog(["gocr", "-h"]) + #self.print_dep("gocr", gocr) captcha = pil and tesser @@ -175,7 +211,7 @@ class Setup(): print "" web = self.check_module("django") - sqlite = self.check_module("sqlite3") + try: import django @@ -190,7 +226,6 @@ class Setup(): web = False self.print_dep("django", web) - self.print_dep("sqlite3", sqlite) web = web and sqlite return (basic, ssl, captcha, gui, web) diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 692202bb2..346c1eb23 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1010,11 +1010,15 @@ a.backlink { a.play {
background:transparent url(/media/default/img/control_play.png) 0px 1px no-repeat;
}
-a.time {
+.time {
background:transparent url(/media/default/img/status_None.png) 0px 1px no-repeat;
+ padding: 2px 0px 2px 18px;
+ margin: 0px 3px;
}
-a.reconnect {
+.reconnect {
background:transparent url(/media/default/img/reconnect.png) 0px 1px no-repeat;
+ padding: 2px 0px 2px 18px;
+ margin: 0px 3px;
}
a.play:hover {
background:transparent url(/media/default/img/control_play_blue.png) 0px 1px no-repeat;
@@ -1038,6 +1042,12 @@ a.stop { a.stop:hover {
background:transparent url(/media/default/img/control_stop_blue.png) 0px 1px no-repeat;
}
+a.add {
+ background:transparent url(/media/default/img/control_add.png) 0px 1px no-repeat;
+}
+a.add:hover {
+ background:transparent url(/media/default/img/control_add_blue.png) 0px 1px no-repeat;
+}
a.cog {
background:transparent url(/media/default/img/cog.png) 0px 1px no-repeat;
}
@@ -1531,66 +1541,108 @@ div.codearea pre span.Preprc { font-weight: normal;
}
-#horizontalForm fieldset
-{
- display: block;
- margin: 0 0 3em 0;
- padding: 0 1em 1em 1em;
-}
-#horizontalForm fieldset.radio
+.clearer
{
- margin: 1em 0 2em 0;
+ clear: both;
+ height: 1px;
}
-#horizontalForm fieldset.radio input
+.left
{
- clear: both;
float: left;
- width: auto;
}
-#horizontalForm fieldset.radio label
+.right
{
- font-weight: normal;
+ float: right;
}
-#horizontalForm input
+
+.setfield
{
- display: block;
- width: 15em;
+ display: table-cell;
}
-#horizontalForm input.submit
+#tabsback
{
- clear: both;
+ background-color: #525252;
+ margin: 0px;
+ padding: 6px 4px 1px 4px;
+
+ border-top-right-radius: 30px;
+ border-top-left-radius: 3px;
+ -moz-border-radius-topright: 30px;
+ -moz-border-radius-topleft: 3px;
+}
+ul#tabs
+{
+ list-style-type: none;
+ margin:0px;
+ padding: 0px 40px 0px 0px;
+}
+ul#tabs li
+{
+ display: inline;
+ margin-left: 8px;
}
+ul#tabs li a
+{
+ color: #42454a;
+ background-color: #eaeaea;
+ border: 1px solid #c9c3ba;
+ border-bottom: none;
+ padding: 2px 4px 2px 4px;
+ margin: 0px;
+ text-decoration: none;
-#horizontalForm label
+ outline: 0;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+}
+
+ul#tabs li a.selected, ul#tabs li a:hover
{
- float: left;
- display: block;
- margin: 1em 1em 0 0;
- font-weight: bold;
+ color: #000;
+ background-color: white;
+ padding: 2px 4px 6px 4px;
+
+ border-bottom-right-radius: 0px;
+ border-bottom-left-radius: 0px;
+ -moz-border-radius-bottomright: 0px;
+ -moz-border-radius-bottomleft: 0px;
}
-#horizontalForm select
+ul#tabs li a:hover
{
- display: block;
+ background-color: #f1f4ee;
}
-.clearer
+ul#tabs li a.selected
{
- clear: both;
- height: 1px;
+ font-weight: bold;
}
-.left
+div.tabContent
{
- float: left;
+ border: 2px solid #525252;
+ margin: 0px 0px 0px 0px;
+ padding: 0px;
+
+}
+div.tabContent.hide
+{
+ display: none;
}
-.right
+.settable
{
- float: right;
+ margin: 20px;
+ border: none;
}
+.settable td
+{
+ border: none;
+ margin: 0px;
+ padding: 5px;
+}
\ No newline at end of file diff --git a/module/web/media/default/img/control_add.png b/module/web/media/default/img/control_add.png Binary files differnew file mode 100644 index 000000000..d39886893 --- /dev/null +++ b/module/web/media/default/img/control_add.png diff --git a/module/web/media/default/img/control_add_blue.png b/module/web/media/default/img/control_add_blue.png Binary files differnew file mode 100644 index 000000000..d11b7f41d --- /dev/null +++ b/module/web/media/default/img/control_add_blue.png diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 112875cc0..fd18aee84 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -263,14 +263,14 @@ function AddBox() <li id="action_play"><a href="#" class="action play" accesskey="o" rel="nofollow">{% trans "Play" %}</a></li>
<li id="action_cancel"><a href="#" class="action cancel" accesskey="o" rel="nofollow">{% trans "Cancel" %}</a></li>
<li id="action_stop"><a href="#" class="action stop" accesskey="o" rel="nofollow">{% trans "Stop" %}</a></li>
- <li id="action_add"><a href="javascript:AddBox();" class="action stop" accesskey="o" rel="nofollow" >{% trans "Add" %}</a></li>
+ <li id="action_add"><a href="javascript:AddBox();" class="action add" accesskey="o" rel="nofollow" >{% trans "Add" %}</a></li>
</ul>
{% endif %}
{% if perms.pyload.can_see_dl %}
<ul id="page-actions">
- <li><a class="time">{% trans "Download:" %}<a id="time" style=" background-color: {% if status.download %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.download %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></a></li>
- <li><a class="reconnect">{% trans "Reconnect:" %}<a id="reconnect" style=" background-color: {% if status.reconnect %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.reconnect %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></a></li>
+ <li><span class="time">{% trans "Download:" %}</span><a id="time" style=" background-color: {% if status.download %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.download %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></li>
+ <li><span class="reconnect">{% trans "Reconnect:" %}</span><a id="reconnect" style=" background-color: {% if status.reconnect %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.reconnect %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></li>
<li><a class="action backlink">{% trans "Speed:" %} <b id="speed">{{ status.speed }}</b> kb/s</a></li>
<li><a class="action cog">{% trans "Active:" %} <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li>
<li><a href="" class="action revisions" accesskey="o" rel="nofollow">{% trans "Reload page" %}</a></li>
diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html index 48ae85170..02ded19a4 100644 --- a/module/web/templates/default/settings.html +++ b/module/web/templates/default/settings.html @@ -5,6 +5,30 @@ {% block title %}{% trans "Config" %} - {{block.super}} {% endblock %} {% block subtitle %}{% trans "Config" %}{% endblock %} +{% block head %} +<script type="text/javascript"> + window.addEvent('domready', function() + { + $$('#tabs a').addEvent('click', function(e) + { + $$('#tabs a').removeProperty('class'); + e.target.set('class', 'selected'); + + $$('div.tabContent').set('class', 'tabContent hide'); + $(e.target.get('href').substring(1)).set('class', 'tabContent'); + return false; + }); + + $$('#tabs a')[0].set('class', 'selected'); + $$('div.tabContent').set('class', 'tabContent hide'); + $$('div.tabContent')[0].set('class', 'tabContent'); + }); + + +</script> + +{% endblock %} + {% block menu %} <li> <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a> @@ -31,47 +55,54 @@ {% for message in errors %} <b>{{message}}</b><br> {% endfor %} - -<form id="horizontalForm" action="" method="POST"> +{% if conf|length > 0 %} +<div class="setfield"> + <div id="tabsback"> + <ul id="tabs"> + {% for skey, section in conf.iteritems %} + <li><a href="#{{skey}}">{{section.desc}}</a></li> + {% endfor %} + </ul> + </div> + <form id="horizontalForm" action="" method="POST"> {% for skey, section in conf.iteritems %} - - <h2>{{section.desc}}</h2> - - {% for okey, option in section.items %} - - {% ifnotequal okey "desc" %} - - <label for="{{skey}}|{{okey}}" style="color:#424242;"> - {{option.desc}} - {% ifequal option.type "bool" %} - <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> - <option {% if option.value %} selected="selected" {% endif %}value="True">{% trans "on" %}</option> - <option {% if not option.value %} selected="selected" {% endif %}value="False">{% trans "off" %}</option> - </select> - {% else %} - {% if option.type|contains:";" %} - <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> - {% for entry in option.list %} - <option {% ifequal option.value entry %} selected="selected" {% endifequal %}>{{entry}}</option> + <div class="tabContent" id="{{skey}}"> + <table class="settable"> + {% for okey, option in section.items %} + {% ifnotequal okey "desc" %} + <tr> + <td><label for="{{skey}}|{{okey}}" style="color:#424242;">{{option.desc}}:</label></td> + <td> + {% ifequal option.type "bool" %} + <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> + <option {% if option.value %} selected="selected" {% endif %}value="True">{% trans "on" %}</option> + <option {% if not option.value %} selected="selected" {% endif %}value="False">{% trans "off" %}</option> + </select> + {% else %} + {% if option.type|contains:";" %} + <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> + {% for entry in option.list %} + <option {% ifequal option.value entry %} selected="selected" {% endifequal %}>{{entry}}</option> + {% endfor %} + </select> + {% else %} + <input id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}" type="text" value="{{option.value}}"/> + {% endif %} + {% endifequal %} + </td> + </tr> + {% endifnotequal %} {% endfor %} - </select> - {% else %} - <input id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}" type="text" value="{{option.value}}"/> - {% endif %} - {% endifequal %} - </label> - - {% endifnotequal %} - - {% endfor %} - <br /><br /><br /><br /> + </table> + </div> {% endfor %} + {% if conf %} <input class="submit" type="submit" value="{% trans "Submit" %}" /> - <div class="clearer"></div> {% endif %} -</form> - + </form> +</div> +{% endif %} {% endblock %} |