[gnote] Add new notebook application menu item
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Add new notebook application menu item
- Date: Sat, 13 Oct 2012 19:43:58 +0000 (UTC)
commit 6f346919d15724019dbdadb991409a6603a0217f
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Sat Oct 13 21:59:39 2012 +0300
Add new notebook application menu item
src/notebooks/notebookapplicationaddin.cpp | 11 +++++++++++
src/notebooks/notebookapplicationaddin.hpp | 2 ++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/notebooks/notebookapplicationaddin.cpp b/src/notebooks/notebookapplicationaddin.cpp
index f3ea860..1505e4d 100644
--- a/src/notebooks/notebookapplicationaddin.cpp
+++ b/src/notebooks/notebookapplicationaddin.cpp
@@ -170,6 +170,11 @@ namespace gnote {
sigc::mem_fun(*this, &NotebookApplicationAddin::on_note_added));
nm.signal_note_deleted.connect(
sigc::mem_fun(*this, &NotebookApplicationAddin::on_note_deleted));
+
+ am.add_app_action("new-notebook");
+ am.get_app_action("new-notebook")->signal_activate().connect(
+ sigc::mem_fun(*this, &NotebookApplicationAddin::on_new_notebook_action));
+ am.add_app_menu_item(ActionManager::APP_ACTION_NEW, 300, _("New Note_book"), "app.new-notebook");
m_initialized = true;
}
@@ -288,6 +293,12 @@ namespace gnote {
}
+ void NotebookApplicationAddin::on_new_notebook_action(const Glib::VariantBase&)
+ {
+ NotebookManager::prompt_create_new_notebook (NULL);
+ }
+
+
void NotebookApplicationAddin::on_tag_added(const Note & note, const Tag::Ptr& tag)
{
if (NotebookManager::instance().is_adding_notebook()) {
diff --git a/src/notebooks/notebookapplicationaddin.hpp b/src/notebooks/notebookapplicationaddin.hpp
index 0ffbe9b..44c808b 100644
--- a/src/notebooks/notebookapplicationaddin.hpp
+++ b/src/notebooks/notebookapplicationaddin.hpp
@@ -1,6 +1,7 @@
/*
* gnote
*
+ * Copyright (C) 2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -57,6 +58,7 @@ namespace gnote {
void on_tag_removed(const Note::Ptr&, const std::string&);
void on_note_added(const Note::Ptr &);
void on_note_deleted(const Note::Ptr &);
+ void on_new_notebook_action(const Glib::VariantBase&);
bool m_initialized;
guint m_notebookUi;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]