From: Dirk H Bartley Date: Tue, 29 May 2007 23:13:43 +0000 (+0000) Subject: Add Update Slots and update slots scan within storage context. X-Git-Tag: Release-7.0.0~6210 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3eae2cc48657230c3382dc395886ffae50b636a7;p=bacula%2Fbacula Add Update Slots and update slots scan within storage context. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4935 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/COMMANDS b/bacula/src/qt-console/COMMANDS index 43b86bb33a..6082078d1d 100644 --- a/bacula/src/qt-console/COMMANDS +++ b/bacula/src/qt-console/COMMANDS @@ -27,8 +27,9 @@ I'd say we could choose not to implement this in bat unmount [ jobid= | job= ] Mmmmm -update media, volume, pool, slots -media/volume still has more work, they are the same after all +update + /* Attempted, having problems */ + Volume from Pool All Volumes from Pool use still need to make decisions about how to handle multiple catalogs @@ -120,3 +121,6 @@ reload status unmount storage= [ drive=\lt{}num\gt{} ] + +update volume (via mediaedit) + "update slots" "update slots scan" (context of storage) diff --git a/bacula/src/qt-console/images/package-x-generic.png b/bacula/src/qt-console/images/package-x-generic.png new file mode 100644 index 0000000000..4311b57995 Binary files /dev/null and b/bacula/src/qt-console/images/package-x-generic.png differ diff --git a/bacula/src/qt-console/main.qrc b/bacula/src/qt-console/main.qrc index 55eb8a3062..2667db21a9 100644 --- a/bacula/src/qt-console/main.qrc +++ b/bacula/src/qt-console/main.qrc @@ -25,7 +25,7 @@ images/new.png images/next.png images/open.png - images/package-x-generic.svg + images/package-x-generic.png images/paste.png images/print.png images/restore.png diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 027d6cb023..d50198a66d 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -208,20 +208,18 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI if (m_checkcurwidget) { /* The Previous item */ if (previouswidgetitem) { /* avoid a segfault if first time */ - int treedepth = previouswidgetitem->data(0, Qt::UserRole).toInt(); - if (treedepth == 2){ - mp_treeWidget->removeAction(actionEditVolume); - mp_treeWidget->removeAction(actionListJobsOnVolume); - mp_treeWidget->removeAction(actionDeleteVolume); - mp_treeWidget->removeAction(actionPruneVolume); - mp_treeWidget->removeAction(actionPurgeVolume); - mp_treeWidget->removeAction(actionRelabelVolume); - } + mp_treeWidget->removeAction(actionEditVolume); + mp_treeWidget->removeAction(actionListJobsOnVolume); + mp_treeWidget->removeAction(actionDeleteVolume); + mp_treeWidget->removeAction(actionPruneVolume); + mp_treeWidget->removeAction(actionPurgeVolume); + mp_treeWidget->removeAction(actionRelabelVolume); + mp_treeWidget->removeAction(actionAllVolumesFromPool); } int treedepth = currentwidgetitem->data(0, Qt::UserRole).toInt(); + m_currentVolumeName=currentwidgetitem->text(0); if (treedepth == 2){ - m_currentVolumeName=currentwidgetitem->text(0); m_currentVolumeId=currentwidgetitem->text(1); mp_treeWidget->addAction(actionEditVolume); mp_treeWidget->addAction(actionListJobsOnVolume); @@ -229,6 +227,12 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI mp_treeWidget->addAction(actionPruneVolume); mp_treeWidget->addAction(actionPurgeVolume); mp_treeWidget->addAction(actionRelabelVolume); + } else if (treedepth == 1) { +/* *******FIXME****** + * I can't seem to get "All volumes from pool" or "Volume from pool" to work + * in one sentence command. Works when you do it one step at a time vi console + mp_treeWidget->addAction(actionAllVolumesFromPool); +*/ } } } @@ -254,6 +258,7 @@ void MediaList::createContextMenu() /* connect to the action specific to this pages class */ connect(actionRefreshMediaList, SIGNAL(triggered()), this, SLOT(populateTree())); + connect(actionAllVolumesFromPool, SIGNAL(triggered()), this, SLOT(allVolumesFromPool())); } /* @@ -330,3 +335,14 @@ void MediaList::relabelVolume() setConsoleCurrent(); new relabelDialog(m_console, m_currentVolumeName); } + +/* + * Called from the signal of the context sensitive menu to purge! + */ +void MediaList::allVolumesFromPool() +{ + QString cmd("update pool="); + cmd += m_currentVolumeName + " All Volumes From Pool"; + consoleCommand(cmd); + populateTree(); +} diff --git a/bacula/src/qt-console/medialist/medialist.h b/bacula/src/qt-console/medialist/medialist.h index 143e83a3ad..17130cbe85 100644 --- a/bacula/src/qt-console/medialist/medialist.h +++ b/bacula/src/qt-console/medialist/medialist.h @@ -59,6 +59,7 @@ private slots: void purgeVolume(); void pruneVolume(); void relabelVolume(); + void allVolumesFromPool(); private: void createContextMenu(); diff --git a/bacula/src/qt-console/medialist/medialist.ui b/bacula/src/qt-console/medialist/medialist.ui index 4dfb5bb1f1..6f0020b240 100644 --- a/bacula/src/qt-console/medialist/medialist.ui +++ b/bacula/src/qt-console/medialist/medialist.ui @@ -5,8 +5,8 @@ 0 0 - 636 - 357 + 490 + 303 @@ -82,6 +82,23 @@ Relabel Volume + + + :/images/cartridge-edit.svg + + + Update all Volumes From Pool + + + Update all Volumes From Pool + + + Update all Volumes From Pool + + + Update all Volumes From Pool + + diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 4b8bd9846a..b2f8ac6492 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -48,7 +48,7 @@ Storage::Storage() m_name = "Storage"; pgInitialize(); QTreeWidgetItem* thisitem = mainWin->getFromHash(this); - thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/package-x-generic.svg"))); + thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/package-x-generic.png"))); /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_storage.h */ m_populated = false; @@ -165,6 +165,8 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte mp_treeWidget->removeAction(actionLabelStorage); mp_treeWidget->removeAction(actionMountStorage); mp_treeWidget->removeAction(actionUnMountStorage); + mp_treeWidget->removeAction(actionUpdateSlots); + mp_treeWidget->removeAction(actionUpdateSlotsScan); } } @@ -179,14 +181,22 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte mp_treeWidget->addAction(actionMountStorage); mp_treeWidget->addAction(actionUnMountStorage); QString text; - text = "Status Storage " + m_currentStorage; + text = "Status Storage \"" + m_currentStorage + "\""; actionStatusStorageInConsole->setText(text); - text = "Label media in Storage " + m_currentStorage; + text = "Label media in Storage \"" + m_currentStorage + "\""; actionLabelStorage->setText(text); - text = "Mount media in Storage " + m_currentStorage; + text = "Mount media in Storage \"" + m_currentStorage + "\""; actionMountStorage->setText(text); - text = "\"UN\" Mount media in Storage " + m_currentStorage; + text = "\"UN\" Mount media in Storage \"" + m_currentStorage + "\""; actionUnMountStorage->setText(text); + if (m_currentAutoChanger != 0) { + mp_treeWidget->addAction(actionUpdateSlots); + mp_treeWidget->addAction(actionUpdateSlotsScan); + text = "Barcode Scan media in Storage \"" + m_currentStorage + "\""; + actionUpdateSlots->setText(text); + text = "Mount and read scan media in Storage \"" + m_currentStorage + "\""; + actionUpdateSlotsScan->setText(text); + } } } } @@ -214,6 +224,10 @@ void Storage::createContextMenu() SLOT(consoleMountStorage())); connect(actionUnMountStorage, SIGNAL(triggered()), this, SLOT(consoleUnMountStorage())); + connect(actionUpdateSlots, SIGNAL(triggered()), this, + SLOT(consoleUpdateSlots())); + connect(actionUpdateSlotsScan, SIGNAL(triggered()), this, + SLOT(consoleUpdateSlotsScan())); } /* @@ -268,3 +282,19 @@ void Storage::consoleUnMountStorage() cmd += m_currentStorage; consoleCommand(cmd); } + +/* Update Slots */ +void Storage::consoleUpdateSlots() +{ + QString cmd("update slots storage="); + cmd += m_currentStorage; + consoleCommand(cmd); +} + +/* Update Slots Scan*/ +void Storage::consoleUpdateSlotsScan() +{ + QString cmd("update slots scan storage="); + cmd += m_currentStorage; + consoleCommand(cmd); +} diff --git a/bacula/src/qt-console/storage/storage.h b/bacula/src/qt-console/storage/storage.h index 7705640511..fb9d13e0ae 100644 --- a/bacula/src/qt-console/storage/storage.h +++ b/bacula/src/qt-console/storage/storage.h @@ -53,11 +53,12 @@ public slots: private slots: void populateTree(); -// void showJobs(); void consoleStatusStorage(); void consoleLabelStorage(); void consoleMountStorage(); void consoleUnMountStorage(); + void consoleUpdateSlots(); + void consoleUpdateSlotsScan(); private: void createContextMenu(); diff --git a/bacula/src/qt-console/storage/storage.ui b/bacula/src/qt-console/storage/storage.ui index 61a37e5d84..7ec0c643ac 100644 --- a/bacula/src/qt-console/storage/storage.ui +++ b/bacula/src/qt-console/storage/storage.ui @@ -5,8 +5,8 @@ 0 0 - 791 - 644 + 468 + 311 @@ -41,6 +41,9 @@ Status Storage In Console + + Status Storage In Console + @@ -49,6 +52,9 @@ Label Storage + + Label Storage + @@ -57,6 +63,9 @@ MountStorage + + MountStorage + @@ -65,6 +74,31 @@ UnMount Storage + + UnMount Storage + + + + + :/images/package-x-generic.png + + + Update Slots + + + Update Slots + + + + + :/images/package-x-generic.png + + + Update Slots Scan + + + Update Slots Scan +