diff options
-rw-r--r-- | Widgets/settings.py | 46 | ||||
-rw-r--r-- | extras/config.ini | 60 | ||||
-rw-r--r-- | extras/config.py | 95 | ||||
-rw-r--r-- | ui/Settings_Window.ui | 737 |
4 files changed, 298 insertions, 640 deletions
diff --git a/Widgets/settings.py b/Widgets/settings.py index b0512cc..08f6a00 100644 --- a/Widgets/settings.py +++ b/Widgets/settings.py @@ -1,16 +1,7 @@ -# Copyright 2023 Suchinton Chakravarty +# Copyright (C) 2023 Suchinton Chakravarty +# Copyright (C) 2024 Konsulko Group # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 from extras import config import extras.Kuksa_Instance as kuksa_instance @@ -54,7 +45,6 @@ def create_animated_toggle(): class settings(Base, Form): """ A class representing the settings widget of the AGL Demo Control Panel. - Attributes: - SSL_toggle: An AnimatedToggle object representing the SSL toggle button. - CAN_Kuksa_toggle: An AnimatedToggle object representing the CAN/Kuksa toggle button. @@ -76,22 +66,10 @@ class settings(Base, Form): self.SSL_toggle = create_animated_toggle() self.Protocol_toggle = create_animated_toggle() - self.CAN_Kuksa_toggle = create_animated_toggle() self.connectionStatus = self.findChild(QLabel, "connectionStatus") self.connectionLogo = self.findChild(QLabel, "connectionLogo") - list_of_configs = config.get_list_configs() - default_config_name = config.get_default_config() - - self.List_Configs_ComboBox = self.findChild( - QComboBox, "List_Configs_ComboBox") - self.List_Configs_ComboBox.setItemDelegate(QStyledItemDelegate()) - self.List_Configs_ComboBox.addItems(list_of_configs) - self.List_Configs_ComboBox.setCurrentText(default_config_name) - self.List_Configs_ComboBox.currentTextChanged.connect( - lambda: self.set_settings(self.List_Configs_ComboBox.currentText())) - self.IPAddrInput = self.findChild(QLineEdit, "IPAddrInput") self.PortInput = self.findChild(QLineEdit, "PortInput") self.TLS_Server_Name = self.findChild(QLineEdit, "TLS_Server_Name") @@ -110,7 +88,6 @@ class settings(Base, Form): self.startClientBtn.clicked.connect(self.start_stop_client) self.reconnectBtn.clicked.connect(self.reconnectClient) self.SSL_toggle.clicked.connect(self.toggleSSL) - self.CAN_Kuksa_toggle.clicked.connect(self.toggle_CAN_Kuksa) Frame_GS = self.findChild(QWidget, "frame_general_settings") Frame_PS = self.findChild(QWidget, "frame_page_settings") @@ -120,14 +97,11 @@ class settings(Base, Form): GS_layout.replaceWidget(self.place_holder_toggle_1, self.SSL_toggle) GS_layout.replaceWidget( self.place_holder_toggle_2, self.Protocol_toggle) - PS_layout.replaceWidget( - self.place_holder_toggle_3, self.CAN_Kuksa_toggle) self.place_holder_toggle_1.deleteLater() self.place_holder_toggle_2.deleteLater() - self.place_holder_toggle_3.deleteLater() - self.set_settings(default_config_name) + self.init_settings() def start_stop_client(self): if self.startClientBtn.isChecked(): @@ -282,19 +256,17 @@ class settings(Base, Form): validate_and_set_style(self, self.CA_File, "cacertificate") validate_and_set_style(self, self.Auth_Token) - config.save_session_config( - new_config, self.kuksa_token, self.CA_File.text()) + config.save_config(new_config, self.kuksa_token, self.CA_File.text()) return new_config - def set_settings(self, config_name): + def init_settings(self): """ Reloads the parameters of settings widget. """ - new_config = config.select_config(config_name) - self.kuksa_config_name = new_config[0] - self.kuksa_config = new_config[1] - self.kuksa_token = new_config[2] + new_config = config.load_config() + self.kuksa_config = new_config[0] + self.kuksa_token = new_config[1] self.IPAddrInput.setText(self.kuksa_config["ip"]) self.PortInput.setText(self.kuksa_config["port"]) diff --git a/extras/config.ini b/extras/config.ini index 2fcbbed..6619900 100644 --- a/extras/config.ini +++ b/extras/config.ini @@ -1,58 +1,12 @@ [default] -preferred-config=user-session -fullscreen-mode=true +fullscreen-mode = true -[user-session] -ip = -port = -protocol = -insecure = -tls_server_name = +[vss-server] +ip = localhost +port = 55555 +protocol = grpc +insecure = True token = default cacert = default +tls_server_name = Server -# [cutom-config-template] -# ip=<ip address> -# port=<port number> -# protocol=<ws|grpc> # ws/grpc -> kuksa-val-server, grpc -> databroker -# insecure=<True|False> # Note: Use insecure mode only if server is also running in insecure mode -# cacert=<default|/path/to/CA.pem> -# token=<default|/path/to/token> -# tls_server_name=<name> - -[kuksa-val-server] -ip=localhost -port=8090 -protocol=ws -insecure=False -token=default -tls_server_name= - - -[databroker] -ip=localhost -port=55555 -protocol=grpc -insecure=False -token=default -tls_server_name=Server - - -[AGL-kuksa-val-server] -ip=localhost -port=8090 -protocol=ws -insecure=False -cacert=default -token=default -tls_server_name= - - -[AGL-databroker] -ip=10.42.0.95 -port=55555 -protocol=grpc -insecure=False -cacert=default -token=default -tls_server_name=Server diff --git a/extras/config.py b/extras/config.py index 4959b40..d901a8e 100644 --- a/extras/config.py +++ b/extras/config.py @@ -62,57 +62,46 @@ GRPC_TOKEN = next((path for path, exists in GRPC_TOKEN_PATHS.items() if exists), KUKSA_CONFIG = {} KUKSA_TOKEN = None -def select_config(preferred_config): +def load_config(): """ - Selects a configuration from the config.ini file based on the preferred_config parameter. + Initializes configuration from the config.ini file. Args: - preferred_config (str): The name of the configuration section to select. Returns: - Tuple[str, Dict[str, Union[str, bool]], str]: A tuple containing the name of the selected configuration section, - a dictionary containing the configuration options for the selected section, and the token to use for the selected - protocol. + Tuple[str, Dict[Union[str, bool]], str]: A tuple containing a dictionary containing + the configuration option and the token to use for the selected protocol. """ global KUKSA_CONFIG, KUKSA_TOKEN KUKSA_CONFIG.clear() - if config.has_section(preferred_config): - KUKSA_CONFIG['ip'] = config[preferred_config]['ip'] - KUKSA_CONFIG['port'] = config[preferred_config]['port'] - KUKSA_CONFIG['protocol'] = config[preferred_config]['protocol'] - KUKSA_CONFIG['insecure'] = False if config[preferred_config]['insecure'] == 'False' else True + if config.has_section('vss-server'): + KUKSA_CONFIG['ip'] = config['vss-server']['ip'] + KUKSA_CONFIG['port'] = config['vss-server']['port'] + KUKSA_CONFIG['protocol'] = config['vss-server']['protocol'] + KUKSA_CONFIG['insecure'] = False if config['vss-server']['insecure'] == 'False' else True - if config.has_option(preferred_config, 'cacert'): - KUKSA_CONFIG['cacertificate'] = config[preferred_config]['cacert'] if os.path.exists( - config[preferred_config]['cacert']) else CA_PATH + if config.has_option('vss-server', 'cacert'): + KUKSA_CONFIG['cacertificate'] = config['vss-server']['cacert'] if os.path.exists( + config['vss-server']['cacert']) else CA_PATH else: KUKSA_CONFIG['cacertificate'] = None - KUKSA_CONFIG['tls_server_name'] = config[preferred_config]['tls_server_name'] + KUKSA_CONFIG['tls_server_name'] = config['vss-server']['tls_server_name'] - if config.has_option(preferred_config, 'token'): - if config[preferred_config]['token'] == 'default': + if config.has_option('vss-server', 'token'): + if config['vss-server']['token'] == 'default': KUKSA_TOKEN = get_default_token(KUKSA_CONFIG['protocol']) - elif os.path.exists(config[preferred_config]['token']): - KUKSA_TOKEN = config[preferred_config]['token'] + elif os.path.exists(config['vss-server']['token']): + KUKSA_TOKEN = config['vss-server']['token'] else: ValueError( - f"Token file {config[preferred_config]['token']} not found") + f"Token file {config['vss-server']['token']} not found") else: raise ValueError( - f"Config section {preferred_config} not found in config.ini") + f"Config section {'vss-server'} not found in config.ini") - return preferred_config, KUKSA_CONFIG, KUKSA_TOKEN - - -def get_list_configs(): - return config.sections()[1:] - - -def get_default_config(): - defaultConfigName = config.get('default', 'preferred-config') - return defaultConfigName + return KUKSA_CONFIG, KUKSA_TOKEN def get_default_token(protocol): @@ -122,44 +111,50 @@ def get_default_token(protocol): return WS_TOKEN -def save_session_config(session_config, auth_token, CA_File=None): +def save_config(new_config, auth_token, CA_File=None): """ - save values to config.ini under [user-session] + save values to config.ini under [vss-server] """ - config.set('user-session', 'ip', str(session_config['ip'])) - config.set('user-session', 'port', str(session_config['port'])) - config.set('user-session', 'protocol', str(session_config['protocol'])) - config.set('user-session', 'insecure', str(session_config['insecure'])) - config.set('user-session', 'tls_server_name', - str(session_config['tls_server_name'])) + config.set('vss-server', 'ip', str(new_config['ip'])) + config.set('vss-server', 'port', str(new_config['port'])) + config.set('vss-server', 'protocol', str(new_config['protocol'])) + config.set('vss-server', 'insecure', str(new_config['insecure'])) + config.set('vss-server', 'tls_server_name', + str(new_config['tls_server_name'])) if auth_token in WS_TOKEN_PATHS or auth_token in GRPC_TOKEN_PATHS or auth_token == 'default': - config.set('user-session', 'token', 'default') + config.set('vss-server', 'token', 'default') else: - config.set('user-session', 'token', str(auth_token)) + config.set('vss-server', 'token', str(auth_token)) if CA_File in CA_PATHS or CA_File == 'default': - config.set('user-session', 'cacert', 'default') + config.set('vss-server', 'cacert', 'default') else: - config.set('user-session', 'cacert', str(CA_File)) + config.set('vss-server', 'cacert', str(CA_File)) with open(config_path, 'w') as configfile: config.write(configfile) def fullscreen_mode(): - return config.getboolean('default', 'fullscreen-mode') + return config.getboolean('default', 'fullscreen-mode', fallback=False) + +def hvac_enabled(): + return config.getboolean('default', 'hvac-enabled', fallback=True) + +def steering_wheel_enabled(): + return config.getboolean('default', 'steering-wheel-enabled', fallback=True) -if not config.has_section('user-session'): - config.add_section('user-session') +if not config.has_section('vss-server'): + config.add_section('vss-server') temp = { - 'ip': "", - 'port': "", - 'protocol': "", + 'ip': "localhost", + 'port': "55555", + 'protocol': "grpc", 'insecure': "", 'cacert': "", 'token': "", 'tls_server_name': "", } - save_session_config(temp, 'default', 'default') + save_config(temp, 'default', 'default') diff --git a/ui/Settings_Window.ui b/ui/Settings_Window.ui index e4d5c52..d59cae6 100644 --- a/ui/Settings_Window.ui +++ b/ui/Settings_Window.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>1105</width> - <height>631</height> + <width>1379</width> + <height>754</height> </rect> </property> <property name="windowTitle"> @@ -122,25 +122,13 @@ QCheckBox:indicator:disabled { }</string> </property> <widget class="QWidget" name="centralwidget"> + <property name="minimumSize"> + <size> + <width>800</width> + <height>631</height> + </size> + </property> <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="3"> - <widget class="QLabel" name="label_2"> - <property name="font"> - <font> - <pointsize>16</pointsize> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Page Settings</string> - </property> - <property name="margin"> - <number>6</number> - </property> - </widget> - </item> <item row="3" column="1"> <widget class="QFrame" name="divider_1"> <property name="frameShape"> @@ -151,367 +139,140 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLabel" name="label_19"> - <property name="font"> - <font> - <pointsize>16</pointsize> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Client Settings</string> - </property> - </widget> - </item> - <item row="1" column="5" rowspan="6"> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> + <item row="4" column="2" rowspan="2" colspan="2" alignment="Qt::AlignTop"> + <widget class="QFrame" name="frame_page_settings"> + <property name="minimumSize"> <size> - <width>40</width> - <height>20</height> + <width>0</width> + <height>0</height> </size> </property> - </spacer> - </item> - <item row="0" column="0" colspan="6"> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> </property> - </spacer> + <layout class="QGridLayout" name="gridLayout_3"/> + </widget> </item> - <item row="6" column="1" colspan="4"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> + <item row="5" column="1"> + <widget class="QFrame" name="frame_general_settings"> + <property name="minimumSize"> <size> - <width>20</width> - <height>40</height> + <width>800</width> + <height>0</height> </size> </property> - </spacer> - </item> - <item row="1" column="1" colspan="4"> - <widget class="QFrame" name="frame_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout_4"> - <item row="0" column="0"> - <widget class="QPushButton" name="startClientBtn"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="3" column="3" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_12"> <property name="font"> <font> - <pointsize>16</pointsize> + <pointsize>14</pointsize> <weight>75</weight> <italic>true</italic> <bold>true</bold> </font> </property> <property name="text"> - <string>Start client</string> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/play.svg</normaloff>:/Carbon_Icons/carbon_icons/play.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> + <string>WS</string> </property> </widget> </item> - <item row="0" column="1" colspan="2" alignment="Qt::AlignRight"> - <widget class="QPushButton" name="reconnectBtn"> + <item row="2" column="0" colspan="3"> + <widget class="QLabel" name="label"> <property name="font"> <font> - <pointsize>16</pointsize> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> + <pointsize>14</pointsize> </font> </property> - <property name="text"> - <string>Reconnect</string> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/renew.svg</normaloff>:/Carbon_Icons/carbon_icons/renew.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> + <property name="toolTip"> + <string>Default: Secure</string> </property> - </widget> - </item> - <item row="3" column="1" alignment="Qt::AlignRight"> - <widget class="QLabel" name="connectionLogo"> <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/connection-signal--off.svg</pixmap> + <string>Secure Mode</string> </property> </widget> </item> - <item row="3" column="2" alignment="Qt::AlignLeft"> - <widget class="QLabel" name="connectionStatus"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <item row="4" column="0"> + <widget class="QLabel" name="label_20"> <property name="font"> <font> <pointsize>14</pointsize> - <weight>75</weight> - <bold>true</bold> </font> </property> <property name="text"> - <string>Disconnected</string> + <string>TLS Server Name</string> </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="status"> + <item row="3" column="0" colspan="2"> + <widget class="QLabel" name="label_11"> <property name="font"> <font> <pointsize>14</pointsize> - <weight>75</weight> - <bold>true</bold> </font> </property> - <property name="text"> - <string>Status</string> - </property> - </widget> - </item> - <item row="4" column="0" colspan="3"> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Maximum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" rowspan="6"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="2" rowspan="4"> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="4" column="3" rowspan="2" colspan="2" alignment="Qt::AlignTop"> - <widget class="QFrame" name="frame_page_settings"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="3" column="1" colspan="3"> - <widget class="QLabel" name="label_4"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> + <property name="toolTip"> + <string>Default: WS</string> </property> <property name="text"> - <string>HVAC</string> + <string>Protocol</string> </property> </widget> </item> - <item row="5" column="3" alignment="Qt::AlignHCenter"> - <widget class="QCheckBox" name="place_holder_toggle_3"> - <property name="text"> - <string/> + <item row="2" column="5" colspan="4" alignment="Qt::AlignLeft"> + <widget class="QCheckBox" name="place_holder_toggle_1"> + <property name="toolTip"> + <string>Default: Secure</string> </property> - </widget> - </item> - <item row="4" column="4"> - <widget class="QPushButton" name="pushButton_3"> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/view.svg</normaloff>:/Carbon_Icons/carbon_icons/view.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> + <property name="checked"> + <bool>false</bool> </property> </widget> </item> - <item row="2" column="1" colspan="3"> - <widget class="QLabel" name="label_3"> + <item row="6" column="3" colspan="6"> + <widget class="QLineEdit" name="CA_File"> <property name="font"> <font> <pointsize>14</pointsize> </font> </property> - <property name="text"> - <string>Instrument Cluster</string> - </property> </widget> </item> - <item row="4" column="1" colspan="3"> - <widget class="QLabel" name="label_5"> + <item row="5" column="3" colspan="6"> + <widget class="QLineEdit" name="Auth_Token"> <property name="font"> <font> <pointsize>14</pointsize> </font> </property> - <property name="text"> - <string>Steering Controls</string> - </property> - </widget> - </item> - <item row="5" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QLabel" name="label_15"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/x-axis.svg</pixmap> - </property> </widget> </item> - <item row="5" column="2" alignment="Qt::AlignRight|Qt::AlignVCenter"> - <widget class="QLabel" name="label_14"> + <item row="1" column="0"> + <widget class="QLabel" name="label_16"> <property name="font"> <font> <pointsize>14</pointsize> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> </font> </property> <property name="text"> - <string>Kuksa</string> - </property> - </widget> - </item> - <item row="2" column="4"> - <widget class="QPushButton" name="pushButton"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/view.svg</normaloff>:/Carbon_Icons/carbon_icons/view.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>25</width> - <height>25</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/windy--strong.svg</pixmap> - </property> - <property name="scaledContents"> - <bool>true</bool> + <string>Port</string> </property> </widget> </item> - <item row="5" column="4" alignment="Qt::AlignLeft"> - <widget class="QLabel" name="label_10"> + <item row="3" column="7" colspan="2" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_13"> <property name="font"> <font> <pointsize>14</pointsize> @@ -521,106 +282,23 @@ QCheckBox:indicator:disabled { </font> </property> <property name="text"> - <string>CAN</string> - </property> - </widget> - </item> - <item row="3" column="4"> - <widget class="QPushButton" name="pushButton_2"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/view.svg</normaloff>:/Carbon_Icons/carbon_icons/view.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>25</width> - <height>25</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Images/Images/steering-wheel.svg</pixmap> - </property> - <property name="scaledContents"> - <bool>true</bool> + <string>gRPC</string> </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Ignored"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>25</width> - <height>25</height> - </size> + <item row="5" column="0"> + <widget class="QLabel" name="label_21"> + <property name="font"> + <font> + <pointsize>14</pointsize> + </font> </property> <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/meter.svg</pixmap> - </property> - <property name="scaledContents"> - <bool>true</bool> + <string>Auth Token</string> </property> </widget> </item> - </layout> - </widget> - </item> - <item row="3" column="3" colspan="2"> - <widget class="QFrame" name="divider_2"> - <property name="acceptDrops"> - <bool>false</bool> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="frameShape"> - <enum>QFrame::HLine</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QFrame" name="frame_general_settings"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="3" colspan="6"> + <item row="0" column="3" colspan="6"> <widget class="QLineEdit" name="IPAddrInput"> <property name="font"> <font> @@ -632,19 +310,17 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_16"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> - </property> + <item row="2" column="3" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_9"> <property name="text"> - <string>Port</string> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/security-services.svg</pixmap> </property> </widget> </item> - <item row="4" column="4" colspan="3" alignment="Qt::AlignHCenter"> + <item row="3" column="4" colspan="3" alignment="Qt::AlignHCenter"> <widget class="QCheckBox" name="place_holder_toggle_2"> <property name="toolTip"> <string>Default: WS</string> @@ -654,8 +330,8 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="5" column="3" colspan="6"> - <widget class="QLineEdit" name="TLS_Server_Name"> + <item row="1" column="3" colspan="6"> + <widget class="QLineEdit" name="PortInput"> <property name="font"> <font> <pointsize>14</pointsize> @@ -663,188 +339,249 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_18"> + <item row="6" column="0"> + <widget class="QLabel" name="label_17"> <property name="font"> <font> <pointsize>14</pointsize> </font> </property> <property name="text"> - <string>Default Config</string> + <string>CA.pem File</string> </property> </widget> </item> - <item row="1" column="0" colspan="3"> - <widget class="QLabel" name="IPAddr"> + <item row="4" column="3" colspan="6"> + <widget class="QLineEdit" name="TLS_Server_Name"> <property name="font"> <font> <pointsize>14</pointsize> </font> </property> - <property name="text"> - <string>IP Address</string> - </property> </widget> </item> - <item row="3" column="0" colspan="3"> - <widget class="QLabel" name="label"> + <item row="0" column="0" colspan="3"> + <widget class="QLabel" name="IPAddr"> <property name="font"> <font> <pointsize>14</pointsize> </font> </property> - <property name="toolTip"> - <string>Default: Secure</string> - </property> <property name="text"> - <string>Secure Mode</string> + <string>IP Address</string> </property> </widget> </item> - <item row="2" column="3" colspan="6"> - <widget class="QLineEdit" name="PortInput"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> + </layout> + </widget> + </item> + <item row="1" column="4" rowspan="6"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="0" colspan="5"> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="1" colspan="3"> + <widget class="QFrame" name="frame_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_4"> + <item row="0" column="0"> + <widget class="QPushButton" name="startClientBtn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </widget> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="label_21"> <property name="font"> <font> - <pointsize>14</pointsize> + <pointsize>16</pointsize> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> </font> </property> <property name="text"> - <string>Auth Token</string> + <string>Start client</string> </property> - </widget> - </item> - <item row="6" column="3" colspan="6"> - <widget class="QLineEdit" name="Auth_Token"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/play.svg</normaloff>:/Carbon_Icons/carbon_icons/play.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> </property> </widget> </item> - <item row="4" column="3" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_12"> + <item row="0" column="1" colspan="2" alignment="Qt::AlignRight"> + <widget class="QPushButton" name="reconnectBtn"> <property name="font"> <font> - <pointsize>14</pointsize> + <pointsize>16</pointsize> <weight>75</weight> <italic>true</italic> <bold>true</bold> </font> </property> <property name="text"> - <string>WS</string> + <string>Reconnect</string> </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_20"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/renew.svg</normaloff>:/Carbon_Icons/carbon_icons/renew.svg</iconset> </property> - <property name="text"> - <string>TLS Server Name</string> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> </property> </widget> </item> - <item row="3" column="5" colspan="4" alignment="Qt::AlignLeft"> - <widget class="QCheckBox" name="place_holder_toggle_1"> - <property name="toolTip"> - <string>Default: Secure</string> - </property> + <item row="3" column="1" alignment="Qt::AlignRight"> + <widget class="QLabel" name="connectionLogo"> <property name="text"> <string/> </property> - <property name="checked"> - <bool>false</bool> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/connection-signal--off.svg</pixmap> </property> </widget> </item> - <item row="4" column="0" colspan="2"> - <widget class="QLabel" name="label_11"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> - </property> - <property name="toolTip"> - <string>Default: WS</string> - </property> - <property name="text"> - <string>Protocol</string> + <item row="3" column="2" alignment="Qt::AlignLeft"> + <widget class="QLabel" name="connectionStatus"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </widget> - </item> - <item row="0" column="3" colspan="6"> - <widget class="QComboBox" name="List_Configs_ComboBox"> <property name="font"> <font> <pointsize>14</pointsize> + <weight>75</weight> + <bold>true</bold> </font> </property> - </widget> - </item> - <item row="3" column="3" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_9"> <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/security-services.svg</pixmap> + <string>Disconnected</string> </property> </widget> </item> - <item row="4" column="7" colspan="2" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_13"> + <item row="3" column="0"> + <widget class="QLabel" name="status"> <property name="font"> <font> <pointsize>14</pointsize> <weight>75</weight> - <italic>true</italic> <bold>true</bold> </font> </property> <property name="text"> - <string>gRPC</string> + <string>Status:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> </item> - <item row="7" column="0"> - <widget class="QLabel" name="label_17"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> + <item row="4" column="0" colspan="3"> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="text"> - <string>CA.pem File</string> + <property name="sizeType"> + <enum>QSizePolicy::Maximum</enum> </property> - </widget> - </item> - <item row="7" column="3" colspan="6"> - <widget class="QLineEdit" name="CA_File"> - <property name="font"> - <font> - <pointsize>14</pointsize> - </font> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> </property> - </widget> + </spacer> </item> </layout> </widget> </item> + <item row="6" column="1" colspan="3"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_19"> + <property name="font"> + <font> + <pointsize>16</pointsize> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Client Settings</string> + </property> + </widget> + </item> + <item row="1" column="0" rowspan="6"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> </layout> </widget> </widget> |