--- a/MqttMonitor/MqttConnectionOptionsDialog.ui Wed Jul 21 20:10:36 2021 +0200 +++ b/MqttMonitor/MqttConnectionOptionsDialog.ui Thu Jul 22 19:02:32 2021 +0200 @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>550</width> - <height>675</height> + <width>450</width> + <height>350</height> </rect> </property> <property name="windowTitle"> @@ -16,67 +16,390 @@ <property name="sizeGripEnabled"> <bool>true</bool> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>General</string> + <widget class="QTabWidget" name="optionsWidget"> + <property name="currentIndex"> + <number>0</number> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Client ID:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="clientIdEdit"> - <property name="toolTip"> - <string>Enter the ID string for this client</string> - </property> - <property name="clearButtonEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="generateIdButton"> - <property name="toolTip"> - <string>Press to generate a client ID</string> - </property> - <property name="text"> - <string>Generate</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QGroupBox" name="groupBox_5"> - <property name="title"> - <string>MQTT Protocol</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <widget class="QWidget" name="generalTab"> + <attribute name="title"> + <string>General</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QRadioButton" name="mqttv31Button"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Client ID:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="clientIdEdit"> <property name="toolTip"> - <string>Select to use the MQTT 3.1 protocol</string> + <string>Enter the ID string for this client</string> </property> - <property name="text"> - <string>v 3.1</string> + <property name="clearButtonEnabled"> + <bool>true</bool> </property> </widget> </item> <item> - <widget class="QRadioButton" name="mqttv311Button"> + <widget class="QPushButton" name="generateIdButton"> <property name="toolTip"> - <string>Select to use the MQTT 3.1.1 protocol</string> + <string>Press to generate a client ID</string> </property> <property name="text"> - <string>v 3.1.1</string> + <string>Generate</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox_5"> + <property name="title"> + <string>MQTT Protocol</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QRadioButton" name="mqttv31Button"> + <property name="toolTip"> + <string>Select to use the MQTT 3.1 protocol</string> + </property> + <property name="text"> + <string>v 3.1</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="mqttv311Button"> + <property name="toolTip"> + <string>Select to use the MQTT 3.1.1 protocol</string> + </property> + <property name="text"> + <string>v 3.1.1</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="mqttv5Button"> + <property name="toolTip"> + <string>Select to use the MQTT 5.0 protocol</string> + </property> + <property name="text"> + <string>v 5.0</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>Connection Timeout:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSpinBox" name="connectionTimeoutSpinBox"> + <property name="toolTip"> + <string>Enter the connection timeout in seconds</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="suffix"> + <string> s</string> + </property> + <property name="maximum"> + <number>300</number> + </property> + <property name="singleStep"> + <number>5</number> + </property> + <property name="value"> + <number>15</number> + </property> + </widget> + </item> + <item row="0" column="2"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>148</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Keep Alive Interval:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="keepaliveSpinBox"> + <property name="toolTip"> + <string>Enter the keep alive interval in seconds</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="suffix"> + <string> s</string> + </property> + <property name="maximum"> + <number>300</number> + </property> + <property name="singleStep"> + <number>5</number> + </property> + <property name="value"> + <number>60</number> + </property> + </widget> + </item> + <item row="1" column="2"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>148</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QCheckBox" name="cleanSessionCheckBox"> + <property name="toolTip"> + <string>Select to start with a clean session</string> + </property> + <property name="text"> + <string>Clean Session</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>92</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="credentialsTab"> + <attribute name="title"> + <string>User Credentials</string> + </attribute> + <layout class="QGridLayout" name="gridLayout_5"> + <item row="0" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>User Name:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="usernameEdit"> + <property name="toolTip"> + <string>Enter the user name</string> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Password:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="passwordEdit"> + <property name="toolTip"> + <string>Enter the password</string> + </property> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="1"> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>204</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="lastWillTab"> + <attribute name="title"> + <string>Last Will</string> + </attribute> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="1"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>QoS:</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="4"> + <widget class="QPlainTextEdit" name="willMessageEdit"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>300</height> + </size> + </property> + <property name="toolTip"> + <string>Enter the last will message to be sent</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QSpinBox" name="willQosSpinBox"> + <property name="toolTip"> + <string>Enter the desired QoS value</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="maximum"> + <number>2</number> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QCheckBox" name="willRetainCheckBox"> + <property name="toolTip"> + <string>Select to retain the last will message</string> + </property> + <property name="text"> + <string>Retain</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLineEdit" name="willTopicEdit"> + <property name="toolTip"> + <string>Enter the topic of the last will</string> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="tlsTab"> + <attribute name="title"> + <string>SSL/TLS</string> + </attribute> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0" colspan="2"> + <widget class="QCheckBox" name="tlsEnableCheckBox"> + <property name="toolTip"> + <string>Select to enable SSL/TLS connections</string> + </property> + <property name="text"> + <string>SSL/TLS Enabled</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>CA File:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="EricPathPicker" name="tlsCertsFilePicker" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <property name="toolTip"> + <string>Enter the full path to the CA certificate file; leave empty to use platform default</string> + </property> + </widget> + </item> + <item row="2" column="0" colspan="2"> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>214</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="propertiesTab"> + <attribute name="title"> + <string>User Properties</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QRadioButton" name="connectPropertiesButton"> + <property name="toolTip"> + <string>Select to edit the CONNECT user properties</string> + </property> + <property name="text"> + <string>CONNECT</string> </property> <property name="checked"> <bool>true</bool> @@ -84,270 +407,42 @@ </widget> </item> <item> - <widget class="QRadioButton" name="mqttv5Button"> + <widget class="QRadioButton" name="disconnectPropertiesButton"> <property name="toolTip"> - <string>Select to use the MQTT 5.0 protocol</string> + <string>Select to edit the DISCONNECT user properties</string> </property> <property name="text"> - <string>v 5.0</string> + <string>DISCONNECT</string> </property> </widget> </item> </layout> - </widget> - </item> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Connection Timeout:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="connectionTimeoutSpinBox"> - <property name="toolTip"> - <string>Enter the connection timeout in seconds</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="suffix"> - <string> s</string> - </property> - <property name="maximum"> - <number>300</number> - </property> - <property name="singleStep"> - <number>5</number> - </property> - <property name="value"> - <number>15</number> - </property> - </widget> - </item> - <item row="0" column="2"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>148</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Keep Alive Interval:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="keepaliveSpinBox"> - <property name="toolTip"> - <string>Enter the keep alive interval in seconds</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="suffix"> - <string> s</string> - </property> - <property name="maximum"> - <number>300</number> - </property> - <property name="singleStep"> - <number>5</number> - </property> - <property name="value"> - <number>60</number> - </property> - </widget> - </item> - <item row="1" column="2"> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>148</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QCheckBox" name="cleanSessionCheckBox"> - <property name="toolTip"> - <string>Select to start with a clean session</string> - </property> - <property name="text"> - <string>Clean Session</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>User Credentials</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>User Name:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="usernameEdit"> - <property name="toolTip"> - <string>Enter the user name</string> - </property> - <property name="clearButtonEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Password:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="passwordEdit"> - <property name="toolTip"> - <string>Enter the password</string> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="clearButtonEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_3"> - <property name="title"> - <string>Last Will and Testament</string> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0"> - <widget class="QLineEdit" name="willTopicEdit"> - <property name="toolTip"> - <string>Enter the topic of the last will</string> - </property> - <property name="clearButtonEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>QoS:</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QSpinBox" name="willQosSpinBox"> - <property name="toolTip"> - <string>Enter the desired QoS value</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="maximum"> - <number>2</number> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QCheckBox" name="willRetainCheckBox"> - <property name="toolTip"> - <string>Select to retain the last will message</string> - </property> - <property name="text"> - <string>Retain</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="4"> - <widget class="QPlainTextEdit" name="willMessageEdit"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>300</height> - </size> - </property> - <property name="toolTip"> - <string>Enter the last will message to be sent</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_4"> - <property name="title"> - <string>SSL/TLS</string> - </property> - <layout class="QGridLayout" name="gridLayout_4"> - <item row="0" column="0" colspan="2"> - <widget class="QCheckBox" name="tlsEnableCheckBox"> - <property name="toolTip"> - <string>Select to enable SSL/TLS connections</string> - </property> - <property name="text"> - <string>SSL/TLS Enabled</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>CA File:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="EricPathPicker" name="tlsCertsFilePicker" native="true"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="toolTip"> - <string>Enter the full path to the CA certificate file; leave empty to use platform default</string> - </property> - </widget> - </item> - </layout> + </item> + <item> + <widget class="MqttUserPropertiesEditor" name="propertiesWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="samePropertiesCheckBox"> + <property name="toolTip"> + <string>Select to use the CONNECT user properties when disconnecting</string> + </property> + <property name="text"> + <string>Use CONNECT properties for DISCONNECT</string> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> <item> @@ -369,8 +464,15 @@ <header>EricWidgets/EricPathPicker.h</header> <container>1</container> </customwidget> + <customwidget> + <class>MqttUserPropertiesEditor</class> + <extends>QWidget</extends> + <header>MqttMonitor/MqttUserPropertiesEditor.h</header> + <container>1</container> + </customwidget> </customwidgets> <tabstops> + <tabstop>optionsWidget</tabstop> <tabstop>clientIdEdit</tabstop> <tabstop>generateIdButton</tabstop> <tabstop>mqttv31Button</tabstop> @@ -382,11 +484,15 @@ <tabstop>usernameEdit</tabstop> <tabstop>passwordEdit</tabstop> <tabstop>willTopicEdit</tabstop> + <tabstop>willMessageEdit</tabstop> <tabstop>willQosSpinBox</tabstop> <tabstop>willRetainCheckBox</tabstop> - <tabstop>willMessageEdit</tabstop> <tabstop>tlsEnableCheckBox</tabstop> <tabstop>tlsCertsFilePicker</tabstop> + <tabstop>connectPropertiesButton</tabstop> + <tabstop>disconnectPropertiesButton</tabstop> + <tabstop>propertiesWidget</tabstop> + <tabstop>samePropertiesCheckBox</tabstop> </tabstops> <resources/> <connections>