[gtkmm] Application: Add set_accel_for_action().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Application: Add set_accel_for_action().
- Date: Tue, 18 Mar 2014 11:36:54 +0000 (UTC)
commit 4b6f8ec937704933b2eb4c12e916664fe48e70d7
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Mar 18 12:32:16 2014 +0100
Application: Add set_accel_for_action().
* gtk/src/application.[hg|ccg]: So we don't need to create
a vector for just one accel.
gtk/src/application.ccg | 6 ++++++
gtk/src/application.hg | 16 +++++++++++++++-
2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/gtk/src/application.ccg b/gtk/src/application.ccg
index 4498ed8..62707ea 100644
--- a/gtk/src/application.ccg
+++ b/gtk/src/application.ccg
@@ -175,5 +175,11 @@ void Application::on_activate_add_and_show_main_window(Window* window)
}
}
+void Application::set_accel_for_action(const Glib::ustring& detailed_action_name, const Glib::ustring& accel)
+{
+ std::vector<Glib::ustring> vec;
+ vec.push_back(accel);
+ set_accels_for_action(detailed_action_name, vec);
+}
} // namespace Gtk
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 01af134..f1f17fd 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -323,10 +323,24 @@ public:
#m4
_CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3,
Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> get_accels_for_action(const Glib::ustring& detailed_action_name)
const, gtk_application_get_accels_for_action)
-//TODO: Add one to set just one accel:
#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const
gchar*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
_WRAP_METHOD(void set_accels_for_action(const Glib::ustring& detailed_action_name, const
std::vector<Glib::ustring>& ccels), gtk_application_set_accels_for_action)
+ //TODO: Add unset_accels_for_action().
+ //See https://bugzilla.gnome.org/show_bug.cgi?id=726623
+
+ /** Sets a keyboard accelerator that will trigger the
+ * given action. It will be the primary
+ * accelerator, which may be displayed in the UI.
+ *
+ * @param detailed_action_name A detailed action name, specifying an action
+ * and target to associate accelerators with.
+ * @param accels An accelerator in the format understood by gtk_accelerator_parse().
+ *
+ * @newin{3,12}
+ */
+ void set_accel_for_action(const Glib::ustring& detailed_action_name, const Glib::ustring& accel);
+
_WRAP_PROPERTY("app-menu", Glib::RefPtr<Gio::MenuModel>)
_WRAP_PROPERTY("menubar", Glib::RefPtr<Gio::MenuModel>)
_WRAP_PROPERTY("register-session", bool)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]