tweak search path for export profiles
[ardour.git] / libs / gtkmm2ext / actions.cc
index 1145987764727669ffeec15612957033ff8b85d4..e9ff15fa461f263934cdac1b2ced7713f3920110 100644 (file)
@@ -21,6 +21,7 @@
 #include <vector>
 #include <string>
 #include <list>
+#include <stdint.h>
 
 #include <gtk/gtkaccelmap.h>
 #include <gtk/gtkuimanager.h>
@@ -32,6 +33,7 @@
 #include "pbd/error.h"
 
 #include "gtkmm2ext/actions.h"
+#include "gtkmm2ext/utils.h"
 
 #include "i18n.h"
 
@@ -40,6 +42,7 @@ using namespace Gtk;
 using namespace Glib;
 using namespace sigc;
 using namespace PBD;
+using namespace Gtkmm2ext;
 
 RefPtr<UIManager> ActionManager::ui_manager;
 string ActionManager::unbound_string = "--";
@@ -265,8 +268,10 @@ ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
 }
 
 void
-ActionManager::uncheck_toggleaction (const char * name)
+ActionManager::uncheck_toggleaction (string n)
 {
+       char const * name = n.c_str ();
+       
        const char *last_slash = strrchr (name, '/');
 
        if (last_slash == 0) {
@@ -294,3 +299,17 @@ ActionManager::uncheck_toggleaction (const char * name)
 
        delete [] group_name;
 }
+
+string
+ActionManager::get_key_representation (const string& accel_path, AccelKey& key)
+{
+       bool known = lookup_entry (accel_path, key);
+       
+       if (known) {
+               uint32_t k = possibly_translate_legal_accelerator_to_real_key (key.get_key());
+               key = AccelKey (k, Gdk::ModifierType (key.get_mod()));
+               return ui_manager->get_accel_group()->name (key.get_key(), Gdk::ModifierType (key.get_mod()));
+       } 
+       
+       return unbound_string;
+}