mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Preserve Cinema Path selection
Commit 81c57e8a28 added support for adding and removing paths.
Reloading path list stores the current selection but it's unused, assume
the idea was to restore it again.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
df06b6895e
commit
cf7b8aab39
1 changed files with 3 additions and 4 deletions
|
|
@ -135,10 +135,7 @@ void CinemaSidebar::OnDeletePath(wxCommandEvent&)
|
|||
|
||||
void CinemaSidebar::ReloadPathList()
|
||||
{
|
||||
int index = m_PathList->GetSelection();
|
||||
wxString pathName;
|
||||
if (index >= 0)
|
||||
pathName = m_PathList->GetString(index);
|
||||
const wxString selection = m_PathList->GetStringSelection();
|
||||
|
||||
AtlasMessage::qGetCinemaPaths query_paths;
|
||||
query_paths.Post();
|
||||
|
|
@ -146,6 +143,8 @@ void CinemaSidebar::ReloadPathList()
|
|||
m_PathList->Clear();
|
||||
for (const AtlasMessage::sCinemaPath& path : *query_paths.paths)
|
||||
m_PathList->Append(*path.name);
|
||||
|
||||
m_PathList->SetStringSelection(selection);
|
||||
}
|
||||
|
||||
wxBEGIN_EVENT_TABLE(CinemaSidebar, Sidebar)
|
||||
|
|
|
|||
Loading…
Reference in a new issue