Changeset 9d5cf20


Ignore:
Timestamp:
05/15/14 06:41:56 (16 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2, releng/10.2, stable/10
Children:
c246252
Parents:
cd05890
Message:

Fix an issue creating comments on Warden ZFS snapshots, and also
update the GUI to allow setting comments / displaying them

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/warden-gui/dialogwarden.cpp

    rd71f644 r9d5cf20  
    1414#include <QDebug> 
    1515#include <QFileDialog> 
     16#include <QInputDialog> 
    1617#include <QMessageBox> 
    1718#include <QSettings> 
     
    12381239 
    12391240   snapshotList.clear(); 
    1240    QString tmp; 
     1241   snapshotComments.clear(); 
     1242   QString tmp, line, comment; 
    12411243 
    12421244   qDebug() << "Getting ZFS snapshots for " + IP; 
     
    12441246   // Get output of ZFS snapshots 
    12451247   while (m.canReadLine()) { 
    1246       tmp = m.readLine().simplified(); 
     1248      line = m.readLine().simplified(); 
     1249      tmp = line; 
     1250      tmp = tmp.section(" ", 0, 0); 
    12471251      tmp.section("-", 0, 0).toInt(&ok); 
    12481252      tmp.section("-", 1, 1).toInt(&ok2); 
     1253      comment = line; 
     1254      comment = comment.section(" ", 1, -1); 
     1255      if ( comment == "-" ) 
     1256         comment = tr("No label"); 
    12491257      if (ok && ok2) { 
    12501258         snapshotList << tmp; 
     1259         snapshotComments << comment; 
    12511260      } 
    12521261   } 
     
    12731282      tmp = tr("(Cloned)"); 
    12741283  
    1275    labelSnap->setText(getSnapDateReadable(snapshotList.at(snapshotList.count()-1)) + " " + tmp); 
     1284   labelSnap->setText(getSnapDateReadable(snapshotList.at(snapshotList.count()-1)) + " ("+ snapshotComments.at(snapshotList.count()-1) + ") " + tmp); 
    12761285   sliderSnaps->setEnabled(true); 
    12771286   pushRestoreSnap->setEnabled(true); 
     
    15381547   QString IP = listJails->currentItem()->text(0); 
    15391548 
     1549   // Ask user for comment to this snapshot 
     1550   bool ok; 
     1551   QString comment = QInputDialog::getText (this, tr("Snapshot comment"), tr("Snapshot comment"), QLineEdit::Normal, "GUI snapshot", &ok); 
     1552   if ( ! ok ) 
     1553      comment = "GUI snapshot"; 
     1554 
    15401555   // Now start the script to stop this jail 
    15411556   createJailProc = new QProcess( this );  
    15421557   QString program = "warden"; 
    15431558   QStringList args; 
    1544    args << "zfsmksnap" << IP; 
     1559   args << "zfsmksnap" << IP << comment; 
    15451560 
    15461561   // Connect the exited signal and start the process 
     
    16521667      pushRemoveSnap->setEnabled(true); 
    16531668   } 
    1654    labelSnap->setText(getSnapDateReadable(snapshotList.at(newVal)) + " " + tmp); 
     1669   labelSnap->setText(getSnapDateReadable(snapshotList.at(newVal)) + " (" + snapshotComments.at(newVal) + ") " + tmp); 
    16551670} 
    16561671 
  • src-qt4/warden-gui/dialogwarden.h

    r4efda4d r9d5cf20  
    143143    QList<QStringList> jailDetails; 
    144144    QStringList snapshotList; 
     145    QStringList snapshotComments; 
    145146    QStringList cloneList; 
    146147    dialogEditIP *dIP; 
  • src-sh/warden/scripts/backend/zfsmksnap.sh

    r1620346 r9d5cf20  
    3333fi 
    3434 
    35 mkZFSSnap "${JAILDIR}" 
     35mkZFSSnap "${JAILDIR}" "$2" 
Note: See TracChangeset for help on using the changeset viewer.