summaryrefslogtreecommitdiff
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
parent405fda66f708e61a933d88a3889916b6488cd9da (diff)
hacked up incomplete use of print-key-bindings-as-html
-rw-r--r--gtk2_ardour/keyeditor.cc23
-rw-r--r--gtk2_ardour/keyeditor.h2
2 files changed, 25 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);
+}
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<Tab*> 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__ */