LibrePCB Developers Documentation
|
Container for all workspace related settings. More...
#include <workspacesettings.h>
Inherits QObject.
Public Member Functions | |
WorkspaceSettings (const WorkspaceSettings &other)=delete | |
WorkspaceSettings (QObject *parent=nullptr) | |
~WorkspaceSettings () noexcept | |
void | load (const SExpression &node, const Version &fileFormat) |
Load settings from file. More... | |
void | restoreDefaults () noexcept |
Reset all settings to their default value. More... | |
std::unique_ptr< SExpression > | serialize () |
Serialize settings to librepcb::SExpression. More... | |
WorkspaceSettings & | operator= (const WorkspaceSettings &rhs)=delete |
Private Member Functions | |
QList< WorkspaceSettingsItem * > | getAllItems () const noexcept |
Get all librepcb::WorkspaceSettingsItem objects. More... | |
Private Attributes | |
QMap< QString, SExpression > | mFileContent |
Settings nodes loaded by load() More... | |
bool | mUpgradeRequired |
Whether mFileContent needs to be upgraded or not. More... | |
Container for all workspace related settings.
The "settings.lp" file in a workspace is used to store workspace related settings. This class is an interface to those settings. A librepcb::WorkspaceSettings object is created in the constructor of the librepcb::Workspace object.
Each settings item is represented by an instance of a librepcb::WorkspaceSettingsItem subclass.
|
delete |
|
explicit |
|
noexcept |
void load | ( | const SExpression & | node, |
const Version & | fileFormat | ||
) |
Load settings from file.
node | S-Expression node of settings file. |
fileFormat | File format of settings file. |
|
noexcept |
Reset all settings to their default value.
std::unique_ptr< SExpression > serialize | ( | ) |
Serialize settings to librepcb::SExpression.
|
delete |
|
privatenoexcept |
Get all librepcb::WorkspaceSettingsItem objects.
|
private |
Settings nodes loaded by load()
This map is filled with all settings S-Expression nodes when loading the settings from file. When modifying settings with the workspace settings dialog, the nodes in this map are updated accordingly. When saving the settings to file, these S-Expression nodes will be written to the file.
Important:
|
private |
Whether mFileContent needs to be upgraded or not.
WorkspaceSettingsItem_GenericValue<QString> userName |
User name.
Used when creating new library elements or projects.
Default: "" (but gets initialized when creating a new workspace)
WorkspaceSettingsItem_GenericValue<QString> applicationLocale |
The application's locale (e.g. "en_US")
An empty string means that the system locale will be used.
Default: ""
WorkspaceSettingsItem_GenericValue<LengthUnit> defaultLengthUnit |
The application's default length unit.
Default: millimeters
WorkspaceSettingsItem_GenericValue<uint> projectAutosaveIntervalSeconds |
Project autosave interval [seconds] (0 = autosave disabled)
Default: 600
WorkspaceSettingsItem_GenericValue<bool> useOpenGl |
Use OpenGL hardware acceleration.
Default: False
WorkspaceSettingsItem_GenericValueList<QStringList> libraryLocaleOrder |
Preferred library locales (like "de_CH") in the right order.
The locale which should be used first is at index 0 of the list. If no translation strings are found for all locales in this list, the fallback locale "en_US" will be used automatically, so the list do not have to contain "en_US". An empty list is also valid, then the fallback locale "en_US" will be used.
Default: []
WorkspaceSettingsItem_GenericValueList<QStringList> libraryNormOrder |
Preferred library norms (like "DIN EN 81346") in the right order.
The norm which should be used first is at index 0 of the list.
Default: []
WorkspaceSettingsItem_GenericValueList<QList<QUrl> > apiEndpoints |
The list of API endpoint URLs in the right order.
The endpoint with the highest priority is at index 0 of the list. In case of version conflicts, the endpoint with the higher priority will be used.
Default: ["https://api.librepcb.org"]
WorkspaceSettingsItem_GenericValue<bool> autofetchLivePartInformation |
Enable auto-fetch of live parts information (through apiEndpoints)
Default: True
WorkspaceSettingsItem_GenericValueList<QStringList> externalWebBrowserCommands |
Custom command(s) to be used for opening web URLs.
When opening an URL, the application will iterate through this list of commands until a command was successful. If none was successful, the system's default command will be used as fallback.
Supported placeholders: {{URL}}
Default: []
WorkspaceSettingsItem_GenericValueList<QStringList> externalFileManagerCommands |
Custom command(s) to be used for opening directories.
When opening a directory, the application will iterate through this list of commands until a command was successful. If none was successful, the system's default command will be used as fallback.
Supported placeholders: {{URL}}
, {{FILEPATH}}
Default: []
WorkspaceSettingsItem_GenericValueList<QStringList> externalPdfReaderCommands |
Custom command(s) to be used for opening PDF files.
When opening a PDF file, the application will iterate through this list of commands until a command was successful. If none was successful, the system's default command will be used as fallback.
Supported placeholders: {{URL}}
, {{FILEPATH}}
Default: []
WorkspaceSettingsItem_KeyboardShortcuts keyboardShortcuts |
Keyboard shortcuts.
WorkspaceSettingsItem_Themes themes |
Themes.
WorkspaceSettingsItem_GenericValueList<QSet<QString> > dismissedMessages |
Dismissed messages.
List of messages which the user dismissed with "do not show again". It's just a generic list of strings, where each message is identified by some locale-independent string. It's recommended to use UPPER_SNAKE_CASE strings, For example: "WORKSPACE_V0.1_HAS_NO_LIBRARIES".
Default: []