Changes in / [b5e5e3e:7a97446]


Ignore:
Location:
src-qt4
Files:
1 added
7 edited

Legend:

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

    refffa15 r4e117af  
    7272  QStringList list; 
    7373  if(dir.exists()){ 
    74     list = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed); 
     74    list = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time | QDir::Reversed); 
    7575  } 
    7676  return list; 
     
    204204//    Snapshop Management 
    205205// ================== 
    206 bool LPBackend::newSnapshot(QString dataset){ 
    207   QString cmd = "lpreserver mksnap "+dataset; 
     206bool LPBackend::newSnapshot(QString dataset, QString snapshotname){ 
     207  QString cmd = "lpreserver mksnap --replicate "+dataset+" "+snapshotname; 
    208208  int ret = system(cmd.toUtf8()); 
    209209    
  • src-qt4/life-preserver/LPBackend.h

    r96c5e841 r9a67431  
    2525        static bool datasetInfo(QString dataset, int& time, int& numToKeep); //get current settings for a dataset 
    2626        //Snapshop Management 
    27         static bool newSnapshot(QString dataset); 
     27        static bool newSnapshot(QString dataset, QString snapshotname); 
    2828        static bool removeSnapshot(QString dataset, QString snapshot); 
    2929        static bool revertSnapshot(QString dataset, QString snapshot); //revert to given snapshot 
  • src-qt4/life-preserver/lPreserve.qrc

    r96c5e841 r9a67431  
    11<RCC> 
    22  <qresource> 
     3    <file>images/camera_add.png</file> 
    34    <file>images/upload.png</file> 
    45    <file>images/key.png</file> 
  • src-qt4/life-preserver/mainUI.cpp

    r4a54eef r33a568a  
    158158    ui->tool_remove->setVisible(false); 
    159159    ui->tool_config->setVisible(false); 
    160  
     160    ui->tool_newsnapshot->setVisible(false); 
    161161  }else{ 
    162162    ui->tool_remove->setVisible(true); 
    163163    ui->tool_config->setVisible(true);     
     164    ui->tool_newsnapshot->setVisible(true); 
    164165  } 
    165166  //Enabled/disable the SSH key management 
     
    276277} 
    277278 
     279void mainUI::on_tool_newsnapshot_clicked(){ 
     280  QString ds = getSelectedDS(); 
     281  if(ds.isEmpty()){return; } 
     282  //Get the new snapshot name from the user 
     283  bool ok; 
     284  QString name = QInputDialog::getText(this,tr("New Snapshot Name"), tr("Snapshot Name:"), QLineEdit::Normal, tr("Name"), &ok, 0, Qt::ImhUppercaseOnly | Qt::ImhLowercaseOnly | Qt::ImhDigitsOnly ); 
     285  if(!ok || name.isEmpty()){ return; } //cancelled 
     286  qDebug() << "Creating a new snapshot:" << ds << name; 
     287  //Now create the new snapshot 
     288  ok = LPBackend::newSnapshot(ds,name); 
     289  if( ok ){ 
     290    QMessageBox::information(this,tr("Success"), tr("The new snapshot has been created")); 
     291  }else{ 
     292    QMessageBox::warning(this,tr("Failure"), tr("The new snapshot could not be created")); 
     293  } 
     294  setupUI(); 
     295} 
    278296 
    279297// --- Menu Items Clicked 
  • src-qt4/life-preserver/mainUI.h

    r96c5e841 r9a67431  
    5757        void on_tool_config_clicked(); 
    5858        void on_tool_remove_clicked(); 
     59        void on_tool_newsnapshot_clicked(); 
    5960 
    6061        void slotRevertToSnapshot(QAction*); 
  • src-qt4/life-preserver/mainUI.ui

    r96c5e841 r9a67431  
    144144       </item> 
    145145       <item> 
     146        <widget class="QToolButton" name="tool_newsnapshot"> 
     147         <property name="statusTip"> 
     148          <string>Make a new snapshot immediately</string> 
     149         </property> 
     150         <property name="text"> 
     151          <string>...</string> 
     152         </property> 
     153         <property name="icon"> 
     154          <iconset resource="lPreserve.qrc"> 
     155           <normaloff>:/images/camera_add.png</normaloff>:/images/camera_add.png</iconset> 
     156         </property> 
     157        </widget> 
     158       </item> 
     159       <item> 
    146160        <widget class="QToolButton" name="tool_browse"> 
    147161         <property name="statusTip"> 
  • src-qt4/pc-softwaremanager/processManager.cpp

    rdee1bcb r31283ea  
    298298 
    299299void ProcessManager::slotOtProcFinished(){ 
    300   if(otProc->exitStatus() != QProcess::NormalExit || otProc->exitCode() != 0){ 
     300  if(otProc->exitStatus() != QProcess::NormalExit){ 
    301301    QString msg = otProc->readAllStandardError(); 
    302302    if(msg.isEmpty()){ msg = otProc->readAllStandardOutput(); } 
Note: See TracChangeset for help on using the changeset viewer.