using std::string;
using std::cout;
using std::vector;
+using std::exception;
using boost::shared_ptr;
using boost::weak_ptr;
using boost::dynamic_pointer_cast;
return;
}
- shared_ptr<Content> content = content_factory (_film, path);
+ shared_ptr<Content> content;
+
+ try {
+ content = content_factory (_film, path);
+ } catch (exception& e) {
+ error_dialog (_parent, e.what());
+ return;
+ }
+
if (!content) {
error_dialog (_parent, _("No content found in this folder."));
return;
_film->examine_and_add_content (content);
}
-void
+/** @return true if this remove "click" should be ignored */
+bool
ContentPanel::remove_clicked (bool hotkey)
{
/* If the method was called because Delete was pressed check that our notebook page
is visible and that the content list is focussed.
*/
if (hotkey && (_parent->GetCurrentPage() != _panel || !_content->HasFocus())) {
- return;
+ return true;
}
BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
}
selection_changed ();
+ return false;
}
void