NDEVR
API Documentation
WebSocketConnectionDialog

A ConnectionDialog that allows the user to modify a WebSocketConnection. More...

Inheritance diagram for WebSocketConnectionDialog:
[legend]
Collaboration diagram for WebSocketConnectionDialog:
[legend]

Public Member Functions

 WebSocketConnectionDialog (QWidget *parent=nullptr)
 Constructs a WebSocketConnectionDialog with an optional parent widget.
 ~WebSocketConnectionDialog ()
 Destroys the dialog and frees the UI resources.
bool checkIfValid () const
 Validates the current dialog field values.
virtual void clear () override
 Resets all dialog fields to their default empty state.
void clearFixedProtocol ()
 Removes the fixed protocol constraint, allowing the user to choose freely.
virtual ConnectionInfo connectionInfo () const override
 Builds and returns a ConnectionInfo populated from the current dialog field values.
virtual bool handlesConnection (const ConnectionInfo &connection) override
 Checks whether this dialog can edit the given connection type.
String protocol () const
 Returns the currently selected or fixed protocol string.
void setAllowLocalButton (bool allow_local)
 Enables or disables the local/localhost shortcut button.
void setAllowPingLogic (bool allow_ping)
 Enables or disables the ping-test logic and associated UI controls.
virtual void setConnectionInfo (const ConnectionInfo &connection) override
 Populates the dialog fields from the given connection information.
void setFixedProtocol (const String &mode)
 Locks the protocol selector to a fixed value, preventing user changes.
Public Member Functions inherited from ConnectionDialog
 ConnectionDialog (QWidget *parent=nullptr)
 Constructs a ConnectionDialog.
void acceptedSignal ()
 Emitted when the user accepts the connection configuration.
void cancelSignal ()
 Emitted when the user cancels the dialog.
virtual ConnectioncreateConnection (const Model &model) const
 Creates a Connection object from the current dialog settings and associates it with a model.

Protected Member Functions

void refreshPingVisible ()
 Updates the visibility of ping-related controls based on current settings.
void updateFromDialog ()
 Slot that synchronizes internal state when dialog fields are modified by the user.

Protected Attributes

bool m_allow_local_button = true
 Whether the localhost shortcut button is visible.
bool m_allow_ping_logic = true
 Whether ping-test controls are visible and active.
String m_fixed_protocol
 When non-empty, locks the protocol to this value.
Ui::WebNetworkConnectionUI * ui
 The auto-generated UI form for WebSocket connection settings.

Detailed Description

A ConnectionDialog that allows the user to modify a WebSocketConnection.


Definition at line 57 of file WebSocketConnectionDialog.h.

Constructor & Destructor Documentation

◆ WebSocketConnectionDialog()

WebSocketConnectionDialog::WebSocketConnectionDialog ( QWidget * parent = nullptr)
explicit

Constructs a WebSocketConnectionDialog with an optional parent widget.

Parameters
[in]parentThe parent widget, or nullptr for a top-level dialog.

Member Function Documentation

◆ checkIfValid()

bool WebSocketConnectionDialog::checkIfValid ( ) const

Validates the current dialog field values.

Returns
True if the dialog contains a valid, complete connection configuration.

◆ connectionInfo()

virtual ConnectionInfo WebSocketConnectionDialog::connectionInfo ( ) const
overridevirtual

Builds and returns a ConnectionInfo populated from the current dialog field values.

Returns
The ConnectionInfo reflecting the user's current selections.

Implements ConnectionDialog.

◆ handlesConnection()

virtual bool WebSocketConnectionDialog::handlesConnection ( const ConnectionInfo & connection)
overridevirtual

Checks whether this dialog can edit the given connection type.

Parameters
[in]connectionThe connection information to test.
Returns
True if this dialog handles the specified connection.

Implements ConnectionDialog.

◆ protocol()

String WebSocketConnectionDialog::protocol ( ) const

Returns the currently selected or fixed protocol string.

Returns
The protocol identifier (e.g., "ws" or "wss").

◆ setAllowLocalButton()

void WebSocketConnectionDialog::setAllowLocalButton ( bool allow_local)

Enables or disables the local/localhost shortcut button.

Parameters
[in]allow_localTrue to show the local button, false to hide it.

◆ setAllowPingLogic()

void WebSocketConnectionDialog::setAllowPingLogic ( bool allow_ping)

Enables or disables the ping-test logic and associated UI controls.

Parameters
[in]allow_pingTrue to enable ping controls, false to hide them.

◆ setConnectionInfo()

virtual void WebSocketConnectionDialog::setConnectionInfo ( const ConnectionInfo & connection)
overridevirtual

Populates the dialog fields from the given connection information.

Parameters
[in]connectionThe connection parameters to display.

Implements ConnectionDialog.

◆ setFixedProtocol()

void WebSocketConnectionDialog::setFixedProtocol ( const String & mode)

Locks the protocol selector to a fixed value, preventing user changes.

Parameters
[in]modeThe protocol string to fix (e.g., "ws" or "wss").

The documentation for this class was generated from the following file: