Changeset dcfefbb


Ignore:
Timestamp:
12/03/13 10:53:59 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
ef37894
Parents:
623b6e6
Message:

When running the first-boot wizard, prime PCDM with the users
language / keyboard settings for initial login

Location:
src-qt4/pc-firstbootgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-firstbootgui/dialogKeyboard.cpp

    r31290f1 rdcfefbb  
    6868  QString model, layout, variant; 
    6969 
    70   if ( ! (comboBoxKeyboardModel->currentIndex() == -1) ) 
     70  if ( comboBoxKeyboardModel->currentIndex() == -1 ) 
    7171     return; 
    7272  if ( ! listKbLayouts->currentItem() ) 
  • src-qt4/pc-firstbootgui/firstboot.cpp

    r9fabf4e rdcfefbb  
    4646    keyModels = Scripts::Backend::keyModels(); 
    4747    keyLayouts = Scripts::Backend::keyLayouts(); 
     48 
     49    // If we have a saved keyboard layout from installation, use it first 
     50    QString kD; 
     51    if ( QFile::exists("/var/.wizardKeyboard") ) { 
     52      QFile kFile("/var/.wizardKeyboard"); 
     53      if ( kFile.open(QIODevice::ReadOnly | QIODevice::Text) ) { 
     54         kD = kFile.readLine().simplified(); 
     55         kFile.close(); 
     56          
     57         kbMod = kD.section(" ", 0, 0); 
     58         kbLay = kD.section(" ", 1, 1); 
     59         kbVar = kD.section(" ", 2, 2); 
     60         Scripts::Backend::changeKbMap(kbMod, kbLay, kbVar); 
     61      }  
     62    } 
    4863 
    4964    // Load the timezones 
     
    507522  } 
    508523 
     524 
     525  // Save the PCDM default lang / inputs 
     526  QString curLang; 
     527  if ( comboLanguage->currentIndex() != -1 ) { 
     528    // Figure out the language code 
     529    curLang = languages.at(comboLanguage->currentIndex()); 
     530           
     531    // Grab the language code 
     532    curLang.truncate(curLang.lastIndexOf(")")); 
     533    curLang.remove(0, curLang.lastIndexOf("(") + 1); 
     534  } 
     535 
     536  system("mkdir -p /var/db/pcdm 2>/dev/null"); 
     537  QFile pcdmfile("/var/db/pcdm/defaultInputs"); 
     538  if (pcdmfile.open(QIODevice::WriteOnly | QIODevice::Text)) { 
     539    QTextStream out(&pcdmfile); 
     540    out << "Lang=" << curLang << "\n"; 
     541 
     542    if ( kbMod.isEmpty() ) 
     543      out << "KeyModel=pc104\n"; 
     544    else 
     545      out << "KeyModel=" << kbMod << "\n"; 
     546 
     547    if ( kbLay.isEmpty() ) 
     548      out << "KeyLayout=us\n"; 
     549    else 
     550      out << "KeyLayout=" << kbLay << "\n"; 
     551 
     552    if ( kbVar.isEmpty() ) 
     553      out << "KeyVariant="; 
     554    else 
     555      out << "KeyVariant=" << kbVar; 
     556 
     557    pcdmfile.close(); 
     558  } else { 
     559    qDebug() << "Error opening /var/db/pcdm/defaultInputs"; 
     560  } 
    509561} 
    510562 
Note: See TracChangeset for help on using the changeset viewer.