fw4spl
App.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 #include "fwGuiQt/App.hpp"
8 
9 #include <fwGui/dialog/MessageDialog.hpp>
10 
11 #include <fwRuntime/profile/Profile.hpp>
12 
13 #include <fwTools/Os.hpp>
14 
15 #include <locale.h>
16 
17 #include <boost/filesystem/operations.hpp>
18 #include <boost/filesystem/path.hpp>
19 #include <boost/tokenizer.hpp>
20 
21 #include <iostream>
22 #include <sstream>
23 
24 namespace fwGuiQt
25 {
26 
27 //-----------------------------------------------------------------------------
28 
29 App::App(int& argc, char** argv, bool guiEnabled) :
30  QApplication(argc, argv, guiEnabled)
31 {
33 
34  setlocale(LC_ALL, "C"); // needed for mfo save process
35  QLocale::setDefault(QLocale::C); // on Linux we need that as well...
36 
37  std::string appName = "No name";
38 
39  ::fwRuntime::profile::Profile::sptr profile = ::fwRuntime::profile::getCurrentProfile();
40 
41  if (profile)
42  {
43  appName = profile->getName();
44  }
45 
46  this->setApplicationName( QString::fromStdString(appName) );
47 
48  QObject::connect(this, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuit()));
49 }
50 
51 //-----------------------------------------------------------------------------
52 
53 void App::aboutToQuit()
54 {
56 }
57 
58 //-----------------------------------------------------------------------------
59 
60 void App::onExit()
61 {
63 
64  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
65  QApplication::restoreOverrideCursor();
66 
67  qApp->flush();
68  qApp->exit(0);
69 }
70 
71 //-----------------------------------------------------------------------------
72 
73 } // namespace fwGuiQt
74 
#define SLM_TRACE_FUNC()
Trace contextual function signature.
Definition: spyLog.hpp:329
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
Definition: WindowLevel.hpp:32