#include "route_params_ui.h"
#include "save_as_dialog.h"
#include "script_selector.h"
+#include "session_archive_dialog.h"
#include "session_dialog.h"
#include "session_metadata_dialog.h"
#include "session_option_editor.h"
}
}
+void
+ARDOUR_UI::archive_session ()
+{
+ if (!_session) {
+ return;
+ }
+
+ time_t n;
+ time (&n);
+ Glib::DateTime gdt (Glib::DateTime::create_now_local (n));
+
+ SessionArchiveDialog sad;
+ sad.set_name (_session->name() + gdt.format ("_%F_%H%M%S"));
+ int response = sad.run ();
+
+ if (response != Gtk::RESPONSE_OK) {
+ sad.hide ();
+ return;
+ }
+
+ if (_session->archive_session (sad.target_folder(), sad.name(), sad.encode_option (), sad.only_used_sources (), &sad)) {
+ MessageDialog msg (_("Session Archiving failed."));
+ msg.run ();
+ }
+}
+
void
ARDOUR_UI::quick_snapshot_session (bool switch_to_it)
{
void
ARDOUR_UI::load_from_application_api (const std::string& path)
{
+ /* OS X El Capitan (and probably later) now somehow passes the command
+ line arguments to an app via the openFile delegate protocol. Ardour
+ already does its own command line processing, and having both
+ pathways active causes crashes. So, if the command line was already
+ set, do nothing here.
+ */
+
+ if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
+ return;
+ }
+
ARDOUR_COMMAND_LINE::session_name = path;
+
/* Cancel SessionDialog if it's visible to make OSX delegates work.
*
* ARDOUR_UI::starting connects app->ShouldLoad signal and then shows a SessionDialog
}
catch (SessionException e) {
+ cerr << "Here are the errors associated with this failed session:\n";
dump_errors (cerr);
+ cerr << "---------\n";
MessageDialog msg (string_compose(_("Could not create session in \"%1\": %2"), path, e.what()));
msg.set_title (_("Loading Error"));
msg.set_position (Gtk::WIN_POS_CENTER);
return -1;
}
catch (...) {
+ cerr << "Here are the errors associated with this failed session:\n";
dump_errors (cerr);
+ cerr << "---------\n";
MessageDialog msg (string_compose(_("Could not create session in \"%1\""), path));
msg.set_title (_("Loading Error"));
msg.set_position (Gtk::WIN_POS_CENTER);
}
static Gtkmm2ext::Bindings*
-get_bindings_from_widget_heirarchy (GtkWidget* w)
+get_bindings_from_widget_heirarchy (GtkWidget** w)
{
void* p = NULL;
- while (w) {
- if ((p = g_object_get_data (G_OBJECT(w), "ardour-bindings")) != 0) {
+ while (*w) {
+ if ((p = g_object_get_data (G_OBJECT(*w), "ardour-bindings")) != 0) {
break;
}
- w = gtk_widget_get_parent (w);
+ *w = gtk_widget_get_parent (*w);
}
return reinterpret_cast<Gtkmm2ext::Bindings*> (p);
{
GtkWindow* win = window.gobj();
GtkWidget* focus = gtk_window_get_focus (win);
+ GtkWidget* binding_widget = focus;
bool special_handling_of_unmodified_accelerators = false;
const guint mask = (Keyboard::RelevantModifierKeyMask & ~(Gdk::SHIFT_MASK|Gdk::LOCK_MASK));
} else {
- Gtkmm2ext::Bindings* focus_bindings = get_bindings_from_widget_heirarchy (focus);
+ Gtkmm2ext::Bindings* focus_bindings = get_bindings_from_widget_heirarchy (&binding_widget);
if (focus_bindings) {
bindings = focus_bindings;
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Switch bindings based on focus widget, now using %1\n", bindings->name()));
DEBUG_TRACE (DEBUG::Accelerators, "\tsending to window\n");
KeyboardKey k (ev->state, ev->keyval);
- if (bindings) {
+ while (bindings) {
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("\tusing Ardour bindings %1 @ %2 for this event\n", bindings->name(), bindings));
DEBUG_TRACE (DEBUG::Accelerators, "\t\thandled\n");
return true;
}
+
+ if (binding_widget) {
+ binding_widget = gtk_widget_get_parent (binding_widget);
+ if (binding_widget) {
+ bindings = get_bindings_from_widget_heirarchy (&binding_widget);
+ } else {
+ bindings = 0;
+ }
+ } else {
+ bindings = 0;
+ }
}
DEBUG_TRACE (DEBUG::Accelerators, "\tnot yet handled, try global bindings\n");
DEBUG_TRACE (DEBUG::Accelerators, "\tpropagation didn't handle, so activate\n");
KeyboardKey k (ev->state, ev->keyval);
- if (bindings) {
+ while (bindings) {
DEBUG_TRACE (DEBUG::Accelerators, "\tusing Ardour bindings for this window\n");
return true;
}
+ if (binding_widget) {
+ binding_widget = gtk_widget_get_parent (binding_widget);
+ if (binding_widget) {
+ bindings = get_bindings_from_widget_heirarchy (&binding_widget);
+ } else {
+ bindings = 0;
+ }
+ } else {
+ bindings = 0;
+ }
}
DEBUG_TRACE (DEBUG::Accelerators, "\tnot yet handled, try global bindings\n");