summaryrefslogtreecommitdiff
path: root/src/wx/video_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-27 13:41:49 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-27 13:41:49 +0100
commit7aab34abcab28ca38a5354dec075b56d430e82db (patch)
treea7a02355bb4ea08cdf652ccb89b4ee6d1247b5dd /src/wx/video_panel.cc
parent526829ad670c19d5466555890d8afe8d7f744834 (diff)
More stack-allocated Dialog objects.
Diffstat (limited to 'src/wx/video_panel.cc')
-rw-r--r--src/wx/video_panel.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index e1770efbe..4f7c2db79 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -541,17 +541,16 @@ VideoPanel::edit_colour_conversion_clicked ()
{
auto vc = _parent->selected_video ();
- auto d = new ContentColourConversionDialog (this, vc.front()->video->yuv ());
- d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion));
- if (d->ShowModal() == wxID_OK) {
+ ContentColourConversionDialog dialog(this, vc.front()->video->yuv());
+ dialog.set(vc.front()->video->colour_conversion().get_value_or(PresetColourConversion::all().front().conversion));
+ if (dialog.ShowModal() == wxID_OK) {
for (auto i: vc) {
- i->video->set_colour_conversion (d->get ());
+ i->video->set_colour_conversion(dialog.get());
}
} else {
/* Reset the colour conversion choice */
film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
}
- d->Destroy ();
}
@@ -725,16 +724,17 @@ bool
VideoPanel::scale_custom_edit_clicked ()
{
auto vc = _parent->selected_video().front()->video;
- auto d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
- int const r = d->ShowModal ();
- if (r == wxID_OK) {
- for (auto i: _parent->selected_video()) {
- i->video->set_custom_ratio (d->custom_ratio());
- i->video->set_custom_size (d->custom_size());
- }
+ CustomScaleDialog dialog(this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size());
+ if (dialog.ShowModal() != wxID_OK) {
+ return false;
+ }
+
+ for (auto i: _parent->selected_video()) {
+ i->video->set_custom_ratio(dialog.custom_ratio());
+ i->video->set_custom_size(dialog.custom_size());
}
- d->Destroy ();
- return r == wxID_OK;
+
+ return true;
}