[ghex/gtk4-port: 53/91] Add missing keybindings; GApp "open" in new tab




commit a2cdc11f1abd2c008b21db6b734ffc75723bc701
Author: Logan Rathbone <poprocks gmail com>
Date:   Mon Jan 25 08:38:12 2021 -0500

    Add missing keybindings; GApp "open" in new tab

 src/gtkhex.c | 14 ++++++++++++++
 src/main.c   |  7 +++----
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/gtkhex.c b/src/gtkhex.c
index 7ddc250c..9cac21a6 100644
--- a/src/gtkhex.c
+++ b/src/gtkhex.c
@@ -2938,6 +2938,20 @@ gtk_hex_class_init (GtkHexClass *klass)
                        "gtkhex.copy",
                        NULL);  // no args.
 
+       /* Ctrl+x - cut */
+       gtk_widget_class_add_binding_action (widget_class,
+                       GDK_KEY_x,
+                       GDK_CONTROL_MASK,
+                       "gtkhex.cut",
+                       NULL);  // no args.
+
+       /* Ctrl+v - paste */
+       gtk_widget_class_add_binding_action (widget_class,
+                       GDK_KEY_v,
+                       GDK_CONTROL_MASK,
+                       "gtkhex.paste",
+                       NULL);  // no args.
+
        /* Ctrl+z - undo */
        gtk_widget_class_add_binding_action (widget_class,
                        GDK_KEY_z,
diff --git a/src/main.c b/src/main.c
index a071ff01..c2747bf6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -126,18 +126,17 @@ main (int argc, char *argv[])
 
        ghex_init_configuration ();
 
-       /* FIXME - not 100% decided on NON_UNIQUE for this as yet. */
        app = gtk_application_new ("org.gnome.GHex",
-                       G_APPLICATION_NON_UNIQUE | G_APPLICATION_HANDLES_OPEN);
+                       G_APPLICATION_HANDLES_OPEN);
 
-       g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
+       g_signal_connect (app, "activate", G_CALLBACK(activate), NULL);
        g_signal_connect (app, "open", G_CALLBACK(open), NULL);
 
        g_application_register (G_APPLICATION (app), NULL, NULL);
 
        status = g_application_run (G_APPLICATION(app), argc, argv);
 
-       g_object_unref(app);
+       g_object_unref (app);
 
        return status;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]