After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 601852 - Search window context menus rework
Search window context menus rework
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
git master
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2009-11-13 23:31 UTC by Aurimas Černius
Modified: 2011-05-20 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch, implementing new feature proposed. (2.42 KB, patch)
2009-11-13 23:31 UTC, Aurimas Černius
none Details | Review
Better solution: always available item, dealing with notebooks (1.62 KB, patch)
2009-11-26 21:46 UTC, Aurimas Černius
none Details | Review
Rework of both context menus (4.32 KB, patch)
2009-12-11 18:01 UTC, Aurimas Černius
none Details | Review
Update of previous with small modifications (4.01 KB, patch)
2010-07-30 22:31 UTC, Aurimas Černius
none Details | Review

Description Aurimas Černius 2009-11-13 23:31:04 UTC
Created attachment 147700 [details] [review]
Patch, implementing new feature proposed.

A patch, that lets create new note from context menu in notes list.
Currently only editing end deleting is possible. Ability to create new note from the same context menu seems natural to me.
Comment 1 Debarshi Ray 2009-11-26 13:05:08 UTC
Why did you remove the following lines in your patch? Typo?

-    // 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;
Comment 2 Aurimas Černius 2009-11-26 19:31:17 UTC
These lines allow context menu only when right click is done on a row in notes list. New note should be available even when notes list is empty, that's the reason for removal.

BTW, I think this patch can be improved: when a notebook is selected, any new note should be created in that notebook. Right now, when you create new note using window menu (or context menu, implemented in this patch), new note is not assigned to notebook, which seems a bit confusing to me. Don't you think so?
Comment 3 Debarshi Ray 2009-11-26 20:07:53 UTC
(In reply to comment #2)
> These lines allow context menu only when right click is done on a row in notes
> list. New note should be available even when notes list is empty, that's the
> reason for removal.

I see.
 
> BTW, I think this patch can be improved: when a notebook is selected, any new
> note should be created in that notebook. Right now, when you create new note
> using window menu (or context menu, implemented in this patch), new note is not
> assigned to notebook, which seems a bit confusing to me. Don't you think so?

There are two context menus -- one each for the right and left panes. If you use the menu on the left pane with a notebook selected, you can create a note and it will be in the selected notebook. Maybe you can see how it is done for your patch.
Comment 4 Aurimas Černius 2009-11-26 20:21:42 UTC
(In reply to comment #3)
> > BTW, I think this patch can be improved: when a notebook is selected, any new
> > note should be created in that notebook. Right now, when you create new note
> > using window menu (or context menu, implemented in this patch), new note is not
> > assigned to notebook, which seems a bit confusing to me. Don't you think so?
> 
> There are two context menus -- one each for the right and left panes. If you
> use the menu on the left pane with a notebook selected, you can create a note
> and it will be in the selected notebook. Maybe you can see how it is done for
> your patch.


It looks like using NewNotebookNoteAction in place of NewNoteAction should do it. I'll try it.
Comment 5 Aurimas Černius 2009-11-26 21:46:50 UTC
Created attachment 148553 [details] [review]
Better solution: always available item, dealing with notebooks

-Add new note to selected notebook (if any).
-Action is always enabled (no reason to disable it).
Comment 6 Debarshi Ray 2009-11-26 23:39:04 UTC
Actually I was expecting a behaviour more aligned towards that of the context menus for the notebooks. When right clicked over notebook names it lets you create a new note but not a new notebook, while clicking outside lets you add a new notebook. We can have something similar for the right panel too. When right clicked over notes and a note is already selected using left click, allow only open and delete. In all other cases allow only new notes to be created.

You can look at the notebook code in src/notebooks/ and src/recentchanges.cpp. They use two separate context menus.
Comment 7 Aurimas Černius 2009-11-27 09:35:36 UTC
(In reply to comment #6)
> Actually I was expecting a behaviour more aligned towards that of the context
> menus for the notebooks. When right clicked over notebook names it lets you
> create a new note but not a new notebook, while clicking outside lets you add a
> new notebook. We can have something similar for the right panel too. When right
> clicked over notes and a note is already selected using left click, allow only
> open and delete. In all other cases allow only new notes to be created.


That has a problem: if you have enough notebooks to fill the notebook list, you can not create new notebook from context menu anymore. Notes list is much more likely to become full. Maybe it's notebooks list needs a fix?
Also, right click on note doesn't select it, while context menu works on a selection. This seems to be related with the fact, that notebooks list is single-select, while notes list is multi-select.
Comment 8 Aurimas Černius 2009-12-11 18:01:32 UTC
Created attachment 149597 [details] [review]
Rework of both context menus

New solution: rework of both bontext menus:

* 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.
* Both context menus (from above) are divided into 2 parts using
separator: above separater are items, related to selection, below
it - items, related to entire pane.
Comment 9 Aurimas Černius 2010-07-30 22:31:35 UTC
Created attachment 166862 [details] [review]
Update of previous with small modifications

Updated the patch to apply for current code.
A change is, that "New Note" menu item to notes list is now added by NotebookApplicationAddin.
Comment 10 Aurimas Černius 2011-05-20 20:02:08 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.