diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/editor.c | 49 | ||||
-rw-r--r-- | src/gui/menus/project.c | 2 |
2 files changed, 48 insertions, 3 deletions
diff --git a/src/gui/editor.c b/src/gui/editor.c index 16b7a59..b52ec9d 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -46,6 +46,7 @@ #include "../common/extstr.h" #include "../core/global.h" #include "../core/params.h" +#include "../glibext/chrysamarshal.h" #include "../glibext/signal.h" #include "../gtkext/easygtk.h" #include "../gtkext/gtkdisplaypanel.h" @@ -129,8 +130,11 @@ static void notify_editor_project_change(GStudyProject *, bool); /* Assure un positionnement initial idéal. */ static gboolean scroll_for_the_first_time(GtkWidget *, GdkEvent *, GLoadedContent *); +/* Présente une possibilité de sélection des contenus chargés. */ +static void on_editor_contents_available(GStudyProject *, GLoadedContent **, guint, void *); + /* Affiche le contenu qui vient de rejoindre un projet donné. */ -void on_editor_loaded_content_added(GStudyProject *, GLoadedContent *, void *); +static void on_editor_loaded_content_added(GStudyProject *, GLoadedContent *, void *); /* Recherche et retirer de l'affichage un contenu chargé. */ static void remove_loaded_content_from_editor(GtkWidget *, GLoadedContent *); @@ -905,9 +909,15 @@ static void notify_editor_project_change(GStudyProject *project, bool new) contents = _g_study_project_get_contents(project, &count); if (new) + { + g_signal_connect_to_main(project, "contents-available", G_CALLBACK(on_editor_contents_available), NULL, + g_cclosure_user_marshal_VOID__POINTER_UINT); + g_signal_connect_to_main(project, "content-added", G_CALLBACK(on_editor_loaded_content_added), NULL, g_cclosure_marshal_VOID__OBJECT); + } + g_study_project_unlock_contents(project); if (new) @@ -934,6 +944,41 @@ static void notify_editor_project_change(GStudyProject *project, bool new) /****************************************************************************** * * +* Paramètres : project = project impliqué dans l'opération. * +* contents = nouveaux contenus à éventuellement charger. * +* count = taille de la liste fournie. * +* unused = adresse non utilisée ici. * +* * +* Description : Présente une possibilité de sélection des contenus chargés. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void on_editor_contents_available(GStudyProject *project, GLoadedContent **contents, guint count, void *unused) +{ + guint i; /* Boucle de parcours */ + + for (i = 0; i < count; i++) + { + g_signal_connect(contents[i], "analyzed", G_CALLBACK(on_loaded_content_analyzed), project); + + g_loaded_content_analyze(contents[i]); + + g_object_unref(G_OBJECT(contents[i])); + + } + + if (contents != NULL) + free(contents); + +} + + +/****************************************************************************** +* * * Paramètres : project = project impliqué dans l'opération. * * content = nouveau contenu à présenter dans l'éditeur. * * unused = adresse non utilisée ici. * @@ -946,7 +991,7 @@ static void notify_editor_project_change(GStudyProject *project, bool new) * * ******************************************************************************/ -void on_editor_loaded_content_added(GStudyProject *project, GLoadedContent *content, void *unused) +static void on_editor_loaded_content_added(GStudyProject *project, GLoadedContent *content, void *unused) { GtkWidget *selected; /* Interface de prédilection */ const char *name; /* Titre associé au binaire */ diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c index a6a078b..80eff6f 100644 --- a/src/gui/menus/project.c +++ b/src/gui/menus/project.c @@ -205,7 +205,7 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar) if (content != NULL) { - g_study_project_discover_binary_content(project, content); + g_study_project_discover_binary_content(project, content, NULL, NULL); g_object_unref(G_OBJECT(content)); } |