Merge remote-tracking branch 'origin/v1.7'

This commit is contained in:
Adolfo Gómez García 2015-03-20 15:16:15 +01:00
commit e02b3ad881
5 changed files with 13 additions and 4 deletions

View File

@ -292,6 +292,9 @@ if __name__ == '__main__':
logger.error('UDS Service is not running. Tool stopped')
sys.exit(1)
# Sets a default idle duration, but will not be used unless idle is notified from server
operations.initIdleDuration(3600 * 10)
trayIcon.show()
# Catch kill and logout user :)

View File

@ -208,6 +208,8 @@ def initIdleDuration(atLeastSeconds):
threading._DummyThread._Thread__stop = lambda x: 42
subprocess.call(['/usr/bin/xset', 's', '{}'.format(atLeastSeconds + 30)])
# And now reset it
subprocess.call(['/usr/bin/xset', 's', 'reset'])
def getIdleDuration():
@ -225,10 +227,14 @@ def getIdleDuration():
available = xss.XScreenSaverQueryExtension(display, ctypes.byref(event_base), ctypes.byref(error_base))
if available != 1:
return 0
return 0 # No screen saver is available, no way of getting idle
info = xss.XScreenSaverAllocInfo()
xss.XScreenSaverQueryInfo(display, xlib.XDefaultRootWindow(display), info)
if info.contents.state != 0:
return 3600 * 100 * 1000 # If screen saver is active, return a high enough value
return info.contents.idle / 1000.0

View File

@ -45,7 +45,7 @@
</div>
{{ else }}
{{# ifequals value.type 1 }}
<textarea class="form-control" data-section="{{ cfg_section }}" data-key="{{ cfg_key }}" rows="3">{{ value.value }}</textarea>
<textarea class="form-control config-ctrl" data-section="{{ cfg_section }}" data-key="{{ cfg_key }}" rows="3">{{ value.value }}</textarea>
{{ else }}
{{# ifequals value.type 3 }}
<input type="checkbox" data-on-text="{% endverbatim %}{% trans 'Yes' %}{% verbatim %}" data-off-text="{% endverbatim %}{% trans 'No' %}{% verbatim %}" class="config-ctrl" {{# ifequals value.value 1 }} checked{{/ ifequals }} data-section="{{ cfg_section }}" data-key="{{ cfg_key }}">

View File

@ -1,7 +1,7 @@
{% load i18n %}
<div class="row">
<div class="col-xs-12">
<h1>{% trans 'Connectivity' %} <small>{% trans 'overview' %}</small></h1>
<h1>{% trans 'Connectivity' %}</h1>
<ol class="breadcrumb">
<li><a class="lnk-dashboard" href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li>{% trans 'Connectivity' %}</li>

View File

@ -1,7 +1,7 @@
{% load i18n %}
<div class="row">
<div class="col-xs-12">
<h1>Os Managers <small>{% trans 'overview' %}</small></h1>
<h1>Os Managers</h1>
<ol class="breadcrumb">
<li><a class="lnk-dashboard" href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li>OS Managers</li>