diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/editem-int.h | 1 | ||||
-rw-r--r-- | src/gui/editor.c | 10 | ||||
-rw-r--r-- | src/gui/menus/project.c | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/editem-int.h b/src/gui/editem-int.h index a70cc87..801e54c 100644 --- a/src/gui/editem-int.h +++ b/src/gui/editem-int.h @@ -32,6 +32,7 @@ #include <gtk/gtkwidget.h> +#include "../analysis/project.h" #include "../common/dllist.h" #include "../gtkext/gtkdisplaypanel.h" diff --git a/src/gui/editor.c b/src/gui/editor.c index 7047f32..ea2fe1f 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -1608,7 +1608,7 @@ static void notify_paned_handle_position_change(GObject *obj, GParamSpec *pspec, * Remarques : - * * * ******************************************************************************/ - +#include "../glibext/signal.h" static void notify_editor_project_change(GStudyProject *project, bool new) { @@ -1616,7 +1616,9 @@ static void notify_editor_project_change(GStudyProject *project, bool new) { - g_signal_connect(project, "content-added", G_CALLBACK(on_editor_loaded_content_added), NULL); + g_signal_connect_to_main(project, "content-added", G_CALLBACK(on_editor_loaded_content_added), NULL, + g_cclosure_marshal_VOID__OBJECT); + @@ -1630,8 +1632,8 @@ static void notify_editor_project_change(GStudyProject *project, bool new) g_study_project_hide(project); - - g_signal_handlers_disconnect_by_func(project, G_CALLBACK(on_editor_loaded_content_added), NULL); + // FIXME + //g_signal_handlers_disconnect_by_func(project, G_CALLBACK(on_editor_loaded_content_added), NULL); } diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c index 424a506..5a28a7e 100644 --- a/src/gui/menus/project.c +++ b/src/gui/menus/project.c @@ -286,8 +286,6 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar) free(dir); } - g_object_unref(G_OBJECT(project)); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); @@ -296,7 +294,7 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar) if (content != NULL) { - qck_study_new_content(content, PCS_ROOT); + g_study_project_discover_binary_content(project, content); g_object_unref(G_OBJECT(content)); } @@ -304,6 +302,8 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar) } + g_object_unref(G_OBJECT(project)); + gtk_widget_destroy(dialog); } |