ID_file_duplicate_and_open,
ID_file_history,
/* Allow spare IDs after _history for the recent files list */
- ID_edit_copy = 100,
+ ID_file_close = 100,
+ ID_edit_copy,
ID_edit_paste,
ID_content_scale_to_fit_width,
ID_content_scale_to_fit_height,
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_save_as_template, this), ID_file_save_as_template);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_duplicate, this), ID_file_duplicate);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_duplicate_and_open, this), ID_file_duplicate_and_open);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_close, this), ID_file_close);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_history, this, _1), ID_file_history, ID_file_history + HISTORY_SIZE);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_copy, this), ID_edit_copy);
right_sizer->Add (job_manager_view, 1, wxEXPAND | wxALL, 6);
wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
- main_sizer->Add (_film_editor, 1, wxEXPAND | wxALL, 6);
- main_sizer->Add (right_sizer, 2, wxEXPAND | wxALL, 6);
+ main_sizer->Add (_film_editor, 0, wxEXPAND | wxALL, 6);
+ main_sizer->Add (right_sizer, 1, wxEXPAND | wxALL, 6);
set_menu_sensitivity ();
accel[4].Set (wxACCEL_NORMAL, WXK_LEFT, ID_back_frame);
accel[5].Set (wxACCEL_NORMAL, WXK_RIGHT, ID_forward_frame);
#ifdef __WXOSX__
- accel[6].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
+ accel[6].Set (wxACCEL_CTRL, static_cast<int>('W'), ID_file_close);
#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);
_video_waveform_dialog = 0;
}
set_menu_sensitivity ();
- if (_film->directory()) {
+ if (_film && _film->directory()) {
Config::instance()->add_to_history (_film->directory().get());
}
- _film->Change.connect (boost::bind (&DOMFrame::film_change, this, _1));
+ if (_film) {
+ _film->Change.connect (boost::bind (&DOMFrame::film_change, this, _1));
+ _film->Message.connect (boost::bind(&DOMFrame::film_message, this, _1));
+ }
}
shared_ptr<Film> film () const {
private:
+ void film_message (string m)
+ {
+ message_dialog (this, std_to_wx(m));
+ }
+
void film_change (ChangeType type)
{
if (type == CHANGE_TYPE_DONE) {
d->Destroy ();
}
+ void file_close ()
+ {
+ if (_film && _film->dirty ()) {
+
+ FilmChangedClosingDialog* dialog = new FilmChangedClosingDialog (_film->name ());
+ int const r = dialog->run ();
+ delete dialog;
+
+ switch (r) {
+ case wxID_NO:
+ /* Don't save and carry on to close */
+ break;
+ case wxID_YES:
+ /* Save and carry on to close */
+ _film->write_metadata ();
+ break;
+ case wxID_CANCEL:
+ /* Stop */
+ return;
+ }
+ }
+
+ set_film (shared_ptr<Film>());
+ }
+
void file_history (wxCommandEvent& event)
{
vector<boost::filesystem::path> history = Config::instance()->history ();
if (!_film->should_be_enough_disk_space (required, available, can_hard_link)) {
wxString message;
if (can_hard_link) {
- message = wxString::Format (_("The DCP for this film will take up about %.1f Gb, and the disk that you are using only has %.1f Gb available. Do you want to continue anyway?"), required, available);
+ message = wxString::Format (_("The DCP for this film will take up about %.1f GB, and the disk that you are using only has %.1f GB available. Do you want to continue anyway?"), required, available);
} else {
- message = wxString::Format (_("The DCP and intermediate files for this film will take up about %.1f Gb, and the disk that you are using only has %.1f Gb available. You would need half as much space if the filesystem supported hard links, but it does not. Do you want to continue anyway?"), required, available);
+ message = wxString::Format (_("The DCP and intermediate files for this film will take up about %.1f GB, and the disk that you are using only has %.1f GB available. You would need half as much space if the filesystem supported hard links, but it does not. Do you want to continue anyway?"), required, available);
}
if (!confirm_dialog (this, message)) {
return;
string body;
body += d->name() + "\n";
body += d->language() + "\n";
+ body += string(dcpomatic_version) + " " + string(dcpomatic_git_commit) + "\n";
+ body += "--\n";
map<string, string> translations = I18NHook::translations ();
for (map<string, string>::const_iterator i = translations.begin(); i != translations.end(); ++i) {
- body += i->first + "\n" + i->second + "\n";
+ body += i->first + "\n" + i->second + "\n\n";
}
list<string> to;
to.push_back ("carl@dcpomatic.com");
_history_position = _file_menu->GetMenuItems().GetCount();
+ _file_menu->AppendSeparator ();
+ add_item (_file_menu, _("&Close\tCtrl-W"), ID_file_close, NEEDS_FILM);
+
#ifndef __WXOSX__
_file_menu->AppendSeparator ();
#endif
int pos = _history_position;
+ /* Clear out non-existant history items before we re-build the menu */
+ Config::instance()->clean_history ();
vector<boost::filesystem::path> history = Config::instance()->history ();
if (!history.empty ()) {
}
_history_items = history.size ();
+
+ dcpomatic_log->set_types (Config::instance()->log_types());
}
void update_checker_state_changed ()
Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
- wxSplashScreen* splash = maybe_show_splash ();
+ splash = maybe_show_splash ();
SetAppName (_("DCP-o-matic"));