From 3eae2cc48657230c3382dc395886ffae50b636a7 Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Tue, 29 May 2007 23:13:43 +0000 Subject: [PATCH] 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 --- bacula/src/qt-console/COMMANDS | 8 +++- .../qt-console/images/package-x-generic.png | Bin 0 -> 1270 bytes bacula/src/qt-console/main.qrc | 2 +- bacula/src/qt-console/medialist/medialist.cpp | 36 +++++++++++----- bacula/src/qt-console/medialist/medialist.h | 1 + bacula/src/qt-console/medialist/medialist.ui | 21 ++++++++- bacula/src/qt-console/storage/storage.cpp | 40 +++++++++++++++--- bacula/src/qt-console/storage/storage.h | 3 +- bacula/src/qt-console/storage/storage.ui | 38 ++++++++++++++++- 9 files changed, 126 insertions(+), 23 deletions(-) create mode 100644 bacula/src/qt-console/images/package-x-generic.png 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 0000000000000000000000000000000000000000..4311b57995d12bb0ae2d51973caf3b9e3530f34b GIT binary patch literal 1270 zcmVJh0eAPwq?gbVn~|a`xj@JL5a<3EvEHG!RXgJw@45vCH`gu*)z4{dZh1G7O7t)kj}-)8(6X0?c}wv7{lw#OE}uKa zw8qB?R0SCt8sb{)64AqJaY^7aHyDilE>7s_OeAx>VmM=0w!IvTuHF@Yt7ryVHw7LF zO`ZMyk_{g=hzQru|3G>;MK+TKELl8E#SGF}$QUqID6gz0n@*#&CTl?GdO2CRjI}V=f;3$RGDql6?r~6_%ohJ?qS67vJ*KQ1U zr_$Mt>-HoL1IU4mm4UKA-RaQO*>(NBe|H#@t6#R^g9l|O3f2G?ti_HQPi)ShtLM;u zY=0(t_NVV0t>&e(CSZ(te*ND56Vmodojka#d&b!1z&w>nC0kZ(|8r3$!}*3smu#;N&v3v2Cjf2$ zoB-km5nuko7esv3h%bbAA@GI33n5+&;?*Ml+L31+%3p`_hf)3zcK8O1UwpHvyfXOu z+TDp&Koih?s|df?8rc?k|dWK7h|#+rQQAur;qwG z$-Y@@_6@`ex?t2k+ZuO9v9|ka?9!g2@ne7oxQzK1El@%c2?4c0H4p@< zimyCjyGj17ljPt0vb8pQ2fzq~HxfJql&TUFBf*ov;OPDr1sDUOfa1L~aWi(DK;r`Z gUpDCnlSv2o2YL7O(o54y>;M1&07*qoM6N<$g4_#K9smFU literal 0 HcmV?d00001 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 + -- 2.39.5