diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2025-02-22 17:53:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2025-02-22 17:53:07 (GMT) |
commit | 8fe33f41ae9bd319298c601548a453020d23ad06 (patch) | |
tree | b7936b22311f403616fc851d8715d7fee9a49cb2 /src/gui | |
parent | 0b8fbc0c0d6a18cf1b90337dbd20639316af1fe7 (diff) |
Handle configuration edition for plugins.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/preferences.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/dialogs/preferences.c b/src/gui/dialogs/preferences.c index aca562a..68e7fd9 100644 --- a/src/gui/dialogs/preferences.c +++ b/src/gui/dialogs/preferences.c @@ -37,6 +37,8 @@ #include "prefs/security.h" #include "../../common/cpp.h" #include "../../gtkext/tweak.h" +#include "../../plugins/pglist.h" +#include "../../plugins/tweakable.h" @@ -133,6 +135,8 @@ static void gtk_preferences_dialog_init(GtkPreferencesDialog *dialog) const tweak_info_t *info; /* Informations à considérer */ GtkListBox *navigation; /* Liste de sections à afficher*/ GtkTweakSection *section; /* Nouvelle section à présenter*/ + tweak_info_t *dyn_infos; /* Informations supplémentaires*/ + size_t dyn_count; /* Quantité de ces informations*/ tweak_info_t infos[] = { TWEAK_SIMPLE_DEF("root", "Basics", @@ -158,6 +162,26 @@ static void gtk_preferences_dialog_init(GtkPreferencesDialog *dialog) } + /* Chargement des sections dynamiques */ + + dyn_infos = get_tweakable_plugins_info(&dyn_count); + + for (i = 0; i < dyn_count; i++) + { + info = &dyn_infos[i]; + + navigation = gtk_preferences_dialog_get_navigation(dialog, info->parent, true); + assert(navigation != NULL); + + section = gtk_tweak_section_new(info); + + gtk_list_box_append(navigation, GTK_WIDGET(section)); + + } + + if (dyn_infos != NULL) + free(dyn_infos); + /* Affichage de la liste racine */ navigation = gtk_preferences_dialog_get_navigation(dialog, "root", false); |