Ignore:
Timestamp:
10/25/13 08:26:43 (14 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
7a4b57b
Parents:
c4cd122
Message:

Add the network scan button to the LpWizard? as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/lp-gui/LPWizard.cpp

    r6a2483b rf15ae5d  
    88  connect(this,SIGNAL(accepted()), this,SLOT(slotFinished()) ); 
    99  connect(this,SIGNAL(rejected()),this,SLOT(slotCancelled()) ); 
     10  connect(ui->push_scanNetwork, SIGNAL(clicked()), this, SLOT(scanNetwork()) ); 
    1011} 
    1112 
     
    5758  this->close(); 
    5859} 
     60 
     61void LPWizard::scanNetwork(){ 
     62  QStringList targs = LPGUtils::scanNetworkSSH(); // <name>:::<address>:::<port> 
     63  if(targs.isEmpty()){ 
     64    QMessageBox::warning(this,tr("No Network Targets"), tr("We could not find any systems on the local network with SSH availability (port 22)") ); 
     65    return; 
     66  } 
     67  //Ask the user to select a target 
     68  QStringList targets; 
     69  for(int i=0; i<targs.length(); i++){ 
     70    targets << targs[i].section(":::",0,0); 
     71  } 
     72  bool ok; 
     73  QString target = QInputDialog::getItem(this, tr("Select Replication Target"), tr("Hostname:"), targets, 0, false, &ok); 
     74  if(!ok || target.isEmpty() ){ return; } //cancelled 
     75  //Now look for that target in the list of info 
     76  for(int i=0; i<targs.length(); i++){ 
     77    if(targs[i].startsWith(target+":::")){ 
     78      ui->lineHostName->setText(targs[i].section(":::",1,1)); 
     79      ui->spinPort->setValue( targs[i].section(":::",2,2).toInt() ); 
     80      break; 
     81    } 
     82  } 
     83} 
Note: See TracChangeset for help on using the changeset viewer.