forked from shaba/openuds
Merge remote-tracking branch 'origin/v1.7'
This commit is contained in:
commit
e02b3ad881
@ -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 :)
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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 }}">
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user