#include "wx/hints_dialog.h"
#include "wx/html_dialog.h"
#include "wx/i18n_hook.h"
+#include "wx/id.h"
#include "wx/job_manager_view.h"
#include "wx/kdm_dialog.h"
#include "wx/nag_dialog.h"
map<wxMenuItem*, int> menu_items;
enum {
- ID_file_new = 1,
+ ID_file_new = DCPOMATIC_MAIN_MENU,
ID_file_open,
ID_file_save,
ID_file_save_as_template,
ID_file_duplicate_and_open,
ID_file_history,
/* Allow spare IDs after _history for the recent files list */
- ID_file_close = 100,
+ ID_file_close = DCPOMATIC_MAIN_MENU + 100,
ID_edit_copy,
ID_edit_paste,
ID_edit_select_all,
);
if (dialog.ShowModal() == wxID_OK) {
- save_all_config_as_zip(wx_to_std(dialog.GetPath()));
+ auto const path = boost::filesystem::path(wx_to_std(dialog.GetPath()));
+ if (boost::filesystem::exists(path)) {
+ boost::system::error_code ec;
+ boost::filesystem::remove(path, ec);
+ if (ec) {
+ error_dialog(nullptr, _("Could not remove existing preferences file"), std_to_wx(path.string()));
+ return;
+ }
+ }
+
+ save_all_config_as_zip(path);
}
}
add_item (edit, _("Select all\tShift-Ctrl-A"), ID_edit_select_all, NEEDS_FILM);
#ifdef __WXOSX__
- add_item (_file_menu, _("&Preferences...\tCtrl-P"), wxID_PREFERENCES, ALWAYS);
+ add_item(_file_menu, _("&Preferences...\tCtrl-,"), wxID_PREFERENCES, ALWAYS);
#else
edit->AppendSeparator ();
/* [Shortcut] Ctrl+P:Open preferences window */
void config_changed (Config::Property what)
{
/* Instantly save any config changes when using the DCP-o-matic GUI */
- if (what == Config::CINEMAS) {
+ switch (what) {
+ case Config::CINEMAS:
try {
Config::instance()->write_cinemas();
} catch (exception& e) {
)
);
}
- } else {
+ break;
+ case Config::DKDM_RECIPIENTS:
+ try {
+ Config::instance()->write_dkdm_recipients();
+ } catch (exception& e) {
+ error_dialog (
+ this,
+ wxString::Format (
+ _("Could not write to DKDM recipients file at %s. Your changes have not been saved."),
+ std_to_wx(Config::instance()->dkdm_recipients_file().string()).data()
+ )
+ );
+ }
+ break;
+ default:
try {
Config::instance()->write_config();
} catch (exception& e) {
App ()
: wxApp ()
{
+ dcpomatic_setup_path_encoding ();
#ifdef DCPOMATIC_LINUX
XInitThreads ();
#endif
make_foreground_application ();
#endif
- dcpomatic_setup_path_encoding ();
-
/* Enable i18n; this will create a Config object
to look for a force-configured language. This Config
object will be wrong, however, because dcpomatic_setup
}
return true;
}
+ case Config::BAD_SIGNER_DN_QUALIFIER:
+ {
+ RecreateChainDialog dialog(
+ _frame, _("Recreate signing certificates"),
+ _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n"
+ "which will prevent DCPs from being validated correctly on some systems. This error was caused\n"
+ "by a bug in DCP-o-matic which has now been fixed. Do you want to re-create the certificate chain\n"
+ "for signing DCPs and KDMs?"),
+ _("Do nothing"),
+ Config::NAG_BAD_SIGNER_DN_QUALIFIER
+ );
+ return dialog.ShowModal() == wxID_OK;
+ }
default:
DCPOMATIC_ASSERT (false);
}