LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
LC::Util::AddressesModelManager Class Reference

Manages an XML settings model with a list of network interfaces selected by the user from the list of available ones. More...

#include "addressesmodelmanager.h"

+ Inheritance diagram for LC::Util::AddressesModelManager:
+ Collaboration diagram for LC::Util::AddressesModelManager:

Public Slots

void addRequested (const QString &property, const QVariantList &list)
 Invoked by XML settings dialog to add new user-selected items. More...
 
void removeRequested (const QString &property, const QModelIndexList &list)
 Invoked by XML settings dialog to remove some user-selected items. More...
 

Signals

void addressesChanged ()
 Notifies about the changes in the selected interfaces list. More...
 

Public Member Functions

 AddressesModelManager (BaseSettingsManager *bsm, int defaultPort, QObject *parent=nullptr)
 Constructs the model manager. More...
 
QAbstractItemModel * GetModel () const
 Returns the managed model. More...
 
AddrList_t GetAddresses () const
 Returns the list of addresses of interfaces selected by the user. More...
 

Static Public Member Functions

static void RegisterTypes ()
 Registers the types used for storage in Qt metasystem. More...
 

Detailed Description

Manages an XML settings model with a list of network interfaces selected by the user from the list of available ones.

AddressesModelManager uses a BaseSettingsManager instance to store the interfaces.

The default list is populated by local-only interfaces.

Definition at line 35 of file addressesmodelmanager.h.

Constructor & Destructor Documentation

◆ AddressesModelManager()

LC::Util::AddressesModelManager::AddressesModelManager ( BaseSettingsManager *  bsm,
int  defaultPort,
QObject *  parent = nullptr 
)

Constructs the model manager.

Parameters
[in]bsmThe settings manager to be used to store the list of interfaces.
[in]defaultPortThe default port used when presenting interface addition dialog to the user.
[in]parentThe parent object.

Definition at line 32 of file addressesmodelmanager.cpp.

Member Function Documentation

◆ addRequested

void LC::Util::AddressesModelManager::addRequested ( const QString &  property,
const QVariantList &  list 
)
slot

Invoked by XML settings dialog to add new user-selected items.

Parameters
[in]propertyThe name of the property for which new items should be added.
[in]listThe list of items to add (corresponding to the columns in the model).
See also
removeRequested()

Definition at line 125 of file addressesmodelmanager.cpp.

◆ addressesChanged

void LC::Util::AddressesModelManager::addressesChanged ( )
signal

Notifies about the changes in the selected interfaces list.

◆ GetAddresses()

AddrList_t LC::Util::AddressesModelManager::GetAddresses ( ) const

Returns the list of addresses of interfaces selected by the user.

Returns
The list of addresses of the interfaces selected by the user.
See also
GetModel()

Definition at line 77 of file addressesmodelmanager.cpp.

◆ GetModel()

QAbstractItemModel * LC::Util::AddressesModelManager::GetModel ( ) const

Returns the managed model.

The model contains the list of network interfaces selected by the user.

Returns
The network interfaces model.
See also
GetAddresses()

Definition at line 72 of file addressesmodelmanager.cpp.

◆ RegisterTypes()

void LC::Util::AddressesModelManager::RegisterTypes ( )
static

Registers the types used for storage in Qt metasystem.

This function should be called once during plugin startup before XML settings system is initialized (that is, before the corresponding BaseSettingsManager passed to the constructor of this class is instantiated).

Definition at line 66 of file addressesmodelmanager.cpp.

◆ removeRequested

void LC::Util::AddressesModelManager::removeRequested ( const QString &  property,
const QModelIndexList &  list 
)
slot

Invoked by XML settings dialog to remove some user-selected items.

Parameters
[in]propertyThe name of the property for which new items should be added.
[in]listThe list of model indexes to remove.
See also
addRequested()

Definition at line 135 of file addressesmodelmanager.cpp.


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