summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_dependents.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-12-19 02:41:19 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-12-19 02:41:19 +0000
commit486020b4032da9bbb20fafd83ec6f10263c892e5 (patch)
treeec7b4a43e25f628a64ccd56afbca5b556c8f268f /gtk2_ardour/ardour_ui_dependents.cc
parent575c7974ebddffe71b1fc673c1463221f134bc16 (diff)
save keybindings to file used at startup; allow keybindings file to be cmdline-specified; remove some GTK2FIX comments; fix feedback based on john anderson's patch; apply scons patches; fix crash when taking MIDI ports online+offline; try to prevent aborts when shutting down due to metering thread; start work on reconstructing GlobalFOOCommand commands; use ftruncate to hint at peakfile preallocation to reduce fragmentation
git-svn-id: svn://localhost/ardour2/trunk@1223 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui_dependents.cc')
-rw-r--r--gtk2_ardour/ardour_ui_dependents.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc
index e00a769a37..7c4f3563f3 100644
--- a/gtk2_ardour/ardour_ui_dependents.cc
+++ b/gtk2_ardour/ardour_ui_dependents.cc
@@ -60,19 +60,36 @@ ARDOUR_UI::we_have_dependents ()
editor->UpdateAllTransportClocks.connect (mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
}
+static void
+accel_map_changed (GtkAccelMap* map,
+ gchar* path,
+ guint key,
+ GdkModifierType mod,
+ gpointer arg)
+{
+ static_cast<ARDOUR_UI*>(arg)->save_keybindings ();
+}
+
void
ARDOUR_UI::setup_keybindings ()
{
install_actions ();
RedirectBox::register_actions ();
- std::string key_binding_file = ARDOUR::find_config_file("ardour.bindings");
+ cerr << "loading bindings from " << keybindings_path << endl;
try {
- AccelMap::load (key_binding_file);
+ AccelMap::load (keybindings_path);
} catch (...) {
- error << "ardour key bindings file not found" << endmsg;
+ error << string_compose (_("Ardour key bindings file not found at \"%1\" or contains errors."), keybindings_path)
+ << endmsg;
}
+
+ /* catch changes */
+
+ GtkAccelMap* accelmap = gtk_accel_map_get();
+ g_signal_connect (accelmap, "changed", (GCallback) accel_map_changed, this);
+
}
void
@@ -80,6 +97,10 @@ ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
{
editor->connect_to_session (s);
mixer->connect_to_session (s);
+
+ /* its safe to do this now */
+
+ s->restore_history ("");
}
void