fix theme display in servicemanager

This commit is contained in:
Tim Bentley 2016-05-17 22:28:27 +01:00
parent 05e9e5dca0
commit 2f8b12934b
4 changed files with 12 additions and 10 deletions

View File

@ -1324,8 +1324,8 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ServiceMa
The theme may have changed in the settings dialog so make sure the theme combo box is in the correct state. The theme may have changed in the settings dialog so make sure the theme combo box is in the correct state.
""" """
visible = not self.renderer.theme_level == ThemeLevel.Global visible = not self.renderer.theme_level == ThemeLevel.Global
self.theme_label.setVisible(visible) self.toolbar.actions['theme_combo_box'].setVisible(visible)
self.theme_combo_box.setVisible(visible) self.toolbar.actions['theme_label'].setVisible(visible)
def regenerate_service_items(self, changed=False): def regenerate_service_items(self, changed=False):
""" """

View File

@ -221,9 +221,13 @@ class HttpRouter(RegistryProperties):
self.request_data = None self.request_data = None
url_path_split = urlparse(url_path) url_path_split = urlparse(url_path)
url_query = parse_qs(url_path_split.query) url_query = parse_qs(url_path_split.query)
# GET # Get data from HTTP request
if 'data' in url_query.keys(): if self.command == 'GET':
self.request_data = url_query['data'][0] if 'data' in url_query.keys():
self.request_data = url_query['data'][0]
elif self.command == 'POST':
content_len = int(self.headers['content-length'])
self.request_data = self.rfile.read(content_len).decode("utf-8")
for route, func in self.routes: for route, func in self.routes:
match = re.match(route, url_path_split.path) match = re.match(route, url_path_split.path)
if match: if match:
@ -401,10 +405,8 @@ class HttpRouter(RegistryProperties):
log.debug('serve file request %s' % file_name) log.debug('serve file request %s' % file_name)
if not file_name: if not file_name:
file_name = 'index.html' file_name = 'index.html'
elif file_name == 'stage': if '.' not in file_name:
file_name = 'stage.html' file_name += '.html'
elif file_name == 'main':
file_name = 'main.html'
if file_name.startswith('/'): if file_name.startswith('/'):
file_name = file_name[1:] file_name = file_name[1:]
path = os.path.normpath(os.path.join(self.html_dir, file_name)) path = os.path.normpath(os.path.join(self.html_dir, file_name))

View File

@ -167,7 +167,6 @@ class HTTPSServer(HTTPServer):
local_data = AppLocation.get_directory(AppLocation.DataDir) local_data = AppLocation.get_directory(AppLocation.DataDir)
self.socket = ssl.SSLSocket( self.socket = ssl.SSLSocket(
sock=socket.socket(self.address_family, self.socket_type), sock=socket.socket(self.address_family, self.socket_type),
ssl_version=ssl.PROTOCOL_TLSv1_2,
certfile=os.path.join(local_data, 'remotes', 'openlp.crt'), certfile=os.path.join(local_data, 'remotes', 'openlp.crt'),
keyfile=os.path.join(local_data, 'remotes', 'openlp.key'), keyfile=os.path.join(local_data, 'remotes', 'openlp.key'),
server_side=True) server_side=True)

View File

@ -93,6 +93,7 @@ MODULES = [
'bs4', 'bs4',
'mako', 'mako',
'uno', 'uno',
'six'
] ]