From c3074096817166209b0b7dc6a8ef1df527b9fe70 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 20 Oct 2009 19:56:33 +0000 Subject: [PATCH] bat: cleanup MediaView --- bacula/src/qt-console/medialist/mediaview.cpp | 116 +++++------------- bacula/src/qt-console/medialist/mediaview.h | 7 -- 2 files changed, 28 insertions(+), 95 deletions(-) diff --git a/bacula/src/qt-console/medialist/mediaview.cpp b/bacula/src/qt-console/medialist/mediaview.cpp index e56601a70a..f470a00207 100644 --- a/bacula/src/qt-console/medialist/mediaview.cpp +++ b/bacula/src/qt-console/medialist/mediaview.cpp @@ -91,6 +91,26 @@ void MediaView::editPushed() void MediaView::purgePushed() { + if (QMessageBox::warning(this, "Bat", + tr("Are you sure you want to purge ?? !!!.\n" +"The Purge command will delete associated Catalog database records from Jobs and" +" Volumes without considering the retention period. Purge works only on the" +" Catalog database and does not affect data written to Volumes. This command can" +" be dangerous because you can delete catalog records associated with current" +" backups of files, and we recommend that you do not use it unless you know what" +" you are doing.\n" + "Press OK to proceed with the purge operation?"), + QMessageBox::Ok | QMessageBox::Cancel) + == QMessageBox::Cancel) { return; } + + QStringList lst; + QString cmd; + getSelection(lst); + for(int i=0; isetEditTriggers(QAbstractItemView::NoEditTriggers); } -/* - * Called from the signal of the context sensitive menu! - */ -void MediaView::editVolume() -{ - MediaEdit* edit = new MediaEdit(mainWin->getFromHash(this), m_currentVolumeId); - connect(edit, SIGNAL(destroyed()), this, SLOT(populateTable())); -} - -/* - * Called from the signal of the context sensitive menu! - */ -void MediaView::viewVolume() -{ - QTreeWidgetItem *parentItem = mainWin->getFromHash(this); - MediaInfo* view = new MediaInfo(parentItem, m_currentVolumeName); - connect(view, SIGNAL(destroyed()), this, SLOT(populateTable())); - -} - /* * When the treeWidgetItem in the page selector tree is singleclicked, Make sure * The tree has been populated. @@ -339,68 +341,6 @@ void MediaView::currentStackItem() } } -/* - * Called from the signal of the context sensitive menu to delete a volume! - */ -void MediaView::deleteVolume() -{ - if (QMessageBox::warning(this, "Bat", - tr("Are you sure you want to delete?? !!!.\n" -"This delete command is used to delete a Volume record and all associated catalog" -" records that were created. This command operates only on the Catalog" -" database and has no effect on the actual data written to a Volume. This" -" command can be dangerous and we strongly recommend that you do not use" -" it unless you know what you are doing. All Jobs and all associated" -" records (File and JobMedia) will be deleted from the catalog." - "Press OK to proceed with delete operation.?"), - QMessageBox::Ok | QMessageBox::Cancel) - == QMessageBox::Cancel) { return; } - - QStringList lst; - QString cmd; - getSelection(lst); - for(int i=0; i