From eaddf752c7106d33bf6730a591c10705a46ba172 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 21 May 2016 09:30:24 -0400 Subject: [PATCH] hacked up incomplete use of print-key-bindings-as-html --- gtk2_ardour/keyeditor.cc | 23 +++++++++++++++++++++++ gtk2_ardour/keyeditor.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index ce066efd70..fc69d89e28 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -22,6 +22,7 @@ #endif #include +#include #include @@ -72,6 +73,7 @@ KeyEditor::KeyEditor () , unbind_box (BUTTONBOX_END) , filter_entry (_("Search..."), true) , filter_string("") + , print_button (_("Print")) , sort_column(0) , sort_type(Gtk::SORT_ASCENDING) { @@ -100,10 +102,14 @@ KeyEditor::KeyEditor () reset_button.add (reset_label); reset_label.set_markup (string_compose ("%1", _("Reset Bindings to Defaults"))); + print_button.signal_clicked().connect (sigc::mem_fun (*this, &KeyEditor::print)); + reset_box.pack_start (reset_button, true, false); + reset_box.pack_start (print_button, true, false); reset_box.show (); reset_button.show (); reset_label.show (); + print_button.show (); reset_button.signal_clicked().connect (sigc::mem_fun (*this, &KeyEditor::reset)); vpacker.pack_start (reset_box, false, false); @@ -510,3 +516,20 @@ KeyEditor::search_string_updated (const std::string& filter) tab->filter->refilter (); } } + +void +KeyEditor::print () const +{ + char templ[14]; + + snprintf (templ, sizeof (templ), "akprintXXXXXX"); + + int fd = mkstemp (templ); + ofstream f; + //f.open (fd); + + Bindings::save_all_bindings_as_html (cerr); + + f.close (); + close (fd); +} diff --git a/gtk2_ardour/keyeditor.h b/gtk2_ardour/keyeditor.h index 5e15368069..a5662333ce 100644 --- a/gtk2_ardour/keyeditor.h +++ b/gtk2_ardour/keyeditor.h @@ -107,6 +107,7 @@ class KeyEditor : public ArdourWindow Gtk::Label reset_label; Gtkmm2ext::SearchBar filter_entry; std::string filter_string; + Gtk::Button print_button; typedef std::vector Tabs; @@ -122,6 +123,7 @@ class KeyEditor : public ArdourWindow Gtk::SortType sort_type; void toggle_sort_type (); void search_string_updated (const std::string&); + void print () const; }; #endif /* __ardour_gtk_key_editor_h__ */ -- 2.30.2