Skip to content
Commits on Source (15)
......@@ -47,3 +47,4 @@ libtool-fixed
libtool
ltmain.sh
rpmbuild
*.kdev4
This diff is collapsed.
......@@ -84,14 +84,25 @@
<Unit filename="NEWS" />
<Unit filename="README" />
<Unit filename="README.mingw32" />
<Unit filename="acinclude.m4" />
<Unit filename="aeskulap-0.2.2-screenshot.png" />
<Unit filename="aeskulap.spec" />
<Unit filename="autogen.sh" />
<Unit filename="configure.ac" />
<Unit filename="configure.mingw32" />
<Unit filename="doc/aeskulap-tutorials.odt" />
<Unit filename="doc/aeskulap-tutorials.pdf" />
<Unit filename="doc/aeskulap-tutorials.sxw" />
<Unit filename="gettext.h" />
<Unit filename="ltmain.sh" />
<Unit filename="packaging/Makefile.am" />
<Unit filename="packaging/autopackage/Makefile.am" />
<Unit filename="packaging/autopackage/default.apspec.in" />
<Unit filename="packaging/rpm/Makefile.am" />
<Unit filename="packaging/rpm/aeskulap.spec.in" />
<Unit filename="packaging/win32/Makefile.am" />
<Unit filename="packaging/win32/aeskulap-setup-large.bmp" />
<Unit filename="packaging/win32/aeskulap-setup-small.bmp" />
<Unit filename="packaging/win32/aeskulap.ico" />
<Unit filename="packaging/win32/aeskulap.iss.in" />
<Unit filename="pixmaps/Makefile.am" />
<Unit filename="pixmaps/README" />
<Unit filename="pixmaps/aeskulap.png" />
......@@ -121,6 +132,7 @@
<Unit filename="pixmaps/stock-tool-scale-22.png" />
<Unit filename="po/ChangeLog" />
<Unit filename="po/LINGUAS" />
<Unit filename="po/Makefile.in.in" />
<Unit filename="po/Makevars" />
<Unit filename="po/POTFILES.in" />
<Unit filename="po/de.po" />
......@@ -149,6 +161,7 @@
<Unit filename="src/main.cpp" />
<Unit filename="src/mainwindow.cpp" />
<Unit filename="src/mainwindow.h" />
<Unit filename="src/org.gnu.aeskulap.gschema.xml" />
<Unit filename="src/prescandialog.cpp" />
<Unit filename="src/prescandialog.h" />
<Unit filename="src/settings.cpp" />
......
%global git e467dfd
%global git ce82f85
%global github jenslody-aeskulap
%global checkout git%{git}
%global checkout_date 20151201
%if 0%{?fedora} < 23
%global _hardened_build 1
%endif
%global checkout_date 20180219
Name: aeskulap
Version: 0.2.2
Release: 0.25.beta1%{?dist}
Release: 0.35.beta2%{?dist}
Summary: Full open source replacement for commercially available DICOM viewers
# The sources of the (internal) libraries are LGPLv2+, the rest of the sources are GPLv2+,
# except binreloc.{c,h} and the documentation, which are in the public domain
......@@ -18,6 +14,7 @@ URL: https://github.com/jenslody/aeskulap
Source0: https://github.com/jenslody/%{name}/tarball/master/%{github}-%{git}.tar.gz
BuildRequires: gcc-c++
BuildRequires: dcmtk-devel
BuildRequires: intltool
BuildRequires: libpng-devel
......@@ -26,7 +23,6 @@ BuildRequires: libtiff-devel
BuildRequires: libtool
BuildRequires: openssl-devel
BuildRequires: gettext-devel
BuildRequires: tcp_wrappers-devel
BuildRequires: desktop-file-utils
BuildRequires: pkgconfig(gtkmm-2.4)
BuildRequires: pkgconfig(libglademm-2.4)
......@@ -81,27 +77,6 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.a
%find_lang %{name}
%pre
%gconf_schema_prepare %{name}
%post
%gconf_schema_upgrade %{name}
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
%preun
%gconf_schema_remove %{name}
%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files -f %{name}.lang
%{_bindir}/%{name}
%{_libdir}/%{name}/
......@@ -110,7 +85,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{_sysconfdir}/gconf/schemas/%{name}.schemas
%{_datadir}/glib-2.0/schemas/org.gnu.aeskulap.gschema.xml
%exclude %{_libdir}/%{name}/*.la
%doc AUTHORS ABOUT-NLS ChangeLog README
%license COPYING COPYING.LIB
......@@ -120,6 +95,39 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%license COPYING.DOC
%changelog
* Mon Feb 19 2018 Jens Lody <fedora@jenslody.de> - 0.2.2-0.35.beta2
- New beta release (switch to gsettings).
- Add BuildRequires for c++.
- Fix build on Rawhide.
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-0.34.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sun Jan 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.2-0.33.beta1
- Remove obsolete scriptlets
* Tue Jan 02 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.2.2-0.32.beta1
- Rebuild for dcmtk
* Tue Jan 02 2018 Jens Lody <fedora@jenslody.de> - 0.2.2-0.31.beta1
- Rebuilt for dcmtk-update.
* Tue Dec 12 2017 Jens Lody <fedora@jenslody.de> - 0.2.2-0.30.beta1
- Build fixes for dcmtk >= 3.6.2.
- Don't link with deprecated tcp-wrapper, fixes rhbz #1518750.
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-0.29.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-0.28.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-0.27.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.2-0.26.beta1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Dec 01 2015 Jens Lody <fedora@jenslody.de> - 0.2.2-0.25.beta1
- Add license file, to doc-package.
......
#!/bin/bash
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
AUTOCONF_REQUIRED_VERSION=2.52
AUTOMAKE_REQUIRED_VERSION=1.8
# default version requirements ...
test "$REQUIRED_AUTOMAKE_VERSION" || REQUIRED_AUTOMAKE_VERSION=1.8
test "$REQUIRED_AUTORECONF_VERSION" || REQUIRED_AUTORECONF_VERSION=2.52
test "$REQUIRED_GLIB_GETTEXT_VERSION" || REQUIRED_GLIB_GETTEXT_VERSION=2.2.0
test "$REQUIRED_INTLTOOL_VERSION" || REQUIRED_INTLTOOL_VERSION=0.25
test "$REQUIRED_PKG_CONFIG_VERSION" || REQUIRED_PKG_CONFIG_VERSION=0.14.0
cd `dirname $0`
TOPDIR=`pwd`
# a list of required m4 macros. Package can set an initial value
test "$REQUIRED_M4MACROS" || REQUIRED_M4MACROS=
# check for proper versions
topdir=`pwd`
srcdir=`dirname $0`
check_version ()
{
if expr $1 \>= $2 > /dev/null; then
echo "yes (version $1)"
# Not all echo versions allow -n, so we check what is possible. This test is
# based on the one in autoconf.
ECHO_C=
ECHO_N=
case `echo -n x` in
-n*)
case `echo 'x\c'` in
*c*) ;;
*) ECHO_C='\c';;
esac;;
*)
ECHO_N='-n';;
esac
# some terminal codes ...
if tty 1>/dev/null 2>&1; then
boldface="`tput bold 2>/dev/null`"
normal="`tput sgr0 2>/dev/null`"
else
echo "Too old (found version $1)!"
DIE=1
boldface=
normal=
fi
printbold() {
echo $ECHO_N "$boldface" $ECHO_C
echo "$@"
echo $ECHO_N "$normal" $ECHO_C
}
printerr() {
echo "$@" >&2
}
echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
VER=`autoconf --version | grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $AUTOCONF_REQUIRED_VERSION
else
echo
echo " autoconf version >= $VER $AUTOCONF_REQUIRED_VERSION must bei nstalled "
echo " to compile aeskulap."
echo " Download the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
exit 1
fi
echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
if (automake --version) < /dev/null > /dev/null 2>&1; then
VER=`automake --version | grep -iw automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $AUTOMAKE_REQUIRED_VERSION
else
echo
echo " You must have automake 1.8 or newer installed to compile aeskulap."
echo " Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.8.5.tar.gz"
echo " (or a newer version of 1.8 if it is available; note that 1.9 is buggy)"
exit 1
if [ -z "$srcdir" ]; then
printerr "***Warning*** \$srcdir is not defined, out of dir autogen is broken!"
srcdir=.
fi
# process dcmtk
echo "Preparing dcmtk ..."
cd dcmtk/config
sh ./autoall
sh ./rootconf
PKG_NAME=`autoconf --trace='AC_INIT:$1' "$srcdir/configure.ac"`
cd $TOPDIR
# Usage:
# compare_versions MIN_VERSION ACTUAL_VERSION
# returns true if ACTUAL_VERSION >= MIN_VERSION
compare_versions() {
ch_min_version=$1
ch_actual_version=$2
ch_status=0
IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
set $ch_actual_version
for ch_min in $ch_min_version; do
ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
if [ -z "$ch_min" ]; then break; fi
if [ -z "$ch_cur" ]; then ch_status=1; break; fi
if [ $ch_cur -gt $ch_min ]; then break; fi
if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
done
IFS="$ch_save_IFS"
return $ch_status
}
# Usage:
# version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
# checks to see if the package is available
version_check() {
vc_package=$1
vc_variable=$2
vc_checkprogs=$3
vc_min_version=$4
vc_source=$5
vc_status=1
local ${vc_variable}_VERSION
echo "Generating build information ..."
aclocalinclude="$ACLOCAL_FLAGS"
vc_checkprog=`eval echo "\\$$vc_variable"`
if [ -n "$vc_checkprog" ]; then
printbold "using $vc_checkprog for $vc_package"
return 0
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude || {
echo
echo "**ERROR**: aclocal failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
echo "for the prefix where you installed the packages whose"
echo "macros were not found"
exit 1
printbold "checking for $vc_package >= $vc_min_version..."
for vc_checkprog in $vc_checkprogs; do
echo $ECHO_N " testing $vc_checkprog... " $ECHO_C
if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
vc_actual_version=`$vc_checkprog --version | head -n 1 | \
sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'`
if compare_versions $vc_min_version $vc_actual_version; then
echo "found $vc_actual_version"
# set variables
eval "$vc_variable=$vc_checkprog; \
${vc_variable}_VERSION=$vc_actual_version"
vc_status=0
break
else
echo "too old (found version $vc_actual_version)"
fi
else
echo "not found."
fi
done
if [ "$vc_status" != 0 ]; then
printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
printerr " to build $PKG_NAME. Download the appropriate package for"
printerr " from your distribution or get the source tarball at"
printerr " $vc_source"
printerr
exit $vc_status
fi
return $vc_status
}
echo "Running autoheader ..."
autoheader || {
echo "***ERROR*** autoheader failed."
exit 1
# Usage:
# require_m4macro filename.m4
# adds filename.m4 to the list of required macros
require_m4macro() {
case "$REQUIRED_M4MACROS" in
$1\ * | *\ $1\ * | *\ $1) ;;
*) REQUIRED_M4MACROS="$REQUIRED_M4MACROS $1" ;;
esac
}
echo "Running libtoolize ..."
libtoolize --automake -c || {
echo
echo "**ERROR**: intltoolize failed. This may mean that you have not"
echo "installed all of the packages you need. Please install the"
echo "'libtool' package."
exit 1
# Usage:
# add_to_cm_macrodirs dirname
# Adds the dir to $cm_macrodirs, if it's not there yet.
add_to_cm_macrodirs() {
case $cm_macrodirs in
"$1 "* | *" $1 "* | *" $1") ;;
*) cm_macrodirs="$cm_macrodirs $1";;
esac
}
echo "Running automake ..."
automake -c --foreign --add-missing || {
echo "***ERROR*** automake failed."
exit 1
# Usage:
# print_m4macros_error
# Prints an error message saying that autoconf macros were misused
print_m4macros_error() {
printerr "***Error***: some autoconf macros required to build $PKG_NAME"
printerr " were not found in your aclocal path, or some forbidden"
printerr " macros were found. Perhaps you need to adjust your"
printerr " ACLOCAL_PATH?"
printerr
}
echo "Running autoconf ..."
autoconf || {
echo "***ERROR*** autoconf failed."
exit 1
}
# Usage:
# check_m4macros
# Checks that all the requested macro files are in the aclocal macro path
# Uses REQUIRED_M4MACROS and ACLOCAL_PATH variables.
check_m4macros() {
# construct list of macro directories
cm_macrodirs=`aclocal --print-ac-dir`
# aclocal also searches a version specific dir, eg. /usr/share/aclocal-1.9
# but it contains only Automake's own macros, so we can ignore it.
echo "Running glib-gettextize ..."
glib-gettextize --copy --force > /dev/null || {
echo
echo "***ERROR*** glib-gettextize failed."
exit 1
}
# Read the dirlist file
if [ -s $cm_macrodirs/dirlist ]; then
cm_dirlist=`sed 's/[ ]*#.*//;/^$/d' $cm_macrodirs/dirlist`
if [ -n "$cm_dirlist" ] ; then
for cm_dir in $cm_dirlist; do
if [ -d $cm_dir ]; then
add_to_cm_macrodirs $cm_dir
fi
done
fi
fi
# Parse $ACLOCAL_PATH
IFS="${IFS= }"; save_IFS="$IFS"; IFS=":"
for dir in ${ACLOCAL_PATH}; do
add_to_cm_macrodirs "$dir"
done
IFS="$save_IFS"
echo "Running intltoolize ..."
intltoolize -c -f --automake || {
echo
echo "***ERROR* intltoolize failed."
exit 1
cm_status=0
if [ -n "$REQUIRED_M4MACROS" ]; then
printbold "Checking for required M4 macros..."
# check that each macro file is in one of the macro dirs
for cm_macro in $REQUIRED_M4MACROS; do
cm_macrofound=false
for cm_dir in $cm_macrodirs; do
if [ -f "$cm_dir/$cm_macro" ]; then
cm_macrofound=true
break
fi
# The macro dir in Cygwin environments may contain a file
# called dirlist containing other directories to look in.
if [ -f "$cm_dir/dirlist" ]; then
for cm_otherdir in `cat $cm_dir/dirlist`; do
if [ -f "$cm_otherdir/$cm_macro" ]; then
cm_macrofound=true
break
fi
done
fi
done
if $cm_macrofound; then
:
else
printerr " $cm_macro not found"
cm_status=1
fi
done
fi
if [ "$cm_status" != 0 ]; then
print_m4macros_error
exit $cm_status
fi
if [ "$cm_status" != 0 ]; then
print_m4macros_error
exit $cm_status
fi
}
chmod +x `find . -name configure`
chmod +x `find . -name mkinstalldirs`
version_check automake AUTOMAKE automake $REQUIRED_AUTOMAKE_VERSION \
"http://ftp.gnu.org/pub/gnu/automake/automake-$REQUIRED_AUTOMAKE_VERSION.tar.xz"
version_check autoreconf AUTORECONF autoreconf $REQUIRED_AUTORECONF_VERSION \
"http://ftp.gnu.org/pub/gnu/autoconf/autoconf-$REQUIRED_AUTORECONF_VERSION.tar.xz"
version_check glib-gettext GLIB_GETTEXTIZE glib-gettextize $REQUIRED_GLIB_GETTEXT_VERSION \
"ftp://ftp.gtk.org/pub/gtk/v2.2/glib-$REQUIRED_GLIB_GETTEXT_VERSION.tar.gz"
require_m4macro glib-gettext.m4
version_check intltool INTLTOOLIZE intltoolize $REQUIRED_INTLTOOL_VERSION \
"http://ftp.gnome.org/pub/GNOME/sources/intltool/"
require_m4macro intltool.m4
version_check pkg-config PKG_CONFIG pkg-config $REQUIRED_PKG_CONFIG_VERSION \
"'http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-$REQUIRED_PKG_CONFIG_VERSION.tar.gz"
require_m4macro pkg.m4
check_m4macros
if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
printerr "**Warning**: I am going to run \`configure' with no arguments."
printerr "If you wish to pass any to it, please specify them on the"
printerr \`$0\'" command line."
printerr
fi
printbold "Processing $configure_ac"
cd $srcdir
# if the AC_CONFIG_MACRO_DIR() macro is used, create that directory
# This is a automake bug fixed in automake 1.13.2
# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13514
m4dir=`autoconf --trace 'AC_CONFIG_MACRO_DIR:$1'`
if [ -n "$m4dir" ]; then
mkdir -p $m4dir
fi
printbold "Running $GLIB_GETTEXTIZE... Ignore non-fatal messages."
echo "no" | $GLIB_GETTEXTIZE --force --copy || exit 1
echo
echo "Please run ./configure now."
printbold "Running $INTLTOOLIZE..."
$INTLTOOLIZE --force --copy --automake || exit 1
# Now that all the macros are sorted, run autoreconf ...
printbold "Running autoreconf..."
autoreconf --verbose --force --install -Wno-portability || exit 1
cd "$topdir"
if test x$NOCONFIGURE = x; then
printbold Running $srcdir/configure "$@" ...
$srcdir/configure "$@" \
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
else
echo Skipping configure process.
fi
......@@ -4,12 +4,23 @@ else
lib_LTLIBRARIES = libconfiguration.la
endif
if USE_MINGW
extra_SOURCES=aconfiguration-win32.cpp
else
if USE_GSETTINGS
extra_SOURCES=aconfiguration-gsettings.cpp
else
extra_SOURCES=aconfiguration-gconf.cpp
endif
endif
libconfiguration_la_SOURCES = \
awindowlevel.h \
aconfiguration.h \
aconfiguration.cpp \
aconfigclient.h \
aconfigclient.cpp
aconfigclient.cpp \
$(extra_SOURCES)
libconfiguration_la_LIBADD = \
$(GCONFMM_LIBS) \
......@@ -19,10 +30,10 @@ libconfiguration_la_LDFLAGS = \
$(LDFLAGS_AESKULAP_LIBS)
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GCONFMM_CFLAGS) \
$(GTKMM_CFLAGS)
EXTRA_DIST = \
aconfiguration-gconf.cpp \
aconfiguration-win32.cpp
aconfiguration-gsettings.cpp \
aconfiguration-gconf.cpp
......@@ -22,6 +22,7 @@
#include <gconfmm.h>
#include <cstdio>
#include <iostream>
#include "aconfiguration.h"
namespace Aeskulap {
......
/*
Aeskulap Configuration - persistent configuration interface library
Copyright (C) 2005 Alexander Pipelka
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Alexander Pipelka
*/
#include <giomm.h>
#include <glibmm.h>
#include <cstdio>
#include <iostream>
#include "aconfiguration.h"
namespace Aeskulap {
using Gio::Settings;
using PSettings = Glib::RefPtr<Settings>;
struct ConfigurationImpl {
ConfigurationImpl();
PSettings settings_prefs;
PSettings settings_presets;
bool has_modality(const Glib::ustring& modality);
};
ConfigurationImpl::ConfigurationImpl():
settings_prefs(Settings::create("org.gnu.aeskulap")),
settings_presets(Settings::create("org.gnu.aeskulap.presets"))
{
}
bool ConfigurationImpl::has_modality(const Glib::ustring& modality)
{
auto children = settings_presets->list_children();
bool has_modality = false;
for (auto c = children.begin(); !has_modality && c != children.end(); ++c)
has_modality = (*c == modality);
return has_modality;
}
Configuration::Configuration() {
std::cout << "Gio::Settings init" << std::endl;
Gio::init();
impl = new ConfigurationImpl();
if (!impl->has_modality("CT"))
add_default_presets_ct();
}
std::string Configuration::get_local_aet() {
Glib::ustring local_aet = impl->settings_prefs->get_string("local-aet");
if(local_aet.empty()) {
local_aet = "AESKULAP";
set_local_aet(local_aet);
}
return std::string(local_aet.c_str());
}
void Configuration::set_local_aet(const std::string& aet) {
impl->settings_prefs->set_string("local-aet", aet);
}
unsigned int Configuration::get_local_port() {
gint local_port = impl->settings_prefs->get_int("local-port");
if(local_port <= 0) {
local_port = 6000;
set_local_port(local_port);
}
return (unsigned int)local_port;
}
void Configuration::set_local_port(unsigned int port) {
if(port <= 0) {
port = 6000;
}
impl->settings_prefs->set_int("local-port", (gint)port);
}
std::string Configuration::get_encoding() {
Glib::ustring charset = impl->settings_prefs->get_string("characterset");
if(charset.empty()) {
charset = "ISO_IR 100";
set_encoding(charset);
}
return charset.c_str();
}
void Configuration::set_encoding(const std::string& encoding) {
impl->settings_prefs->set_string("characterset", encoding);
}
std::vector<int> convert_to_int_array(const std::vector<Glib::ustring>& in) {
std::vector<int> result(in.size());
transform(in.begin(), in.end(), result.begin(), [](const Glib::ustring& x) {
std::istringstream s(x.c_str());
int o;
s >> o;
return o;
});
return result;
}
std::vector<bool> convert_to_bool_array(const std::vector<Glib::ustring>& in) {
std::vector<bool> result(in.size());
transform(in.begin(), in.end(), result.begin(), [](const Glib::ustring& x) {
return x == "true";
});
return result;
}
Configuration::ServerList* Configuration::get_serverlist() {
Configuration::ServerList* list = new Configuration::ServerList;
std::vector<Glib::ustring> aet_list = impl->settings_prefs->get_string_array("server-aet");
std::vector<int> port_list = convert_to_int_array(impl->settings_prefs->get_string_array("server-port"));
std::vector<Glib::ustring> hostname_list = impl->settings_prefs->get_string_array("server-hostname");
std::vector<Glib::ustring> description_list = impl->settings_prefs->get_string_array("server-description");
std::vector<Glib::ustring> group_list = impl->settings_prefs->get_string_array("server-group");
std::vector<bool> lossy_list = convert_to_bool_array(impl->settings_prefs->get_string_array("server-lossy"));
std::vector<bool> relational_list = convert_to_bool_array(impl->settings_prefs->get_string_array("server-relational"));
auto a = aet_list.begin();
auto p = port_list.begin();
auto h = hostname_list.begin();
auto d = description_list.begin();
auto g = group_list.begin();
auto l = lossy_list.begin();
auto r = relational_list.begin();
for(; h != hostname_list.end() && a != aet_list.end()&& p != port_list.end(); a++, p++, h++) {
std::string servername;
if(d != description_list.end()) {
servername = *d;
d++;
}
else {
char buffer[50];
snprintf(buffer, sizeof(buffer), "Server%li", list->size()+1);
servername = buffer;
}
ServerData& s = (*list)[servername];
s.m_aet = *a;
s.m_port = *p;
s.m_hostname = *h;
s.m_name = servername;
s.m_lossy = false;
s.m_relational = false;
if(g != group_list.end()) {
s.m_group = *g;
g++;
}
if ( l != lossy_list.end()) {
s.m_lossy = *l;
++l;
}
if(r != relational_list.end()) {
s.m_relational = *r;
r++;
}
}
return list;
}
void Configuration::set_serverlist(std::vector<ServerData>& list) {
std::vector<Glib::ustring> aet_list;
std::vector<Glib::ustring> hostname_list;
std::vector<Glib::ustring> port_list;
std::vector<Glib::ustring> description_list;
std::vector<Glib::ustring> group_list;
std::vector<Glib::ustring> lossy_list;
std::vector<Glib::ustring> relational_list;
std::vector<ServerData>::iterator i;
for(i = list.begin(); i != list.end(); i++) {
aet_list. push_back(i->m_aet);
hostname_list.push_back(i->m_hostname);
port_list.push_back( Glib::ustring::compose("%1", i->m_port));
description_list.push_back(i->m_name);
group_list.push_back(i->m_group);
lossy_list.push_back(i->m_lossy ? "true": "false");
relational_list.push_back(i->m_relational ? "true": "false");
}
impl->settings_prefs->set_string_array("server-aet", aet_list);
impl->settings_prefs->set_string_array("server-hostname", hostname_list);
impl->settings_prefs->set_string_array("server-port", port_list);
impl->settings_prefs->set_string_array("server-description", description_list);
impl->settings_prefs->set_string_array("server-group", group_list);
impl->settings_prefs->set_string_array("server-lossy", lossy_list);
impl->settings_prefs->set_string_array("server-relational", relational_list);
}
bool Configuration::get_windowlevel(const Glib::ustring& modality,
const Glib::ustring& desc, WindowLevel& w) {
auto modality_settings = impl->settings_presets->get_child(modality);
if (!modality_settings) {
g_warning("Modality %s not found", modality.c_str());
return false;
}
auto tissue_settings = modality_settings->get_child(desc);
if (!tissue_settings) {
g_warning("tissue setting for %s not found in %s", desc.c_str(),
modality.c_str());
return false;
}
w.modality = modality;
w.description = desc;
w.center = tissue_settings->get_int("center");
w.width = tissue_settings->get_int("width");
return true;
}
static PSettings get_child_tree(PSettings settings, const Glib::ustring& key,
const Glib::ustring& scheme)
{
std::string pp = settings->property_path();
pp.append(key).append("/");
g_message("Get child tree at %s", pp.c_str());
return Settings::create(scheme, pp);
}
bool Configuration::get_windowlevel_list(const Glib::ustring& modality,
WindowLevelList& list) {
if(modality.empty()) {
g_warning("No modality given");
return false;
}
std::vector<Glib::ustring> supported_modalities =
impl->settings_presets->get_string_array("modalities");
auto m = find(supported_modalities.begin(), supported_modalities.end(),
modality);
if (m == supported_modalities.end()) {
g_warning("Modality %s not found in presets", modality.c_str());
return false;
}
auto modality_settings = get_child_tree(impl->settings_presets, modality,
"org.gnu.aeskulap.presets.modality");
std::vector<Glib::ustring> supported_tissues =
modality_settings->get_string_array("tissue-types");
for(const auto& tissue: supported_tissues) {
WindowLevel w;
w.modality = modality;
w.description = tissue;
auto tissue_settings = get_child_tree(modality_settings, tissue,
"org.gnu.aeskulap.presets.modality.tissue");
w.center = tissue_settings->get_int("center");
w.width = tissue_settings->get_int("width");
list[tissue] = w;
}
return true;
}
bool Configuration::set_windowlevel(const WindowLevel& w) {
std::vector<Glib::ustring> supported_modalities =
impl->settings_presets->get_string_array("modalities");
if (find(supported_modalities.begin(), supported_modalities.end(),
w.modality) == supported_modalities.end()) {
supported_modalities.push_back(w.modality);
impl->settings_presets->set_string_array("modalities", supported_modalities);
}
auto modality_settings = get_child_tree(impl->settings_presets, w.modality,
"org.gnu.aeskulap.presets.modality");
std::vector<Glib::ustring> tissues =
modality_settings->get_string_array("tissue-types");
if (find(tissues.begin(), tissues.end(), w.description) == tissues.end()) {
tissues.push_back(w.description);
modality_settings->set_string_array("tissue-types", tissues);
}
auto tissue_settings = get_child_tree(modality_settings, w.description,
"org.gnu.aeskulap.presets.modality.tissue");
tissue_settings->set_int("center", w.center);
tissue_settings->set_int("width", w.width);
return true;
}
bool Configuration::set_windowlevel_list(const Glib::ustring& modality,
WindowLevelList& list) {
std::vector<Glib::ustring> supported_modalities =
impl->settings_presets->get_string_array("modalities");
if (find(supported_modalities.begin(), supported_modalities.end(),
modality) == supported_modalities.end()) {
supported_modalities.push_back(modality);
impl->settings_presets->set_string_array("modalities", supported_modalities);
}
auto modality_settings = get_child_tree(impl->settings_presets, modality,
"org.gnu.aeskulap.presets.modality");
std::vector<Glib::ustring> tissues =
modality_settings->get_string_array("tissue-types");
for(auto i = list.begin(); i != list.end(); i++) {
auto& t = i->second.description;
if (find(tissues.begin(), tissues.end(), t) == tissues.end())
tissues.push_back(t);
i->second.modality = modality;
auto tissue_settings = get_child_tree(modality_settings, t,
"org.gnu.aeskulap.presets.modality.tissue");
tissue_settings->set_int("center", i->second.center);
tissue_settings->set_int("width", i->second.width);
}
modality_settings->set_string_array("tissue-types", tissues);
return true;
}
bool Configuration::unset_windowlevels(const Glib::ustring& modality) {
std::vector<Glib::ustring> supported_modalities =
impl->settings_presets->get_string_array("modalities");
auto m = find(supported_modalities.begin(), supported_modalities.end(),
modality);
if (m == supported_modalities.end())
return true;
auto modality_settings = get_child_tree(impl->settings_presets, modality,
"org.gnu.aeskulap.presets.modality");
std::vector<Glib::ustring> tissues =
modality_settings->get_string_array("tissue-types");
for (auto& t: tissues) {
auto tissue_settings = get_child_tree(modality_settings, t,
"org.gnu.aeskulap.presets.modality.tissue");
tissue_settings->reset("center");
tissue_settings->reset("width");
}
return true;
}
} // namespace Aeskulap
......@@ -24,6 +24,7 @@
#include <iostream>
#include <string>
#include <list>
#include "aconfiguration.h"
namespace Aeskulap {
......
......@@ -22,6 +22,10 @@
#include "aconfiguration.h"
#include "gettext.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
namespace Aeskulap {
Configuration& Configuration::get_instance() {
......@@ -42,6 +46,8 @@ void Configuration::add_default_presets_ct() {
// Spine W: 300 C: 40
// Vertebrae W: 2300 C: 530
WindowLevelList w;
set_windowlevel_list("CT", w);
set_windowlevel(WindowLevel(gettext("Abdomen"), "CT", 50, 250));
set_windowlevel(WindowLevel(gettext("Head"), "CT", 50, 150));
set_windowlevel(WindowLevel(gettext("Lung"), "CT", -550, 2000));
......@@ -66,18 +72,3 @@ Glib::ustring Configuration::get_name_from_path(const Glib::ustring& path) {
} // namespace Aeskulap
#ifdef WIN32
// WIN32 configuration backend
#include "aconfiguration-win32.cpp"
#else
// gconf configuration backend
#include "aconfiguration-gconf.cpp"
#endif
......@@ -27,6 +27,10 @@
#include <map>
#include <vector>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#include "awindowlevel.h"
namespace Aeskulap {
......@@ -74,8 +78,6 @@ public:
void set_encoding(const std::string& encoding);
bool get_windowlevel(const Glib::ustring& modality, const Glib::ustring& desc, WindowLevel& w);
bool get_windowlevel_list(const Glib::ustring& modality, WindowLevelList& list);
bool set_windowlevel(const WindowLevel& w);
......@@ -89,10 +91,16 @@ protected:
Configuration();
private:
bool get_windowlevel(const Glib::ustring& modality, const Glib::ustring& desc, WindowLevel& w);
// internal helper (backend independend) functions
Glib::ustring get_name_from_path(const Glib::ustring& path);
#ifdef HAVE_GSETTINGS
struct ConfigurationImpl *impl;
#endif
};
} // namespace Aeskulap
......
AC_PREREQ([2.69])
m4_define([AESKULAP_VERSION], 0.2.2-beta1)
m4_define([AESKULAP_VERSION], 0.2.2-beta2)
AC_INIT(aeskulap, AESKULAP_VERSION)
......@@ -82,18 +82,44 @@ PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
AM_CONDITIONAL(USE_MINGW, test "x$MINGW32" = "xyes")
if test x"$MINGW32" = xno ; then
AC_ARG_WITH(gsettings, [AS_HELP_STRING([--with-gsettings],
[Build with the gsettings configuration backend])],
[],
[with_gsettings=yes])
echo "with_gsettings='$with_gsettings'"
if test "x$with_gsettings" = "xyes"; then
echo "Using GSettings"
GLIB_GSETTINGS
HAVE_GSETTINGS=1
AC_SUBST(HAVE_GSETTINGS)
AC_DEFINE(HAVE_GSETTINGS, 1, [use gsettings configuration backend])
AM_CONDITIONAL(USE_GSETTINGS, test "x$with_gsettings" = "xyes")
else
echo "falling back to old gconf backend"
PKG_CHECK_MODULES(GCONFMM, gconfmm-2.6 >= 2.10.0)
AC_SUBST(GCONFMM_CFLAGS)
AC_SUBST(GCONFMM_LIBS)
AC_DEFINE(HAVE_GCONFMM, 1, [Have gconfmm settings backend])
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test x"$GCONFTOOL" = xno ; then
AC_MSG_ERROR([gconftool2 executable not found in your path - should be
installed with GConf])
fi
fi
dnl not WIN32
fi
......@@ -105,7 +131,7 @@ AC_SUBST(DCMTK_CFLAGS)
AC_SUBST(DCMTK_LIBS)
DCMTK_CFLAGS="-DHAVE_CONFIG_H -I\$(prefix)/include"
DCMTK_LIBS="-L\$(prefix)/lib -ldcmjpeg -lijg8 -lijg12 -lijg16 -ldcmimage -ldcmimgle -ldcmnet -ldcmdata -loflog -lofstd -lwrap"
DCMTK_LIBS="-L\$(prefix)/lib -ldcmjpeg -lijg8 -lijg12 -lijg16 -ldcmimage -ldcmimgle -ldcmnet -ldcmdata -loflog -lofstd"
dnl set PREFIX
if test "x${prefix}" = "xNONE"; then
......@@ -115,7 +141,7 @@ else
fi
if test x"$MINGW32" = xno ; then
LDFLAGS_AESKULAP_LIBS="-Wl,-rpath,${prefix}/lib/aeskulap -avoid-version"
LDFLAGS_AESKULAP_LIBS="-avoid-version"
else
LDFLAGS_MINGW32="-mwindows"
LDFLAGS_AESKULAP_LIBS="-avoid-version -no-undefined"
......
aeskulap (0.2.2-beta2+git20180219.8787e95-1) unstable; urgency=medium
* Revert 8e93d35c8b780fa600a69cacd579a7cb663e3ee8 to bundle
libglademm-2.4 since it is adopted in buster
Closes: #909976
* debhelper 11
* Standards-Version: 4.2.1
* Respect DEB_BUILD_OPTIONS in override_dh_auto_test target
* Remove trailing whitespace in debian/changelog
* Remove trailing whitespace in debian/copyright
* Drop get-orig-source which is outdated and unused
* d/watch: Use git mode to get two sensible commits
* GCONF_SCHEMAS_INSTALL is unknown - just ignore the if statement
-- Andreas Tille <tille@debian.org> Fri, 26 Oct 2018 23:13:05 +0200
aeskulap (0.2.2b1+git20161206-5) unstable; urgency=medium
* d/p/gcc8: Fix friend declaration, Closes: #897699
......
......@@ -4,14 +4,15 @@ Uploaders: Andreas Tille <tille@debian.org>,
Gert Wollny <gewo@debian.org>
Section: science
Priority: optional
Build-Depends: debhelper (>= 10),
Build-Depends: debhelper (>= 11~),
libgtkmm-2.4-dev,
libglade2-dev,
libgconf2-dev,
libglademm-2.4-dev,
libwrap0-dev,
intltool,
libdcmtk-dev,
libtiff-dev
Standards-Version: 4.1.5
Standards-Version: 4.2.1
Vcs-Browser: https://salsa.debian.org/med-team/aeskulap
Vcs-Git: https://salsa.debian.org/med-team/aeskulap.git
Homepage: http://aeskulap.nongnu.org
......
......@@ -38,11 +38,6 @@ Files: debian/*
Copyright: 2007-2012 Andreas Tille <tille@debian.org>
License: GPL-2
Files: debian/bundle-glademm.patch
Copyright: 2001 Free Software Foundation
2002 The libglademm Development Team
License: LGPL-2.0
License: GPL-2
The Debian packaging is licensed under the GPL,
see `/usr/share/common-licenses/GPL-2'.
......
#!/bin/sh -e
NAME=aeskulap
UVERSION=0.2.2-beta1
DVERSION=0.2.2b1
UPSTREAMTAR="$NAME"-"$UVERSION".tar.gz
UPSTREAMDIR=`basename $UPSTREAMTAR .tar.gz`
patchname=get-orig-source_patch
patchfile="$patchname"
if [ ! -f "$patchfile" ] ; then
if [ -d debian -a -f "debian/$patchname" ] ; then
patchfile="debian/$patchname"
else
echo "File not found: $patchname"
exit -1
fi
fi
patchfile="`pwd`/$patchfile"
# To rebuild the new upstream tarball you need these
# packages installed. This will be checked later on.
# The rationale behind this dependency is that the
# script should work for later upstream releases as well
# and thus a simple patch for Makefile.am and
# configure.in would not work
BUILDTARBALLDEPENDS="autoconf automake libtool libgconf2-dev intltool"
# Also these build-dependencies are needed to be installed to
# run ./configure which is a precondition for "make dist"
BUILDDEPS="libgtkmm-2.4-dev libglademm-2.4-dev libgconfmm-2.6-dev"
missingdepends=`dpkg -l ${BUILDTARBALLDEPENDS} ${BUILDDEPS} | \
grep -v -e "^ii" -e "^|" -e "^++" -e "^ " -e "^..[^[:space:]]" | \
sed 's/^[a-z][a-z][[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+.*/\1/'`
if [ "$missingdepends" != "" ] ; then
echo "Please install the following packages to rebuild the upstream source tarball:"
echo $missingdepends
exit -1
fi
mkdir -p ../tarballs
cd ../tarballs
if [ ! -f "$UPSTREAMTAR" ] ; then
wget http://www.bms-austria.com/~pipelka/aeskulap/"$UPSTREAMTAR"
fi
tar -xzf "$UPSTREAMTAR"
# Apply patch that removes dcmtk stuff from Makefile.in and configure.in
patch -p0 < "$patchfile"
cd "$UPSTREAMDIR"
# remove dcmtk stuff, once we are at it
# Leave the packaging directory untouched even if in Debian context useless
rm -rf COPYING.DCMTK dcmtk
echo "Upstream tarball repackaged without dcmtk at `date`." > NEWS
autoreconf
./configure
make dist
mv "$UPSTREAMDIR".tar.gz ../"$NAME"_"$DVERSION".orig.tar.gz
cd ..
rm -rf "$UPSTREAMDIR"
diff -ubrN aeskulap-0.2.2-beta1.orig/configure.in aeskulap-0.2.2-beta1/configure.in
--- aeskulap-0.2.2-beta1.orig/configure.in 2007-05-24 20:59:09.000000000 +0200
+++ aeskulap-0.2.2-beta1/configure.in 2007-11-12 23:03:37.000000000 +0100
@@ -30,7 +30,6 @@
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
-
if test x"$MINGW32" = xno ; then
AM_BINRELOC
else
@@ -80,6 +79,7 @@
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
+
if test x"$MINGW32" = xno ; then
PKG_CHECK_MODULES(GCONFMM, gconfmm-2.6 >= 2.10.0)
@@ -95,32 +95,16 @@
fi
-dnl AC_CONFIG_SUBDIRS(dcmtk)
-
-if test x"$MINGW32" = xyes ; then
-
-DCMTK_CFLAGS="-DHAVE_CONFIG_H -I\$(prefix)/include"
-DCMTK_LIBS="-L\$(prefix)/lib -ldcmjpeg -lijg8 -lijg12 -lijg16 -ldcmimage -ldcmimgle -ldcmnet -ldcmdata -lofstd -lwsock32"
-
-else
-
-DCMJPEG_LIBS="-L../dcmtk/dcmjpeg/libijg8 -L../dcmtk/dcmjpeg/libijg12 -L../dcmtk/dcmjpeg/libijg16 -lijg8 -lijg12 -lijg16"
-AC_SUBST(DCMJPEG_LIBS)
-
-DCMTK_CFLAGS="-DHAVE_CONFIG_H -I\$(top_srcdir)/dcmtk/config/include -I\$(top_srcdir)/dcmtk/ofstd/include -I\$(top_srcdir)/dcmtk/dcmdata/include -I\$(top_srcdir)/dcmtk/dcmnet/include -I\$(top_srcdir)/dcmtk/dcmimage/include -I\$(top_srcdir)/dcmtk/dcmimgle/include -I\$(top_srcdir)/dcmtk/dcmjpeg/include"
-DCMTK_LIBS="-L../dcmtk/ofstd/libsrc \
--L../dcmtk/dcmdata/libsrc \
--L../dcmtk/dcmnet/libsrc \
--L../dcmtk/dcmjpeg/libsrc \
--L../dcmtk/dcmimage/libsrc \
--L../dcmtk/dcmimgle/libsrc \
-\$(DCMJPEG_LIBS) -ldcmjpeg -ldcmimage -ldcmimgle -ldcmnet -ldcmdata -lofstd -lrt -lpthread"
-
-fi
+dnl use Debian packages dcmtk
+dnl AC_CHECK_LIB(dcmimage)
+AC_CHECK_HEADER(dcmtk/config/osconfig.h)
AC_SUBST(DCMTK_CFLAGS)
AC_SUBST(DCMTK_LIBS)
+DCMTK_CFLAGS="-DHAVE_CONFIG_H -I\$(prefix)/include"
+DCMTK_LIBS="-L\$(prefix)/lib -ldcmjpeg -lijg8 -lijg12 -lijg16 -ldcmimage -ldcmimgle -ldcmnet -ldcmdata -lofstd -lwrap"
+
dnl set PREFIX
if test "x${prefix}" = "xNONE"; then
packageprefix=${ac_default_prefix}
@@ -128,16 +112,13 @@
packageprefix=${prefix}
fi
-DCMTK_SUBDIR=""
if test x"$MINGW32" = xno ; then
-DCMTK_SUBDIR="dcmtk"
LDFLAGS_AESKULAP_LIBS="-Wl,-rpath,${prefix}/lib/aeskulap -avoid-version"
else
LDFLAGS_MINGW32="-mwindows"
LDFLAGS_AESKULAP_LIBS="-avoid-version -no-undefined"
fi
-AC_SUBST(DCMTK_SUBDIR)
AC_SUBST(LDFLAGS_MINGW32)
AC_SUBST(LDFLAGS_AESKULAP_LIBS)
@@ -160,12 +141,3 @@
packaging/win32/aeskulap.iss
])
-
-if test x"$MINGW32" = xno ; then
-
-cd $srcdir/dcmtk
-export CFLAGS="$CFLAGS"
-export CXXFLAGS="$CXXFLAGS"
-sh ./configure --without-openssl --without-zlib --without-libwrap --prefix=${prefix} --libdir=${prefix}/lib/aeskulap
-
-fi
diff -ubrN aeskulap-0.2.2-beta1.orig/Makefile.am aeskulap-0.2.2-beta1/Makefile.am
--- aeskulap-0.2.2-beta1.orig/Makefile.am 2007-05-24 21:19:55.000000000 +0200
+++ aeskulap-0.2.2-beta1/Makefile.am 2007-11-07 07:23:00.000000000 +0100
@@ -1,6 +1,5 @@
SUBDIRS = \
po \
- $(DCMTK_SUBDIR) \
configuration \
imagepool \
widgets \
@@ -21,7 +20,6 @@
AUTHORS \
COPYING \
COPYING.LIB \
- COPYING.DCMTK \
INSTALL \
README \
aeskulap.cbp \
@@ -39,18 +37,7 @@
@INTLTOOL_DESKTOP_RULE@
-dist-hook:
- mkdir -p $(distdir)/dcmtk
- cp -Rf $(top_srcdir)/dcmtk/* $(distdir)/dcmtk
- cd $(distdir)/dcmtk && make distclean
- list=`find $(distdir)/dcmtk -name "CVS"` && rm -Rf $$list
- list=`find $(distdir)/dcmtk -name ".cvsignore"` && rm -f $$list
- list=`find $(distdir)/dcmtk -name ".#*"` && rm -f $$list
- list=`find $(distdir)/dcmtk -name "*.a"` && rm -f $$list
- list=`find $(distdir)/dcmtk -name "*.so"` && rm -f $$list
-
distclean: distclean-recursive
- if test x"" != "x" ; then cd ./dcmtk && make distclean ; fi
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile