Medical Imaging Interaction Toolkit  2016.11.0
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,
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 
23  : QAction(nullptr)
24  , m_Window(nullptr)
25 {
26  this->init(window.GetPointer());
27 }
28 
30  : QAction(nullptr)
31  , m_Window(nullptr)
32 {
33  this->setIcon(icon);
34  this->init(window.GetPointer());
35 }
36 
38  : QAction(nullptr)
39  , m_Window(nullptr)
40 {
41  this->init(window);
42 }
43 
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 
61 {
63 }
QmitkFileExitAction(berry::SmartPointer< berry::IWorkbenchWindow > window)
virtual bool Close()=0
static IWorkbench * GetWorkbench()
ObjectType * GetPointer() const