summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-09-29 13:49:54 +0100
committerCarl Hetherington <cth@carlh.net>2014-09-29 13:49:54 +0100
commit391d85619ac19a2a93696ddc35c222eb9bb5d9d6 (patch)
treefd551f1dda4c97076cbc29465e97e3ad3fdef5e1 /src
parent41e0dcde8ea8ec93e14778d09db3d9604b8fada7 (diff)
parent8b842865451795d5e8f8b39691c210de1ed5dd4f (diff)
Merge master.
Diffstat (limited to 'src')
-rw-r--r--src/lib/writer.cc10
-rw-r--r--src/tools/dcpomatic.cc26
-rw-r--r--src/wx/content_panel.h3
-rw-r--r--src/wx/film_editor.h1
4 files changed, 26 insertions, 14 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index a023d5cd2..6262525c8 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -52,6 +52,7 @@
#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
#define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING);
#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_WARNING);
+#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR);
/* OS X strikes again */
#undef set_key
@@ -406,9 +407,12 @@ Writer::finish ()
boost::system::error_code ec;
boost::filesystem::create_hard_link (video_from, video_to, ec);
if (ec) {
- /* hard link failed; copy instead */
- boost::filesystem::copy_file (video_from, video_to);
- LOG_WARNING_NC ("Hard-link failed; fell back to copying");
+ LOG_WARNING_NC ("Hard-link failed; copying instead");
+ boost::filesystem::copy_file (video_from, video_to, ec);
+ if (ec) {
+ LOG_ERROR ("Failed to copy video file from %1 to %2 (%3)", video_from.string(), video_to.string(), ec.message ());
+ throw FileError (ec.message(), video_from);
+ }
}
_picture_mxf->set_file (video_to);
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 8a0aa245e..01aa0158b 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -126,7 +126,9 @@ enum {
ID_jobs_show_dcp,
ID_tools_hints,
ID_tools_encoding_servers,
- ID_tools_check_for_updates
+ ID_tools_check_for_updates,
+ /* IDs for shortcuts (with no associated menu item) */
+ ID_add_file
};
class Frame : public wxFrame
@@ -189,6 +191,12 @@ public:
Bind (wxEVT_CLOSE_WINDOW, boost::bind (&Frame::close, this, _1));
+ wxAcceleratorEntry accel[1];
+ accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file);
+ Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
+ wxAcceleratorTable accel_table (1, accel);
+ SetAcceleratorTable (accel_table);
+
/* Use a panel as the only child of the Frame so that we avoid
the dark-grey background on Windows.
*/
@@ -592,10 +600,10 @@ private:
void setup_menu (wxMenuBar* m)
{
_file_menu = new wxMenu;
- add_item (_file_menu, _("New..."), ID_file_new, ALWAYS);
- add_item (_file_menu, _("&Open..."), ID_file_open, ALWAYS);
+ add_item (_file_menu, _("New...\tCtrl-N"), ID_file_new, ALWAYS);
+ add_item (_file_menu, _("&Open...\tCtrl-O"), ID_file_open, ALWAYS);
_file_menu->AppendSeparator ();
- add_item (_file_menu, _("&Save"), ID_file_save, NEEDS_FILM);
+ add_item (_file_menu, _("&Save\tCtrl-S"), ID_file_save, NEEDS_FILM);
_file_menu->AppendSeparator ();
add_item (_file_menu, _("&Properties..."), ID_file_properties, NEEDS_FILM);
@@ -612,10 +620,10 @@ private:
#endif
#ifdef __WXOSX__
- add_item (_file_menu, _("&Preferences..."), wxID_PREFERENCES, ALWAYS);
+ add_item (_file_menu, _("&Preferences...\tCtrl-P"), wxID_PREFERENCES, ALWAYS);
#else
wxMenu* edit = new wxMenu;
- add_item (edit, _("&Preferences..."), wxID_PREFERENCES, ALWAYS);
+ add_item (edit, _("&Preferences...\tCtrl-P"), wxID_PREFERENCES, ALWAYS);
#endif
wxMenu* content = new wxMenu;
@@ -623,13 +631,13 @@ private:
add_item (content, _("Scale to fit &height"), ID_content_scale_to_fit_height, NEEDS_FILM | NEEDS_SELECTED_VIDEO_CONTENT);
wxMenu* jobs_menu = new wxMenu;
- add_item (jobs_menu, _("&Make DCP"), ID_jobs_make_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION);
- add_item (jobs_menu, _("Make &KDMs..."), ID_jobs_make_kdms, NEEDS_FILM);
+ add_item (jobs_menu, _("&Make DCP\tCtrl-M"), ID_jobs_make_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION);
+ add_item (jobs_menu, _("Make &KDMs...\tCtrl-K"), ID_jobs_make_kdms, NEEDS_FILM);
add_item (jobs_menu, _("&Send DCP to TMS"), ID_jobs_send_dcp_to_tms, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_CPL);
add_item (jobs_menu, _("S&how DCP"), ID_jobs_show_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_CPL);
wxMenu* tools = new wxMenu;
- add_item (tools, _("Hints..."), ID_tools_hints, 0);
+ add_item (tools, _("Hints...\tCtrl-H"), ID_tools_hints, 0);
add_item (tools, _("Encoding servers..."), ID_tools_encoding_servers, 0);
add_item (tools, _("Check for updates"), ID_tools_check_for_updates, 0);
diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h
index 1f64d51c6..ab198411d 100644
--- a/src/wx/content_panel.h
+++ b/src/wx/content_panel.h
@@ -63,10 +63,11 @@ public:
SubtitleContentList selected_subtitle ();
FFmpegContentList selected_ffmpeg ();
+ void add_file_clicked ();
+
private:
void sequence_video_changed ();
void selection_changed ();
- void add_file_clicked ();
void add_folder_clicked ();
void remove_clicked ();
void earlier_clicked ();
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index b311184fa..25749fffa 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -54,7 +54,6 @@ public:
return _film;
}
-private:
/* Handle changes to the model */
void film_changed (Film::Property);
void film_content_changed (int);