comparison Applications/Generic/NativeStoneApplicationRunner.cpp @ 385:6cc3ce74dc05

using message broker in widgets
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 Nov 2018 20:49:41 +0100
parents 8eb4fe74000f
children aee3d7941c9b
comparison
equal deleted inserted replaced
384:d20d75f20c5d 385:6cc3ce74dc05
22 #if ORTHANC_ENABLE_NATIVE != 1 22 #if ORTHANC_ENABLE_NATIVE != 1
23 #error this file shall be included only with the ORTHANC_ENABLE_NATIVE set to 1 23 #error this file shall be included only with the ORTHANC_ENABLE_NATIVE set to 1
24 #endif 24 #endif
25 25
26 #include "NativeStoneApplicationRunner.h" 26 #include "NativeStoneApplicationRunner.h"
27
28 #include "../../Framework/Toolbox/MessagingToolbox.h"
29 #include "../../Platforms/Generic/OracleWebService.h"
27 #include "NativeStoneApplicationContext.h" 30 #include "NativeStoneApplicationContext.h"
28 #include <boost/program_options.hpp>
29
30 #include "../../Framework/Toolbox/MessagingToolbox.h"
31 31
32 #include <Core/Logging.h> 32 #include <Core/Logging.h>
33 #include <Core/HttpClient.h> 33 #include <Core/HttpClient.h>
34 #include <Core/Toolbox.h> 34 #include <Core/Toolbox.h>
35 #include <Core/OrthancException.h>
35 #include <Plugins/Samples/Common/OrthancHttpConnection.h> 36 #include <Plugins/Samples/Common/OrthancHttpConnection.h>
36 #include "../../Platforms/Generic/OracleWebService.h" 37
38 #include <boost/program_options.hpp>
37 39
38 namespace OrthancStone 40 namespace OrthancStone
39 { 41 {
40 // Anonymous namespace to avoid clashes against other compilation modules 42 // Anonymous namespace to avoid clashes against other compilation modules
41 namespace 43 namespace
181 183
182 LOG(WARNING) << "Creating the widgets of the application"; 184 LOG(WARNING) << "Creating the widgets of the application";
183 185
184 LogStatusBar statusBar; 186 LogStatusBar statusBar;
185 187
186 NativeStoneApplicationContext context; 188 NativeStoneApplicationContext context(broker_);
187 189
188 { 190 {
189 Oracle oracle(4); // use 4 threads to download content 191 Oracle oracle(4); // use 4 threads to download content
190 oracle.Start(); 192 oracle.Start();
191 193
195 197
196 application_.Initialize(&context, statusBar, parameters); 198 application_.Initialize(&context, statusBar, parameters);
197 199
198 { 200 {
199 NativeStoneApplicationContext::GlobalMutexLocker locker(context); 201 NativeStoneApplicationContext::GlobalMutexLocker locker(context);
200 context.SetCentralWidget(application_.GetCentralWidget()); 202 locker.SetCentralWidget(application_.GetCentralWidget());
201 context.GetCentralViewport().SetStatusBar(statusBar); 203 locker.GetCentralViewport().SetStatusBar(statusBar);
202 } 204 }
203 205
204 std::string title = application_.GetTitle(); 206 std::string title = application_.GetTitle();
205 if (title.empty()) 207 if (title.empty())
206 { 208 {