#include "name_format_editor.h"
#include "nag_dialog.h"
#include "monitor_dialog.h"
+#include "check_box.h"
#include "lib/config.h"
#include "lib/ratio.h"
#include "lib/filter.h"
table->Add (_image_display, wxGBPosition(r, 1));
++r;
- _respect_kdm = new wxCheckBox (_panel, wxID_ANY, _("Respect KDM validity periods"));
+ _respect_kdm = new CheckBox (_panel, _("Respect KDM validity periods"));
table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2));
++r;
#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);
- wxButton* get = new wxButton(_panel, wxID_ANY, _("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));
}