, _ignore_deselect (false)
, _no_check_selection (false)
{
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- _text_panel[i] = 0;
- }
-
_splitter = new LimitedSplitter (n);
_top_panel = new wxPanel (_splitter);
bool have_video = false;
bool have_audio = false;
- bool have_text[static_cast<int>(TextType::COUNT)] = { false, false };
+ EnumIndexedVector<bool, TextType> have_text;
for (auto i: selected()) {
if (i->video) {
have_video = true;
_text_panel[i]->create ();
} else if (!have_text[i] && _text_panel[i]) {
_notebook->DeletePage (off);
- _text_panel[i] = 0;
+ _text_panel[i] = nullptr;
}
if (have_text[i]) {
++off;
_parent,
_(
"This looks like a DCP-o-matic project folder, which cannot be added to a different project. "
- "Choose the DCP directory inside the DCP-o-matic project folder if that's what you want to import."
+ "Choose the DCP folder inside the DCP-o-matic project folder if that's what you want to import."
)
);
} catch (exception& e) {
ContentPanel::remove_clicked (bool hotkey)
{
/* If the method was called because Delete was pressed check that our notebook page
- is visible and that the content list is focussed.
+ is visible and that the content list is focused.
*/
if (hotkey && (_parent->GetCurrentPage() != _splitter || !_content->HasFocus())) {
return true;
if (_audio_panel) {
_audio_panel->Enable (_generally_sensitive && audio_selection.size() > 0);
}
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- if (_text_panel[i]) {
- _text_panel[i]->Enable (_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
+ for (auto text: _text_panel) {
+ if (text) {
+ text->Enable(_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
}
}
_timing_panel->Enable (_generally_sensitive);
if (_audio_panel) {
p.push_back (_audio_panel);
}
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- if (_text_panel[i]) {
- p.push_back (_text_panel[i]);
+ for (auto text: _text_panel) {
+ if (text) {
+ p.push_back(text);
}
}
p.push_back (_timing_panel);