From: Dirk H Bartley Date: Fri, 8 Jun 2007 12:34:19 +0000 (+0000) Subject: This fixes a reproduceable way to have close action show in context for a X-Git-Tag: Release-7.0.0~6145 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=25abe3f9ffca8517fb985da496d0205d4190119e;p=bacula%2Fbacula This fixes a reproduceable way to have close action show in context for a page selector tree widget item that was not supposed to have it. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5001 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 1a3d065fe0..277ded583b 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -300,6 +300,11 @@ void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *pre Pages *previousPage, *nextPage; Console *previousConsole, *nextConsole; + /* remove all actions before adding actions appropriate for new page */ + foreach(QAction* pageAction, treeWidget->actions()) { + treeWidget->removeAction(pageAction); + } + /* first determine the next item */ /* knowing the treeWidgetItem, get the page from the hash */ @@ -341,15 +346,6 @@ void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *pre QBrush greyBrush(Qt::lightGray); dirItem->setBackground(0, greyBrush); } - /* make sure the close window and toggle dock options are removed */ - treeWidget->removeAction(actionClosePage); - treeWidget->removeAction(actionToggleDock); - /* Is this a page that has been inserted into the hash */ - if (previousPage) { - foreach(QAction* pageaction, previousPage->m_contextActions) { - treeWidget->removeAction(pageaction); - } - } } } diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 29ae0288f3..005c7e642e 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -211,14 +211,6 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI foreach(QAction* mediaAction, mp_treeWidget->actions()) { mp_treeWidget->removeAction(mediaAction); } - /*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); - mp_treeWidget->removeAction(actionVolumeFromPool);*/ } int treedepth = currentwidgetitem->data(0, Qt::UserRole).toInt();