LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WorkspaceSettings Class Referencefinal

The WorkspaceSettings class manages all workspace related settings. More...

#include <workspacesettings.h>

+ Inheritance diagram for WorkspaceSettings:
+ Collaboration diagram for WorkspaceSettings:

Public Slots

void showSettingsDialog () noexcept
 Open the workspace settings dialog. More...
 

Public Member Functions

 WorkspaceSettings ()=delete
 
 WorkspaceSettings (const WorkspaceSettings &other)=delete
 
 WorkspaceSettings (const Workspace &workspace)
 
 ~WorkspaceSettings () noexcept
 
WSI_UsergetUser () const noexcept
 
WSI_AppLocalegetAppLocale () const noexcept
 
WSI_AppDefaultMeasurementUnitsgetAppDefMeasUnits () const noexcept
 
WSI_ProjectAutosaveIntervalgetProjectAutosaveInterval () const noexcept
 
WSI_AppearancegetAppearance () const noexcept
 
WSI_LibraryLocaleOrdergetLibLocaleOrder () const noexcept
 
WSI_LibraryNormOrdergetLibNormOrder () const noexcept
 
WSI_RepositoriesgetRepositories () const noexcept
 
WSI_DebugToolsgetDebugTools () const noexcept
 
void restoreDefaults () noexcept
 
void applyAll ()
 
void revertAll () noexcept
 
WorkspaceSettingsoperator= (const WorkspaceSettings &rhs)=delete
 
- Public Member Functions inherited from SerializableObject
 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 

Private Member Functions

template<typename T >
void loadSettingsItem (QScopedPointer< T > &member, SExpression &root)
 
void saveToFile () const
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 

Private Attributes

FilePath mFilePath
 path to the "settings.lp" file More...
 
QScopedPointer
< WorkspaceSettingsDialog
mDialog
 the settings dialog More...
 
QList< WSI_Base * > mItems
 contains all settings items More...
 
QScopedPointer< WSI_UsermUser
 
QScopedPointer< WSI_AppLocalemAppLocale
 
QScopedPointer
< WSI_AppDefaultMeasurementUnits
mAppDefMeasUnits
 
QScopedPointer
< WSI_ProjectAutosaveInterval
mProjectAutosaveInterval
 
QScopedPointer< WSI_AppearancemAppearance
 
QScopedPointer
< WSI_LibraryLocaleOrder
mLibraryLocaleOrder
 
QScopedPointer
< WSI_LibraryNormOrder
mLibraryNormOrder
 
QScopedPointer< WSI_RepositoriesmRepositories
 
QScopedPointer< WSI_DebugToolsmDebugTools
 

Additional Inherited Members

- Static Public Member Functions inherited from SerializableObject
template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 

Detailed Description

The WorkspaceSettings class manages all workspace related settings.

The "settings.lp" file in a workspace is used to store workspace related settings. This class is an interface to these settings. A WorkspaceSettings object is created in the constructor of the Workspace object.

This class also provides a graphical dialog to show and edit all these settings. For this purpose, the WorkspaceSettingsDialog class is used. It can be shown by calling the slot showSettingsDialog().

Author
ubruhin
Date
2014-07-12

Constructor & Destructor Documentation

WorkspaceSettings ( )
delete
WorkspaceSettings ( const WorkspaceSettings other)
delete
WorkspaceSettings ( const Workspace workspace)
explicit

+ Here is the call graph for this function:

~WorkspaceSettings ( )
noexcept

Member Function Documentation

WSI_User& getUser ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_AppLocale& getAppLocale ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_AppDefaultMeasurementUnits& getAppDefMeasUnits ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_ProjectAutosaveInterval& getProjectAutosaveInterval ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_Appearance& getAppearance ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_LibraryLocaleOrder& getLibLocaleOrder ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_LibraryNormOrder& getLibNormOrder ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_Repositories& getRepositories ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

WSI_DebugTools& getDebugTools ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

void restoreDefaults ( )
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void applyAll ( )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void revertAll ( )
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WorkspaceSettings& operator= ( const WorkspaceSettings rhs)
delete
void showSettingsDialog ( )
slotnoexcept

Open the workspace settings dialog.

Note
The dialog is application modal, so this method is blocking while the dialog is open. This method will not return before the dialog is closed.
void loadSettingsItem ( QScopedPointer< T > &  member,
SExpression root 
)
private

+ Here is the caller graph for this function:

void saveToFile ( ) const
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize ( SExpression root) const
overrideprivatevirtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implements SerializableObject.

+ Here is the call graph for this function:

Member Data Documentation

FilePath mFilePath
private

path to the "settings.lp" file

QScopedPointer<WorkspaceSettingsDialog> mDialog
private

the settings dialog

QList<WSI_Base*> mItems
private

contains all settings items

QScopedPointer<WSI_User> mUser
private
QScopedPointer<WSI_AppLocale> mAppLocale
private
QScopedPointer<WSI_AppDefaultMeasurementUnits> mAppDefMeasUnits
private
QScopedPointer<WSI_ProjectAutosaveInterval> mProjectAutosaveInterval
private
QScopedPointer<WSI_Appearance> mAppearance
private
QScopedPointer<WSI_LibraryLocaleOrder> mLibraryLocaleOrder
private
QScopedPointer<WSI_LibraryNormOrder> mLibraryNormOrder
private
QScopedPointer<WSI_Repositories> mRepositories
private
QScopedPointer<WSI_DebugTools> mDebugTools
private

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