[gnote] Centralize note action constants
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Centralize note action constants
- Date: Sun, 20 Oct 2013 18:20:56 +0000 (UTC)
commit 1f1b3c44736a091adba9ebe94d68b0d3a9790bc7
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Oct 20 18:03:24 2013 +0300
Centralize note action constants
src/addins/backlinks/backlinksnoteaddin.cpp | 3 ++-
src/addins/exporttohtml/exporttohtmlnoteaddin.cpp | 3 ++-
.../inserttimestamp/inserttimestampnoteaddin.cpp | 3 ++-
src/addins/printnotes/printnotesnoteaddin.cpp | 3 ++-
src/addins/readonly/readonlynoteaddin.cpp | 3 ++-
src/addins/replacetitle/replacetitlenoteaddin.cpp | 3 ++-
.../tableofcontents/tableofcontentsnoteaddin.cpp | 3 ++-
src/iactionmanager.hpp | 10 ++++++++++
8 files changed, 24 insertions(+), 7 deletions(-)
---
diff --git a/src/addins/backlinks/backlinksnoteaddin.cpp b/src/addins/backlinks/backlinksnoteaddin.cpp
index aa30651..52255ad 100644
--- a/src/addins/backlinks/backlinksnoteaddin.cpp
+++ b/src/addins/backlinks/backlinksnoteaddin.cpp
@@ -23,6 +23,7 @@
#include "sharp/string.hpp"
#include "backlinksnoteaddin.hpp"
#include "backlinkmenuitem.hpp"
+#include "iactionmanager.hpp"
#include "notemanager.hpp"
#include "utils.hpp"
@@ -54,7 +55,7 @@ void BacklinksNoteAddin::on_note_opened ()
{
Glib::RefPtr<Gtk::Action> action = BacklinkAction::create(
sigc::mem_fun(*this, &BacklinksNoteAddin::update_menu));
- add_note_action(action, 100);
+ add_note_action(action, gnote::BACKLINKS_ORDER);
}
void BacklinksNoteAddin::update_menu(Gtk::Menu *menu)
diff --git a/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
b/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
index 6f3b5fd..404a05e 100644
--- a/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
+++ b/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
@@ -34,6 +34,7 @@
#include "sharp/uri.hpp"
#include "sharp/xsltargumentlist.hpp"
#include "debug.hpp"
+#include "iactionmanager.hpp"
#include "preferences.hpp"
#include "notewindow.hpp"
#include "utils.hpp"
@@ -76,7 +77,7 @@ void ExportToHtmlNoteAddin::on_note_opened()
_("Export note to HTML"));
action->signal_activate().connect(
sigc::mem_fun(*this, &ExportToHtmlNoteAddin::export_button_clicked));
- add_note_action(action, 200);
+ add_note_action(action, gnote::EXPORT_TO_HTML_ORDER);
}
diff --git a/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
b/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
index b4cf23d..ce7f1bd 100644
--- a/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
+++ b/src/addins/inserttimestamp/inserttimestampnoteaddin.cpp
@@ -23,6 +23,7 @@
#include <glibmm/i18n.h>
#include "sharp/datetime.hpp"
+#include "iactionmanager.hpp"
#include "inserttimestamppreferences.hpp"
#include "inserttimestamppreferencesfactory.hpp"
#include "inserttimestampnoteaddin.hpp"
@@ -81,7 +82,7 @@ namespace inserttimestamp {
Glib::RefPtr<Gtk::Action> action = InsertTimestampAction::create(get_window());
action->signal_activate().connect(
sigc::mem_fun(*this, &InsertTimestampNoteAddin::on_menu_item_activated));
- add_note_action(action, 300);
+ add_note_action(action, gnote::INSERT_TIMESTAMP_ORDER);
Glib::RefPtr<Gio::Settings> settings =
gnote::Preferences::obj().get_schema_settings(SCHEMA_INSERT_TIMESTAMP);
m_date_format = settings->get_string(INSERT_TIMESTAMP_FORMAT);
diff --git a/src/addins/printnotes/printnotesnoteaddin.cpp b/src/addins/printnotes/printnotesnoteaddin.cpp
index e3b2c0d..e8ece20 100644
--- a/src/addins/printnotes/printnotesnoteaddin.cpp
+++ b/src/addins/printnotes/printnotesnoteaddin.cpp
@@ -30,6 +30,7 @@
#include "sharp/datetime.hpp"
#include "debug.hpp"
+#include "iactionmanager.hpp"
#include "notetag.hpp"
#include "notewindow.hpp"
#include "printnotesnoteaddin.hpp"
@@ -86,7 +87,7 @@ namespace printnotes {
Glib::RefPtr<Gtk::Action> action = PrintNotesAction::create(get_window());
action->signal_activate().connect(
sigc::mem_fun(*this, &PrintNotesNoteAddin::print_button_clicked));
- add_note_action(action, 400);
+ add_note_action(action, gnote::PRINT_ORDER);
}
diff --git a/src/addins/readonly/readonlynoteaddin.cpp b/src/addins/readonly/readonlynoteaddin.cpp
index c562c93..0f8e24d 100644
--- a/src/addins/readonly/readonlynoteaddin.cpp
+++ b/src/addins/readonly/readonlynoteaddin.cpp
@@ -21,6 +21,7 @@
#include <glibmm/i18n.h>
#include <gtkmm/checkmenuitem.h>
+#include "iactionmanager.hpp"
#include "itagmanager.hpp"
#include "notewindow.hpp"
#include "readonlynoteaddin.hpp"
@@ -103,7 +104,7 @@ void ReadOnlyNoteAddin::shutdown()
void ReadOnlyNoteAddin::on_note_opened()
{
m_action = ReadOnlyAction::create();
- add_note_action(m_action, 700);
+ add_note_action(m_action, gnote::READ_ONLY_ORDER);
m_action->signal_activate().connect(
sigc::mem_fun(*this, &ReadOnlyNoteAddin::on_menu_item_toggled));
diff --git a/src/addins/replacetitle/replacetitlenoteaddin.cpp
b/src/addins/replacetitle/replacetitlenoteaddin.cpp
index 01101fb..63d8875 100644
--- a/src/addins/replacetitle/replacetitlenoteaddin.cpp
+++ b/src/addins/replacetitle/replacetitlenoteaddin.cpp
@@ -21,6 +21,7 @@
#include <gtkmm/stock.h>
#include <gtkmm/clipboard.h>
+#include "iactionmanager.hpp"
#include "notewindow.hpp"
#include "replacetitlenoteaddin.hpp"
#include "sharp/string.hpp"
@@ -75,7 +76,7 @@ void ReplaceTitleNoteAddin::on_note_opened()
Glib::RefPtr<Gtk::Action> action = ReplaceTitleAction::create(get_window());
action->signal_activate().connect(
sigc::mem_fun(*this, &ReplaceTitleNoteAddin::replacetitle_button_clicked));
- add_note_action(action, 500);
+ add_note_action(action, gnote::REPLACE_TITLE_ORDER);
}
void ReplaceTitleNoteAddin::replacetitle_button_clicked()
diff --git a/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
b/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
index 4e762e5..7e890d6 100644
--- a/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
+++ b/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
@@ -28,6 +28,7 @@
#include "sharp/string.hpp"
+#include "iactionmanager.hpp"
#include "notemanager.hpp"
#include "notewindow.hpp"
#include "notebuffer.hpp"
@@ -83,7 +84,7 @@ void TableofcontentsNoteAddin::on_note_opened ()
Glib::RefPtr<Gtk::Action> action = TableofcontentsAction::create(
sigc::mem_fun(*this, &TableofcontentsNoteAddin::update_menu));
- add_note_action(action, 600);
+ add_note_action(action, gnote::TABLE_OF_CONTENTS_ORDER);
// Reacts to key press events
get_note()->get_window()->signal_key_press_event().connect(
diff --git a/src/iactionmanager.hpp b/src/iactionmanager.hpp
index d4f108c..019bdfe 100644
--- a/src/iactionmanager.hpp
+++ b/src/iactionmanager.hpp
@@ -29,6 +29,16 @@
namespace gnote {
+enum NoteActionOrder {
+ BACKLINKS_ORDER = 100,
+ EXPORT_TO_HTML_ORDER = 200,
+ INSERT_TIMESTAMP_ORDER = 300,
+ PRINT_ORDER = 400,
+ REPLACE_TITLE_ORDER = 500,
+ TABLE_OF_CONTENTS_ORDER = 600,
+ READ_ONLY_ORDER = 700,
+};
+
class IActionManager
: public base::Singleton<IActionManager>
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]