Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silx.gui: Fixed support of PySide6.4 enums #3737

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/silx/gui/plot/MaskToolsWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def _saveMask(self):
"""Open Save mask dialog"""
dialog = qt.QFileDialog(self)
dialog.setWindowTitle("Save Mask")
dialog.setOption(dialog.DontUseNativeDialog)
dialog.setOption(qt.QFileDialog.DontUseNativeDialog)
dialog.setModal(1)
hdf5Filter = 'HDF5 (%s)' % _HDF5_EXT_STR
filters = [
Expand All @@ -733,9 +733,9 @@ def onFilterSelection(filt_):
# disable overwrite confirmation for HDF5,
# because we append the data to existing files
if filt_ == hdf5Filter:
dialog.setOption(dialog.DontConfirmOverwrite)
dialog.setOption(qt.QFileDialog.DontConfirmOverwrite)
else:
dialog.setOption(dialog.DontConfirmOverwrite, False)
dialog.setOption(qt.QFileDialog.DontConfirmOverwrite, False)

dialog.filterSelected.connect(onFilterSelection)
if not dialog.exec():
Expand Down
12 changes: 6 additions & 6 deletions src/silx/gui/plot/actions/io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /*##########################################################################
#
# Copyright (c) 2004-2021 European Synchrotron Radiation Facility
# Copyright (c) 2004-2022 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -628,21 +628,21 @@ def _actionTriggered(self, checked=False):

# Create and run File dialog
dialog = qt.QFileDialog(self.plot)
dialog.setOption(dialog.DontUseNativeDialog)
dialog.setOption(qt.QFileDialog.DontUseNativeDialog)
dialog.setWindowTitle("Output File Selection")
dialog.setModal(1)
dialog.setNameFilters(list(filters.keys()))

dialog.setFileMode(dialog.AnyFile)
dialog.setAcceptMode(dialog.AcceptSave)
dialog.setFileMode(qt.QFileDialog.AnyFile)
dialog.setAcceptMode(qt.QFileDialog.AcceptSave)

def onFilterSelection(filt_):
# disable overwrite confirmation for NXdata types,
# because we append the data to existing files
if filt_ in self._appendFilters:
dialog.setOption(dialog.DontConfirmOverwrite)
dialog.setOption(qt.QFileDialog.DontConfirmOverwrite)
else:
dialog.setOption(dialog.DontConfirmOverwrite, False)
dialog.setOption(qt.QFileDialog.DontConfirmOverwrite, False)

dialog.filterSelected.connect(onFilterSelection)

Expand Down
6 changes: 3 additions & 3 deletions src/silx/gui/plot3d/actions/io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /*##########################################################################
#
# Copyright (c) 2016-2021 European Synchrotron Radiation Facility
# Copyright (c) 2016-2022 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -226,8 +226,8 @@ def _triggered(self, checked=False):
dialog.setModal(True)
dialog.setNameFilters([self.PNG_SERIE_FILTER,
self.MNG_FILTER])
dialog.setFileMode(dialog.AnyFile)
dialog.setAcceptMode(dialog.AcceptSave)
dialog.setFileMode(qt.QFileDialog.AnyFile)
dialog.setAcceptMode(qt.QFileDialog.AcceptSave)

if not dialog.exec():
return
Expand Down