Permalink
Browse files

Get the new snapshot functionality working

  • Loading branch information...
1 parent cd3210a commit 82f4fbf1214f8ba9395d5d26c8f2742ca5ffb7c1 Ken Moore committed Oct 15, 2013
Showing with 12 additions and 1 deletion.
  1. +11 −1 lp-gui/LPMain.cpp
  2. +1 −0 lp-gui/LPMain.h
View
@@ -396,7 +396,17 @@ void LPMain::menuStartScrub(){
// ==== Snapshots Menu ====
void LPMain::menuNewSnapshot(){
qDebug() << "New Snapshot";
-
+ QString ds = ui->combo_pools->currentText();
+ if(ds.isEmpty()){return; }
+ //Get the new snapshot name from the user
+ bool ok;
+ QString name = QInputDialog::getText(this,tr("New Snapshot Name"), tr("Snapshot Name:"), QLineEdit::Normal, tr("Name"), &ok, 0, Qt::ImhUppercaseOnly | Qt::ImhLowercaseOnly | Qt::ImhDigitsOnly );
+ if(!ok || name.isEmpty()){ return; } //cancelled
+ qDebug() << "Creating a new snapshot:" << ds << name;
+ //Now create the new snapshot
+ LPBackend::newSnapshot(ds,name);
+ QMessageBox::information(this,tr("Snapshot Pending"), tr("The new snapshot creation has been added to the queue"));
+ updateTabs();
}
void LPMain::menuRemoveSnapshot(){
View
@@ -10,6 +10,7 @@
#include <QRadioButton>
#include <QWidgetAction>
#include <QFileSystemModel>
+#include <QInputDialog>
#include "LPBackend.h"
#include "LPContainers.h"

0 comments on commit 82f4fbf

Please sign in to comment.