mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Add discard confirmation on table intervals
Change-Id: Id152577c570febf06b4d829fd2723c2a30c3ccd9
This commit is contained in:
committed by
Émilie Feral
parent
bd23135198
commit
150a5bfa5a
@@ -13,7 +13,12 @@ IntervalParameterController::IntervalParameterController(Responder * parentRespo
|
||||
m_intervalCells{},
|
||||
m_title(I18n::Message::IntervalSet),
|
||||
m_startMessage(I18n::Message::XStart),
|
||||
m_endMessage(I18n::Message::XEnd)
|
||||
m_endMessage(I18n::Message::XEnd),
|
||||
m_confirmPopUpController(Invocation([](void * context, void * sender) {
|
||||
Container::activeApp()->dismissModalViewController();
|
||||
((IntervalParameterController *)context)->stackController()->pop();
|
||||
return true;
|
||||
}, this))
|
||||
{
|
||||
for (int i = 0; i < k_totalNumberOfCell; i++) {
|
||||
m_intervalCells[i].setParentResponder(&m_selectableTableView);
|
||||
@@ -87,6 +92,11 @@ bool IntervalParameterController::handleEvent(Ion::Events::Event event) {
|
||||
stackController()->pop();
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::Back && !m_interval->hasSameParameters(*SharedTempIntervalParameters())) {
|
||||
// Open pop-up to confirm discarding values
|
||||
Container::activeApp()->displayModalViewController(&m_confirmPopUpController, 0.f, 0.f, Metric::ExamPopUpTopMargin, Metric::PopUpRightMargin, Metric::ExamPopUpBottomMargin, Metric::PopUpLeftMargin);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user