Skip to content

Refactor ExportProjectDialog - #8215

Merged
sakertooth merged 31 commits into
LMMS:masterfrom
sakertooth:refactor-export-dialog
Jan 23, 2026
Merged

sakertooth merged 31 commits into
LMMS:masterfrom
sakertooth:refactor-export-dialog

Conversation

@sakertooth

@sakertooth sakertooth commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

This PR refactors ExportProjectDialog to allow for greater flexibility, control, and simplicity.

Changes

  • Removes the export_project.ui and converts ExportProjectDialog to use Qt layouts and widgets directly. This will help making changes to the dialog much easier, as controls and be removed or added without going through another file. export_project.ui was also hardcoding the available sample rates, bit rates, etc, which is a problem since if we ever decide to change them, we have to remember to update the UI file as well. Instead, the file format combo boxes are dynamically populated according to the values in SUPPORTED_SAMPLERATES, SUPPORTED_BITRATES, etc.
  • General refactoring to make the code easier to work with and maintain.

For testing the PR, the goal is that the export dialog does not have any regressions or missing behavior from the original export dialog since this is a refactor. Test by exporting different formats with different options, and overall confirm that this dialog keeps all the behavior of the old one.

@szeli1 szeli1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test the PR, here are my findings:
Exporting generally works, but there are some inconvenient things: In the file dialog, when you select .flac and click okay, the export dialog still defaults to wav. I also found a bug:

  1. export something as wav
  2. export again, in the file dialog select the previously exported file and select "mp3". A warning should show up.
  3. continue exporting, still as "mp3", finish exporting.
  4. the mp3 file doesn't show up where the original file was.
    I repeated these steps, but used a different name for the mp3 file and it exported correctly.

Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
Comment thread src/gui/modals/ExportProjectDialog.cpp Resolved
@szeli1

szeli1 commented Jan 17, 2026 •

Copy link
Copy Markdown
Contributor

I usually include a "how to test" section in my pull requests, because testers may not know what ExportProjectDialog is or what behavior was changed in the PR.

@sakertooth

Copy link
Copy Markdown
Contributor Author

Thanks for the review @szeli1 👍

I usually include a "how to test" section in my pull requests, because testers may not know what ExportProjectDialog is or what behavior was changed in the PR.

Just added this. Let me know if there's a need for more targeted testing instead of a general "test everything" approach, but basically we don't want any behavior to be missing from the refactor.

export something as wav
export again, in the file dialog select the previously exported file and select "mp3". A warning should show up.
continue exporting, still as "mp3", finish exporting.
the mp3 file doesn't show up where the original file was.
I repeated these steps, but used a different name for the mp3 file and it exported correctly.

So are you saying that when you select "MP3', the extension used for the output path should change? I think I can do that, yeah. Because right now, if you select a WAV file, it will try to select a WAV for export but if you change it to MP3, it just replaces the WAV file that has the ".wav" extension with an MP3 file, which is misleading.

@sakertooth

Copy link
Copy Markdown
Contributor Author

So are you saying that when you select "MP3', the extension used for the output path should change? I think I can do that, yeah. Because right now, if you select a WAV file, it will try to select a WAV for export but if you change it to MP3, it just replaces the WAV file that has the ".wav" extension with an MP3 file, which is misleading.

Just fixed the two issues you mentioned and addressed most of the review.

@szeli1

szeli1 commented Jan 17, 2026 •

Copy link
Copy Markdown
Contributor

So are you saying that when you select "MP3', the extension used for the output path should change? I think I can do that, yeah. Because right now, if you select a WAV file, it will try to select a WAV for export but if you change it to MP3, it just replaces the WAV file that has the ".wav" extension with an MP3 file, which is misleading.

If I reuse a filename with a new extension, I expect a file with the new extension to show up. If I reuse the filename and the extension, then I expect the original file to be overridden. What I described failed my first expectation: I reused a filename, but used "MP3" instead of "WAV" and I didn't see an "MP3" file show up. I hope this makes it clearer.

Just fixed the two issues you mentioned and addressed most of the review.

I will review again.

@szeli1 szeli1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any more bugs or issues. Thanks for making this PR!

@sakertooth

Copy link
Copy Markdown
Contributor Author

There's a slight issue with the layout flow changing when you select a different format in the file format settings group. I'm going to try and see if I can fix this. Hopefully its simple enough.

@sakertooth
sakertooth marked this pull request as draft January 19, 2026 22:31
Simply hiding and showing the rows causes inconsistent padding between some of the rows that are visible
@sakertooth
sakertooth marked this pull request as ready for review January 21, 2026 04:32
@sakertooth

Copy link
Copy Markdown
Contributor Author

Fixed the spacing issue. This will be available for any testing for a few days before merge (I think this is good overall).

@sakertooth
sakertooth merged commit 13ea2ee into LMMS:master Jan 23, 2026
10 of 11 checks passed
@sakertooth
sakertooth deleted the refactor-export-dialog branch January 23, 2026 00:07
khoidauminh pushed a commit to khoidauminh/lmms that referenced this pull request Feb 16, 2026
This refactors the export dialog to no longer use the export_project.ui file and moves it into standard C++ Qt code. This also brings minor changes to the dialog, such as horizontal labels instead of vertical ones.
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.

2 participants

⌂