Changeset 7e84c8b


Ignore:
Timestamp:
Dec 2, 2013 3:17:23 PM (5 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1
Children:
f2fe669
Parents:
a982a19 (diff), 7793d08 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • build-files/ports-overlay/sysutils/uhidd/Makefile

    rad23101 ra94f096  
    1919 
    2020USE_RC_SUBR=    uhidd 
    21 USE_GCC=        4.2 
     21USE_GCC=        4.2+ 
    2222SUB_FILES=      pkg-message 
    2323 
  • src-qt4/PCDM/src/dialogKeyboard.cpp

    r72c9698 ra982a19  
    9393   
    9494  Backend::changeKbMap(model, layout, variant); 
     95  Backend::saveDefaultSysEnvironment( QString(getenv("LANG")) , model, layout, variant); 
    9596} 
    9697 
  • src-qt4/PCDM/src/main.cpp

    r41d9f84 ra982a19  
    4040  Backend::openLogFile("/var/log/PCDM.log");   
    4141  //qDebug() << "Backend Checks Finished:" << QString::number(clock.elapsed())+" ms"; 
     42  //Setup the initial system environment (locale, keyboard) 
     43  QString lang, kmodel, klayout, kvariant; 
     44  Backend::readDefaultSysEnvironment(lang,kmodel,klayout,kvariant); 
     45  setenv("LANG", lang.toUtf8(), 0); 
     46  Backend::changeKbMap(kmodel,klayout,kvariant); 
    4247  //Check for the flag to try and auto-login 
    4348  bool ALtriggered = FALSE; 
     
    7681    QString pwd = Backend::getALPassword(); 
    7782    QString dsk = Backend::getLastDE(user); 
    78     QString lang = QString( getenv("LANG") ).section(".",0,0); 
    7983    if( user.isEmpty() || dsk.isEmpty() ){ 
    8084         goodAL=FALSE;    
     
    9599    // Load the translator 
    96100    QTranslator translator; 
    97     QLocale mylocale; 
    98     QString langCode = mylocale.name(); 
     101    QString langCode = lang; 
    99102    //Check for a language change detected 
    100103    if ( ! changeLang.isEmpty() )        
     
    205208    sleep(2); 
    206209    waitpid(sid,&status,0); //wait for the child (session) to finish 
     210    //NOTE: the parent will eventually become a login-watcher daemon process that 
     211    //   can spawn multiple child sessions on different TTY displays 
    207212  } 
    208213  qDebug() << "-- PCDM Session Ended --"; 
  • src-qt4/PCDM/src/pcdm-backend.cpp

    r88745de ra982a19  
    185185{ 
    186186    QStringList _languages; 
     187    _languages << "Default - (en_US)"; //make sure this is always at the top of the list 
    187188    QString code, desc, line; 
    188189 
     
    253254  writeSystemLastLogin(user,desktop); //save the system file (/usr/local/share/PCDM/.lastlogin) 
    254255  writeUserLastDesktop(user,desktop); //save the user file (~/.lastlogin) 
     256} 
     257 
     258void Backend::readDefaultSysEnvironment(QString &lang, QString &keymodel, QString &keylayout, QString &keyvariant){ 
     259  //Set the default values 
     260    lang = "en_US"; 
     261    keymodel = "pc104"; 
     262    keylayout = "us"; 
     263    keyvariant = ""; 
     264  //Read the current inputs file and overwrite default values 
     265  QFile file("/usr/local/share/PCDM/.defaultInputs"); 
     266  bool goodFile=false; 
     267  if(file.exists()){ 
     268    if(file.open(QIODevice::ReadOnly | QIODevice::Text) ){ 
     269      QTextStream in(&file); 
     270      while(!in.atEnd()){ 
     271        QString line = in.readLine(); 
     272        QString var = line.section("=",0,0).simplified(); 
     273        QString val = line.section("=",1,1).simplified(); 
     274        if(var=="Lang"){ lang = val;} 
     275        else if(var=="KeyModel"){ keymodel = val; } 
     276        else if(var=="KeyLayout"){ keylayout = val; } 
     277        else if(var=="KeyVariant"){ keyvariant = val; } 
     278      } 
     279      file.close(); 
     280    } 
     281  } 
     282  if(!goodFile){ 
     283    //Save our own defaults 
     284    saveDefaultSysEnvironment(lang, keymodel, keylayout, keyvariant); 
     285  }      
     286} 
     287 
     288void Backend::saveDefaultSysEnvironment(QString lang, QString keymodel, QString keylayout, QString keyvariant){ 
     289  QFile file("/usr/local/share/PCDM/.defaultInputs"); 
     290    if(file.open(QIODevice::WriteOnly | QIODevice::Text) ){ 
     291      QTextStream out(&file); 
     292      out << "Lang=" + lang + "\n"; 
     293      out << "KeyModel=" + keymodel + " \n"; 
     294      out << "KeyLayout=" + keylayout + " \n"; 
     295      out << "KeyVariant=" + keyvariant + " \n"; 
     296      file.close(); 
     297    } 
    255298} 
    256299 
  • src-qt4/PCDM/src/pcdm-backend.h

    rb28c8d9 ra982a19  
    5555    static QString getLastDE(QString); 
    5656    static void saveLoginInfo(QString, QString); 
     57    static void readDefaultSysEnvironment(QString &lang, QString &keymodel, QString &keylayout, QString &keyvariant); 
     58    static void saveDefaultSysEnvironment(QString lang, QString keymodel, QString keylayout, QString keyvariant); 
    5759     
    5860private:         
  • src-qt4/PCDM/src/pcdm-gui.cpp

    r41d9f84 ra982a19  
    432432   
    433433  Backend::log("Current Locale after change: " + this->locale().name() ); 
     434  //Now save the locale to the system file 
     435  QString lang, kMod, kLay, kVar; 
     436  Backend::readDefaultSysEnvironment(lang,kMod,kLay,kVar); //need the keyboard settings 
     437  Backend::saveDefaultSysEnvironment(langCode,kMod,kLay,kVar); 
    434438} 
    435439 
Note: See TracChangeset for help on using the changeset viewer.