Changeset 618401b


Ignore:
Timestamp:
12/03/13 10:06:30 (9 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
ba4d08f
Parents:
c2eb399
Message:

Fix some bugs setting the keyboard layout during installation

When a new layout is set, save it for the desktop usage during the next
boot, I.E the first-boot wizard

Location:
src-qt4/pc-installgui
Files:
4 edited

Legend:

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

    rb7d9fad r618401b  
    6868  QString model, layout, variant; 
    6969 
    70   if ( ! (comboBoxKeyboardModel->currentIndex() == -1) ) 
     70  if ( comboBoxKeyboardModel->currentIndex() == -1 ) 
    7171     return; 
     72 
    7273  if ( ! listKbLayouts->currentItem() ) 
    7374     return; 
     75 
    7476  if ( ! listKbVariants->currentItem() ) 
    7577     return; 
     
    9294   
    9395  Scripts::Backend::changeKbMap(model, layout, variant); 
     96  emit saved(model, layout, variant); 
    9497} 
    9598 
  • src-qt4/pc-installgui/dialogKeyboard.h

    r1620346 r618401b  
    4040 
    4141signals: 
     42    void saved(QString, QString, QString); 
    4243 
    4344} ; 
  • src-qt4/pc-installgui/installer.cpp

    r9fabf4e r618401b  
    9494  wKey->programInit(keyModels, keyLayouts); 
    9595  wKey->setWindowModality(Qt::ApplicationModal); 
     96  connect(wKey, SIGNAL(saved(QString, QString, QString)), this, SLOT(slotSaveKeyLayout(QString, QString, QString))); 
    9697  wKey->show(); 
    9798  wKey->raise(); 
     99} 
     100 
     101void Installer::slotSaveKeyLayout(QString model, QString layout, QString variant) 
     102{ 
     103  curKeyModel = model; 
     104  curKeyLayout = layout; 
     105  curKeyVariant = variant; 
     106  qDebug() << "Changed keyboard layout:" << curKeyModel << curKeyLayout << curKeyVariant; 
    98107} 
    99108 
     
    797806    // Change the default keyboard layout 
    798807    if ( langCode == "en" ) { 
     808       curKeyModel="pc104"; 
     809       curKeyLayout="us"; 
     810       curKeyVariant=""; 
    799811       Scripts::Backend::changeKbMap("pc104", "us", ""); 
    800812    } else { 
    801813       // TODO - At some point, add additional tests here and set more specific layouts 
    802814       // based upon the language selected 
     815       curKeyModel="pc105"; 
     816       curKeyLayout=langCode; 
     817       curKeyVariant=""; 
    803818       Scripts::Backend::changeKbMap("pc105", langCode, "" ); 
    804819    } 
     
    10171032      } 
    10181033 
     1034      // If the user changed the keyboard layout, save it for first boot 
     1035      if ( ! curKeyModel.isEmpty() ) { 
     1036        cfgList << "runCommand=echo \"" + curKeyModel + " " + curKeyLayout + " " + curKeyVariant + "\" >/var/.wizardKeyboard"; 
     1037      } 
     1038 
    10191039    } else { 
    10201040      // Doing TrueOS Install 
  • src-qt4/pc-installgui/installer.h

    r07eb74c r618401b  
    7676    void slotSaveRestoreSettings(QStringList); 
    7777 
     78    // Slot to save keyboard layout 
     79    void slotSaveKeyLayout(QString, QString, QString); 
    7880 
    7981private: 
     
    177179    QStringList keyModels; 
    178180    QStringList keyLayouts; 
     181    QString curKeyLayout; 
     182    QString curKeyModel; 
     183    QString curKeyVariant; 
    179184 
    180185    // Disk setup wizard 
Note: See TracChangeset for help on using the changeset viewer.