[PC-BSD Commits] r4604 - pcbsd/trunk/SysInstaller/phases

svn at pcbsd.org svn at pcbsd.org
Wed Oct 7 12:49:49 PDT 2009


Author: kris
Date: 2009-10-07 12:49:49 -0700 (Wed, 07 Oct 2009)
New Revision: 4604

Modified:
   pcbsd/trunk/SysInstaller/phases/anteinstall.cpp
Log:

Updated anteinstall.cpp to load our keyboard layouts from the backend



Modified: pcbsd/trunk/SysInstaller/phases/anteinstall.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/phases/anteinstall.cpp	2009-10-07 19:49:26 UTC (rev 4603)
+++ pcbsd/trunk/SysInstaller/phases/anteinstall.cpp	2009-10-07 19:49:49 UTC (rev 4604)
@@ -69,7 +69,7 @@
 
 void AnteInstall::loadLicenses()
 {
-    //
+    // Start loading the license text
 }
 
 void AnteInstall::loadLanguages()
@@ -94,7 +94,7 @@
         langcode = line;
         langcode.truncate(line.indexOf(" ") ); 
         langdesc = line.remove(0, line.indexOf(" ") + 1);
-        languages.append(langdesc + "(" + langcode + ")");
+        languages.append(langdesc.simplified() + " - (" + langcode.simplified() + ")");
       }
     }
 
@@ -105,12 +105,30 @@
 {
     QStringList keyboards;
 
-    // load keyboards in "keyboards" stringlist
-    // <ForTest>
-    keyboards.append("QWERTY");
-    keyboards.append("abcdef");
-    // </ForTest>
+    QString laycode, line, laydesc;
 
+    // Create process to load the languages from the backend
+    QProcess getLayoutProc;
+    QString prog = PCSYSINSTALL;
+    QStringList args;
+    args << "xkeyboard-layouts";
+    getLayoutProc.setReadChannel(QProcess::StandardOutput);
+    getLayoutProc.start(prog, args);
+
+    // Wait for the process to finish
+    if ( getLayoutProc.waitForFinished() )
+    {
+     // load keyboards in "keyboards" stringlist
+      while (getLayoutProc.canReadLine()) {
+        line = getLayoutProc.readLine();
+        laycode = line;
+        laycode.truncate(line.indexOf(" ") );
+        laydesc = line.remove(0, line.indexOf(" ") + 1);
+        keyboards.append(laydesc.simplified() + " - (" + laycode.simplified() + ")");
+      }
+    }
+
+
     comboKeyboard->addItems(keyboards);
 }
 



More information about the Commits mailing list