Skip to content

Commit

Permalink
Simple Item Selector: save selected index even on cancel
Browse files Browse the repository at this point in the history
This is a better fix for bug #25536 since it allows easy bypassing of the dialog with Esc if single button
mode was enabled, but without crashing. Usecases can stil explicitly check for the dialog retval for conditional
behavior.
  • Loading branch information
Vultraz committed Feb 23, 2017
1 parent 789fcb6 commit 0474c2e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/gui/dialogs/simple_item_selector.cpp
Expand Up @@ -120,12 +120,8 @@ void simple_item_selector::pre_show(window& window)

void simple_item_selector::post_show(window& window)
{
if(get_retval() != window::OK) {
return;
}

listbox& list = find_widget<listbox>(&window, "listbox", false);
index_ = list.get_selected_row();
index_ = find_widget<listbox>(&window, "listbox", false).get_selected_row();
}

} // namespace dialogs
} // namespace gui2

0 comments on commit 0474c2e

Please sign in to comment.