Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
Home
Manual
API Reference
Download
Bugzilla
Groups
Namespace List
Class List
File List
Examples
File List
File Members
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,
6
Division of Medical and Biological Informatics.
7
All rights reserved.
8
9
This software is distributed WITHOUT ANY WARRANTY; without
10
even the implied warranty of MERCHANTABILITY or FITNESS FOR
11
A PARTICULAR PURPOSE.
12
13
See LICENSE.txt or http://www.mitk.org for details.
14
15
===================================================================*/
16
17
#include "
QmitkFileExitAction.h
"
18
#include "internal/org_mitk_gui_qt_application_Activator.h"
19
20
#include <
berryPlatformUI.h
>
21
22
QmitkFileExitAction::QmitkFileExitAction
(
berry::IWorkbenchWindow::Pointer
window)
23
: QAction(nullptr)
24
, m_Window(nullptr)
25
{
26
this->init(window.
GetPointer
());
27
}
28
29
QmitkFileExitAction::QmitkFileExitAction
(
const
QIcon & icon,
berry::IWorkbenchWindow::Pointer
window)
30
: QAction(nullptr)
31
, m_Window(nullptr)
32
{
33
this->setIcon(icon);
34
this->init(window.
GetPointer
());
35
}
36
37
QmitkFileExitAction::QmitkFileExitAction
(
berry::IWorkbenchWindow
* window)
38
: QAction(nullptr)
39
, m_Window(nullptr)
40
{
41
this->init(window);
42
}
43
44
QmitkFileExitAction::QmitkFileExitAction
(
const
QIcon& icon,
berry::IWorkbenchWindow
* window)
45
: QAction(nullptr)
46
, m_Window(nullptr)
47
{
48
this->setIcon(icon);
49
this->init(window);
50
}
51
52
void
QmitkFileExitAction::init(
berry::IWorkbenchWindow
* window)
53
{
54
m_Window = window;
55
this->setText(
"&Exit"
);
56
this->setToolTip(
"Exit the application. Please save your data before exiting."
);
57
this->connect(
this
, SIGNAL(triggered(
bool
)),
this
, SLOT(
Run
()));
58
}
59
60
void
QmitkFileExitAction::Run
()
61
{
62
berry::PlatformUI::GetWorkbench
()->
Close
();
63
}
berry::SmartPointer< Self >
QmitkFileExitAction::QmitkFileExitAction
QmitkFileExitAction(berry::SmartPointer< berry::IWorkbenchWindow > window)
berry::IWorkbench::Close
virtual bool Close()=0
berry::IWorkbenchWindow
Definition:
berryIWorkbenchWindow.h:70
berry::PlatformUI::GetWorkbench
static IWorkbench * GetWorkbench()
Definition:
berryPlatformUI.cpp:51
berryPlatformUI.h
QmitkFileExitAction::Run
void Run()
Definition:
QmitkFileExitAction.cpp:60
berry::SmartPointer::GetPointer
ObjectType * GetPointer() const
Definition:
berrySmartPointer.h:213
QmitkFileExitAction.h
git
MITK
Plugins
org.mitk.gui.qt.application
src
QmitkFileExitAction.cpp
Generated on Fri Feb 3 2017 20:52:13 for Medical Imaging Interaction Toolkit by
1.8.9.1