#include <QmitkExtWorkbenchWindowAdvisorHack.h>

Public Slots | |
| void | onUndo () |
| void | onRedo () |
| void | onImageNavigator () |
| void | onEditPreferences () |
| void | onQuit () |
| void | onResetPerspective () |
| void | onClosePerspective () |
| void | onNewWindow () |
| void | onIntro () |
| void | onHelp () |
| This slot is called if the user klicks the menu "item help->active bundle" or presses F1. In this case a new window is opened which shows a help page. | |
| void | onAbout () |
| This slot is called if the user clicks in help menu the about button. | |
Public Member Functions | |
| QmitkExtWorkbenchWindowAdvisorHack () | |
| ~QmitkExtWorkbenchWindowAdvisorHack () | |
Static Public Attributes | |
| static QmitkExtWorkbenchWindowAdvisorHack * | undohack |
Definition at line 22 of file QmitkExtWorkbenchWindowAdvisorHack.h.
| QmitkExtWorkbenchWindowAdvisorHack::QmitkExtWorkbenchWindowAdvisorHack | ( | ) |
Definition at line 565 of file QmitkExtWorkbenchWindowAdvisor.cpp.
: QObject()
{
}
| QmitkExtWorkbenchWindowAdvisorHack::~QmitkExtWorkbenchWindowAdvisorHack | ( | ) |
Definition at line 570 of file QmitkExtWorkbenchWindowAdvisor.cpp.
{
}
| void QmitkExtWorkbenchWindowAdvisorHack::onAbout | ( | ) | [slot] |
This slot is called if the user clicks in help menu the about button.
Definition at line 704 of file QmitkExtWorkbenchWindowAdvisor.cpp.
{
QmitkAboutDialog* aboutDialog = new QmitkAboutDialog(QApplication::activeWindow(),NULL);
aboutDialog->show();
}
| void QmitkExtWorkbenchWindowAdvisorHack::onClosePerspective | ( | ) | [slot] |
Definition at line 653 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::PlatformUI::GetWorkbench().
{
berry::IWorkbenchPage::Pointer
page =
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
page->ClosePerspective(page->GetPerspective(), true, true);
}
| void QmitkExtWorkbenchWindowAdvisorHack::onEditPreferences | ( | ) | [slot] |
Definition at line 637 of file QmitkExtWorkbenchWindowAdvisor.cpp.
{
QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
_PreferencesDialog.exec();
}
| void QmitkExtWorkbenchWindowAdvisorHack::onHelp | ( | ) | [slot] |
This slot is called if the user klicks the menu "item help->active bundle" or presses F1. In this case a new window is opened which shows a help page.
Definition at line 699 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::QtAssistantUtil::OpenActivePartHelp().
| void QmitkExtWorkbenchWindowAdvisorHack::onImageNavigator | ( | ) | [slot] |
Definition at line 619 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::PlatformUI::GetWorkbench().
{
// get ImageNavigatorView
berry::IViewPart::Pointer imageNavigatorView =
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.imagenavigator");
if (imageNavigatorView)
{
bool isImageNavigatorVisible = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->IsPartVisible(imageNavigatorView);
if (isImageNavigatorVisible)
{
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->HideView(imageNavigatorView);
return;
}
}
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ShowView("org.mitk.views.imagenavigator");
//berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
}
| void QmitkExtWorkbenchWindowAdvisorHack::onIntro | ( | ) | [slot] |
Definition at line 666 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::PlatformUI::GetWorkbench().
{
bool hasIntro =
berry::PlatformUI::GetWorkbench()->GetIntroManager()->HasIntro();
if (!hasIntro)
{
QRegExp reg("(.*)<title>(\\n)*");
QRegExp reg2("(\\n)*</title>(.*)");
QFile file(":/org.mitk.gui.qt.ext/index.html");
file.open(QIODevice::ReadOnly | QIODevice::Text); // Als Text-Datei nur zum Lesen öffnen
QString text = QString(file.readAll());
file.close();
QString title = text;
title.replace(reg, "");
title.replace(reg2, "");
std::cout << title.toStdString() << std::endl;
QMessageBox::information(NULL, title,
text, "Close");
}
else
{
berry::PlatformUI::GetWorkbench()->GetIntroManager()->ShowIntro(
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow(), false);
}
}
| void QmitkExtWorkbenchWindowAdvisorHack::onNewWindow | ( | ) | [slot] |
Definition at line 661 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::PlatformUI::GetWorkbench().
{
berry::PlatformUI::GetWorkbench()->OpenWorkbenchWindow(0);
}
| void QmitkExtWorkbenchWindowAdvisorHack::onQuit | ( | ) | [slot] |
Definition at line 643 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::PlatformUI::GetWorkbench().
{
berry::PlatformUI::GetWorkbench()->Close();
}
| void QmitkExtWorkbenchWindowAdvisorHack::onRedo | ( | ) | [slot] |
Definition at line 597 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References mitk::UndoController::GetCurrentUndoModel(), MITK_ERROR, MITK_INFO, and mitk::UndoModel::Redo().
{
mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel();
if (model)
{
if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast<mitk::VerboseLimitedLinearUndo*>( model ))
{
mitk::VerboseLimitedLinearUndo::StackDescription descriptions =
verboseundo->GetRedoDescriptions();
if (descriptions.size() >= 1)
{
MITK_INFO << "Redo " << descriptions.front().second;
}
}
model->Redo();
}
else
{
MITK_ERROR << "No undo model instantiated";
}
}
| void QmitkExtWorkbenchWindowAdvisorHack::onResetPerspective | ( | ) | [slot] |
Definition at line 648 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References berry::PlatformUI::GetWorkbench().
{
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
}
| void QmitkExtWorkbenchWindowAdvisorHack::onUndo | ( | ) | [slot] |
Definition at line 575 of file QmitkExtWorkbenchWindowAdvisor.cpp.
References mitk::UndoController::GetCurrentUndoModel(), MITK_ERROR, MITK_INFO, and mitk::UndoModel::Undo().
{
mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel();
if (model)
{
if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast<mitk::VerboseLimitedLinearUndo*>( model ))
{
mitk::VerboseLimitedLinearUndo::StackDescription descriptions =
verboseundo->GetUndoDescriptions();
if (descriptions.size() >= 1)
{
MITK_INFO << "Undo " << descriptions.front().second;
}
}
model->Undo();
}
else
{
MITK_ERROR << "No undo model instantiated";
}
}
Definition at line 54 of file QmitkExtWorkbenchWindowAdvisorHack.h.
1.7.2