Changeset 47a52f4


Ignore:
Timestamp:
02/27/14 11:15:04 (6 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
b6aabdf
Parents:
ae41693 (diff), 2078496 (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

Location:
src-qt4
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-softwaremanager/mainUI.ui

    r316d4d3 r2078496  
    935935                 <x>0</x> 
    936936                 <y>0</y> 
    937                  <width>435</width> 
    938                  <height>386</height> 
     937                 <width>98</width> 
     938                 <height>28</height> 
    939939                </rect> 
    940940               </property> 
     
    958958                 <y>0</y> 
    959959                 <width>435</width> 
    960                  <height>386</height> 
     960                 <height>384</height> 
    961961                </rect> 
    962962               </property> 
     
    13571357                    <x>0</x> 
    13581358                    <y>0</y> 
    1359                     <width>419</width> 
    1360                     <height>61</height> 
     1359                    <width>98</width> 
     1360                    <height>28</height> 
    13611361                   </rect> 
    13621362                  </property> 
     
    14821482     <y>0</y> 
    14831483     <width>473</width> 
    1484      <height>20</height> 
     1484     <height>21</height> 
    14851485    </rect> 
    14861486   </property> 
    14871487   <widget class="QMenu" name="menuFile"> 
    14881488    <property name="title"> 
    1489      <string>File</string> 
     1489     <string>&amp;File</string> 
    14901490    </property> 
    14911491    <addaction name="actionInstall_From_File"/> 
     
    14981498   <widget class="QMenu" name="menuConfigure"> 
    14991499    <property name="title"> 
    1500      <string>Configure</string> 
     1500     <string>&amp;Configure</string> 
    15011501    </property> 
    15021502    <addaction name="actionAppCafe_Settings"/> 
     
    15121512   </property> 
    15131513   <property name="text"> 
    1514     <string>Import PBI List</string> 
     1514    <string>&amp;Import PBI List</string> 
    15151515   </property> 
    15161516  </action> 
     
    15211521   </property> 
    15221522   <property name="text"> 
    1523     <string>Export PBI List</string> 
     1523    <string>&amp;Export PBI List</string> 
    15241524   </property> 
    15251525  </action> 
     
    15331533   </property> 
    15341534   <property name="shortcut"> 
    1535     <string>Shift+Q</string> 
     1535    <string>Ctrl+Q</string> 
    15361536   </property> 
    15371537  </action> 
     
    15441544   <property name="icon"> 
    15451545    <iconset resource="SoftwareManager.qrc"> 
    1546      <normaloff>:/icons/config.png</normaloff>:/icons/config.png</iconset> 
     1546     <normaloff>:/icons/preferences-system.png</normaloff>:/icons/preferences-system.png</iconset> 
    15471547   </property> 
    15481548   <property name="text"> 
    1549     <string>AppCafe Settings</string> 
    1550    </property> 
    1551    <property name="shortcut"> 
    1552     <string>Shift+S</string> 
     1549    <string>&amp;Settings</string> 
    15531550   </property> 
    15541551  </action> 
     
    15591556   </property> 
    15601557   <property name="text"> 
    1561     <string>Install PBI</string> 
     1558    <string>I&amp;nstall PBI</string> 
    15621559   </property> 
    15631560  </action> 
  • src-qt4/PCDM/src/loginWidget.cpp

    rbac293d rae41693  
    1818  pwVisible = FALSE; //Have the password box hide the input behind dots 
    1919  allowPWVisible = TRUE; //Allow the password button to show the password text 
    20    
     20  showUsers = true; //Display the available users on the system 
     21         
    2122  //Create the Grid layout 
    2223  QHBoxLayout* hlayout1 = new QHBoxLayout(); 
    2324  QHBoxLayout* hlayout2 = new QHBoxLayout(); 
     25  QHBoxLayout* hlayout3 = new QHBoxLayout(); 
    2426  QVBoxLayout* vlayout = new QVBoxLayout(); 
    2527  QFormLayout* flayout = new QFormLayout(); 
     
    3638  linePassword = new QLineEdit; 
    3739        linePassword->setFocusPolicy(Qt::StrongFocus); 
     40  lineUsername = new QLineEdit; 
     41        lineUsername->setFocusPolicy(Qt::StrongFocus); 
    3842  pushLogin = new QToolButton; 
    3943        QAction* tmp1 = new QAction(this); 
     
    5761    vlayout->addWidget(listUserBig); 
    5862    //User selected widgets 
    59       flayout->addRow(pushUserIcon, listUsers); 
     63        hlayout3->addWidget(listUsers); 
     64        hlayout3->addWidget(lineUsername); 
     65      flayout->addRow(pushUserIcon, hlayout3); 
    6066      flayout->addRow(pushViewPassword, linePassword); 
    6167      flayout->addRow(deIcon,listDE); 
     
    8894void LoginWidget::updateWidget(){ 
    8995  //Setup the visibility/sizes 
    90   if(userSelected){ 
     96  if(userSelected && showUsers){ 
    9197    userIcon->setVisible(FALSE); 
    9298    listUserBig->setVisible(FALSE); 
    9399    pushUserIcon->setVisible(TRUE); 
    94100    listUsers->setVisible(TRUE); 
     101    lineUsername->setVisible(false); 
    95102    linePassword->setVisible(TRUE); 
    96103    pushLogin->setVisible(TRUE); 
     
    98105    if( listDE->count() < 1 ){ listDE->setVisible(FALSE); deIcon->setVisible(FALSE); } 
    99106    else{ listDE->setVisible(TRUE); deIcon->setVisible(TRUE); } 
    100   }else{ 
     107  }else if(!showUsers){ 
     108    //Do not show either of the user selection widgets 
     109    userIcon->setVisible(FALSE); 
     110    listUserBig->setVisible(FALSE); 
     111    pushUserIcon->setVisible(TRUE); 
     112    listUsers->setVisible(false); 
     113    lineUsername->setVisible(true); 
     114    linePassword->setVisible(TRUE); 
     115    pushLogin->setVisible(TRUE); 
     116    pushViewPassword->setVisible(TRUE); 
     117    if( listDE->count() < 1 ){ listDE->setVisible(FALSE); deIcon->setVisible(FALSE); } 
     118    else{ listDE->setVisible(TRUE); deIcon->setVisible(TRUE); } 
     119  }else{ 
     120    //ShowUsers and none selected 
    101121    userIcon->setVisible(TRUE); 
    102122    listUserBig->setVisible(TRUE); 
     
    154174 
    155175void LoginWidget::slotTryLogin(){ 
    156   QString user = listUsers->currentText(); 
     176  QString user; 
     177  if(showUsers){ 
     178    user = listUsers->currentText(); 
     179  }else{ 
     180    user = lineUsername->text(); 
     181  } 
    157182  QString pw = linePassword->text(); 
    158183  emit loginRequested(user,pw); 
     
    364389  } 
    365390} 
     391 
     392void LoginWidget::allowUserSelection(bool allow){ 
     393  showUsers = allow; 
     394  updateWidget(); 
     395} 
  • src-qt4/PCDM/src/loginWidget.h

    r72c9698 rae41693  
    5454        void resetFocus(QString item=""); 
    5555        void allowPasswordView(bool); 
     56        void allowUserSelection(bool); 
    5657   
    5758  private: 
     
    5960        QComboBox* listDE; 
    6061        QListWidget* listUserBig; 
    61         QLineEdit* linePassword; 
     62        QLineEdit *linePassword, *lineUsername; 
    6263        QToolButton* pushLogin; 
    6364        QToolButton* pushViewPassword; 
     
    6970        QSize desktopIconSize; 
    7071        QString hostName; 
    71         bool userSelected, pwVisible, allowPWVisible; 
     72        bool userSelected, pwVisible, allowPWVisible, showUsers; 
    7273 
    7374        void updateWidget(); 
  • src-qt4/PCDM/src/pcdm-backend.cpp

    r7af9bd1 rae41693  
    471471  bool usepw = true; //for testing purposes 
    472472  if(usepw){ 
    473     //Use "pw" to get all possible users 
     473    //Use "getent" to get all possible users 
    474474    QProcess p; 
    475475    p.setProcessChannelMode(QProcess::MergedChannels); 
     
    477477      env.insert("MM_CHARSET","UTF-8"); 
    478478    p.setProcessEnvironment(env); 
    479     p.start("pw usershow -a"); 
     479    p.start("getent passwd"); 
    480480    while(p.state()==QProcess::Starting || p.state() == QProcess::Running){ 
    481481      p.waitForFinished(200); 
     
    488488    bool bad = FALSE; 
    489489    // "nologin" as their shell 
    490     if(uList[i].section(":",9,9).contains("nologin")){bad=TRUE;} 
     490    if(uList[i].section(":",6,6).contains("nologin")){bad=TRUE;} 
    491491    // "nonexistent" as their user directory 
    492     else if(uList[i].section(":",8,8).contains("nonexistent")){bad=TRUE;} 
     492    else if(uList[i].section(":",5,5).contains("nonexistent")){bad=TRUE;} 
    493493    // uid > 1000 
    494494    else if(uList[i].section(":",2,2).toInt() < 1000){bad=TRUE;} 
     
    499499      //Add this user to the lists if it is good 
    500500      usernameList << uList[i].section(":",0,0).simplified(); 
    501       displaynameList << uList[i].section(":",7,7).simplified(); 
    502       homedirList << uList[i].section(":",8,8).simplified(); 
    503       usershellList << uList[i].section(":",9,9).simplified(); 
     501      displaynameList << uList[i].section(":",4,4).simplified(); 
     502      homedirList << uList[i].section(":",5,5).simplified(); 
     503      usershellList << uList[i].section(":",6,6).simplified(); 
    504504    } 
    505505   } 
  • src-qt4/PCDM/src/pcdm-config.cpp

    r28c79ad rae41693  
    2525  confStruct << "TRUE";                                 // [8] Password view button enabled 
    2626  confStruct << "10";                                           // [9] Auto-login delay (seconds) 
     27  confStruct << "TRUE";                                 // [10] Show System Users 
    2728  return; 
    2829} 
     
    5657      else if(var=="ENABLE_VIEW_PASSWORD_BUTTON"){ confStruct[8] = val; } 
    5758      else if(var=="AUTO_LOGIN_DELAY"){ confStruct[9] = val; } 
     59      else if(var=="SHOW_SYSTEM_USERS"){ confStruct[10] = val; } 
    5860      else{} 
    5961       
     
    117119} 
    118120 
     121bool Config::allowUserSelection(){ 
     122  if(confStruct[10].toLower()=="true"){ return TRUE; } 
     123  else{ return FALSE; }  
     124} 
  • src-qt4/PCDM/src/pcdm-config.h

    r28c79ad rae41693  
    3434  static QString splashscreen();        //return the image file for the splashscreen 
    3535  static bool allowPasswordView();      //returns whether password view button is enabled 
     36  static bool allowUserSelection();     //returns whether to display system users for selection 
    3637 
    3738}; 
  • src-qt4/PCDM/src/pcdm-gui.cpp

    r656891d rae41693  
    192192    //Enable/disable the password view functionality 
    193193    loginW->allowPasswordView( Config::allowPasswordView() ); 
     194    loginW->allowUserSelection( Config::allowUserSelection() ); 
    194195    //Add item to the grid 
    195196    grid->addWidget( loginW, currentTheme->itemLocation("login","row"), \ 
Note: See TracChangeset for help on using the changeset viewer.