X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilter_dialog.cc;fp=src%2Fwx%2Ffilter_dialog.cc;h=517978c746b145040422f86706c25ae224bd848a;hb=83a948956916abb7b2c13c25141323d326b38708;hp=f9ba06eae9b752ff7e98855ed6e55e907b4617f2;hpb=bb3a9a12116a4b2a5bc1fef38e73853f576a773a;p=dcpomatic.git diff --git a/src/wx/filter_dialog.cc b/src/wx/filter_dialog.cc index f9ba06eae..517978c74 100644 --- a/src/wx/filter_dialog.cc +++ b/src/wx/filter_dialog.cc @@ -36,7 +36,7 @@ using namespace std; using boost::bind; -FilterDialog::FilterDialog (wxWindow* parent, vector const & active) +FilterDialog::FilterDialog(wxWindow* parent, vector const& active) : wxDialog (parent, wxID_ANY, wxString(_("Filters"))) { auto panel = new wxPanel (this); @@ -44,29 +44,29 @@ FilterDialog::FilterDialog (wxWindow* parent, vector const & act auto filters = Filter::all (); - map> categories; + map> categories; for (auto i: filters) { - auto j = categories.find (i->category()); + auto j = categories.find(i.category()); if (j == categories.end ()) { - categories[i->category()] = { i }; + categories[i.category()] = { i }; } else { j->second.push_back (i); } } - for (auto const& i: categories) { - auto c = new StaticText (panel, std_to_wx(i.first)); + for (auto const& category: categories) { + auto c = new StaticText(panel, std_to_wx(category.first)); auto font = c->GetFont(); font.SetWeight(wxFONTWEIGHT_BOLD); c->SetFont(font); sizer->Add (c, 1, wxTOP | wxBOTTOM, DCPOMATIC_SIZER_GAP); - for (auto j: i.second) { - auto b = new CheckBox(panel, std_to_wx(j->name())); - bool const a = find (active.begin(), active.end(), j) != active.end(); + for (auto const& filter: category.second) { + auto b = new CheckBox(panel, std_to_wx(filter.name())); + bool const a = find(active.begin(), active.end(), filter) != active.end(); b->SetValue (a); - _filters[j] = b; + _filters[filter] = b; b->bind(&FilterDialog::filter_toggled, this); sizer->Add (b); } @@ -95,10 +95,10 @@ FilterDialog::filter_toggled () } -vector +vector FilterDialog::active () const { - vector active; + vector active; for (auto const& i: _filters) { if (i.second->IsChecked()) { active.push_back(i.first);