[connections/kbd-shortcuts: 1/3] window: Add Ctrl+Q shortcut to quit application
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [connections/kbd-shortcuts: 1/3] window: Add Ctrl+Q shortcut to quit application
- Date: Tue, 16 Mar 2021 12:46:43 +0000 (UTC)
commit cafd0bf01619581fc95445c10686728a81cc941a
Author: Felipe Borges <felipeborges gnome org>
Date: Tue Mar 16 13:39:19 2021 +0100
window: Add Ctrl+Q shortcut to quit application
Fixes #35
src/application.vala | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/src/application.vala b/src/application.vala
index 1dd8618..6417f67 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -50,6 +50,10 @@ namespace Connections {
action = new GLib.SimpleAction ("about", null);
action.activate.connect (show_about_dialog);
add_action (action);
+
+ action = new GLib.SimpleAction ("quit", null);
+ action.activate.connect (quit_app);
+ add_action (action);
}
private void show_help () {
@@ -205,6 +209,13 @@ namespace Connections {
}
}
+ public void quit_app () {
+ foreach (var window in windows)
+ window.hide ();
+
+ quit ();
+ }
+
static string[] opt_uris;
static string opt_file_import_uri;
const OptionEntry[] options = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]