Skip to content

plug-ins: Fix Save button in Python Console

The Save button was broken due to the following exception thrown:

Traceback (most recent call last):
  File "<redacted>\lib\gimp\2.99\plug-ins\python-console\python-console.py", line 136, in response
	self.save_dialog()
  File "<redacted>\lib\gimp\2.99\plug-ins\python-console\python-console.py", line 274, in save_dialog
	GimpUi.Dialog.set_alternative_button_order_from_array(dlg,
TypeError: argument self: Expected GimpUi.Dialog, but got gi.overrides.Gtk.FileChooserDialog

This was fixed by using directly Gtk.FileChooserDialog.set_alternative_button_order_from_array() instead of GimpUi.Dialog as the class. A deprecation warning would normally be displayed, which I suppressed explicitly via the standard warnings Python module (since gimp_dialog_set_alternative_button_order_from_array() also suppresses them).

Also, this MR now allows specifying a new file instead of overwriting an existing file in the save dialog.

Edited by Kamil Burda

Merge request reports