Skip to content
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

Show format within filename when exporting file #4389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gui-marc
Copy link

Bug Description

The export_file_window was displaying only the filename instead of the entire path, leading to confusion for users, especially when including dynamic placeholders such as {tag} in the file path.

Cause of the Bug

Within the ExportFileWindow class, the method setOutputFilename split the provided path into m_outputPath and m_outputFilename, causing the window to display only the filename. Consequently, dynamic placeholders like {tag} were omitted from the displayed path, leading to ambiguity for users.

Impact

This behavior caused confusion and made it difficult for users to accurately discern the file's destination, particularly when using dynamic placeholders. It also difficulted clearing dynamic placeholders from the export path, as it is not shown in the window.

Solution

To address this issue, the following changes were implemented:

  • Exposed path_formats defined in filename_formatter, modifying its type from vector to array for improved performance.
  • During the assignment of m_outputPath and m_outputFilename, dynamic placeholders such as {tag} are now considered part of m_outputFilename and excluded from m_outputPath.

Example

With the new behavior, let's consider the export path: /home/user/{tag}/test/{frame}/file.png.

  • m_outputPath will be /home/user/
  • m_outputFilename will be {tag}/test/{frame}/file.png

Now, the displayed path will include the entire dynamic placeholder structure, providing users with clear visibility of the file's destination and enabling the editing of these parameters.

Future Considerations

Maintainers should be aware of potential implications when modifying path-related functionalities in the future. Additionally, it's essential to maintain consistency in handling dynamic placeholders across the application to avoid similar issues.

Resolves #4059

I acknowledge that my contributions are licensed under the Individual Contributor License Agreement V4.0 ("CLA"), as stated in CLA.md.

I have signed the CLA following the steps provided here.

- Exposed path_formats defined in filename_formatter and changed type
  from vector to array increasing performance.
- While setting the output filename in the export file window,
  considered path formats (e.g. {tag}, {frame}) to also be included in
  the filename.

Resolves aseprite#4059
@gui-marc gui-marc requested a review from dacap as a code owner March 28, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

{tag} as folder name in "Export As" creating nested folders after first Export
1 participant