Namespace sh::settings

namespace sh::settings

Infrastructure for settings, so everything you see in ‘Manage saved settings’.

See the abstract base class sh::settings::Setting and sh::settings::SettingsManager for more.

Enums

enum SettingGroup

Groups of settings.

A choice here does not make a logical impact. It is merely a matter of graphical presentation.

Values:

enumerator GLOBAL = 1
enumerator GUI = 2
enumerator FILEHANDLING = 3
enumerator DATAVIEW = 4
enumerator BEHAVIOR = 5
enumerator SPECIAL = 6
class ProfileNode
#include <profilenode.h>

One entry in a Shallot settings profile, so one item as selectable in the ‘Manage settings’ dialog.

Public Functions

ProfileNode()

Constructed only by the infrastructure and made available otherwise.

QString nodeId()

An identifier name.

void setNodeId(QString nodeId)

Sets the identifier name.

std::shared_ptr<const filesystem::Eurl> eurl()

The eurl of the directory, or 0 for global profile nodes.

void setEurl(std::shared_ptr<const filesystem::Eurl> eurl)

Sets the eurl.

QString profilename()

The profile name.

void setProfilename(QString profilename)

Sets the profile name.

QStringList inheritsFrom()

List of profile names from which this node inherits.

void setInheritsFrom(QStringList profilenames)

Sets list of profile names from which this node inherits.

bool withSubfolders()

If this node also applies recursively on subfolders.

void setWithSubfolders(bool v)

Sets of this node also applies recursively on subfolders.

void setSetting(QString name, QString value, int onlyInFileview = -1)

Stores a value for a setting for applying it later.

QList<QString> getSettingNames()

List of settings names which are set in this node.

QString getSettingValue(QString name)

Gets the stored value of a setting by setting name.

int getSettingOnlyInFileviewIndex(QString name)

Gets if a setting applies to a certain fileview or to the entire window.

Private Members

QMap<QString, QString> _values
QMap<QString, int> _valuesOnlyInFileviewIndex
std::shared_ptr<const sh::filesystem::Eurl> _eurl
QString _profilename
QStringList _inheritsFrom
bool _withSubfolders
QString _nodeId
class Setting
#include <setting.h>

Abstract base class for a Shallot setting.

Those have the greatest flexibility. They have to be stored manually by the user with many options. See Shallot documentation for details.

Use sh::settings::SettingsRegistration for registering an implementation.

Subclassed by sh::scripting::api::ApiSetting, sh::settings::common::FileDetailsPanelVisible, sh::settings::common::FileViewIconListThumbDimension, sh::settings::common::FileViewPath, sh::settings::common::FileViewViewmode, sh::settings::common::JumpbarMode, sh::settings::common::NumberOfFilePanels, sh::settings::common::ShowHiddenFiles, sh::settings::common::ShowTree, sh::settings::common::SizeFormattingMode, sh::settings::common::StickyTreeview, sh::settings::common::WindowTitle

Public Functions

Setting()

Is (for subclasses) intended to be directly constructed from everywhere or by registering a factory somewhere.

~Setting()
QString name() = 0

Gets the internal name.

QString description() = 0

Gets the description text.

SettingGroup group() = 0

Gets the group;.

bool isAdvancedSetting() = 0

Is this an advanced setting?

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

bool isGlobal() = 0

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview() = 0

Does this setting apply for each fileview individually or for the complete main window?

QString getValue(sh::ui::FileView *filelist) = 0

Get the currently set value.

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class SettingsManager : public QObject, public sh::base::Singleton
#include <settingsmanager.h>

Manager for Shallot settings.

This is the more flexible way of shallot customization. It includes everything you see in the ‘Manage saved settings’ or ‘Save settings’.

See sh::settings::Setting for more.

Public Functions

void applyPerEurlSettingsToFileView(sh::ui::FileView *list)

Applies all stored settings, which are per-eurl to a fileview.

void applyGlobalSettingsToFileView(sh::ui::FileView *list)

Applies all stored settings, which are global to a fileview.

void applyPerEurlSettingsToMainWindow()

Applies all stored settings, which are per-eurl to main window.

void applyGlobalSettingsToMainWindow()

Applies all stored settings, which are global to a main window.

QList<sh::settings::ProfileNode*> getNodesForProfile(QString profile)

Returns a list of all stored settings (as ProfileNodes) for a given profile.

sh::settings::ProfileNode *getNodeByNodeId(QString nodeId)

Searches and returns a ProfileNode by id.

std::shared_ptr<sh::settings::Setting> getSettingByName(QString name)

Searches and returns a Setting by name.

QList<std::shared_ptr<sh::settings::Setting>> getAllSettings()

Returns a list of all available settings, primarily sorted by group.

QStringList getProfileList()

Returns a list of all existing profiles.

void removeProfile(QString profile)

Removes a profile (including all ProfileNodes inside it).

void removeNode(QString nodeId)

Removes a ProfileNode by id.

