84
86
#include <api/toolsystem/itoolsregistry.h>
85
87
#include <api/controllers/imodulecontroller.h>
86
88
#include <api/controllers/icontroladorlog.h>
87
#include <api/controllers/icommandscontroller.h>
89
#include <main/controllers/commandcontroller.h>
88
90
#include <api/controllers/ieventscontroller.h>
89
91
#include <api/dicom/idicomconformance.h>
90
92
#include <eventos/hidesplashwindow.h>
93
94
#include "main/entorno.h"
95
96
#include <main/controllers/controladorextensiones.h>
261
262
wxLog *logger = new wxLogStderr();
262
263
wxLog::SetActiveTarget(logger);
263
264
wxSQLite3Database::InitializeSQLite();
265
//initialize WSA on windows
266
#if defined(_WINDOWS)
268
if (WSAStartup(MAKEWORD( 2, 2 ), &wsaData) != 0) {
269
LOG_ERROR("INIT", "Error initializing network");
273
/* Must initialize libcurl before any threads are started */
274
curl_global_init(CURL_GLOBAL_ALL);
265
276
WriteHeaderLog();
303
314
name, inst_name);
308
fileName = wxFileName(argv[1]);
309
if (fileName.IsRelative()) {
310
#if defined(__WXGTK__)
311
char* invocation_dir = getenv("INVOCATION_DIR");
312
if (invocation_dir != NULL) {
313
wxString invocationDir = wxString::FromUTF8(invocation_dir);
314
if (!invocationDir.IsEmpty()) {
315
fileName = invocationDir + wxFileName::GetPathSeparator() + fileName.GetFullPath();
319
fileName.MakeAbsolute();
322
if (fileName.IsOk() && ((fileName.FileExists() && fileName.IsFileReadable()) || (wxDirExists(fileName.GetFullPath()) && fileName.IsDirReadable()))) {
323
LOG_INFO("Core", "The client sends following file: " << fileName.GetFullPath().ToUTF8());
319
wxString str = wxString(argv[1]);
320
if (str.Lower().StartsWith(wxT("ginkgocadx://"))) {
321
LOG_INFO("Core", "The client sends following URL: " << str.ToUTF8());
324
322
// Ask the other instance to open a file or raise itself
325
connection->Execute(fileName.GetFullPath());
323
connection->Execute(str);
326
324
connection->Disconnect();
327
325
delete connection;
330
wxString err = wxString::Format(wxT("Error: The file %s does not exists or is not readable"), argv[1]);
331
LOG_ERROR("Core", TOPATH(err));
332
wxMessageBox(err, wxT("Ginkgo CADx"), wxICON_INFORMATION|wxOK);
329
wxFileName fileName = wxFileName(argv[1]);
330
if (fileName.IsRelative()) {
331
#if defined(__WXGTK__)
332
char* invocation_dir = getenv("INVOCATION_DIR");
333
if (invocation_dir != NULL) {
334
wxString invocationDir = wxString::FromUTF8(invocation_dir);
335
if (!invocationDir.IsEmpty()) {
336
fileName = invocationDir + wxFileName::GetPathSeparator() + fileName.GetFullPath();
340
fileName.MakeAbsolute();
343
if (fileName.IsOk() && ((fileName.FileExists() && fileName.IsFileReadable()) || (wxDirExists(fileName.GetFullPath()) && fileName.IsDirReadable()))) {
344
LOG_INFO("Core", "The client sends following file: " << fileName.GetFullPath().ToUTF8());
345
// Ask the other instance to open a file or raise itself
346
connection->Execute(fileName.GetFullPath());
347
connection->Disconnect();
351
wxString err = wxString::Format(wxT("Error: The file %s does not exists or is not readable"), argv[1]);
352
LOG_ERROR("Core", TOPATH(err));
353
wxMessageBox(err, wxT("Ginkgo CADx"), wxICON_INFORMATION|wxOK);
335
357
// Ask the other instance to open a file or raise itself
336
358
connection->Execute(wxT(""));
359
381
GNC::GCS::ControladorInternacionalizacion::Instance()->AddCatalog("cadxcore");
361
383
//permisos del core
384
GNC::GCS::IControladorPermisos::Instance()->AddDefinicionPermiso("core.restrictions", _Std("Ginkgo CADx restrictions"), "reutilize_study", _Std("Open only one tab for each study"), false, "", true);
362
385
GNC::GCS::IControladorPermisos::Instance()->AddDefinicionPermiso("core.restrictions", _Std("Ginkgo CADx restrictions"), "anonymous_history", _Std("Anonymous mode (history is cleaned)"), false, "", false);
363
386
GNC::GCS::IControladorPermisos::Instance()->AddDefinicionPermiso("core.restrictions", _Std("Ginkgo CADx restrictions"), "max_tabs", _Std("Max number of tabs opened"), false, "2", false);
364
387
GNC::GCS::IControladorPermisos::Instance()->AddDefinicionPermiso("core.restrictions", _Std("Ginkgo CADx restrictions"), "inactivity_time", _Std("Max seconds of Ginkgo CADx application inactivity"), false, "600", false);
410
433
GNC::GCS::IControladorPermisos::Instance()->AddDefinicionPermiso("core.opengl", _Std("OpenGL"), "enable_shaders", _Std("Enable shaders"), false, "", true);
436
GNC::GCS::IControladorPermisos::Instance()->AddDefinicionPermiso("ginkgocloud",_Std("Ginkgo Cloud"), "download",_Std("Download from Ginkgo Cloud"),false, "", true);
606
632
GNC::GCS::ControladorAcciones::FreeInstance();
607
633
GNC::GCS::InactivityController::FreeInstance();
608
634
GIL::DICOM::PACSController::FreeInstance();
609
GNC::GCS::IControladorComandos::FreeInstance();
635
GNC::GCS::ICommandController::FreeInstance();
610
636
GNC::ControladorExtensiones::FreeInstance();
611
637
GNC::GCS::ControladorCarga::FreeInstance();
612
638
GNC::HistoryToolsController::FreeInstance();