summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2013-02-28 11:59:33 -0500
committerChris Lumens <clumens@redhat.com>2013-02-28 13:24:54 -0500
commitb152dd46135702852158cb086c9038862b8ee7bf (patch)
tree2bab8e0c8df70654ef16fcb8abe0fdff353e27a3
parent0de341e4a7c34bbf3260f20a24734e1855e41298 (diff)
downloadanaconda-b152dd46135702852158cb086c9038862b8ee7bf.tar.gz
anaconda-b152dd46135702852158cb086c9038862b8ee7bf.tar.xz
anaconda-b152dd46135702852158cb086c9038862b8ee7bf.zip
Pressing F12 should do the same thing as clicking "Done" (#840998).
You could do this in the old UI, so let's bring it forward to the new UI.
-rw-r--r--widgets/src/SpokeWindow.c15
-rw-r--r--widgets/src/StandaloneWindow.c23
2 files changed, 36 insertions, 2 deletions
diff --git a/widgets/src/SpokeWindow.c b/widgets/src/SpokeWindow.c
index 2db0efef6..9c1ae472c 100644
--- a/widgets/src/SpokeWindow.c
+++ b/widgets/src/SpokeWindow.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011-2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
#include "SpokeWindow.h"
#include "intl.h"
+#include <gdk/gdkkeysyms.h>
+
/**
* SECTION: SpokeWindow
* @title: AnacondaSpokeWindow
@@ -155,6 +157,7 @@ static void anaconda_spoke_window_init(AnacondaSpokeWindow *win) {
}
static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data) {
+ GtkAccelGroup *accel_group;
GError *error;
GdkPixbuf *pixbuf;
cairo_pattern_t *pattern;
@@ -189,6 +192,16 @@ static void anaconda_spoke_window_realize(GtkWidget *widget, gpointer user_data)
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
gdk_window_set_background_pattern(gtk_widget_get_window(nav_box), pattern);
}
+
+ /* Pressing F12 should send you back to the hub, similar to how the old UI worked. */
+ accel_group = gtk_accel_group_new();
+ gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
+ gtk_widget_add_accelerator(window->priv->button,
+ "clicked",
+ accel_group,
+ GDK_KEY_F12,
+ 0,
+ 0);
}
static void anaconda_spoke_window_button_clicked(GtkButton *button,
diff --git a/widgets/src/StandaloneWindow.c b/widgets/src/StandaloneWindow.c
index d7e86a82b..28b25e2b6 100644
--- a/widgets/src/StandaloneWindow.c
+++ b/widgets/src/StandaloneWindow.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2012 Red Hat, Inc.
+ * Copyright (C) 2011-2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
#include "StandaloneWindow.h"
#include "intl.h"
+#include <gdk/gdkkeysyms.h>
+
/**
* SECTION: StandaloneWindow
* @title: AnacondaStandaloneWindow
@@ -63,6 +65,8 @@ static void anaconda_standalone_window_quit_clicked(GtkButton *button,
AnacondaStandaloneWindow *win);
static void anaconda_standalone_window_continue_clicked(GtkButton *button,
AnacondaStandaloneWindow *win);
+static void anaconda_standalone_window_realize(GtkWidget *widget,
+ AnacondaStandaloneWindow *win);
G_DEFINE_TYPE(AnacondaStandaloneWindow, anaconda_standalone_window, ANACONDA_TYPE_BASE_WINDOW)
@@ -149,6 +153,23 @@ static void anaconda_standalone_window_init(AnacondaStandaloneWindow *win) {
gtk_container_add(GTK_CONTAINER(win->priv->button_box), win->priv->continue_button);
gtk_box_pack_start(GTK_BOX(main_box), win->priv->button_box, FALSE, TRUE, 0);
+
+ /* It would be handy for F12 to continue to work like it did in the old
+ * UI, by skipping you to the next screen.
+ */
+ g_signal_connect(win, "realize", G_CALLBACK(anaconda_standalone_window_realize), win);
+}
+
+static void anaconda_standalone_window_realize(GtkWidget *widget,
+ AnacondaStandaloneWindow *win) {
+ GtkAccelGroup *accel_group = gtk_accel_group_new();
+ gtk_window_add_accel_group(GTK_WINDOW(win), accel_group);
+ gtk_widget_add_accelerator(win->priv->continue_button,
+ "clicked",
+ accel_group,
+ GDK_KEY_F12,
+ 0,
+ 0);
}
static void anaconda_standalone_window_quit_clicked(GtkButton *button,