Files
Upsilon/apps/exam_mode_timer.cpp
Émilie Feral b0f51e818e [apps] Exam mode
Change-Id: I0650df50940bc341217d09f3ad3299a889ec9eab
2017-04-07 15:08:32 +02:00

21 lines
602 B
C++

#include "exam_mode_timer.h"
#include "global_preferences.h"
#include "apps_container.h"
ExamModeTimer::ExamModeTimer(AppsContainer * container) :
Timer(3),
m_container(container),
m_previousPluggedState(false)
{
}
void ExamModeTimer::fire() {
if (!m_previousPluggedState && Ion::USB::isPlugged() && GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate) {
m_container->displayExamModePopUp(false, true);
m_previousPluggedState = true;
}
if (m_previousPluggedState && !Ion::USB::isPlugged()) {
m_previousPluggedState = false;
}
}