diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtOpenPerspectiveAction.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtOpenPerspectiveAction.cpp index d3077df7b1..4c01f85b20 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtOpenPerspectiveAction.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtOpenPerspectiveAction.cpp @@ -1,62 +1,63 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "berryQtOpenPerspectiveAction.h" #include #include #include #include namespace berry { QtOpenPerspectiveAction::QtOpenPerspectiveAction( IWorkbenchWindow::Pointer window, IPerspectiveDescriptor::Pointer descr, QActionGroup* group) : QAction(0), window(window.GetPointer()) { this->setParent(group); this->setText(QString(descr->GetLabel().c_str())); this->setToolTip(QString(descr->GetLabel().c_str())); this->setCheckable(true); + this->setIconVisibleInMenu(true); group->addAction(this); QIcon* icon = static_cast(descr->GetImageDescriptor()->CreateImage()); this->setIcon(*icon); descr->GetImageDescriptor()->DestroyImage(icon); perspectiveId = descr->GetId(); this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run())); } void QtOpenPerspectiveAction::Run() { try { window->GetWorkbench()->ShowPerspective(perspectiveId, IWorkbenchWindow::Pointer(window)); } catch (...) { QMessageBox::critical(0, "Opening Perspective Failed", QString("The perspective \"") + this->text() + "\" could not be opened.\nSee the log for details."); } } } diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShowViewAction.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShowViewAction.cpp index 9d2b2d64f7..e3416a581d 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShowViewAction.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/berryQtShowViewAction.cpp @@ -1,60 +1,61 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "berryQtShowViewAction.h" #include #include namespace berry { QtShowViewAction::QtShowViewAction(IWorkbenchWindow::Pointer window, IViewDescriptor::Pointer desc) : QAction(0) { this->setParent(static_cast(window->GetShell()->GetControl())); this->setText(QString(desc->GetLabel().c_str())); this->setToolTip(QString(desc->GetLabel().c_str())); + this->setIconVisibleInMenu(true); QIcon* icon = static_cast(desc->GetImageDescriptor()->CreateImage()); this->setIcon(*icon); desc->GetImageDescriptor()->DestroyImage(icon); m_Window = window.GetPointer(); m_Desc = desc; this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run())); } void QtShowViewAction::Run() { IWorkbenchPage::Pointer page = m_Window->GetActivePage(); if (page.IsNotNull()) { try { page->ShowView(m_Desc->GetId()); } catch (PartInitException e) { BERRY_ERROR << "Error: " << e.displayText() << std::endl; } } } }