From ed815bfcd04ff341856af7866a7f728190576239 Mon Sep 17 00:00:00 2001 From: abn Date: Tue, 5 Apr 2016 16:26:44 +0200 Subject: [PATCH] Minor bug fix on WidgetPresentationParameters --- src/MEDCalc/gui/WorkspaceController.cxx | 2 ++ src/MEDCalc/gui/dialogs/CMakeLists.txt | 1 + src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx | 7 +++++++ src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/src/MEDCalc/gui/WorkspaceController.cxx b/src/MEDCalc/gui/WorkspaceController.cxx index e98cbe532..cfb1b506e 100644 --- a/src/MEDCalc/gui/WorkspaceController.cxx +++ b/src/MEDCalc/gui/WorkspaceController.cxx @@ -527,6 +527,7 @@ WorkspaceController::_getViewMode() case MEDCALC::VIEW_MODE_NEW_LAYOUT: return "MEDCALC.VIEW_MODE_NEW_LAYOUT"; case MEDCALC::VIEW_MODE_SPLIT_VIEW: return "MEDCALC.VIEW_MODE_SPLIT_VIEW"; } + return QString(); } QString @@ -537,6 +538,7 @@ WorkspaceController::_getColorMap() case MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW: return "MEDCALC.COLOR_MAP_BLUE_TO_RED_RAINBOW"; case MEDCALC::COLOR_MAP_COOL_TO_WARM: return "MEDCALC.COLOR_MAP_COOL_TO_WARM"; } + return QString(); } /** diff --git a/src/MEDCalc/gui/dialogs/CMakeLists.txt b/src/MEDCalc/gui/dialogs/CMakeLists.txt index 6fda54173..9964eea5b 100644 --- a/src/MEDCalc/gui/dialogs/CMakeLists.txt +++ b/src/MEDCalc/gui/dialogs/CMakeLists.txt @@ -31,6 +31,7 @@ SET(MEDCALCGUI_dialogs_FILES DlgChangeUnderlyingMesh.hxx DlgInterpolateField.hxx DlgImageToMed.hxx + WidgetPresentationParameters.hxx ) QT_WRAP_MOC(MEDCALCGUI_dialogs_HEADERS_MOC ${MEDCALCGUI_dialogs_FILES}) diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx index dc246e427..d314cfa35 100644 --- a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx +++ b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx @@ -18,6 +18,7 @@ // #include "WidgetPresentationParameters.hxx" +#include WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent) : QWidget(parent) @@ -40,6 +41,9 @@ WidgetPresentationParameters::getViewMode() { else if (viewMode == tr("LAB_VIEW_MODE_SPLIT_VIEW")) { return MEDCALC::VIEW_MODE_SPLIT_VIEW; } + // Should not happen + STDLOG("Strange!! No matching view mode found - returning VIEW_MODE_REPLACE."); + return MEDCALC::VIEW_MODE_REPLACE; } std::string @@ -82,4 +86,7 @@ WidgetPresentationParameters::getColorMap() else if (colorMap == tr("LAB_COOL_TO_WARM")) { return MEDCALC::COLOR_MAP_COOL_TO_WARM; } + // Should not happen + STDLOG("Strange!! No matching color map found - returning blue to red."); + return MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW; } diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx index febdd1377..0f8815759 100644 --- a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx +++ b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx @@ -27,10 +27,14 @@ #include #include CORBA_SERVER_HEADER(MEDPresentationManager) +#include + class WidgetPresentationParameters : public QWidget { + Q_OBJECT public: WidgetPresentationParameters(QWidget* parent = 0); + virtual ~WidgetPresentationParameters() {} MEDCALC::MEDPresentationViewMode getViewMode(); std::string getField(); -- 2.39.2