+
+ double total_required;
+ double available;
+ bool can_hard_link;
+
+ film->should_be_enough_disk_space (total_required, available, can_hard_link);
+
+ set<shared_ptr<const Film> > films;
+
+ BOOST_FOREACH (shared_ptr<Job> i, JobManager::instance()->get()) {
+ films.insert (i->film());
+ }
+
+ BOOST_FOREACH (shared_ptr<const Film> i, films) {
+ double progress = 0;
+ BOOST_FOREACH (shared_ptr<Job> j, JobManager::instance()->get()) {
+ if (i == j->film() && dynamic_pointer_cast<TranscodeJob>(j)) {
+ progress = j->progress().get_value_or(0);
+ }
+ }
+
+ double required;
+ i->should_be_enough_disk_space (required, available, can_hard_link);
+ total_required += (1 - progress) * required;
+ }
+
+ if ((total_required - available) > 1) {
+ if (!confirm_dialog (
+ this,
+ wxString::Format(
+ _("The DCPs for this film and the films already in the queue will take up about %.1f GB. The "
+ "disks that you are using only have %.1f GB available. Do you want to add this film to the queue anyway?"),
+ total_required, available))) {
+ return;
+ }
+ }
+