How to use a shape without using its tools?
Thorsten Zachmann
t.zachmann at zagge.de
Thu Jul 7 09:21:34 BST 2011
On Thursday, July 07, 2011 10:13:16 Inge Wallin wrote:
> > > When preparing this patch, Dan and I tried to integrate the picture
> > > shape and if that had gone well also the vector shape. However, that
> > > failed because we couldn't find a way to disable the picture tool. We
> > > do not want the user to be able to replace the preview image with
> > > something else.
> >
> >
> >
> > I think we should not limit this functionality. I feel it would be much
> > better to display a warning when the user edits the shape that it
> > contains e.g. additional information that will be lost when the
> > operation is done.
>
> Remember that it's not the shape data itself that the user would be
> manipulating. That data cannot be edited per definitions, since if
> Calligra understood it it wouldn't use the unavail shape to begin
> with. A typical example is an embedded document, like a spreadsheet in an
> text document. Instead it's the image that is supposed to show the user
> what that data looks like. Since the user cannot edit the data, he
> shouldn't be able to edit the preview image.
>
> If we allow the user to change the preview image and then save the result
> back, we could end up with an absurd situation like an embedded
> spreadsheet with a preview image of a flower.
Sure the data can not be change but he can change the image which will result
in the KoUnavailShape getting replaced by the new PictureShape if the user
wants to do that. That is why I said that showing a message in that case is
helpfull for the user so that he undertands there is not in the shape than the
think he might see.
So when saving back only a image will be saved and nothing form the
KoUnavailShape.
> > > So, as it is now the patch is important (it fixes a dataloss problem)
> > > but it also removes some nice preview features. We would be able to
> > > solve this problem if we could find a way to use the image or vector
> > > shapes but with their tools disabled. Any ideas on how to do that?
> >
> >
> >
> > I see at least 2 ways to do that.
> >
> >
> >
> > 1. Use a ProxyShape that displays the content of the shape that can
> > represent the data. A mechanism like that is used in the KWCopyShape that
> > displays the content of another shape at a different position.
>
> This is interesting. Is there such a ProxyShape that is available for all
> to use? That should probably be in the flake library rather than an
> application.
There is no generic ProxyShape at the moment. However i guess it should be
very easy to implement. The KWCopyShape is specific to the needs to words.
> > 2. Use a flag that disables modification of the shape by its tool.
>
> This sounds much simpler. But we must only disable the tools of the shape
> itself, not e.g. the default tool because then we wouldn't be able to move
> the shape. That should be allowed even if we cannot edit the contents.
Agreed and that is what I meant by disabling the shapes of the tool.
Thorsten
More information about the calligra-devel
mailing list