[gnote] Remove app menu
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove app menu
- Date: Sun, 11 Nov 2018 15:36:41 +0000 (UTC)
commit 8e89ed2d09a56b9a1069c34c03fbda0c6711cea2
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Nov 11 17:35:35 2018 +0200
Remove app menu
src/actionmanager.cpp | 45 ---------------------------------------------
src/actionmanager.hpp | 1 -
src/gnote.cpp | 7 -------
src/gnote.hpp | 1 -
4 files changed, 54 deletions(-)
---
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 82939d62..1add3119 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -140,51 +140,6 @@ namespace gnote {
add_app_menu_item(APP_ACTION_LAST, 200, _("_About Gnote"), "app.about");
}
- Glib::RefPtr<Gio::Menu> ActionManager::get_app_menu() const
- {
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
-
- int pos = 0;
- Glib::RefPtr<Gio::Menu> section = make_app_menu_section(APP_ACTION_NEW);
- if(section) {
- menu->insert_section(pos++, section);
- }
-
- section = make_app_menu_section(APP_ACTION_MANAGE);
- if(section) {
- menu->insert_section(pos++, section);
- }
-
- section = make_app_menu_section(APP_ACTION_LAST);
- if(section) {
- menu->insert_section(pos++, section);
- }
-
- return menu;
- }
-
- Glib::RefPtr<Gio::Menu> ActionManager::make_app_menu_section(int sec) const
- {
- std::pair<AppMenuItemMultiMap::const_iterator, AppMenuItemMultiMap::const_iterator>
- range = m_app_menu_items.equal_range(sec);
-
- Glib::RefPtr<Gio::Menu> section;
- if(range.first != m_app_menu_items.end()) {
- std::vector<const AppMenuItem*> menu_items;
- for(AppMenuItemMultiMap::const_iterator iter = range.first; iter != range.second; ++iter) {
- menu_items.push_back(&iter->second);
- }
- std::sort(menu_items.begin(), menu_items.end(), AppMenuItem::ptr_comparator());
-
- section = Gio::Menu::create();
- for(std::vector<const AppMenuItem*>::iterator iter = menu_items.begin(); iter != menu_items.end();
++iter) {
- section->append((*iter)->label, (*iter)->action_def);
- }
- }
-
- return section;
- }
-
void ActionManager::register_main_window_action(const Glib::ustring & action, const Glib::VariantType
*state_type, bool modifying)
{
if(m_main_window_actions.find(action) == m_main_window_actions.end()) {
diff --git a/src/actionmanager.hpp b/src/actionmanager.hpp
index 4421e143..c9715203 100644
--- a/src/actionmanager.hpp
+++ b/src/actionmanager.hpp
@@ -47,7 +47,6 @@ public:
virtual Glib::RefPtr<Gio::SimpleAction> add_app_action(const Glib::ustring & name) override;
virtual void add_app_menu_item(int section, int order, const Glib::ustring & label,
const Glib::ustring & action_def) override;
- Glib::RefPtr<Gio::Menu> get_app_menu() const;
virtual void register_main_window_action(const Glib::ustring & action, const Glib::VariantType *state_type,
bool modifying = true) override;
virtual std::map<Glib::ustring, const Glib::VariantType*> get_main_window_actions() const override;
diff --git a/src/gnote.cpp b/src/gnote.cpp
index 1095c4e2..bc647123 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -184,7 +184,6 @@ namespace gnote {
}
make_app_actions();
- make_app_menu();
if(is_background()) {
// do not exit when all windows are closed
hold();
@@ -491,12 +490,6 @@ namespace gnote {
}
- void Gnote::make_app_menu()
- {
- set_app_menu(static_cast<ActionManager &>(IActionManager::obj()).get_app_menu());
- }
-
-
GnoteCommandLine::GnoteCommandLine()
: m_context(g_option_context_new("Foobar"))
, m_use_panel(false)
diff --git a/src/gnote.hpp b/src/gnote.hpp
index 0b707269..b4d67baa 100644
--- a/src/gnote.hpp
+++ b/src/gnote.hpp
@@ -148,7 +148,6 @@ private:
void on_main_window_closed(Gtk::Window*);
void make_app_actions();
void add_app_actions(const std::vector<Glib::RefPtr<Gio::SimpleAction> > & actions);
- void make_app_menu();
void on_new_window_action(const Glib::VariantBase&);
void on_new_note_app_action(const Glib::VariantBase&);
void on_show_help_shortcust_action(const Glib::VariantBase&);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]