Skip to content

fix: pasting of external exported valuenodes #2086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Apr 24, 2023

Conversation

rodolforg
Copy link
Contributor

@rodolforg rodolforg commented Mar 30, 2021

Fix #1393

@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from 22d71fc to 1e6bf25 Compare March 31, 2021 17:38
@ghost
Copy link

ghost commented Mar 31, 2021

Congratulations 🎉. DeepCode analyzed your code in 2.886 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

👉 The DeepCode service and API will be deprecated in August, 2021. Here is the information how to migrate. Thank you for using DeepCode 🙏 ❤️ !

If you are using our plugins, you might be interested in their successors: Snyk's JetBrains plugin and Snyk's VS Code plugin.

@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from 1e6bf25 to ec21790 Compare March 31, 2021 17:41
@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from ec21790 to aa94ee1 Compare April 1, 2021 12:25
@rodolforg
Copy link
Contributor Author

rodolforg commented Apr 1, 2021

It does work fine now.
However, I didn't try to fix the copy'n paste issues for Layer_Duplicate or Layer_Skeleton or Layer_Skeleton_Deform.

@rodolforg rodolforg changed the title DRAFT - Fix pasting of external exported valuenodes - fix #1393 Fix pasting of external exported valuenodes - fix #1393 Apr 1, 2021
@rodolforg
Copy link
Contributor Author

rodolforg commented Apr 1, 2021

@morevnaproject could you please test it? I hope it works like you described on synfig-docs-dev.

@rodolforg rodolforg mentioned this pull request Apr 16, 2021
@rodolforg rodolforg marked this pull request as ready for review April 16, 2021 02:11
@rodolforg rodolforg marked this pull request as draft April 16, 2021 13:55
@morevnaproject
Copy link
Member

Hi! I have finally tested the feature. ^__^

First of all, I would like to say that this feature is an epic achievement in solving this old and annoying problem of copy-pasting. This is so exciting!

Here is a set of files, which I used to test this PR -
2086.zip

It contains 2 files:

  • export-a.sifz
  • export-b.sifz

I opened both files and copied "Group 1" layer from export-a.sifz to export-b.sifz.
It displays following dialog for me (as expected):

screenshot_001

I have notice following issues:

  1. The leftmost column is too tiny - the heading with "Copy?" title (1) is only partially visible.
  2. If I click Cancel button (2), then the layer is copied anyway. As user I would expect the copy operation to be aborted. ^__^
  3. After playing a bit with the feature, I found that it will be useful to have path in "Source file" column always visible (3). The reference document describes different behaviour, but after using the feature I think we should change that.
  4. When I disabled checkbox in second row (for "t2" value) the "OK" button remains inactive -
    screenshot_002
    Disabling checkbox for "t2" value should tell synfig to not copy exported value. Instead it should be linked from export-a.sifz file, so no conflict take place and OK button should become active.

Thanks again for implementing this! 👏

@rodolforg
Copy link
Contributor Author

rodolforg commented May 3, 2021

The leftmost column is too tiny - the heading with "Copy?" title (1) is only partially visible.

Yes, I'm fighting against Gtk to make it right

If I click Cancel button (2), then the layer is copied anyway. As user I would expect the copy operation to be aborted. ^__^

Fixed

3\. After playing a bit with the feature, I found that it will be useful to have path in "Source file" column always visible (3). The [reference document](https://synfig-docs-dev.readthedocs.io/en/latest/projects/copy-paste-exported-values.html) describes different behaviour, but after using the feature I think we should change that.

Ok, I'll do it. Done

4\. Disabling checkbox for "t2" value should tell synfig to **not** copy  exported value. Instead it should be linked from `export-a.sifz` file, so no conflict take place and OK button should become active.

Problem is that they are of a different type: vector x real.

@rodolforg
Copy link
Contributor Author

rodolforg commented May 3, 2021

Any suggestions about the text in the dialog?
And the tooltips I added in last commit? @morevnaproject

@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from aa94ee1 to a66e03f Compare May 3, 2021 22:40
@morevnaproject
Copy link
Member

screenshot_002
4. Disabling checkbox for "t2" value should tell synfig to not copy exported value. Instead it should be linked from export-a.sifz file, so no conflict take place and OK button should become active.

Problem is that they are of a different type: vector x real.

Yes, they are different types.
But in this case the layer will reference "t2" parameter from export-a.sifz file.
Here I have recorded a short video to demonstrate how it currently works ^__^ (i have used version of Synfig without changes made in this PR) - https://www.youtube.com/watch?v=Q4uJ0HGasfg

@morevnaproject
Copy link
Member

Any suggestions about the text in the dialog?

I suggest to use "exported value" instead of "exported valuenode" in the text.
Also, I can suggest just a slight change for "Note" text -

if you choose to keep a valuenode linked to other file, you won't be able to load this one if source file(s) are deleted, moved or renamed.

I have made attempt to remove double "if":

If you choose to keep an exported value linked to other file, then your current file become dependent on source (referenced) file. That means you will not be able to load this file if any source file is deleted, moved or renamed.

I am not an expert in English, though. ^___^"

@morevnaproject
Copy link
Member

And the tooltips I added in last commit?

Tooltips are great!
There is only one issue - the tooltip for "t3" value is empty in my case ^__^ -
screenshot_004

@rodolforg
Copy link
Contributor Author

I am not an expert in English, though. ^___^"

Me neither ;)