void storeProfile(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString profilename, QMap<QString, QString> values, QMap<QString, int> onlyinfileviewindex, bool withSubfolders, QStringList inheritFrom)

Stores one setting into a profile.

~SettingsManager()
void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Signals

void profilesChanged()

Triggered when the list of profiles or the nodes inside it change.

Can also be triggered when nothing really changed!

Private Functions

void applyToFileView(sh::ui::FileView *list, QMap<QString, QString> settings)

Applies some settings (as string tuples) to a fileview.

void applyToMainWindow(QMap<QString, QString> settings)

Applies some settings (as string tuples) to main window.

QMap<QString, QString> _getSettings(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString profilename, int fileviewindex, bool directNode = true)

Computes all effective settings (including inheritance and sub-directories) for a given situation (global or eurl-bound; fileview- or mainwindow-bound) and returns it as string tuples.

Parameters
  • eurl: The directory to consider as current (or nullptr for global settings).

  • profilename: The current profile.

  • fileviewindex: The fileview index (or -1 for mainwindow-bound settings).

  • directNode: If the given directory is to be considered as the real current directory (not e.g. a parent).

QList<_SettingsFinderStructure> _getSettings_flat(std::shared_ptr<const sh::filesystem::Eurl> eurl, QString profilename)

Used internally by _getSettings().

void invalidateCache()

Invalidates the _getSettings cache.

void readStoredProfiles()

Reads all profiles (including all setting nodes) from filesystem.

SettingsManager()

Private Members

QMap<QString, QMap<QString, QString>> _getSettings_cache
QMap<QString, std::shared_ptr<sh::settings::Setting>> _settings
QMap<std::shared_ptr<const sh::filesystem::Eurl>, QMap<QString, QList<sh::settings::ProfileNode*>>> _profileNodes
QMap<QString, sh::settings::ProfileNode*> _profileNodesById
QList<QString> _profileNames

Friends

friend class sh::settings::SettingsRegistration
class _MyHandler : public QXmlDefaultHandler

Used internally for reading profile node XMLs.

Public Functions

_MyHandler(sh::settings::ProfileNode *node, QString filename)
bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)

Private Functions

void throwError()

Private Members

bool _stateStarted = true
bool _stateInProfile = false
sh::settings::ProfileNode *_node
QString _filename
class _SettingsFinderStructure

Used internally by _getSettings().

Public Functions

_SettingsFinderStructure(QMap<QString, QString> settings, QMap<QString, int> onlyinfileviewindexes, QStringList inheritFrom, bool withSubfolders)
_SettingsFinderStructure()

Public Members

QMap<QString, QString> _settings
QMap<QString, int> _onlyinfileviewindexes
QStringList _inheritFrom
bool _withSubfolders
int _onlyFileviewIndex
class SettingsRegistration
#include <settingsregistration.h>

Used for registering a setting instance.

Constructing a SettingsRegistration automatically registers a sh::settings::Setting, deleting a one automatically unregisters it.

Public Functions

SettingsRegistration(std::shared_ptr<sh::settings::Setting> setting)

Is intended to be directly constructed from everywhere.

~SettingsRegistration()
std::shared_ptr<sh::settings::Setting> setting()

Private Members

std::shared_ptr<sh::settings::Setting> _setting
namespace common

Implementations of settings.

Subclasses of sh::settings::Setting (and possibly some auxiliary stuff). Everything here could be listed in the ‘Save settings’ dialog.

class FileDetailsPanelVisible : public sh::settings::Setting
#include <filedetailspanelvisible.h>

Public Functions

FileDetailsPanelVisible()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class FileViewIconListThumbDimension : public sh::settings::Setting
#include <fileviewiconlistthumbdimension.h>

Public Functions

FileViewIconListThumbDimension()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class FileViewPath : public sh::settings::Setting
#include <fileviewpath.h>

Public Functions

FileViewPath()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *fileview, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class FileViewViewmode : public sh::settings::Setting
#include <fileviewviewmode.h>

Public Functions

FileViewViewmode()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *fileview, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class JumpbarMode : public sh::settings::Setting
#include <jumpbarmode.h>

Public Functions

JumpbarMode()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class NumberOfFilePanels : public sh::settings::Setting
#include <numberoffilepanels.h>

Public Functions

NumberOfFilePanels()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class ShowHiddenFiles : public sh::settings::Setting
#include <showhiddenfiles.h>

Public Functions

ShowHiddenFiles()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class ShowTree : public sh::settings::Setting
#include <showtree.h>

Public Functions

ShowTree()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class SizeFormattingMode : public sh::settings::Setting
#include <sizeformattingmode.h>

Public Functions

SizeFormattingMode()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(QString)

Called from Shallot core when the value was set (for a not-per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class StickyTreeview : public sh::settings::Setting
#include <stickytreeview.h>

Public Functions

StickyTreeview()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class WindowTitle : public sh::settings::Setting
#include <windowtitle.h>

Public Functions

WindowTitle()
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

void setValue(sh::ui::FileView*, QString)

Called from Shallot core when the value was set (for a per-fileview setting).

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.