Skip to content

Commit

Permalink
fix deprecated calls
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Mar 25, 2024
1 parent f7ee04d commit 82cd1f7
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 8 deletions.
8 changes: 5 additions & 3 deletions Plugin/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <EmbeddedResources.h>

#define ORTHANC_PLUGIN_NAME "orthanc-explorer-2"

// we are using Orthanc 1.11.0 API (RequestedTags in tools/find)
#define ORTHANC_CORE_MINIMAL_MAJOR 1
#define ORTHANC_CORE_MINIMAL_MINOR 11
Expand Down Expand Up @@ -713,7 +715,7 @@ extern "C"
return -1;
}

OrthancPluginSetDescription(context, "Advanced User Interface for Orthanc");
OrthancPlugins::SetDescription(ORTHANC_PLUGIN_NAME, "Advanced User Interface for Orthanc");

try
{
Expand Down Expand Up @@ -769,7 +771,7 @@ extern "C"
OrthancPlugins::RegisterRestCallback<GetOE2PreLoginConfiguration>(oe2BaseUrl_ + "api/pre-login-configuration", true);

std::string pluginRootUri = oe2BaseUrl_ + "app/";
OrthancPluginSetRootUri(context, pluginRootUri.c_str());
OrthancPlugins::SetRootUri(ORTHANC_PLUGIN_NAME, pluginRootUri.c_str());

if (pluginJsonConfiguration_["IsDefaultOrthancUI"].asBool())
{
Expand Down Expand Up @@ -817,7 +819,7 @@ extern "C"

ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
{
return "orthanc-explorer-2";
return ORTHANC_PLUGIN_NAME;
}


Expand Down
16 changes: 14 additions & 2 deletions Resources/Orthanc/CMake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
# use by "ExternalProject" in CMake
SET(CMAKE_LSB_CC $ENV{LSB_CC} CACHE STRING "")
SET(CMAKE_LSB_CXX $ENV{LSB_CXX} CACHE STRING "")

# This is necessary to build "Orthanc mainline - Framework LSB
# Release" on "buildbot-worker-debian11"
set(LSB_PTHREAD_NONSHARED "${LSB_PATH}/lib64-${LSB_TARGET_VERSION}/libpthread_nonshared.a")
if (EXISTS ${LSB_PTHREAD_NONSHARED})
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LSB_PTHREAD_NONSHARED}")
endif()
endif()


Expand Down Expand Up @@ -124,12 +131,17 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")

if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND
if (# NOT ${CMAKE_SYSTEM_VERSION} STREQUAL "LinuxStandardBase" AND
NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND
NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
# The "--no-undefined" linker flag makes the shared libraries
# (plugins ModalityWorklists and ServeFolders) fail to compile on
# OpenBSD, and make the PostgreSQL plugin complain about missing
# "environ" global variable in FreeBSD
# "environ" global variable in FreeBSD.
#
# TODO - Furthermore, on Linux Standard Base running on Debian 12,
# the "-Wl,--no-undefined" seems to break the compilation (added
# after Orthanc 1.12.2). This is disabled for now.
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
endif()
Expand Down
2 changes: 2 additions & 0 deletions Resources/Orthanc/CMake/DownloadOrthancFramework.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR
set(ORTHANC_FRAMEWORK_MD5 "8a435140efc8ff4a01d8242f092f21de")
elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.2")
set(ORTHANC_FRAMEWORK_MD5 "d2476b9e796e339ac320b5333489bdb3")
elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.3")
set(ORTHANC_FRAMEWORK_MD5 "975f5bf2142c22cb1777b4f6a0a614c5")

# Below this point are development snapshots that were used to
# release some plugin, before an official release of the Orthanc
Expand Down
44 changes: 44 additions & 0 deletions Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4026,4 +4026,48 @@ namespace OrthancPlugins
result[request->headersKeys[i]] = request->headersValues[i];
}
}

#if !ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
static void SetPluginProperty(const std::string& pluginIdentifier,
_OrthancPluginProperty property,
const std::string& value)
{
_OrthancPluginSetPluginProperty params;
params.plugin = pluginIdentifier.c_str();
params.property = property;
params.value = value.c_str();

GetGlobalContext()->InvokeService(GetGlobalContext(), _OrthancPluginService_SetPluginProperty, &params);
}
#endif

void SetRootUri(const std::string& pluginIdentifier,
const std::string& uri)
{
#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
OrthancPluginSetRootUri2(GetGlobalContext(), pluginIdentifier.c_str(), uri.c_str());
#else
SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_RootUri, uri);
#endif
}

void SetDescription(const std::string& pluginIdentifier,
const std::string& description)
{
#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
OrthancPluginSetDescription2(GetGlobalContext(), pluginIdentifier.c_str(), description.c_str());
#else
SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_Description, description);
#endif
}

void ExtendOrthancExplorer(const std::string& pluginIdentifier,
const std::string& javascript)
{
#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4)
OrthancPluginExtendOrthancExplorer2(GetGlobalContext(), pluginIdentifier.c_str(), javascript.c_str());
#else
SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_OrthancExplorer, javascript);
#endif
}
}
9 changes: 9 additions & 0 deletions Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -1435,4 +1435,13 @@ void GetHttpHeaders(std::map<std::string, std::string>& result, const OrthancPlu
IWebDavCollection& collection);
};
#endif

void SetRootUri(const std::string& pluginIdentifier,
const std::string& uri);

void SetDescription(const std::string& pluginIdentifier,
const std::string& description);

void ExtendOrthancExplorer(const std::string& pluginIdentifier,
const std::string& javascript);
}
4 changes: 2 additions & 2 deletions Resources/Orthanc/Sdk-1.11.2/orthanc/OrthancCPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2024 Osimis S.A., Belgium
* Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
* Copyright (C) 2017-2022 Osimis S.A., Belgium
* Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
6 changes: 5 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.3.0 (2024-03-25)
==================

Changes:
- Theming the interface:
- New configurations:
Expand All @@ -8,9 +11,10 @@ Changes:
- "DateFormat" to customize the date format in study list and in the date pickers.
- OHIF Integration:
- Added support for `Segmentation` and `Microscopy` modes. The `Microscopy`
mode is disabled by default since it is not stable yet.
mode is disabled by default since it is not stable yet in OHIF.
- You can now enable/disable OHIF viewer modes by including/removing them
from the `ViewersOrdering` configuration.
- OHIF buttons are now visible/hidden depending on the content of the study.
- Configurations:
- Updated default values for `ViewersIcons` and `ViewersOrdering`.
- Added date pickers in the Remote Study List (when performing searches on
Expand Down

0 comments on commit 82cd1f7

Please sign in to comment.