summaryrefslogtreecommitdiff
path: root/src/gui/menus/project.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-01-10 23:04:51 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-01-10 23:04:51 (GMT)
commit6b785b0e6c6048a4a8f1f81f9eaa407e05622368 (patch)
treedc6dc802b65ec37b3cbc3c65e9d6637654f0981c /src/gui/menus/project.c
parentc0528230469b10d606b9d1fa66a18696b2584fed (diff)
Cleaned editor items by removing a direct link to the main window.
Diffstat (limited to 'src/gui/menus/project.c')
-rw-r--r--src/gui/menus/project.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c
index 459d963..76dc7e5 100644
--- a/src/gui/menus/project.c
+++ b/src/gui/menus/project.c
@@ -32,6 +32,7 @@
#include "../editem-int.h"
+#include "../core/global.h"
#include "../../analysis/loading.h"
#include "../../analysis/contents/file.h"
#include "../../core/global.h"
@@ -174,14 +175,17 @@ void update_menu_project_for_project(GtkWidget *widget, GStudyProject *project,
static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar)
{
+ GtkWindow *editor; /* Fenêtre graphique principale*/
GtkWidget *dialog; /* Boîte à afficher */
GStudyProject *project; /* Projet courant */
char *dir; /* Répertoire courant */
gchar *filename; /* Nom du fichier à intégrer */
GBinContent *content; /* Contenu binaire à charger */
+ editor = get_editor_window();
+
dialog = gtk_file_chooser_dialog_new(_("Open a binary file"),
- GTK_WINDOW(G_EDITOR_ITEM(bar)->ref),
+ editor,
GTK_FILE_CHOOSER_ACTION_OPEN,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_ACCEPT,
@@ -217,6 +221,8 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar)
gtk_widget_destroy(dialog);
+ g_object_unref(G_OBJECT(editor));
+
}