From: Alex G. <gs...@cs...> - 2006-08-29 10:12:06
|
---------- Forwarded Message ---------- Subject: Re: [Basket-devel] Copy-Pasting rich text Date: Tuesday 29 August 2006 11:59 From: sl...@li... To: "Alex Gontmakher" <gs...@cs...> Cc: sl...@li... Hi Alex, > I have started to handle one of the things that bothers me most: Copying > and pasting of text. What the current version does, is convert everything > to plain text, losing the formatting completely. Well, that's a pity, > since QTextEdit can support (most of) the formatting. Copy/pasting where and when? - In the editor? QTextEdit keeps HTML, isn't it? - In the basket? Notes are copied both in text/plain and text/html already! - From Konqueror? This application doesn't copy HTML from websites, it copies plain text, so BasKet Note Pads cannot paste HTML! - Elsewhere? > So, I have an initial implementation, you can find it in branch > http://basket.linux62.org/svn/basket/branches/gsasha-2006.08-editing_change >s I do not have internet during week. Here, I'm replying at work. And it will be hard to do a diff because you work on a different branch. Or perhapse SVN allows to make diffs between HEAD and a branch... Can you mail a diff, so I can look at it at work? > 1. It does not allow me editing of the pasted text (!) Hein?! How do you do to trigger such a bug? Does it crash, QTextEdit is empty because it can't parse... ? > 2. The rendering in an open note (which is a QTextEdit) and in a closed > note (which is a QSimpleRichText) is different. I don't know if that is > supposed to be so, but if it is, maybe it's just simpler to use > QTextEdits everywhere, and just make the inactive ones read-only? QTextEdit use QSimpleRichText (I think) to render itself. So you should have triggered a very serious bug if they aren't rendering the same way! Oh, and no thanks: we use QSimpleRichText and not a whole QTextEdit. Basket loading is already quite slow (for big baskets, and for the others, it should be instantaneous, but it isn't). Bringing a QTextEdit per note would make baskets at least twice slower to load. In 0.5.0, every notes was a QWidget. With the new engin, where notes are simple QObjects, or only C++ objects, the loading is twice faster. I can't imagine using QTextEdit for every notes... performances will be horribly killed. And the new 0.6.0 display engin will not support supperposing notes... And say good bye to animations. And we would have a lot of hideous layouting problem: QTextEdits have more margins than the notes themselves. Using QTextEdit for every notes is not an option at all, it's a big regression. > 3. The images do not show. Well, of course. I think they should be > downloaded and stored along with the note, but that'll take work and > time. Also, some pages have an entrenched session info, which would not > allow re-d/l'ing the images from Basket. To this end, does somebody > know if I can receive the images through the clipboard as well? Copied from what? - OpenOffice.org? I think it can embedd images too. - Konqueror? Well, forget. It doesn't include HTML, so I don't think it will include images. Or if it does, it will offers you only the URL. - Firefox? I tryed to drag an image from Firefox to BasKet... Firefox provide a image/* MIME type, but it have NO DATA! So it's useless. Unless the bug is finally fixed. - Whatever else? > 4. The stylesheet is lost in translation. That's to be expected, but can > be bothersome. I don't think it's a good idea to import the stylesheet, > even if that is possible, but suggestions welcome. Hum... Difficult area. A small parser could get the most important rules/properties: colors, font, and apply them to the HTML elements... But that would mean lot of work. Is this supported by Qt 4 Arthur? It would be a pitty to develop a hard hack and discover it's useless when ported to Qt 4. > In addition, I found that all the code that handles the copy&paste and > dragging is quite a spaghetti - lots of duplicate code, strange classes, > different shortcuts of the "same" operation doing different things etc. > OUCH. Yes... But everything has a purpose. I think some documentation is needed there. ------------------------------------------------------- |