summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-10-24 21:59:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-10-24 21:59:55 (GMT)
commita9c607a1be25b43a17ea55b21459a0433f4f3d5b (patch)
tree0bc9018cb2b533d32cf8693871eef563835973b0 /src/gui/menus
parent7ba652c99e843b21c108fc242b8faa7f5f9502c0 (diff)
Provided a dialog box to manage snapshots.
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/binary.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c
index cb131d7..aeaf6f6 100644
--- a/src/gui/menus/binary.c
+++ b/src/gui/menus/binary.c
@@ -34,6 +34,7 @@
#include "../dialogs/export_disass.h"
#include "../dialogs/export_graph.h"
#include "../dialogs/gotox.h"
+#include "../dialogs/snapshots.h"
#include "../dialogs/storage.h"
#include "../../gtkext/easygtk.h"
#include "../../gtkext/gtkdisplaypanel.h"
@@ -47,9 +48,12 @@ static void mcb_binary_entry_points(GtkMenuItem *, GMenuBar *);
/* Réagit au menu "Binaire -> Attacher un débogueur". */
static void mcb_binary_attach_debugger(GtkMenuItem *, GMenuBar *);
-/* Réagit au menu "Binaire -> Enregistrements...". */
+/* Réagit au menu "Binaire -> Enregistrements". */
static void mcb_binary_storage(GtkMenuItem *, GMenuBar *);
+/* Réagit au menu "Binaire -> Instantanés". */
+static void mcb_binary_snapshots(GtkMenuItem *, GMenuBar *);
+
/* Réagit au menu "Binaire -> Exporter -> Désassemblage". */
static void mcb_binary_export_disass(GtkMenuItem *, gpointer);
@@ -96,13 +100,21 @@ GtkWidget *build_menu_binary(GObject *ref, GMenuBar *bar)
G_CALLBACK(mcb_binary_attach_debugger), bar);
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+ /* Séparation */
+
submenuitem = qck_create_menu_separator();
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
- submenuitem = qck_create_menu_item(ref, "mnu_binary_storage", _("Storage..."),
+ /* Bases de données */
+
+ submenuitem = qck_create_menu_item(ref, "mnu_binary_storage", _("Storage"),
G_CALLBACK(mcb_binary_storage), bar);
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+ submenuitem = qck_create_menu_item(ref, "mnu_binary_snapshots", _("Snapshots"),
+ G_CALLBACK(mcb_binary_snapshots), bar);
+ gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
+
/* Séparation */
submenuitem = qck_create_menu_separator();
@@ -271,7 +283,7 @@ static void mcb_binary_attach_debugger(GtkMenuItem *menuitem, GMenuBar *bar)
* Paramètres : menuitem = élément de menu sélectionné. *
* bar = barre de menu parente. *
* *
-* Description : Réagit au menu "Binaire -> Enregistrements...". *
+* Description : Réagit au menu "Binaire -> Enregistrements". *
* *
* Retour : - *
* *
@@ -312,6 +324,45 @@ static void mcb_binary_storage(GtkMenuItem *menuitem, GMenuBar *bar)
/******************************************************************************
* *
* Paramètres : menuitem = élément de menu sélectionné. *
+* bar = barre de menu parente. *
+* *
+* Description : Réagit au menu "Binaire -> Instantanés". *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void mcb_binary_snapshots(GtkMenuItem *menuitem, GMenuBar *bar)
+{
+ GLoadedBinary *binary; /* Edition courante */
+ GtkBuilder *builder; /* Constructeur utilisé */
+ GtkWindow *editor; /* Fenêtre graphique principale*/
+ GtkWidget *dialog; /* Boîte de dialogue à montrer */
+
+ binary = G_LOADED_BINARY(get_current_content());
+
+ editor = get_editor_window();
+
+ dialog = create_snapshots_dialog(binary, editor, &builder);
+
+ gtk_dialog_run(GTK_DIALOG(dialog));
+
+ gtk_widget_destroy(dialog);
+
+ g_object_unref(G_OBJECT(builder));
+
+ g_object_unref(G_OBJECT(editor));
+
+ g_object_unref(G_OBJECT(binary));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : menuitem = élément de menu sélectionné. *
* unused = adresse non utilisée ici. *
* *
* Description : Réagit au menu "Binaire -> Exporter -> Désassemblage". *