#include "wx/film_viewer.h"
#include "wx/film_editor.h"
#include "wx/job_manager_view.h"
-#include "wx/config_dialog.h"
+#include "wx/full_config_dialog.h"
#include "wx/wx_util.h"
#include "wx/film_name_location_dialog.h"
#include "wx/wx_signal_manager.h"
overall_panel->SetSizer (main_sizer);
- wxAcceleratorEntry accel[2];
+#ifdef __WXOSX__
+ int accelerators = 3;
+#else
+ int accelerators = 2;
+#endif
+ wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators];
accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file);
accel[1].Set (wxACCEL_NORMAL, WXK_DELETE, ID_remove);
+#ifdef __WXOSX__
+ accel[2].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
+#endif
Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::remove_clicked, this, _1), ID_remove);
- wxAcceleratorTable accel_table (2, accel);
+ wxAcceleratorTable accel_table (accelerators, accel);
SetAcceleratorTable (accel_table);
+ delete[] accel;
UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this));
}
void edit_preferences ()
{
if (!_config_dialog) {
- _config_dialog = create_config_dialog ();
+ _config_dialog = create_full_config_dialog ();
}
_config_dialog->Show (this);
}
_("You are making a DKDM which is encrypted by a private key held in"
"\n\n<tt>%s</tt>\n\nIt is <span weight=\"bold\" size=\"larger\">VITALLY IMPORTANT</span> "
"that you <span weight=\"bold\" size=\"larger\">BACK UP THIS FILE</span> since if it is lost "
- "your DKDMs (and the DCPs they protect) will become useless."), std_to_wx(Config::config_path().string()).data()
+ "your DKDMs (and the DCPs they protect) will become useless."), std_to_wx(Config::config_file().string()).data()
)
);
wxInitAllImageHandlers ();
Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
+ Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
- wxSplashScreen* splash = 0;
- try {
- if (!Config::have_existing ("config.xml")) {
- wxBitmap bitmap;
- boost::filesystem::path p = shared_path () / "splash.png";
- if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) {
- splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1);
- wxYield ();
- }
- }
- } catch (boost::filesystem::filesystem_error& e) {
- /* Maybe we couldn't find the splash image; never mind */
- }
+ wxSplashScreen* splash = maybe_show_splash ();
SetAppName (_("DCP-o-matic"));
message_dialog (_frame, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create."));
}
+ void config_warning (string m)
+ {
+ message_dialog (_frame, std_to_wx (m));
+ }
+
DOMFrame* _frame;
shared_ptr<wxTimer> _timer;
string _film_to_load;