sugarlabs / write-activity

A simple word processor for the Sugar learning environment
GNU General Public License v2.0
2 stars 25 forks source link

Add unformatted paste button #8

Closed erilyth closed 8 years ago

erilyth commented 8 years ago

Links and formatted text will be pasted using paste_special from AbiWord. However for images it would do the same thing as a normal paste would do. Currently the widget on the toolbar is the same as the paste button. (If this is fine I will also add another icon for paste unformatted and link this button to that and make a PR)

samdroid-apps commented 8 years ago

Reviewed.

I believe that you should change the icon from normal paste and also change the palette/tooltip so that the buttons are not identical.

Please don't use Ctrl-B as a shortcut, as that is already bold.

I was unable to use the button to do anything when testing (although I was unable to use the normal paste button). There was nothing of interest in the logs. This may be due to me running unstable fedora rawhide.

erilyth commented 8 years ago

Changed the shortcut to Ctrl-F since nothing else was using it, if you have any other preferred shortcut, Ill change it to that.

Added an icon and set its tooltip as specified.

godiard commented 8 years ago

I don't understand what is the objective of this patch. What is different when you "Paste special" instead of "Paste"? In what cases? Other than that, the code duplicate all the image management from __paste_button_cb() and that is a bad idea. If needed, move the code to a separated method and call from the two callback methods

erilyth commented 8 years ago

The paste special pastes text without formatting. The 'Paste Unformatted' option on http://www.abisource.com/help/en-US/interface/menucontextual.html is what uses the paste special call to paste. I realized that this works for images as well, so no need to use the code from paste itself for images.

erilyth commented 8 years ago

Removed unnecessary image management code .

godiard commented 8 years ago

@erilyth , this not reply my question. When should a kid use this button? What is the use case? What bug or limitation solve? I try to keep the activity so simple as possible, that means do not add options if are not really needed (if not we end with a full text editor like abiword or libreoffice, and that already exist)

erilyth commented 8 years ago

The use for this button might be if the font is styled (font size, bold, italics etc) or if its a link etc, they would be converted to standard font all of the same size when pasted. So copying and pasting from online etc, with this unformatted option would give you the content of the copy in a basic standard font and font size.

@godiard This was a gci task that I saw when I was getting introduced to sugarlabs, I was adviced to do this to get started with sugarlabs https://codein.withgoogle.com/tasks/5455686636929024/?sp-status=2&sp-is_exhausted=False&sp-page=1

But yes, I think you are right, this kind of a button for kids would make the editor more difficult to use, but maybe adults/high school students might find this useful

godiard commented 8 years ago

@erilyth, ok gsoc approal is on @samdroid-apps hands, even if is not included in the activity

erilyth commented 8 years ago

@godiard, I wasn't doing this for gci though, just to get familiar with sugar. So if its not needed for the activity, then lets close the PR.