#include "dcpomatic_button.h"
#include "screen_dialog.h"
#include "screens_panel.h"
+#include "wx_ptr.h"
#include "wx_util.h"
#include "lib/cinema.h"
#include "lib/config.h"
void
ScreensPanel::add_cinema_clicked ()
{
- auto dialog = new CinemaDialog (GetParent(), _("Add Cinema"));
- ScopeGuard sg = [dialog]() { dialog->Destroy(); };
+ auto dialog = make_wx<CinemaDialog>(GetParent(), _("Add Cinema"));
if (dialog->ShowModal() == wxID_OK) {
auto cinema = make_shared<Cinema>(dialog->name(), dialog->emails(), dialog->notes(), dialog->utc_offset_hour(), dialog->utc_offset_minute());
return;
}
- auto dialog = new CinemaDialog(
+ auto dialog = make_wx<CinemaDialog>(
GetParent(), _("Edit cinema"), cinema->name, cinema->emails, cinema->notes, cinema->utc_offset_hour(), cinema->utc_offset_minute()
);
- ScopeGuard sg = [dialog]() { dialog->Destroy(); };
if (dialog->ShowModal() == wxID_OK) {
cinema->name = dialog->name();
return;
}
- auto dialog = new ScreenDialog(GetParent(), _("Add Screen"));
- ScopeGuard sg = [dialog]() { dialog->Destroy(); };
+ auto dialog = make_wx<ScreenDialog>(GetParent(), _("Add Screen"));
if (dialog->ShowModal () != wxID_OK) {
return;
auto edit_screen = _selected_screens[0];
- auto dialog = new ScreenDialog(
+ auto dialog = make_wx<ScreenDialog>(
GetParent(), _("Edit screen"),
edit_screen->name,
edit_screen->notes,
edit_screen->recipient_file,
edit_screen->trusted_devices
);
- ScopeGuard sg = [dialog]() { dialog->Destroy(); };
if (dialog->ShowModal() != wxID_OK) {
return;
_targets->DeleteItem(*item);
}
+ /* This is called by the signal on Linux, but not it seems on Windows, so we call it ourselves
+ * as well.
+ */
+ selection_changed();
notify_cinemas_changed();
}