From 8ddfe113468c6ddfa05d62dd11b9fed1ee84bde2 Mon Sep 17 00:00:00 2001 From: Dmitry Yurov <d.yurov@fz-juelich.de> Date: Mon, 12 Feb 2018 12:16:40 +0100 Subject: [PATCH] Disable inaccessible views for different types of simulations Redmine: #1936 --- .../Views/JobWidgets/JobResultsPresenter.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/GUI/coregui/Views/JobWidgets/JobResultsPresenter.cpp b/GUI/coregui/Views/JobWidgets/JobResultsPresenter.cpp index 662224c08d0..fce43dbbd6f 100644 --- a/GUI/coregui/Views/JobWidgets/JobResultsPresenter.cpp +++ b/GUI/coregui/Views/JobWidgets/JobResultsPresenter.cpp @@ -77,8 +77,14 @@ QStringList JobResultsPresenter::presentationList(SessionItem* item) { Q_ASSERT(item->modelType() == Constants::JobItemType); - return QStringList() << Constants::IntensityDataPresentation - << Constants::SpecularDataPresentation - << Constants::IntensityProjectionsPresentation - << Constants::FitComparisonPresentation; + auto job_item = dynamic_cast<JobItem*>(item); + Q_ASSERT(job_item); + + QStringList result; + if (job_item->defaultPresentationType() == Constants::SpecularDataPresentation) + result << Constants::SpecularDataPresentation; + else + result << Constants::IntensityDataPresentation + << Constants::IntensityProjectionsPresentation; + return result << Constants::FitComparisonPresentation; } -- GitLab