From fbf28343bd4b347d220f5ad385e0a4c0b3391894 Mon Sep 17 00:00:00 2001 From: Fabien-B Date: Wed, 14 Feb 2024 22:47:42 +0100 Subject: [PATCH] [doc] settings and global config --- .../developer_guide/index_developer.rst | 3 +- docs/source/developer_guide/settings.rst | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 docs/source/developer_guide/settings.rst diff --git a/docs/source/developer_guide/index_developer.rst b/docs/source/developer_guide/index_developer.rst index 23a44937..18b7c4db 100644 --- a/docs/source/developer_guide/index_developer.rst +++ b/docs/source/developer_guide/index_developer.rst @@ -6,11 +6,12 @@ Developer guide This part will guide you through the code of PprzGCS, and some desing choices that have been made. .. toctree:: - :maxdepth: 2 + :maxdepth: 1 how_to_build concepts pprzapplication + settings aircraft widgets map diff --git a/docs/source/developer_guide/settings.rst b/docs/source/developer_guide/settings.rst new file mode 100644 index 00000000..2db4b446 --- /dev/null +++ b/docs/source/developer_guide/settings.rst @@ -0,0 +1,31 @@ + +Settings and config +=================== + +Settings and global configurations are both global and accessible from anywhere in the application. They differ only by the intended lifespan. + +Settings +-------- + +Settings are stored in a file and are saved accross sessions. + +It uses the QSettings interface, with a file named ``settings.conf`` at the standard path ``QStandardPaths::AppDataLocation``. +Thus, it's most probably corresponds to ``$HOME/.local/share/pprzgcs/settings.conf``. + + +Use the helper function ``QSettings getAppSettings()`` from ``gcs_utils.h`` to start using them. + + +GlobalConfig +------------ + +The global config is a singleton holding a key/value configuration. + +It lives only for the current session. + +Use the helper function ``GlobalConfig* appConfig()`` from ``gcs_utils.h`` to start using it. + +Like the settings, it uses QVariant type to hold its items. + + +