summaryrefslogtreecommitdiff
path: root/src/gui/editor.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-28 00:24:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-28 00:24:40 (GMT)
commit94cb8acac1027a4deee933c84d7918f4a5ea4983 (patch)
treee6f5a1f372cdceb942d4bd659668c20dc34e649b /src/gui/editor.c
parentfa99f722ed6b06ea7f6b56a8816c61ecd5053289 (diff)
Allowed to filter contents before running analysis.
Diffstat (limited to 'src/gui/editor.c')
-rw-r--r--src/gui/editor.c49
1 files changed, 47 insertions, 2 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 */