]> git.sur5r.net Git - bacula/bacula/commitdiff
This fixes a reproduceable way to have close action show in context for a
authorDirk H Bartley <dbartley@schupan.com>
Fri, 8 Jun 2007 12:34:19 +0000 (12:34 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Fri, 8 Jun 2007 12:34:19 +0000 (12:34 +0000)
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

bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/medialist/medialist.cpp

index 1a3d065fe0645336a1e8931466c91c2470d89354..277ded583b733675b4fe2333ff50023254a4dae9 100644 (file)
@@ -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);
-            }
-         } 
       }
    }
 
index 29ae0288f34010b63e01755f0987e9a71e7fa73a..005c7e642e20588d2d6e9341dd4e315b6474c8d0 100644 (file)
@@ -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();