Ignore:
Timestamp:
02/27/14 11:52:07 (5 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
4e7809d
Parents:
47a52f4
Message:

Finish cleaning up the pc-dmconf display issues, and also add the new PCDM option to disable showing the system users.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-dmconf/mainwindow.cpp

    r7c53dd2 rb6aabdf  
    111111      ui->checkShowPW->setChecked(true); 
    112112 
    113     ui->SaveButton->setEnabled(false); 
    114 } 
    115  
    116 /////////////////////////////////////////////////////////////////////////////// 
    117 void MainWindow::on_UsersList_currentIndexChanged(int item) { 
    118     Q_UNUSED(item); 
    119     ui->SaveButton->setEnabled(true); 
     113    ui->checkShowUsers->setChecked(true); //PCDM defaults to true 
     114    QString showusers = pcbsd::Utils::getValFromSHFile(DM_CONFIG_FILE, "SHOW_SYSTEM_USERS"); 
     115    if( showusers != "TRUE" ){ 
     116      ui->checkShowUsers->setChecked(false); 
     117    } 
     118     
     119    //Update the UI appropriately 
     120    itemChanged(); 
     121    ui->SaveButton->setEnabled(false); //re-disable the save button because nothing has changed yet 
     122     
     123    //Now setup all the signals/slots for updating the UI appropriately 
     124    connect( ui->AutoLoginEnabledCB, SIGNAL(stateChanged(int)), this, SLOT(itemChanged()) ); 
     125    connect( ui->UsersList, SIGNAL(currentIndexChanged(int)), this, SLOT(itemChanged()) ); 
     126    connect( ui->spin_autoLogDelay, SIGNAL(valueChanged(int)), this, SLOT(itemChanged()) ); 
     127    connect( ui->EnableVNC, SIGNAL(stateChanged(int)), this, SLOT(itemChanged()) ); 
     128    connect( ui->checkShowPW, SIGNAL(stateChanged(int)), this, SLOT(itemChanged()) ); 
     129    connect( ui->checkShowUsers, SIGNAL(stateChanged(int)), this, SLOT(itemChanged()) ); 
     130     
     131     
    120132} 
    121133 
     
    205217       pcbsd::Utils::setConfFileValue(DM_CONFIG_FILE, "ENABLE_VIEW_PASSWORD_BUTTON", "ENABLE_VIEW_PASSWORD_BUTTON=FALSE", -1); 
    206218 
     219    if(ui->checkShowUsers->isChecked()){ 
     220        pcbsd::Utils::setConfFileValue(DM_CONFIG_FILE, "SHOW_SYSTEM_USERS", "SHOW_SYSTEM_USERS=TRUE", -1); 
     221    }else{ 
     222        pcbsd::Utils::setConfFileValue(DM_CONFIG_FILE, "SHOW_SYSTEM_USERS", "SHOW_SYSTEM_USERS=FALSE", -1); 
     223    } 
     224     
    207225    // Lastly make sure we set perms 
    208226    system("chmod 600 " + DM_CONFIG_FILE.toLatin1()); 
     
    210228} 
    211229 
    212 /////////////////////////////////////////////////////////////////////////////// 
    213 void MainWindow::on_AutoLoginEnabledCB_clicked(bool checked) 
    214 { 
    215     ui->UsersList->setEnabled(checked); 
    216     ui->SaveButton->setEnabled(true); 
    217 } 
    218  
    219 /////////////////////////////////////////////////////////////////////////////// 
    220 void MainWindow::on_EnableVNC_clicked(bool checked) 
    221 { 
    222   Q_UNUSED(checked); 
    223   ui->SaveButton->setEnabled(true); 
    224 } 
    225  
    226 /////////////////////////////////////////////////////////////////////////////// 
    227 void MainWindow::on_checkShowPW_clicked(bool checked) 
    228 { 
    229   Q_UNUSED(checked); 
    230   ui->SaveButton->setEnabled(true); 
    231 } 
    232230 
    233231/////////////////////////////////////////////////////////////////////////////// 
     
    239237   this->raise(); 
    240238} 
     239 
     240///////////////////////////////////////////////// 
     241void MainWindow::itemChanged(){ 
     242  ui->SaveButton->setEnabled(true); 
     243  //Double check the dependant options for whether they are possible to be changed 
     244  ui->UsersList->setEnabled( ui->AutoLoginEnabledCB->isChecked() ); 
     245  ui->spin_autoLogDelay->setEnabled( ui->AutoLoginEnabledCB->isChecked() ); 
     246} 
Note: See TracChangeset for help on using the changeset viewer.