[gnome-boxes] Set keyboard layout in case of during express install
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Set keyboard layout in case of during express install
- Date: Thu, 8 Dec 2011 17:22:15 +0000 (UTC)
commit 51c669b91d5eac361a267085ffd09a5a3064ac65
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Dec 8 14:42:39 2011 +0200
Set keyboard layout in case of during express install
This currently only works for Fedora.
https://bugzilla.gnome.org/show_bug.cgi?id=665803
data/fedora.ks | 2 +-
src/unattended-installer.vala | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/data/fedora.ks b/data/fedora.ks
index e80d4d8..8799eab 100644
--- a/data/fedora.ks
+++ b/data/fedora.ks
@@ -1,5 +1,5 @@
install
-keyboard us
+keyboard BOXES_KBD
lang en_US.UTF-8
network --device eth0 --bootproto dhcp
rootpw whatever
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 6c29cc3..68e3ede 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -41,16 +41,19 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
protected Gtk.Entry password_entry;
protected string timezone;
+ protected string kbd;
private static Regex username_regex;
private static Regex password_regex;
private static Regex timezone_regex;
+ private static Regex kbd_regex;
static construct {
try {
username_regex = new Regex ("BOXES_USERNAME");
password_regex = new Regex ("BOXES_PASSWORD");
timezone_regex = new Regex ("BOXES_TZ");
+ kbd_regex = new Regex ("BOXES_KBD");
} catch (RegexError error) {
// This just can't fail
assert_not_reached ();
@@ -75,6 +78,10 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
var date = new DateTime.from_timeval_local (time);
timezone = date.get_timezone_abbreviation ();
+ var settings = new GLib.Settings ("org.gnome.libgnomekbd.keyboard");
+ var layouts = settings.get_strv ("layouts");
+ kbd = layouts[0] ?? "us";
+
setup_ui ();
}
@@ -267,6 +274,7 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
str = username_regex.replace (str, str.length, 0, username_entry.text);
str = password_regex.replace (str, str.length, 0, password_entry.text);
str = timezone_regex.replace (str, str.length, 0, timezone);
+ str = kbd_regex.replace (str, str.length, 0, kbd);
yield output_stream.write_async (str.data, Priority.DEFAULT, cancellable);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]