Add File->Close to main DCP-o-matic (#1180).
[dcpomatic.git] / src / wx / player_config_dialog.cc
index 254a84c8a6180be875d733f3788f182952f7a056..ab72284382bb4d0dac01099121a33bc62f7fc464 100644 (file)
@@ -313,7 +313,16 @@ private:
 #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
 
@@ -431,7 +440,7 @@ private:
                        );
                _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));
        }