hacked up incomplete use of print-key-bindings-as-html
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 21 May 2016 13:30:24 +0000 (09:30 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:44 +0000 (15:30 -0400)
gtk2_ardour/keyeditor.cc
gtk2_ardour/keyeditor.h

index ce066efd7012aead1c6e8893ec0a52449221935b..fc69d89e2867d171de432ef11da384e764c909c2 100644 (file)
@@ -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);
+}
index 5e15368069f0661ccfff7babde23613082d3a321..a5662333ce2e5e2a115a47fe68c563595bba6d20 100644 (file)
@@ -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__ */