changeset 1824:a56bf4c534ef

display stone web viewer version in info panel
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 May 2021 21:07:13 +0200
parents 781e9fc8925e
children d6b83b4cedcd fa81bb6378fb
files Applications/StoneWebViewer/WebApplication/app.js Applications/StoneWebViewer/WebApplication/index.html Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp
diffstat 4 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Wed May 26 20:52:13 2021 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Wed May 26 21:07:13 2021 +0200
@@ -401,6 +401,7 @@
       creatingArchive: false,
       archiveJob: '',
       mouseTool: 0,
+      stoneWebViewerVersion: 'Unknown',
 
       modalWarning: false,
       modalNotDiagnostic: false,
@@ -1087,6 +1088,9 @@
   
   console.warn('Stone properly initialized');
 
+  stone.LoadStoneWebViewerVersion();
+  app.stoneWebViewerVersion = stone.GetStringBuffer();
+  
   app.SetCombinedToolActions();
   
   var selectedStudies = getParameterFromUrl('selectedStudies');
--- a/Applications/StoneWebViewer/WebApplication/index.html	Wed May 26 20:52:13 2021 +0200
+++ b/Applications/StoneWebViewer/WebApplication/index.html	Wed May 26 21:07:13 2021 +0200
@@ -33,6 +33,10 @@
               reviewing their images,<br> for research and for quality
               assurance.
             </p>
+            <h3>Versions</h3>
+            <p>
+              Stone Web viewer: {{ stoneWebViewerVersion }}
+            </p>
           </div>
           <div class="wvInfoPopupForm">
             <br>
--- a/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt	Wed May 26 20:52:13 2021 +0200
+++ b/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt	Wed May 26 21:07:13 2021 +0200
@@ -119,6 +119,10 @@
 # Define the WASM module
 # ---------------------------------------------------------------
 
+add_definitions(
+  -DSTONE_WEB_VIEWER_VERSION="${STONE_WEB_VIEWER_VERSION}"
+  )
+
 add_executable(StoneWebViewer
   ${ORTHANC_STONE_SOURCES}
   ${AUTOGENERATED_SOURCES}
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Wed May 26 20:52:13 2021 +0200
+++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Wed May 26 21:07:13 2021 +0200
@@ -3482,6 +3482,17 @@
   
 
   EMSCRIPTEN_KEEPALIVE
+  void LoadStoneWebViewerVersion()
+  {
+    try
+    {
+      stringBuffer_.assign(STONE_WEB_VIEWER_VERSION);
+    }
+    EXTERN_CATCH_EXCEPTIONS;
+  }
+  
+
+  EMSCRIPTEN_KEEPALIVE
   void LoadStudyTags(int i)
   {
     try