Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkXnatSessionTracker.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 "mitkXnatSessionTracker.h"
18 
19 #include "ctkXnatLoginProfile.h"
20 
21 namespace mitk
22 {
23  XnatSessionTracker::XnatSessionTracker(us::ModuleContext *context) : Superclass(context), m_Context(context) {}
24  void XnatSessionTracker::SessionOpened()
25  {
26  ctkXnatSession *session = dynamic_cast<ctkXnatSession *>(QObject::sender());
27  emit Opened(session);
28  }
29 
30  void XnatSessionTracker::SessionAboutToBeClosed()
31  {
32  ctkXnatSession *session = dynamic_cast<ctkXnatSession *>(QObject::sender());
33  emit AboutToBeClosed(session);
34  }
35 
36  ctkXnatSession *XnatSessionTracker::AddingService(const ServiceReferenceType &reference)
37  {
38  ctkXnatSession *session = Superclass::AddingService(reference);
39  if (session->isOpen())
40  {
41  emit Opened(session);
42  }
43  connect(session, SIGNAL(sessionOpened()), this, SLOT(SessionOpened()));
44  connect(session, SIGNAL(sessionAboutToBeClosed()), this, SLOT(SessionAboutToBeClosed()));
45 
46  return session;
47  }
48 
49  void XnatSessionTracker::RemovedService(const ServiceReferenceType &reference, ctkXnatSession *tracked)
50  {
51  emit AboutToBeClosed(tracked);
52  Superclass::RemovedService(reference, tracked);
53  }
54 
55 } // end of namespace mitk
void Opened(ctkXnatSession *)
DataCollection - Class to facilitate loading/accessing structured data.
void RemovedService(const ServiceReferenceType &reference, T service)
T AddingService(const ServiceReferenceType &reference)
XnatSessionTracker(us::ModuleContext *context)
void AboutToBeClosed(ctkXnatSession *)