From fbeb5ed982a12a419f9d3fe9c0f6497926dbca81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 29 May 2020 17:50:21 +0200 Subject: [PATCH] [apps/controller] All code regarding Dutch exam mode is in ExamModeConfiguration --- apps/home/controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/home/controller.cpp b/apps/home/controller.cpp index 65b072ee7..b2f779d1a 100644 --- a/apps/home/controller.cpp +++ b/apps/home/controller.cpp @@ -2,6 +2,8 @@ #include "app.h" #include "../apps_container.h" #include "../global_preferences.h" +#include "../exam_mode_configuration.h" + extern "C" { #include } @@ -59,7 +61,7 @@ bool Controller::handleEvent(Ion::Events::Event event) { if (event == Ion::Events::OK || event == Ion::Events::EXE) { AppsContainer * container = AppsContainer::sharedAppsContainer(); ::App::Snapshot * selectedSnapshot = container->appSnapshotAtIndex(selectionDataSource()->selectedRow()*k_numberOfColumns+selectionDataSource()->selectedColumn()+1); - if (GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Dutch && selectedSnapshot->descriptor()->name() == I18n::Message::CodeApp) { + if (ExamModeConfiguration::appIsForbiddenInExamMode(selectedSnapshot->descriptor()->name(), GlobalPreferences::sharedGlobalPreferences()->examMode())) { App::app()->displayWarning(I18n::Message::ForbidenAppInExamMode1, I18n::Message::ForbidenAppInExamMode2); } else { bool switched = container->switchTo(selectedSnapshot);