[PC-BSD Commits] r5144 - pcbsd/trunk/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Wed Nov 25 09:54:01 PST 2009


Author: kris
Date: 2009-11-25 09:54:01 -0800 (Wed, 25 Nov 2009)
New Revision: 5144

Modified:
   pcbsd/trunk/SysInstaller/backend.cpp
   pcbsd/trunk/SysInstaller/backend.h
   pcbsd/trunk/SysInstaller/sysinstaller.cpp
Log:

Updated backend to allow us to get keyboard Models now



Modified: pcbsd/trunk/SysInstaller/backend.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/backend.cpp	2009-11-25 17:50:36 UTC (rev 5143)
+++ pcbsd/trunk/SysInstaller/backend.cpp	2009-11-25 17:54:01 UTC (rev 5144)
@@ -37,6 +37,25 @@
     return _languages;
 }
 
+QStringList Backend::keyModels()
+{
+    QStringList _models;
+    QString code, desc, line;
+
+    Process p(QStringList() << "xkeyboard-models");
+
+    if (p.waitForFinished()) {
+        while (p.canReadLine()) {
+            line = p.readLine();
+            code = line;
+            code.truncate(line.indexOf(" "));
+            desc = line.remove(0, line.indexOf(" "));
+            _models.append(desc.simplified() + " - (" + code.simplified() + ")");
+        }
+    }
+    return _models;
+}
+
 QStringList Backend::keyLayouts()
 {
     QStringList _layouts;

Modified: pcbsd/trunk/SysInstaller/backend.h
===================================================================
--- pcbsd/trunk/SysInstaller/backend.h	2009-11-25 17:50:36 UTC (rev 5143)
+++ pcbsd/trunk/SysInstaller/backend.h	2009-11-25 17:54:01 UTC (rev 5144)
@@ -39,6 +39,7 @@
 public:
     static QStringList languages();
     static QStringList keyLayouts();
+    static QStringList keyModels();
     static QStringList keyVariants(const QString &, QStringList &savedKeyVariants);
     static QStringList bootableMedia();
     static QStringList networkDevices();

Modified: pcbsd/trunk/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-25 17:50:36 UTC (rev 5143)
+++ pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-25 17:54:01 UTC (rev 5144)
@@ -99,6 +99,7 @@
     // load keyboards
     listKbLayouts->clear();
     listKbLayouts->addItems(Scripts::Backend::keyLayouts());
+    comboBoxKeyboardModel->addItems(Scripts::Backend::keyModels());
 
     // Load the timezones
     comboBoxTimezone->clear();



More information about the Commits mailing list