diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-10-24 22:18:23 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-10-24 22:18:23 (GMT) |
commit | 5acd4ab2dd059c81a333ed630686f6aa78f38a1e (patch) | |
tree | 6748a3d555fab3a9cc8d3dbf915297a438464cde /src/gui/menus | |
parent | 4563123b929366e93973a1d6aa3269bd7b3f47d6 (diff) |
Created bookmarks using a Glade UI.
Diffstat (limited to 'src/gui/menus')
-rw-r--r-- | src/gui/menus/edition.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index 04dd9df..1742616 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -678,6 +678,7 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) GDbCollection *collec; /* Collection à manipuler */ GDbItem *exist; /* Sens du basculement courant */ GObject *ref; /* Espace de référencements */ + GtkBuilder *builder; /* Constructeur utilisé */ GtkWidget *dialog; /* Boîte de dialogue à montrer */ GDbItem *bookmark; /* Nouveau signet défini */ gint ret; /* Retour de confirmation */ @@ -714,11 +715,14 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) else { ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar)); - dialog = create_bookmark_dialog(GTK_WINDOW(ref), curloc); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) + dialog = create_bookmark_dialog(GTK_WINDOW(ref), &builder); + + ret = gtk_dialog_run(GTK_DIALOG(dialog)); + + if (ret == GTK_RESPONSE_OK) { - bookmark = get_item_from_bookmark_dialog(dialog); + bookmark = get_item_from_bookmark_dialog(builder, curloc); g_db_collection_wlock(G_DB_COLLECTION(collec)); @@ -744,6 +748,8 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) gtk_widget_destroy(dialog); + g_object_unref(G_OBJECT(builder)); + } g_object_unref(G_OBJECT(collec)); |