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 688756 - can't copy text
can't copy text
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
: 698583 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-20 21:08 UTC by Andreas Nilsson
Modified: 2013-04-22 18:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add "Copy to the Clipboard" functionality (3.02 KB, patch)
2013-02-01 07:19 UTC, Fabiano Fidêncio
reviewed Details | Review
Add "Copy to the Clipboard" functionality (2.87 KB, patch)
2013-03-28 15:39 UTC, Fabiano Fidêncio
needs-work Details | Review
Add "Copy to the Clipboard" functionality (5.13 KB, patch)
2013-03-28 20:36 UTC, Fabiano Fidêncio
none Details | Review
Add "Copy to the Clipboard" functionality (5.29 KB, patch)
2013-03-28 22:02 UTC, Fabiano Fidêncio
committed Details | Review

Description Andreas Nilsson 2012-11-20 21:08:26 UTC
Seems possible to select text, but not to copy it.
Comment 1 Fabiano Fidêncio 2013-02-01 07:19:30 UTC
Created attachment 234951 [details] [review]
Add "Copy to the Clipboard" functionality
Comment 2 Cosimo Cecchi 2013-02-03 14:23:13 UTC
Review of attachment 234951 [details] [review]:

Thanks for the patch. Code here looks good, but I'm not 100% sure about the placement of the Copy action though. It would probably be better in a contextual menu, even though a menu with only one action might look a bit odd right now. Jon, what do you think?
Comment 3 Cosimo Cecchi 2013-02-22 21:31:05 UTC
Hey Fabiano, I talked with Jon about this today and we settled on a contextual menu for this.
The menu right now would only have the Copy action - in the future we might also want to expose an action that bookmarks/annotates the current selection.
Comment 4 Cosimo Cecchi 2013-03-27 18:50:35 UTC
Fabiano, any chance you can make an updated patch for this?
Comment 5 Fabiano Fidêncio 2013-03-28 15:39:36 UTC
Created attachment 240064 [details] [review]
Add "Copy to the Clipboard" functionality
Comment 6 Cosimo Cecchi 2013-03-28 16:17:07 UTC
Review of attachment 240064 [details] [review]:

Thanks for the patch; I have a comment on the approach below:

::: src/preview.js
@@ +337,3 @@
 
+    _createPopupMenu: function() {
+        this._popupMenu = new Gtk.Menu();

Instead of creating the GtkMenuItem manually and connecting to activate, you could make a preview-context-menu.ui file in src/resources, load it here with gtk_menu_new_from_model().
That would automatically work with the action activation callback you install above.
Comment 7 Fabiano Fidêncio 2013-03-28 20:36:04 UTC
(In reply to comment #6)
> Review of attachment 240064 [details] [review]:
> 
> Thanks for the patch; I have a comment on the approach below:
> 
> ::: src/preview.js
> @@ +337,3 @@
> 
> +    _createPopupMenu: function() {
> +        this._popupMenu = new Gtk.Menu();
> 
> Instead of creating the GtkMenuItem manually and connecting to activate, you
> could make a preview-context-menu.ui file in src/resources, load it here with
> gtk_menu_new_from_model().
> That would automatically work with the action activation callback you install
> above.

Cosimo,

For some reason that I didn't realize, the "Copy" menu item is not enabled.
Could you take a look and point me what I am missing?
Comment 8 Fabiano Fidêncio 2013-03-28 20:36:23 UTC
Created attachment 240082 [details] [review]
Add "Copy to the Clipboard" functionality
Comment 9 Fabiano Fidêncio 2013-03-28 22:02:07 UTC
Created attachment 240087 [details] [review]
Add "Copy to the Clipboard" functionality
Comment 10 Cosimo Cecchi 2013-04-04 17:49:37 UTC
Attachment 240087 [details] pushed as f9364e4 - Add "Copy to the Clipboard" functionality

The patch was only missing a call to gtk_menu_attach_to_widget(), which is necessary for gtk_menu_new_from_model() to work...
Quoting from the docs:
"The created menu items are connected to actions found in the GtkApplicationWindow to which the menu belongs - typically by means of being attached to a widget (see gtk_menu_attach_to_widget()) that is contained within the GtkApplicationWindows widget hierarchy."

I made that change and pushed the patch to master, thanks Fabiano!
Comment 11 Cosimo Cecchi 2013-04-22 18:37:30 UTC
*** Bug 698583 has been marked as a duplicate of this bug. ***