c-koi / gmic-qt

G'MIC-Qt is a versatile front-end to the image processing framework G'MIC.
GNU General Public License v3.0
207 stars 54 forks source link

Allow hosts to check if the user canceled the plugin #86

Closed 0xC0000054 closed 4 years ago

0xC0000054 commented 4 years ago

Currently there is no way for a host the know if the user canceled the dialog, this can cause confusing behavior for users.

For example, in the GIMP and Paint.NET plugins if a user clicks the Apply button followed by Cancel it behaves as if the user clicked Ok. This requires the user to undo the applied G'MIC effect after the G'MIC-Qt plugin has been closed.

The API should provide a method for the host to determine if the user exited the dialog by pressing the Ok button, any other exit method will be treated as if the dialog was canceled.

c-koi commented 4 years ago

a4af7410500fd6e9c8ae40e102fb0eff14a7d04d introduces such a test function (GIMP does not automatically undo all applied modifications even if the plugin returns a GIMP_PDB_CANCEL status.)

0xC0000054 commented 4 years ago

Thanks, I can confirm that it works for the Paint.NET host.

Closing this issue.

0xC0000054 commented 4 years ago

After further testing it appears that pluginDialogWasAccepted() also returns false when the Ok button is pressed. This occurs even if Apply is pressed before Ok.

c-koi commented 4 years ago

Should be fixed by d40db0f4ea35e2aca384c370c6d9d0e2affe251f

0xC0000054 commented 4 years ago

Should be fixed by d40db0f

That fixes the issue.