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 306127 - Paste menu sensitivity isn't set correctly for the notes sidepane
Paste menu sensitivity isn't set correctly for the notes sidepane
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: [obsolete] Sidebar Panel: (Other)
2.11.x
Other All
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-01 09:41 UTC by Paolo Borelli
Modified: 2005-06-23 16:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Proposed patch (against HEAD). (8.59 KB, patch)
2005-06-02 13:43 UTC, Christian Neumair
committed Details | Review

Description Paolo Borelli 2005-06-01 09:41:48 UTC
- Copy some text
- Open a nautilus anvigational window with the notes sidepane on
- Focus the note sidepane
- The Edit->Paste menu item from the menu bar is insensitive

(note that the paste item in context menu is sensitive and you can paste with
Ctrl+V)
Comment 1 Christian Neumair 2005-06-01 09:47:11 UTC
Thank you for your bug report!
This is due to the fact that the NautilusClipboard text view setup function
doesn't setup clipboard tracking for the note sidepane GtkTextView. We might
want to copy over some code from gedit to achieve this.
Comment 2 Paolo Borelli 2005-06-01 09:52:16 UTC
Heh... pretty ironic that I filed this because after adding a sidepane to gedit
we have run in similar problems so we tried out nautilus to see if stuff worked
there and noticed the bug :-)
Comment 3 Christian Neumair 2005-06-01 10:25:39 UTC
Hehe...I've not yet investigated the issue closely but I would guess that we
have to connect to some signals of the underlying GtkTextBuffer and refresh the
sensitivity information when they are emitted. "changed" might be appropriate,
although I don't know whether it is also emitted for selection changes. There is
also "end-user-action" and "begin-user-action", "modified-changed" and some
insert/remove signals. The GTK+ documentation on these signals sucks, we should
update it atfer figuring out how to do it.
Comment 4 Christian Neumair 2005-06-02 12:14:52 UTC
OK, here is how it works: connect to the "mark-set" signal of the buffer
associated with the text view. In the callback, check whether it matches
gtk_text_buffer_get_selection_bound and if it does match, update the sensitivity
of cut/paste. It should be sensitive if gtk_text_buffer_get_selection_bounds
returns TRUE.
Comment 5 Christian Neumair 2005-06-02 12:58:54 UTC
Nah, I was wrong. You should only check for the mark name not being NULL instead
of comparing it with gtk_text_buffer_get_selection_bound.
Comment 6 Christian Neumair 2005-06-02 13:43:30 UTC
Created attachment 47139 [details] [review]
Proposed patch (against HEAD).

Paolo: The important part of the patch (for gedit) is the connection to the
"mark-set" and the "delete-range" callback. The former reacts on selection
changes (combined with the != NULL check in the callback), while the latter
listens for selection deletion.
Comment 7 Christian Neumair 2005-06-23 16:42:11 UTC
I've committed the attached patch (approval under [1]). Thanks for your efforts.

[1] http://mail.gnome.org/archives/nautilus-list/2005-June/msg00047.html