Ignore:
Timestamp:
07/13/13 13:49:05 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
82bcb91
Parents:
2c8ec33
Message:

Update pcdm to setup remote VNC properly

File:
1 edited

Legend:

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

    r708d4b3 r3dcfe4e  
    8888    } 
    8989 
    90     ui->EnableXDCMP->setChecked(false); 
    91     QString xdmcp = pcbsd::Utils::getValFromSHFile(DM_CONFIG_FILE, "ALLOW_REMOTE_LOGIN"); 
    92     if ( xdmcp == "TRUE" ) 
    93       ui->EnableXDCMP->setChecked(true); 
     90    ui->EnableVNC->setChecked(false); 
     91    QString vnc = pcbsd::Utils::getValFromSHFile(DM_CONFIG_FILE, "ALLOW_REMOTE_LOGIN"); 
     92    if ( vnc == "TRUE" ) 
     93      ui->EnableVNC->setChecked(true); 
    9494 
    9595    ui->checkShowPW->setChecked(false); 
     
    142142void MainWindow::on_SaveButton_clicked() 
    143143{ 
     144    bool ok; 
    144145    system("touch " + DM_CONFIG_FILE.toLatin1()); 
    145146    if ( ui->AutoLoginEnabledCB->isChecked() ) { 
    146147       // First ask for password 
    147        bool ok; 
    148148       QString pw = QInputDialog::getText(this, tr("Password Request"), 
    149149                        tr("Please enter the login password for this user"),  
     
    161161    } 
    162162 
    163     if ( ui->EnableXDCMP->isChecked() ) 
     163    if ( ui->EnableVNC->isChecked() ) { 
     164       // First ask for password 
     165       QString pw = QInputDialog::getText(this, tr("Password Request"), 
     166                        tr("Please enter the remote login password"),  
     167                        QLineEdit::Password, "", &ok); 
     168       if ( ! ok ) 
     169          return; 
     170 
     171       QFile file("/usr/local/etc/vncpass"); 
     172       if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) 
     173          return; 
     174 
     175       QTextStream out(&file); 
     176       out << pw; 
     177       file.close(); 
     178       system("chmod 600 /usr/local/etc/vncpass"); 
     179 
    164180       pcbsd::Utils::setConfFileValue(DM_CONFIG_FILE, "ALLOW_REMOTE_LOGIN", "ALLOW_REMOTE_LOGIN=TRUE", -1); 
    165     else 
     181    } else { 
    166182       pcbsd::Utils::setConfFileValue(DM_CONFIG_FILE, "ALLOW_REMOTE_LOGIN", "ALLOW_REMOTE_LOGIN=FALSE", -1); 
     183       system("rm /usr/local/etc/vncpass 2>/dev/null"); 
     184    } 
    167185 
    168186    if ( ui->checkShowPW->isChecked() ) 
     
    184202 
    185203/////////////////////////////////////////////////////////////////////////////// 
    186 void MainWindow::on_EnableXDCMP_clicked(bool checked) 
     204void MainWindow::on_EnableVNC_clicked(bool checked) 
    187205{ 
    188206  Q_UNUSED(checked); 
Note: See TracChangeset for help on using the changeset viewer.