hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.01k stars 172 forks source link

Use imported drumkit immediately on open from Finder #1918

Open cme opened 6 months ago

cme commented 6 months ago

Previously, importing drumkit by opening it in Finder would import the kit, but not update the widget or provide any other feedback to let the user know it was actually successful, or allow them to start using it.

On reflection, a far more reasonable user expectation is that opening a drumkit in Finder should select that drumkit, even if it's already imported.

theGreatWhiteShark commented 6 months ago

Previously, importing drumkit by opening it in Finder would import the kit, but not update the widget or provide any other feedback to let the user know it was actually successful, or allow them to start using it.

It does not? Any error appearing in the logs?

On master I get both a dialog "drumkit was successfully imported" (or something similar) and the Sound Library widget is updated with the imported kit appearing as well.

Since #1905 (on master as well) this can be done by right-clicking within the Sound Library widget or using the "Drumkit" item in the main menu bar. But only for the latter the imported drumkit will be loaded right away (in order to emphasis that actions within the Sound Library do not affect the current song and those accessible from the menu do not affect the kits in the SL).

On reflection, a far more reasonable user expectation is that opening a drumkit in Finder should select that drumkit, even if it's already imported.

Right. What happens if the kit is already imported? I think right now we just overwrite the existing one which is not good. On the other hand, maybe the kit in the SL is a modified version and the user wants to reset it by reimporting it. Maybe we should show a dialog "Kit is already present" with the options load, replace, and cancel or similar.

cme commented 6 months ago

The FileOpen event is macOS specific and is sent to the QApplication when the user opens something in Finder.

I think you're right, a confirmation dialog would be good. I should probably make the behaviour consistent between opening in Finder and using the Import dialog.

theGreatWhiteShark commented 6 months ago

The FileOpen event is macOS specific and is sent to the QApplication when the user opens something in Finder.

Ah. I see. I thought you used the import option from within Hydrogen and Finder was used instead of a QFileDialog.

I should probably make the behaviour consistent between opening in Finder and using the Import dialog.

Yeah. Maybe we can put all of it into CoreActionController (and cover potentially missing GUI-related updates with a dedicated EventType). We also have an OSC event for importing kits (/Hydrogen/EXTRACT_DRUMKIT/ called with just one argument) as well as a command line option in h2cli. They should all behave the same.