[gnome-boxes] A few more Enter handlers in the Wizard
- From: Marc-Andre Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] A few more Enter handlers in the Wizard
- Date: Wed, 16 Nov 2011 18:46:50 +0000 (UTC)
commit 50859ab1899ecc12b33cd191b2c727efb00cc588
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date: Wed Nov 16 19:42:17 2011 +0100
A few more Enter handlers in the Wizard
Fix Selection Source and URL entry handler.
The rest needs more investigation.
Related to bug 664218
src/menu-box.vala | 6 ++++++
src/wizard-source.vala | 1 +
src/wizard.vala | 4 ++++
3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/menu-box.vala b/src/menu-box.vala
index 0b00cc6..e78f7ac 100644
--- a/src/menu-box.vala
+++ b/src/menu-box.vala
@@ -63,6 +63,12 @@ private class Boxes.MenuBox: Gtk.Box {
var item = widget as Item;
if (item != null) {
+ item.key_press_event.connect ((event) => {
+ if (event.keyval == Gdk.Key.Return) {
+ selected (item);
+ }
+ return false;
+ });
item.button_press_event.connect (() => {
item.grab_focus ();
selected (item);
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index f6172d4..a1d6756 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -20,6 +20,7 @@ private class Boxes.WizardSource: GLib.Object {
notebook.set_current_page (page);
switch (page) {
case SourcePage.MAIN:
+ // FIXME: grab first element in the menu list
menubox.grab_focus ();
break;
case SourcePage.URL:
diff --git a/src/wizard.vala b/src/wizard.vala
index c99934e..84868fd 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -41,6 +41,7 @@ private class Boxes.Wizard: Boxes.UI {
switch (value) {
case WizardPage.INTRODUCTION:
next_button.sensitive = true;
+ next_button.grab_focus (); // FIXME: doesn't work?!
break;
case WizardPage.SOURCE:
@@ -109,6 +110,9 @@ private class Boxes.Wizard: Boxes.UI {
// FIXME: add uri checker
next_button.sensitive = wizard_source.uri.length != 0;
});
+ wizard_source.url_entry.activate.connect(() => {
+ page = page + 1;
+ });
}
public Wizard (App app) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]