Skip to content

Commit

Permalink
owcsvimport: Open dialog on bad file
Browse files Browse the repository at this point in the history
  • Loading branch information
irgolic committed Jan 7, 2021
1 parent 0c90945 commit f2bbb02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Orange/widgets/data/owcsvimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ def __init__(self, *args, **kwargs):
"Import Options", enabled=False, autoDefault=False,
clicked=self._activate_import_dialog
)
self.import_options_specified = False

def update_buttons(cbindex):
self.import_options_button.setEnabled(cbindex != -1)
Expand Down Expand Up @@ -989,6 +990,7 @@ def browse(self, prefixname=None, directory=None):
path, selected_filter.mime_type,
)
options = None
self.import_options_specified = False
# Search for path in history.
# If found use the stored params to initialize the import dialog
items = self.itemsFromSettings()
Expand Down Expand Up @@ -1049,6 +1051,7 @@ def _activate_import_dialog(self):
dlg.setOptions(options)

def update():
self.import_options_specified = True
newoptions = dlg.options()
item.setData(newoptions, ImportItem.OptionsRole)
# update local recent paths list
Expand Down Expand Up @@ -1272,6 +1275,8 @@ def __handle_result(self, f):
except Exception as e: # pylint: disable=broad-except
self.__set_error_state(e)
df = None
if not self.import_options_specified:
QTimer.singleShot(0, self._activate_import_dialog)
else:
self.__clear_error_state()

Expand Down

0 comments on commit f2bbb02

Please sign in to comment.