NDEVR
API Documentation
ConnectionStatusWidget

A dial and information text that shows the current status of a connection. More...

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

Public Member Functions

 ConnectionStatusWidget (QWidget *parent=nullptr)
 Constructs a ConnectionStatusWidget.
void cancelConnection ()
 Initiates cancellation of the current connection attempt.
void clearConnectionStatus ()
 Clears all connection status information from the display.
void endCancelConnection ()
 Completes the connection cancellation and updates the display.
ProgressWidgetprogressWidget () const
 Returns the progress widget used by this status display.
void setActAsLog (bool act_like_log)
 Sets whether the widget should display as a log view.
void setColor (RGBColor color)
 Sets the color of the progress dial.
void setConnectionState (ConnectionState state)
 Manually sets the displayed connection state.
void setCustomTitle (const TranslatedString &custom_title)
 Sets a custom title to display instead of the default connection name.
void setHorizontal (bool horizontal)
 Sets whether the widget uses a horizontal or vertical layout.
virtual void setProgress (uint04 idx, fltp04 progress) override
 Updates the progress indicator at the given index.
void setSensor (Connection *sensor)
 Sets the connection whose status will be displayed.
Public Member Functions inherited from LogStream
virtual ~LogStream ()
 Destructor.
virtual void addMessages (uint04 id, const Buffer< LogMessage > &messages)
 Adds multiple log messages to this stream at once.
virtual void addProgressSource (const TranslatedString &name, uint04 idx, fltp04 progress)
 Registers a new progress source to be tracked by this stream.
virtual void allowCancel (bool)
 Sets whether this stream allows the user to cancel an in-progress operation.
virtual void allowInput (bool)
 Sets whether this stream allows user input during an operation.
virtual void attach (InfoPipe *stream)
 Attaches this LogStream to the given InfoPipe so it receives log updates.
void clearLinks ()
 Detaches this LogStream from all linked InfoPipe objects and clears the link list.
virtual void detach (InfoPipe *stream)
 Detaches this LogStream from the given InfoPipe, stopping further updates from it.
bool ignoringMessages () const
 Returns whether this stream is currently ignoring messages.
virtual void removeProgressSource (uint04 idx)
 Removes a previously registered progress source from this stream.
void setIgnoreMessages (bool ignore)
 Sets whether this stream should ignore incoming messages.

Protected Member Functions

virtual void addMessage (uint04 id, const LogMessage &message) override
 Adds a log message to the status display.
void connectionStateUpdatedSlot (ConnectionState state)
 Slot called when the monitored connection's state changes.
void deletedSlot ()
 Slot called when the monitored connection is deleted.
void init ()
 Initializes the widget layout and child widgets.
void updateTitle ()
 Updates the title label based on the connection name or custom title.

Protected Attributes

bool m_act_like_log = false
 Whether to display as a log view.
ConnectionState m_connection_state = ConnectionState::e_no_connection
 The current connection state.
TranslatedString m_custom_title
 Custom title overriding the default connection name.
bool m_has_connection_object = false
 Whether a connection object has been assigned.
bool m_is_horizontal
 Whether the widget uses horizontal layout.
Logm_log
 Log widget for displaying connection messages.
bool m_owns_log = false
 Whether this widget owns the log object.
fltp04 m_pending_progress = Constant<fltp04>::Invalid
 Pending progress value awaiting display.
ProgressWidgetm_progress_widget
 Dial widget showing connection progress.
QPointer< Connectionm_sensor
 The connection being monitored.
QCustomLabelm_status_label
 Label displaying the current status text.
QCustomLabelm_title_label
 Label displaying the connection title.
Protected Attributes inherited from LogStream
bool m_ignore_message = false
 Whether this stream should ignore incoming messages.
Buffer< InfoPipe * > m_linked_logs
 Collection of InfoPipe objects this stream is listening to.
Dictionary< uint04, ProgressSourcem_progress_sources
 Maps progress source indices to their ProgressSource data.

Detailed Description

A dial and information text that shows the current status of a connection.


Typically shown when a connection is being attempted to keep the user informed on the status of the connection attempt.

Definition at line 49 of file ConnectionStatusWidget.h.

Constructor & Destructor Documentation

◆ ConnectionStatusWidget()

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

Constructs a ConnectionStatusWidget.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ addMessage()

virtual void ConnectionStatusWidget::addMessage ( uint04 id,
const LogMessage & message )
overrideprotectedvirtual

Adds a log message to the status display.

Parameters
[in]idThe message identifier.
[in]messageThe log message to add.

Implements LogStream.

◆ connectionStateUpdatedSlot()

void ConnectionStatusWidget::connectionStateUpdatedSlot ( ConnectionState state)
protected

Slot called when the monitored connection's state changes.

Parameters
[in]stateThe new connection state.

◆ progressWidget()

ProgressWidget * ConnectionStatusWidget::progressWidget ( ) const
inline

Returns the progress widget used by this status display.

Returns
The progress widget.

Definition at line 104 of file ConnectionStatusWidget.h.

References m_progress_widget.

◆ setActAsLog()

void ConnectionStatusWidget::setActAsLog ( bool act_like_log)

Sets whether the widget should display as a log view.

Parameters
[in]act_like_logWhether to act as a log display.

◆ setColor()

void ConnectionStatusWidget::setColor ( RGBColor color)

Sets the color of the progress dial.

Parameters
[in]colorThe color to use.

◆ setConnectionState()

void ConnectionStatusWidget::setConnectionState ( ConnectionState state)

Manually sets the displayed connection state.

Parameters
[in]stateThe connection state to display.

◆ setCustomTitle()

void ConnectionStatusWidget::setCustomTitle ( const TranslatedString & custom_title)

Sets a custom title to display instead of the default connection name.

Parameters
[in]custom_titleThe custom title text.

◆ setHorizontal()

void ConnectionStatusWidget::setHorizontal ( bool horizontal)

Sets whether the widget uses a horizontal or vertical layout.

Parameters
[in]horizontalWhether to use horizontal layout.

◆ setProgress()

virtual void ConnectionStatusWidget::setProgress ( uint04 idx,
fltp04 progress )
overridevirtual

Updates the progress indicator at the given index.

Parameters
[in]idxThe progress index.
[in]progressThe progress value between 0 and 1.

Implements LogStream.

◆ setSensor()

void ConnectionStatusWidget::setSensor ( Connection * sensor)

Sets the connection whose status will be displayed.

Parameters
[in]sensorThe connection to monitor.

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