mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user