[gnote] Allow to add custom MainWindowAction to ActionManager



commit a4a040c94dbcbf2f4aa4fd5a1bb0ff0f130e5771
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Dec 5 19:48:17 2015 +0200

    Allow to add custom MainWindowAction to ActionManager

 src/actionmanager.cpp |    7 +++++++
 src/actionmanager.hpp |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 0868125..e5e949f 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -219,6 +219,13 @@ namespace gnote {
     return section;
   }
 
+  void ActionManager::register_main_window_action(const MainWindowAction::Ptr & action)
+  {
+    if(find_main_window_action(action->get_name()) == 0) {
+      m_main_window_actions2.push_back(action);
+    }
+  }
+
   void ActionManager::register_main_window_action(const Glib::ustring & action)
   {
     if(find_main_window_action(action) == 0) {
diff --git a/src/actionmanager.hpp b/src/actionmanager.hpp
index 2925157..451cfa9 100644
--- a/src/actionmanager.hpp
+++ b/src/actionmanager.hpp
@@ -57,6 +57,7 @@ public:
   virtual void add_app_menu_item(int section, int order, const std::string & label,
                                  const std::string & action_def) override;
   Glib::RefPtr<Gio::Menu> get_app_menu() const;
+  virtual void register_main_window_action(const MainWindowAction::Ptr & action);
   virtual void register_main_window_action(const Glib::ustring & action) override;
   virtual std::vector<MainWindowAction::Ptr> get_main_window_actions() const override;
   virtual MainWindowAction::Ptr find_main_window_action(const Glib::ustring & name) const override;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]