Skip to content

Commit

Permalink
ctrl+q
Browse files Browse the repository at this point in the history
  • Loading branch information
artemanufrij committed Jul 16, 2019
1 parent 3754e8f commit dcd1e61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion data/com.github.artemanufrij.regextester.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
</screenshot>
</screenshots>
<releases>
<release version="1.0.3" date="2019-07-17">
<release version="1.1.0" date="2019-07-17">
<description>
<p>New:</p>
<ul>
<li>Quit app by Ctrl+Q</li>
</ul>
<p>Translation:</p>
<ul>
<li>French (by Nathan Bonnemains)</li>
Expand Down
10 changes: 10 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ namespace RegexTester {
}

construct {
var action_quit = new SimpleAction ("quit", null);
add_action (action_quit);
string[] accel_quit = {"<Control>q", "0"};
set_accels_for_action ("app.quit", accel_quit);
action_quit.activate.connect (
() => {
if (mainwindow != null) {
mainwindow.destroy ();
}
});
}

Gtk.Window mainwindow;
Expand Down

0 comments on commit dcd1e61

Please sign in to comment.