SpectralLibraryMatchResults::~SpectralLibraryMatchResults()
{
   Service<DesktopServices> pDesktop;

   // remove toolbar button and menu item
   QAction* pAction = getAction();
   if (pAction != NULL)
   {
      ToolBar* pToolBar = static_cast<ToolBar*>(pDesktop->getWindow("Spectral", TOOLBAR));
      if (pToolBar != NULL)
      {
         pToolBar->removeItem(pAction);
         MenuBar* pMenuBar = pToolBar->getMenuBar();
         if (pMenuBar != NULL)
         {
            pMenuBar->removeMenuItem(pAction);
         }
      }
   }

   // dockwindow should still exist so detach from it
   DockWindow* pWindow = getDockWindow();
   if (pWindow != NULL)
   {
      pWindow->detach(SIGNAL_NAME(DockWindow, AboutToShowContextMenu),
         Slot(this, &SpectralLibraryMatchResults::updateContextMenu));
   }
}
Ejemplo n.º 2
0
ConvolutionMatrixEditor::~ConvolutionMatrixEditor()
{
   QAction* pWindowAction = getAction();
   if (pWindowAction != NULL)
   {
      MenuBar* pMenuBar = Service<DesktopServices>()->getMainMenuBar();
      if (pMenuBar != NULL)
      {
         pMenuBar->removeMenuItem(pWindowAction);
      }
   }
}
Ejemplo n.º 3
0
AnnotationImagePalette::~AnnotationImagePalette()
{
   QAction* pWindowAction = getAction();
   if (pWindowAction != NULL)
   {
      MenuBar* pMenuBar = Service<DesktopServices>()->getMainMenuBar();
      if (pMenuBar != NULL)
      {
         pMenuBar->removeMenuItem(pWindowAction);
      }
      if (Service<DesktopServices>()->getMainWidget() != NULL)
      {
         delete pWindowAction;
      }
   }
}
RangeProfilePlotManager::~RangeProfilePlotManager()
{
   Window* pWindow = getDockWindow();
   if (pWindow != NULL)
   {
      pWindow->detach(SIGNAL_NAME(Window, SessionItemDropped), Slot(this, &RangeProfilePlotManager::dropSessionItem));
   }
   for (std::map<Signature*, std::string>::iterator sig = mSigPointSets.begin(); sig != mSigPointSets.end(); ++sig)
   {
      sig->first->detach(SIGNAL_NAME(Subject, Deleted), Slot(this, &RangeProfilePlotManager::signatureDeleted));
      sig->first->getDataDescriptor()->detach(SIGNAL_NAME(DataDescriptor, Renamed),
         Slot(this, &RangeProfilePlotManager::signatureRenamed));
   }
   QAction* pWindowAction = getAction();
   if (pWindowAction != NULL)
   {
      MenuBar* pMenuBar = Service<DesktopServices>()->getMainMenuBar();
      if (pMenuBar != NULL)
      {
         pMenuBar->removeMenuItem(pWindowAction);
      }
   }
}