From dcd1e613725700bf24b9e7856c2f5c267854af48 Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Tue, 16 Jul 2019 22:23:17 +0200 Subject: [PATCH] ctrl+q --- data/com.github.artemanufrij.regextester.appdata.xml | 6 +++++- src/Application.vala | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/data/com.github.artemanufrij.regextester.appdata.xml b/data/com.github.artemanufrij.regextester.appdata.xml index 5e62ea1..0eb471c 100644 --- a/data/com.github.artemanufrij.regextester.appdata.xml +++ b/data/com.github.artemanufrij.regextester.appdata.xml @@ -30,8 +30,12 @@ - + +

New:

+
    +
  • Quit app by Ctrl+Q
  • +

Translation:

  • French (by Nathan Bonnemains)
  • diff --git a/src/Application.vala b/src/Application.vala index 0064330..ec797fe 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -40,6 +40,16 @@ namespace RegexTester { } construct { + var action_quit = new SimpleAction ("quit", null); + add_action (action_quit); + string[] accel_quit = {"q", "0"}; + set_accels_for_action ("app.quit", accel_quit); + action_quit.activate.connect ( + () => { + if (mainwindow != null) { + mainwindow.destroy (); + } + }); } Gtk.Window mainwindow;