aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
Diffstat (limited to 'extras')
-rw-r--r--extras/UI_Handeler.py5
-rw-r--r--extras/config.ini10
-rw-r--r--extras/config.py34
3 files changed, 38 insertions, 11 deletions
diff --git a/extras/UI_Handeler.py b/extras/UI_Handeler.py
index fa2c3a8..a44cf1a 100644
--- a/extras/UI_Handeler.py
+++ b/extras/UI_Handeler.py
@@ -32,6 +32,11 @@ block_subscription_updates = False
class UI_Handeler(MainWindow):
+ def fullscreen(self):
+ self.headerContainer.hide()
+ self.setAttribute(QtCore.Qt.WA_TranslucentBackground, False)
+ self.showFullScreen()
+
def display_sending_message(self):
print("message sent")
diff --git a/extras/config.ini b/extras/config.ini
index 1c367f9..54e3424 100644
--- a/extras/config.ini
+++ b/extras/config.ini
@@ -1,5 +1,15 @@
[default]
preferred-config=user-session
+fullscreen-mode=true
+
+[user-session]
+ip =
+port =
+protocol =
+insecure =
+tls_server_name =
+token = default
+cacert = default
# [cutom-config-template]
# ip=<ip address>
diff --git a/extras/config.py b/extras/config.py
index 48a63e2..1a10719 100644
--- a/extras/config.py
+++ b/extras/config.py
@@ -52,21 +52,17 @@ GRPC_TOKEN_PATHS = check_paths(
)
config = ConfigParser()
-config_path = next(
- (path for path, exists in CONFIG_PATHS.items() if exists), None)
+config_path = next((path for path, exists in CONFIG_PATHS.items() if exists), None)
if config_path:
config.read(config_path)
CA_PATH = next((path for path, exists in CA_PATHS.items() if exists), None)
-WS_TOKEN = next(
- (path for path, exists in WS_TOKEN_PATHS.items() if exists), None)
-GRPC_TOKEN = next(
- (path for path, exists in GRPC_TOKEN_PATHS.items() if exists), None)
+WS_TOKEN = next((path for path, exists in WS_TOKEN_PATHS.items() if exists), None)
+GRPC_TOKEN = next((path for path, exists in GRPC_TOKEN_PATHS.items() if exists), None)
KUKSA_CONFIG = {}
KUKSA_TOKEN = None
-
def select_config(preferred_config):
"""
Selects a configuration from the config.ini file based on the preferred_config parameter.
@@ -131,8 +127,6 @@ def save_session_config(session_config, auth_token, CA_File=None):
"""
save values to config.ini under [user-session]
"""
- if not config.has_section('user-session'):
- config.add_section('user-session')
config.set('user-session', 'ip', str(session_config['ip']))
config.set('user-session', 'port', str(session_config['port']))
@@ -140,15 +134,33 @@ def save_session_config(session_config, auth_token, CA_File=None):
config.set('user-session', 'insecure', str(session_config['insecure']))
config.set('user-session', 'tls_server_name',
str(session_config['tls_server_name']))
- if auth_token in WS_TOKEN_PATHS or auth_token in GRPC_TOKEN_PATHS:
+ if auth_token in WS_TOKEN_PATHS or auth_token in GRPC_TOKEN_PATHS or auth_token == 'default':
config.set('user-session', 'token', 'default')
else:
config.set('user-session', 'token', str(auth_token))
- if CA_File in CA_PATHS:
+ if CA_File in CA_PATHS or CA_File == 'default':
config.set('user-session', 'cacert', 'default')
else:
config.set('user-session', 'cacert', str(CA_File))
with open(config_path, 'w') as configfile:
config.write(configfile)
+
+
+def fullscreen_mode():
+ return config.getboolean('default', 'fullscreen-mode')
+
+
+if not config.has_section('user-session'):
+ config.add_section('user-session')
+ temp = {
+ 'ip': "",
+ 'port': "",
+ 'protocol': "",
+ 'insecure': "",
+ 'cacert': "",
+ 'token': "",
+ 'tls_server_name': "",
+ }
+ save_session_config(temp, 'default', 'default') \ No newline at end of file