fw4spl
IProgressDialog.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 
8 #include <fwCore/base.hpp>
9 #include "fwGui/dialog/IProgressDialog.hpp"
10 
11 namespace fwGui
12 {
13 namespace dialog
14 {
15 const IProgressDialog::FactoryRegistryKeyType IProgressDialog::REGISTRY_KEY = "::fwGui::dialog::ProgressDialog";
16 
17 IProgressDialog::IProgressDialog()
18  : m_canceled(false),
19  m_raise(true),
20  m_value(0),
21  m_processUserEvents(true)
22 {
23 }
24 
25 //-----------------------------------------------------------------------------
26 
27 IProgressDialog::~IProgressDialog()
28 {
29 }
30 
31 //-----------------------------------------------------------------------------
32 
33 void IProgressDialog::setCancelCallback(CancelCallbackType callback)
34 {
35  m_cancelCallback = callback;
36 }
37 
38 //-----------------------------------------------------------------------------
39 
40 void IProgressDialog::cancelPressed()
41 {
42  m_canceled = true;
43  if(m_cancelCallback)
44  {
45  m_cancelCallback();
46  }
47  else if (m_raise)
48  {
49  FW_RAISE("Operation canceled");
50  }
51 }
52 
53 //-----------------------------------------------------------------------------
54 
55 } // namespace dialog
56 } // namespace fwGui
57 
58 
59 
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
static FWGUI_API const FactoryRegistryKeyType REGISTRY_KEY
this unique key should be used for all factory for specific LocationDialog(qt,wx,...)