[gnote] NotebookNoteAddin select notebook fix
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] NotebookNoteAddin select notebook fix
- Date: Thu, 23 Dec 2010 22:25:53 +0000 (UTC)
commit 47431bf21efc1e8cb5fc22103bda9de789fafc1e
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date: Fri Dec 24 00:17:10 2010 +0200
NotebookNoteAddin select notebook fix
select notebook after creating notebook list, instead of each item
deciding by itself.
Fixes Bug 585048.
src/notebooks/notebookmenuitem.cpp | 14 --------------
src/notebooks/notebooknoteaddin.cpp | 7 +++++++
2 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/src/notebooks/notebookmenuitem.cpp b/src/notebooks/notebookmenuitem.cpp
index b68df9d..34f2a88 100644
--- a/src/notebooks/notebookmenuitem.cpp
+++ b/src/notebooks/notebookmenuitem.cpp
@@ -35,20 +35,6 @@ namespace gnote {
, m_note(note)
, m_notebook(notebook)
{
- if (!notebook) {
- // This is for the "No notebook" menu item
-
- // Check to see if the specified note belongs
- // to a notebook. If so, don't activate the
- // radio button.
- if (!NotebookManager::instance().get_notebook_from_note (note)) {
- set_active(true);
- }
- }
- else if (notebook->contains_note (note)) {
- set_active(true);
- }
-
signal_activate().connect(sigc::mem_fun(*this, &NotebookMenuItem::on_activated));
}
diff --git a/src/notebooks/notebooknoteaddin.cpp b/src/notebooks/notebooknoteaddin.cpp
index ddc3c84..ebbfc91 100644
--- a/src/notebooks/notebooknoteaddin.cpp
+++ b/src/notebooks/notebooknoteaddin.cpp
@@ -201,6 +201,9 @@ namespace notebooks {
noNotebookMenuItem->show_all ();
m_menu->append (*noNotebookMenuItem);
m_menu_items.push_back(noNotebookMenuItem);
+
+ NotebookMenuItem *active_menu_item = noNotebookMenuItem;
+ Notebook::Ptr current_notebook = NotebookManager::instance().get_notebook_from_note(get_note());
// Add in all the real notebooks
std::list<NotebookMenuItem*> notebookMenuItems;
@@ -217,8 +220,12 @@ namespace notebooks {
item->show_all ();
m_menu->append (*item);
m_menu_items.push_back(item);
+ if(current_notebook == item->get_notebook())
+ active_menu_item = item;
}
}
+
+ active_menu_item->set_active(true);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]