[gnome-software/wip/rancell/reviews] Quit when the main window is closed
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/reviews] Quit when the main window is closed
- Date: Tue, 1 Mar 2016 21:08:09 +0000 (UTC)
commit fdce1e5da1b0a4cf067e7cf621539ee402b1ba6c
Author: William Hua <william hua canonical com>
Date: Tue Mar 1 16:07:34 2016 -0500
Quit when the main window is closed
src/gs-shell.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 26189eb..a2d3317 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -567,6 +567,13 @@ gs_shell_monitor_permission (GsShell *shell)
G_CALLBACK (on_permission_changed), shell);
}
+static void
+gs_shell_main_window_hidden_cb (GtkWidget *widget,
+ gpointer user_data)
+{
+ g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()), "quit", NULL);
+}
+
/**
* gs_shell_setup:
*/
@@ -588,6 +595,8 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
/* get UI */
priv->builder = gtk_builder_new_from_resource ("/org/gnome/Software/gnome-software.ui");
priv->main_window = GTK_WINDOW (gtk_builder_get_object (priv->builder, "window_software"));
+ g_signal_connect (priv->main_window, "hide",
+ G_CALLBACK (gs_shell_main_window_hidden_cb), shell);
g_signal_connect (priv->main_window, "map",
G_CALLBACK (gs_shell_main_window_mapped_cb), shell);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]