[GUI] Add PreferencePack support

Preference Packs are collections of preferences that can be applied en
mass to the user's current setup. Any preference that can be stored in
user.cfg can be stored in a preference pack, and they are designed to be
easy to distribute.

Support is also added for saving a subset of current preferences into a
new preference pack in order to facilitate easy creation of new
"themes", etc.
This commit is contained in:
Chris Hennes
2021-04-19 12:19:50 -05:00
parent 30fd2ce5b8
commit 858e88afe1
29 changed files with 1858 additions and 32 deletions

View File

@@ -44,6 +44,7 @@
#endif
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/filesystem.hpp>
#include <QtOpenGL.h>
#if defined(HAVE_QT5_OPENGL)
#include <QWindow>
@@ -72,6 +73,7 @@
#include "WidgetFactory.h"
#include "Command.h"
#include "Macro.h"
#include "PreferencePackManager.h"
#include "ProgressBar.h"
#include "Workbench.h"
#include "WorkbenchManager.h"
@@ -159,6 +161,9 @@ struct ApplicationP
macroMngr = new MacroManager();
else
macroMngr = nullptr;
// Create the Theme Manager
prefPackManager = new PreferencePackManager();
}
~ApplicationP()
@@ -172,6 +177,7 @@ struct ApplicationP
Gui::Document* activeDocument;
Gui::Document* editDocument;
MacroManager* macroMngr;
PreferencePackManager* prefPackManager;
/// List of all registered views
std::list<Gui::BaseView*> passive;
bool isClosing;
@@ -1616,6 +1622,12 @@ CommandManager &Application::commandManager(void)
return d->commandManager;
}
Gui::PreferencePackManager* Application::prefPackManager(void)
{
return d->prefPackManager;
}
//**************************************************************************
// Init, Destruct and singleton