Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkFileExitAction.cpp
Go to the documentation of this file.
1
/*============================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center (DKFZ)
6
All rights reserved.
7
8
Use of this source code is governed by a 3-clause BSD license that can be
9
found in the LICENSE file.
10
11
============================================================================*/
12
13
#include "
QmitkFileExitAction.h
"
14
#include "internal/org_mitk_gui_qt_application_Activator.h"
15
16
#include <
berryPlatformUI.h
>
17
18
QmitkFileExitAction::QmitkFileExitAction
(
berry::IWorkbenchWindow::Pointer
window)
19
: QAction(nullptr)
20
, m_Window(nullptr)
21
{
22
this->init(window.
GetPointer
());
23
}
24
25
QmitkFileExitAction::QmitkFileExitAction
(
const
QIcon & icon,
berry::IWorkbenchWindow::Pointer
window)
26
: QAction(nullptr)
27
, m_Window(nullptr)
28
{
29
this->setIcon(icon);
30
this->init(window.
GetPointer
());
31
}
32
33
QmitkFileExitAction::QmitkFileExitAction
(
berry::IWorkbenchWindow
* window)
34
: QAction(nullptr)
35
, m_Window(nullptr)
36
{
37
this->init(window);
38
}
39
40
QmitkFileExitAction::QmitkFileExitAction
(
const
QIcon& icon,
berry::IWorkbenchWindow
* window)
41
: QAction(nullptr)
42
, m_Window(nullptr)
43
{
44
this->setIcon(icon);
45
this->init(window);
46
}
47
48
void
QmitkFileExitAction::init(
berry::IWorkbenchWindow
* window)
49
{
50
m_Window = window;
51
this->setText(
"&Exit"
);
52
this->setToolTip(
"Exit the application. Please save your data before exiting."
);
53
this->connect(
this
, SIGNAL(triggered(
bool
)),
this
, SLOT(
Run
()));
54
}
55
56
void
QmitkFileExitAction::Run
()
57
{
58
berry::PlatformUI::GetWorkbench
()->
Close
();
59
}
berry::SmartPointer< Self >
QmitkFileExitAction::QmitkFileExitAction
QmitkFileExitAction(berry::SmartPointer< berry::IWorkbenchWindow > window)
berry::IWorkbench::Close
virtual bool Close()=0
berry::IWorkbenchWindow
Definition:
berryIWorkbenchWindow.h:66
berry::PlatformUI::GetWorkbench
static IWorkbench * GetWorkbench()
Definition:
berryPlatformUI.cpp:47
berryPlatformUI.h
QmitkFileExitAction::Run
void Run()
Definition:
QmitkFileExitAction.cpp:56
QmitkFileExitAction.h
berry::SmartPointer::GetPointer
ObjectType * GetPointer() const
Definition:
berrySmartPointer.h:209
Source
Plugins
org.mitk.gui.qt.application
src
QmitkFileExitAction.cpp
Generated on Thu Mar 12 2020 10:24:10 for Medical Imaging Interaction Toolkit by
1.8.13