From f83cd39cccafe65a93f08522f7e89dfb4b1b8259 Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Thu, 23 Mar 2023 17:11:25 +0100 Subject: [PATCH] Fix logic for selecting action in file dialog --- traitsui/qt/file_editor.py | 2 +- traitsui/wx/file_editor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/traitsui/qt/file_editor.py b/traitsui/qt/file_editor.py index 4301d49a8..2f2d55b9f 100644 --- a/traitsui/qt/file_editor.py +++ b/traitsui/qt/file_editor.py @@ -138,7 +138,7 @@ def _create_file_dialog(self): dlg = FileDialog( parent=self.get_control_widget(), default_path=self._file_name.text(), - action="save" if self.factory.dialog_style == "save as" else "open", + action="save as" if self.factory.dialog_style == "save" else "open", wildcard=wildcard, ) return dlg diff --git a/traitsui/wx/file_editor.py b/traitsui/wx/file_editor.py index 396a08b34..7ac95a1a6 100644 --- a/traitsui/wx/file_editor.py +++ b/traitsui/wx/file_editor.py @@ -207,7 +207,7 @@ def _create_file_dialog(self): dlg = FileDialog( parent=self.get_control_widget(), default_path=self._file_name.GetValue(), - action="save" if self.factory.dialog_style == "save as" else "open", + action="save as" if self.factory.dialog_style == "save" else "open", wildcard=wildcard, ) return dlg