mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-12 11:42:13 -04:00
Rename display_error() -> display_modal(), add title argument.
This commit is contained in:
parent
6a3cd4c144
commit
ac49726707
4 changed files with 23 additions and 7 deletions
|
@ -131,10 +131,13 @@ void NavigationView::pop() {
|
|||
}
|
||||
}
|
||||
|
||||
void NavigationView::display_error(const std::string& message) {
|
||||
void NavigationView::display_modal(
|
||||
const std::string& title,
|
||||
const std::string& message
|
||||
) {
|
||||
/* If a modal view is already visible, don't display another */
|
||||
if( !modal_view ) {
|
||||
modal_view = push<ModalMessageView>(message);
|
||||
modal_view = push<ModalMessageView>(title, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -290,7 +293,12 @@ void NotImplementedView::focus() {
|
|||
|
||||
/* ModalMessageView ******************************************************/
|
||||
|
||||
ModalMessageView::ModalMessageView(NavigationView& nav, std::string message) {
|
||||
ModalMessageView::ModalMessageView(
|
||||
NavigationView& nav,
|
||||
const std::string& title,
|
||||
const std::string& message
|
||||
) : title_ { title }
|
||||
{
|
||||
button_done.on_select = [&nav](Button&){
|
||||
nav.pop();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue