diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-04 21:26:03 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-05 23:52:03 +0200 |
| commit | f5bd787fb71466a6187050086b2890b9b0ac9294 (patch) | |
| tree | 816de528eccb8fd252910647ffa2138d65c34468 /src/wx/wx_util.cc | |
| parent | 8afad10c394462c66f68ac00698da38c5b0b8721 (diff) | |
Tidy up code to report failures to load config in the UI.
Diffstat (limited to 'src/wx/wx_util.cc')
| -rw-r--r-- | src/wx/wx_util.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index e94f3e512..d02eb3ca5 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -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; + } +} |
