summaryrefslogtreecommitdiff
path: root/gtk2_ardour/keyeditor.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-05-21 09:30:24 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:44 -0400
commiteaddf752c7106d33bf6730a591c10705a46ba172 (patch)
tree7ccac90f55268bec960102d3233ec78168dc41cd /gtk2_ardour/keyeditor.cc
parent405fda66f708e61a933d88a3889916b6488cd9da (diff)
hacked up incomplete use of print-key-bindings-as-html
Diffstat (limited to 'gtk2_ardour/keyeditor.cc')
-rw-r--r--gtk2_ardour/keyeditor.cc23
1 files changed, 23 insertions, 0 deletions
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 <map>
+#include <fstream>
#include <boost/algorithm/string.hpp>
@@ -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 ("<span size=\"large\" weight=\"bold\">%1</span>", _("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);
+}