#ifdef DCPOMATIC_VARIANT_SWAROOP
void background_image_changed ()
{
- Config::instance()->set_player_background_image(wx_to_std(_background_image->GetPath()));
+ boost::filesystem::path const f = wx_to_std(_background_image->GetPath());
+ if (!boost::filesystem::is_regular_file(f) || !wxImage::CanRead(std_to_wx(f.string()))) {
+ error_dialog (0, _("Could not load image file."));
+ if (Config::instance()->player_background_image()) {
+ checked_set (_background_image, *Config::instance()->player_background_image());
+ }
+ return;
+ }
+
+ Config::instance()->set_player_background_image(f);
}
#endif
);
_panel->GetSizer()->Add(_monitor_list, 1, wxEXPAND | wxALL, _border);
- Button* get = new wxButton(_panel, _("Read current devices"));
+ wxButton* get = new Button(_panel, _("Read current devices"));
_panel->GetSizer()->Add(get, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
get->Bind(wxEVT_BUTTON, bind(&DevicesPage::get_clicked, this));
}