There is only one issue - the tooltip for "t3" value is empty in my case ^__^ -

It was intentional, but I'll fix it.

@rodolforg
Copy link
Contributor Author

rodolforg commented May 8, 2021

But in this case the layer will reference "t2" parameter from export-a.sifz file.

Ouch ! lol

I fixed it as well as the text changes you suggested.

@morevnaproject
Copy link
Member

I have notice following issues:
...

  1. If I click Cancel button (2), then the layer is copied anyway. As user I would expect the copy operation to be aborted. ^__^

Works as expected now. ^__^

  1. After playing a bit with the feature, I found that it will be useful to have path in "Source file" column always visible (3). The reference document describes different behaviour, but after using the feature I think we should change that.

Confirmed as fixed.

  1. When I disabled checkbox in second row (for "t2" value) the "OK" button remains inactive -

Confirmed as fixed.

We have following issue remaining:

  1. The leftmost column is too tiny - the heading with "Copy?" title (1) is only partially visible.

...and here are some more, which I've got after testing latest version of this PR:

  1. After text change the dialog became too wide. I suggest to add line break after "... (referenced) file." words -
    screenshot_001

I have found no other issues so far. Great work! ^__^

@ice0
Copy link
Collaborator

ice0 commented May 27, 2021

  1. After text change the dialog became too wide. I suggest to add line break after "... (referenced) file." words -

Maybe just allow word wrap in the label?

@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from 532dad5 to b782c6f Compare May 28, 2021 06:51
@rodolforg
Copy link
Contributor Author

Here is how it is now.
Captura de tela de 2021-05-28 06-54-40

@rodolforg
Copy link
Contributor Author

rodolforg commented May 28, 2021

i think the only missing issue are reported here:

@morevnaproject
Copy link
Member

i think the only missing issue are reported here:

* [#1393 (comment)](https://github.com/synfig/synfig/issues/1393#issuecomment-831349492)

* [#1393 (comment)](https://github.com/synfig/synfig/issues/1393#issuecomment-810306466)

For first item I have outlined expected behavior in this comment - #1393 (comment)
I need to check how it works in current implementation...

For second item I have wrote comment right now ^__^ - #1393 (comment)

@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from f1a0abe to 1c7b496 Compare June 12, 2021 11:18
…layer pasting

Also Layer Copy behaves like Duplicate: it ignores selected
layers inside groups if the group itself is selected.
It avoids duplication of (group, its contents AND the selected
contents)
https://wiki.synfig.org/Canvas

"Canvases can be exported (the name must not contains space or :#@$^&()* characters) , [...]"

as well as in

synfigapp::Instance::import_external_canvas(Canvas::Handle canvas, std::map<Canvas*, Canvas::Handle> &imported)
And don't let user choose to copy a value node that is
a dependency for another valuenode that user chose to be
a foreign link
@rodolforg rodolforg force-pushed the fix-1393-copy-paste-dialog branch from e314c10 to 8f55096 Compare April 23, 2023 12:41
@rodolforg
Copy link
Contributor Author

Rebased again :)
If OK, please squash and merge. And report the pending problem.

@ice0 ice0 merged commit 571d7ea into synfig:master Apr 24, 2023
@ice0
Copy link
Collaborator

ice0 commented Apr 24, 2023

Squashed and merged :)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File corruption: Copy-paste layers with exported values from one file to another
3 participants