X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fwx_util.cc;h=d02eb3ca5d3b3e68a6f5d26b87e1fd19ac14480d;hb=b3a11879c49c8c0f79e7643827125ae8a7c82a01;hp=493743d4afebb92eb7d64e8b562fa60f0ed4795d;hpb=d311043bf3c1e3e7f41b314f7ab7c91ed7e5aa7f;p=dcpomatic.git diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 493743d4a..d02eb3ca5 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -34,15 +34,15 @@ #include "lib/job_manager.h" #include "lib/util.h" #include "lib/version.h" -#include "lib/warnings.h" #include -DCPOMATIC_DISABLE_WARNINGS +#include +LIBDCP_DISABLE_WARNINGS #include #include #include #include #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #include @@ -101,7 +101,7 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, bool left, int prop, in setup_osx_flags (s, left, flags); #endif auto m = create_label (p, t, left); - s->Add (m, prop, flags, 6); + s->Add (m, prop, flags, DCPOMATIC_SIZER_GAP); return m; } @@ -116,7 +116,7 @@ add_label_to_sizer (wxSizer* s, wxStaticText* t, bool, int prop, int flags) #ifdef __WXOSX__ setup_osx_flags (s, left, flags); #endif - s->Add (t, prop, flags, 6); + s->Add (t, prop, flags, DCPOMATIC_SIZER_GAP); return t; } @@ -517,7 +517,7 @@ maybe_show_splash () wxSplashScreen* splash = nullptr; try { wxBitmap bitmap; - if (bitmap.LoadFile(bitmap_path("splash"), wxBITMAP_TYPE_PNG)) { + if (bitmap.LoadFile(bitmap_path("splash.png"), wxBITMAP_TYPE_PNG)) { { /* This wxMemoryDC must be destroyed before bitmap can be used elsewhere */ wxMemoryDC dc(bitmap); @@ -646,7 +646,7 @@ bitmap_path (string name) base = resources_path(); #endif - auto p = base / String::compose("%1.png", name); + auto p = base / name; return std_to_wx (p.string()); } @@ -700,3 +700,27 @@ search_ctrl_height () #endif } + +void +report_config_load_failure(wxWindow* parent, Config::LoadFailure what) +{ + switch (what) { + case Config::LoadFailure::CONFIG: + message_dialog(parent, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create.")); + break; + case Config::LoadFailure::CINEMAS: + message_dialog( + parent, + _(wxString::Format("The cinemas list for creating KDMs (cinemas.xml) failed to load. Please check the numbered backup files in %s", + std_to_wx(Config::instance()->cinemas_file().parent_path().string()))) + ); + break; + case Config::LoadFailure::DKDM_RECIPIENTS: + message_dialog( + parent, + _(wxString::Format("The recipients list for creating DKDMs (dkdm_recipients.xml) failed to load. Please check the numbered backup files in %s", + std_to_wx(Config::instance()->dkdm_recipients_file().parent_path().string()))) + ); + break; + } +}