[gnote/stable-0.7] Search window context menus rework
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote/stable-0.7] Search window context menus rework
- Date: Fri, 20 May 2011 20:00:21 +0000 (UTC)
commit 70540c6e74f886e83b214e2d7a5607abc4486316
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date: Fri May 20 22:49:20 2011 +0300
Search window context menus rework
* Use only one context menu in notebooks list, because the second
is not always available (when there are a lot of notebooks, you
can not click on empty place, also, it is not possible to press
the context menu key on empty place). "New notebook" item has been
added to the first context menu, while the second is removed.
* Added "new note" item to notes list context menu.
Fixes bug 601852.
src/notebooks/notebookapplicationaddin.cpp | 12 +++++++++---
src/recentchanges.cpp | 27 +++------------------------
2 files changed, 12 insertions(+), 27 deletions(-)
---
diff --git a/src/notebooks/notebookapplicationaddin.cpp b/src/notebooks/notebookapplicationaddin.cpp
index ae307d3..a8081c4 100644
--- a/src/notebooks/notebookapplicationaddin.cpp
+++ b/src/notebooks/notebookapplicationaddin.cpp
@@ -73,13 +73,19 @@ namespace gnote {
" </placeholder>"
" </menu>"
" </menubar>"
+ " <popup name='MainWindowContextMenu' action='MainWindowContextMenuAction'>"
+ " <menuitem name='OpenNote' action='OpenNoteAction' />"
+ " <menuitem name='DeleteNote' action='DeleteNoteAction' />"
+ " <placeholder name='MainWindowContextMenuPlaceholder'>"
+ " <separator />"
+ " <menuitem name='NewNote' action='NewNotebookNoteAction' />"
+ " </placeholder>"
+ " </popup>"
" <popup name='NotebooksTreeContextMenu' action='NotebooksTreeContextMenuAction'>"
" <menuitem name='NewNotebookNote' action='NewNotebookNoteAction' />"
- " <separator />"
" <menuitem name='OpenNotebookTemplateNote' action='OpenNotebookTemplateNoteAction' />"
" <menuitem name='DeleteNotebook' action='DeleteNotebookAction' />"
- " </popup>"
- " <popup name='NotebooksTreeNoRowContextMenu' action='NotebooksTreeNoRowContextMenuAction'>"
+ " <separator />"
" <menuitem name='NewNotebook' action='NewNotebookAction' />"
" </popup>"
" <popup name='TrayIconMenu' action='TrayIconMenuAction'>"
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 7be73a2..a0cc8e3 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -803,12 +803,7 @@ namespace gnote {
m_tree->get_path_at_pos (ev->x, ev->y,
dest_path, column, unused, unused);
- // we need to test gobj() isn't NULL.
- // See Gtkmm bug 586437
- // https://bugzilla.gnome.org/show_bug.cgi?id=586437
- if (dest_path.empty() || !dest_path.gobj())
- return false;
-
+
m_clickX = ev->x;
m_clickY = ev->y;
@@ -1485,26 +1480,10 @@ namespace gnote {
notebooks::Notebook::Ptr notebook = get_selected_notebook ();
if (!notebook)
return true; // Don't pop open a submenu
-
- bool rowClicked = true;
- if (m_notebooksTree->get_path_at_pos (ev->x, ev->y, p, col, cell_x, cell_y) == false) {
- rowClicked = false;
- }
- if (selection->count_selected_rows () == 0) {
- rowClicked = false;
- }
+ Gtk::Menu *menu = dynamic_cast<Gtk::Menu*>(ActionManager::obj().get_widget (
+ "/NotebooksTreeContextMenu"));
- Gtk::Menu *menu = NULL;
- if (rowClicked) {
- menu = dynamic_cast<Gtk::Menu*>(ActionManager::obj().get_widget (
- "/NotebooksTreeContextMenu"));
- }
- else {
- menu = dynamic_cast<Gtk::Menu*>(ActionManager::obj().get_widget (
- "/NotebooksTreeNoRowContextMenu"));
- }
-
popup_context_menu_at_location (menu,
ev->x, ev->y);
return true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]