it harder to make similar errors in the future.
boost::bind(&DOMFrame::inputs, this),
boost::bind(&DOMFrame::set_inputs, this, _1),
&display_string,
- true,
+ EditableListTitle::VISIBLE,
EditableListButton::NEW | EditableListButton::REMOVE
);
boost::bind(&DOMFrame::dcp_paths, this),
boost::bind(&DOMFrame::set_dcp_paths, this, _1),
[](boost::filesystem::path p, int) { return p.filename().string(); },
- false,
+ EditableListTitle::INVISIBLE,
EditableListButton::NEW | EditableListButton::REMOVE
);
[](shared_ptr<dcp::Reel> reel, int) {
return reel->id();
},
- false,
+ EditableListTitle::INVISIBLE,
EditableListButton::EDIT
);
sizer->Add(_reels, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
_email_list = new EditableList<string, EmailDialog> (
this, columns, bind (&CinemaDialog::get_emails, this), bind (&CinemaDialog::set_emails, this, _1), [](string s, int) {
return s;
- }, false, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
+ }, EditableListTitle::INVISIBLE, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
sizer->Add (_email_list, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND);
};
+enum class EditableListTitle
+{
+ VISIBLE,
+ INVISIBLE
+};
+
+
/** @param T type of things being edited.
* @param S dialog to edit a thing.
* @param get Function to get a std::vector of the things being edited.
std::function<std::vector<T> ()> get,
std::function<void (std::vector<T>)> set,
std::function<std::string (T, int)> column,
- bool title,
+ EditableListTitle title,
int buttons
)
: wxPanel (parent)
SetSizer (_sizer);
long style = wxLC_REPORT | wxLC_SINGLE_SEL;
- if (!title) {
+ if (title == EditableListTitle::INVISIBLE) {
style |= wxLC_NO_HEADER;
}
_email_list = new EditableList<string, EmailDialog> (
this, columns, bind(&ExtraKDMEmailDialog::get, this), bind(&ExtraKDMEmailDialog::set, this, _1), [](string s, int) {
return s;
- }, false, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
+ }, EditableListTitle::INVISIBLE, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
sizer->Add (_email_list, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND);
boost::bind (&Config::servers, Config::instance()),
boost::bind (&Config::set_servers, Config::instance(), _1),
boost::bind (&EncodingServersPage::server_column, this, _1),
- false,
+ EditableListTitle::INVISIBLE,
EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
[] (string s, int) {
return s;
},
- true,
+ EditableListTitle::VISIBLE,
EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
table->Add (_cc, 1, wxEXPAND | wxALL);
[] (string s, int) {
return s;
},
- true,
+ EditableListTitle::VISIBLE,
EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
table->Add (_cc, 1, wxEXPAND | wxALL);
}
return r.label;
},
- true,
+ EditableListTitle::VISIBLE,
EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
_ratings->SetMinSize(wxSize(600, -1));
columns.push_back (EditableListColumn(_("Address")));
_email_list = new EditableList<string, EmailDialog> (
this, columns, bind(&RecipientDialog::get_emails, this), bind(&RecipientDialog::set_emails, this, _1), bind(&column, _1),
- EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE, true
+ EditableListTitle::VISIBLE,
+ EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
_sizer->Add (_email_list, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND);
[] (TrustedDevice const& d, int) {
return d.thumbprint();
},
- EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE,
- false
+ EditableListTitle::INVISIBLE,
+ EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
_sizer->Add (_trusted_device_list, wxGBPosition (r, 0), wxGBSpan (1, 3), wxEXPAND);
boost::bind(&SMPTEMetadataDialog::content_versions, this),
boost::bind(&SMPTEMetadataDialog::set_content_versions, this, _1),
boost::bind(&content_versions_column, _1, _2),
- true,
- false
+ EditableListTitle::INVISIBLE,
+ EditableListButton::NEW | EditableListButton::REMOVE
);
sizer->Add (_content_versions, 1, wxEXPAND);
}