Public Slots | Signals | Public Member Functions | Protected Attributes | List of all members
pqServerConfigurationCollection Class Reference

pqServerConfigurationCollection maintains a serializable collection of server-configurations defined in pqServerConfiguration instances. More...

#include <pqServerConfigurationCollection.h>

Inherits QObject.

Public Slots

void removeUserConfigurations ()
 Remove all user configurations. More...
 

Signals

void changed ()
 fired when the collection is modified. More...
 

Public Member Functions

 pqServerConfigurationCollection (QObject *parent=nullptr)
 
 ~pqServerConfigurationCollection () override
 
bool loadContents (const QString &contents, bool mutable_configs)
 load a pvsc txt. More...
 
QString saveContents (bool only_mutable) const
 save the currently loaded configurations to a file. More...
 
bool load (const QString &filename, bool mutable_configs)
 load/save configurations from/to file. More...
 
bool save (const QString &filename, bool only_mutable)
 
bool saveNow ()
 
void addConfiguration (vtkPVXMLElement *configuration, bool mutable_config=true)
 Add a server configuration. More...
 
void addConfiguration (const pqServerConfiguration &)
 
void removeConfiguration (const QString &)
 remove a configuration given the name. More...
 
QList< pqServerConfigurationconfigurations () const
 returns the set of server-configurations. More...
 
QList< pqServerConfigurationconfigurations (const pqServerResource &selector) const
 returns the configurations matching the selector's host. More...
 
const pqServerConfigurationconfiguration (const char *configuration_name) const
 Returns a configuration with the given name. More...
 

Protected Attributes

QMap< QString, pqServerConfigurationConfigurations
 

Detailed Description

pqServerConfigurationCollection maintains a serializable collection of server-configurations defined in pqServerConfiguration instances.

During construction, this class attempts to read server-configurations from following locations:

The location marked as "User-specific servers" is the location where any server-configurations created/imported by user are saved. User can only modify the server-configurations loaded from this file. All others are treated as read-only configurations.

Definition at line 32 of file pqServerConfigurationCollection.h.

Constructor & Destructor Documentation

◆ pqServerConfigurationCollection()

pqServerConfigurationCollection::pqServerConfigurationCollection ( QObject *  parent = nullptr)

◆ ~pqServerConfigurationCollection()

pqServerConfigurationCollection::~pqServerConfigurationCollection ( )
override

Member Function Documentation

◆ loadContents()

bool pqServerConfigurationCollection::loadContents ( const QString &  contents,
bool  mutable_configs 
)

load a pvsc txt.

If mutable_configs==true, then the server-configurations loaded from this file can be edited by the user and get saved in "User-specific servers" configuration file at destruction.

◆ saveContents()

QString pqServerConfigurationCollection::saveContents ( bool  only_mutable) const

save the currently loaded configurations to a file.

If only_mutable==true, only the configurations that were marked mutable are saved, otherwise all configurations are saved.

◆ load()

bool pqServerConfigurationCollection::load ( const QString &  filename,
bool  mutable_configs 
)

load/save configurations from/to file.

◆ save()

bool pqServerConfigurationCollection::save ( const QString &  filename,
bool  only_mutable 
)

◆ saveNow()

bool pqServerConfigurationCollection::saveNow ( )

◆ addConfiguration() [1/2]

void pqServerConfigurationCollection::addConfiguration ( vtkPVXMLElement configuration,
bool  mutable_config = true 
)

Add a server configuration.

◆ addConfiguration() [2/2]

void pqServerConfigurationCollection::addConfiguration ( const pqServerConfiguration )

◆ removeConfiguration()

void pqServerConfigurationCollection::removeConfiguration ( const QString &  )

remove a configuration given the name.

◆ configurations() [1/2]

QList<pqServerConfiguration> pqServerConfigurationCollection::configurations ( ) const

returns the set of server-configurations.

◆ configurations() [2/2]

QList<pqServerConfiguration> pqServerConfigurationCollection::configurations ( const pqServerResource selector) const

returns the configurations matching the selector's host.

◆ configuration()

const pqServerConfiguration* pqServerConfigurationCollection::configuration ( const char *  configuration_name) const

Returns a configuration with the given name.

Returns nullptr when none is found.

◆ removeUserConfigurations

void pqServerConfigurationCollection::removeUserConfigurations ( )
slot

Remove all user configurations.

This deletes the user servers.pvsc file.

◆ changed

void pqServerConfigurationCollection::changed ( )
signal

fired when the collection is modified.

Member Data Documentation

◆ Configurations

QMap<QString, pqServerConfiguration> pqServerConfigurationCollection::Configurations
protected

Definition at line 102 of file pqServerConfigurationCollection.h.


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