Ignore:
Timestamp:
Aug 22, 2013 12:59:33 PM (8 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
33a568a
Parents:
69265de
Message:

Add a new button to the life-preserver for creating a snapshot right then

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/mainUI.cpp

    r4a54eef r9a67431  
    276276} 
    277277 
     278void mainUI::on_tool_newsnapshot_clicked(){ 
     279  QString ds = getSelectedDS(); 
     280  if(ds.isEmpty()){return; } 
     281  //Get the new snapshot name from the user 
     282  bool ok; 
     283  QString name = QInputDialog::getText(this,tr("New Snapshot Name"), tr("Snapshot Name:"), QLineEdit::Normal, tr("Name"), &ok, 0, Qt::ImhUppercaseOnly | Qt::ImhLowercaseOnly | Qt::ImhDigitsOnly ); 
     284  if(!ok || name.isEmpty()){ return; } //cancelled 
     285  qDebug() << "Creating a new snapshot:" << ds << name; 
     286  //Now create the new snapshot 
     287  ok = LPBackend::newSnapshot(ds,name); 
     288  if( ok ){ 
     289    QMessageBox::information(this,tr("Success"), tr("The new snapshot has been created")); 
     290  }else{ 
     291    QMessageBox::warning(this,tr("Failure"), tr("The new snapshot could not be created")); 
     292  } 
     293  setupUI(); 
     294} 
    278295 
    279296// --- Menu Items Clicked 
Note: See TracChangeset for help on using the changeset viewer.