diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-05 00:39:57 (GMT) |
commit | 1e3fa9b79ebe55698e2aa7d5484baec7e8400a8f (patch) | |
tree | c3581ceb7f8586f2f6822de563927a1246dd33a5 /src/gui/core/core.c | |
parent | 6122bb7f34b178d4c07285adae16afcc55294b1f (diff) |
Rewritten the whole API dealing with panels.
Diffstat (limited to 'src/gui/core/core.c')
-rw-r--r-- | src/gui/core/core.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/gui/core/core.c b/src/gui/core/core.c index 0c1e3f3..ccad3ad 100644 --- a/src/gui/core/core.c +++ b/src/gui/core/core.c @@ -30,6 +30,7 @@ #include "theme.h" #include "../menubar.h" #include "../menus/view.h" +#include "../panels/log.h" #include "../panels/welcome.h" #include "../../core/params.h" #include "../../glibext/linesegment.h" @@ -37,6 +38,11 @@ +/* Charge les panneaux sur la base de la configuration fournie. */ +static bool apply_panel_items_configuration(GPanelItemClass *, GGenConfig *); + + + /****************************************************************************** * * * Paramètres : - * @@ -64,7 +70,7 @@ bool load_all_gui_components(void) * Charge une liste initiale pour activer les raccourcis clavier. */ - bar = G_MENU_BAR(find_editor_item_by_key("menubar")); + bar = G_MENU_BAR(find_editor_item_by_type(G_TYPE_MENU_BAR)); builder = get_editor_builder(); @@ -83,6 +89,34 @@ bool load_all_gui_components(void) /****************************************************************************** * * +* Paramètres : class = classe de panneau enregistré comme existant. * +* config = configuration à charger. * +* * +* Description : Charge les panneaux sur la base de la configuration fournie. * +* * +* Retour : true, par conformité avec browse_all_item_panels(). * +* * +* Remarques : - * +* * +******************************************************************************/ + +static bool apply_panel_items_configuration(GPanelItemClass *class, GGenConfig *config) +{ + GPanelItem *panel; /* Panneau à mettre en place */ + + if (gtk_panel_item_class_dock_at_startup(class)) + { + panel = g_panel_item_new(G_TYPE_FROM_CLASS(class), ""); + g_object_unref(G_OBJECT(panel)); + } + + return true; + +} + + +/****************************************************************************** +* * * Paramètres : config = configuration globale à utiliser. * * * * Description : Finalise le chargement des éléments graphiques de l'éditeur. * @@ -111,7 +145,7 @@ bool complete_loading_of_all_gui_components(GGenConfig *config) grid = get_tiled_grid(); - welcome = get_panel_item_by_name(PANEL_WELCOME_ID); + welcome = g_panel_item_new(G_TYPE_WELCOME_PANEL, NULL); gtk_tiled_grid_set_default_main_panel(grid, welcome); g_object_unref(G_OBJECT(welcome)); @@ -127,7 +161,7 @@ bool complete_loading_of_all_gui_components(GGenConfig *config) */ if (result) - result = _browse_all_item_panels(true, (handle_panel_item_fc)gtk_panel_item_apply_configuration, config); + result = _browse_all_item_panels(true, (handle_panel_item_fc)apply_panel_items_configuration, config); /** * Comme la boucle de traitements GTK n'est pas encore lancée, tous les |