small stuff
This commit is contained in:
parent
73bdc71a83
commit
ec9001fb93
@ -28,8 +28,8 @@ class QFCReader(QtWidgets.QDialog, Ui_FCEval_dialog):
|
||||
|
||||
def eventFilter(self, src: QtCore.QObject, evt: QtCore.QEvent) -> bool:
|
||||
# intercept key press in listwidget to allow deletion with Del
|
||||
if evt.type() == QtCore.QEvent.KeyPress:
|
||||
if evt.key() == QtCore.Qt.Key_Delete:
|
||||
if evt.type() == QtCore.QEvent.Type.KeyPress:
|
||||
if evt.key() == QtCore.Qt.Key.Key_Delete:
|
||||
self.listWidget.takeItem(self.listWidget.currentRow())
|
||||
return True
|
||||
|
||||
@ -41,21 +41,25 @@ class QFCReader(QtWidgets.QDialog, Ui_FCEval_dialog):
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_region_checkBox_stateChanged')
|
||||
def use_region(self, state: int):
|
||||
self.start_lineedit.setEnabled(state == QtCore.Qt.Checked)
|
||||
self.stop_lineedit.setEnabled(state == QtCore.Qt.Checked)
|
||||
self.start_lineedit.setEnabled(state == QtCore.Qt.CheckState.Checked)
|
||||
self.stop_lineedit.setEnabled(state == QtCore.Qt.CheckState.Checked)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_file_pushbutton_clicked')
|
||||
@QtCore.pyqtSlot(name='on_dir_pushbutton_clicked')
|
||||
def get_input(self):
|
||||
if self.sender() == self.file_pushbutton:
|
||||
infiles, _ = QtWidgets.QFileDialog.getOpenFileNames(caption='Select HDF files',
|
||||
infiles, _ = QtWidgets.QFileDialog.getOpenFileNames(
|
||||
caption='Select HDF files',
|
||||
directory=str(self.path),
|
||||
filter='HDF files (*.h5)')
|
||||
filter='HDF files (*.h5)',
|
||||
)
|
||||
|
||||
else:
|
||||
infiles = QtWidgets.QFileDialog.getExistingDirectory(caption='Select input directory',
|
||||
infiles = QtWidgets.QFileDialog.getExistingDirectory(
|
||||
caption='Select input directory',
|
||||
directory=str(self.path),
|
||||
options=QtWidgets.QFileDialog.ShowDirsOnly)
|
||||
options=QtWidgets.QFileDialog.ShowDirsOnly,
|
||||
)
|
||||
infiles = [infiles] if infiles else infiles
|
||||
|
||||
if infiles:
|
||||
@ -65,9 +69,12 @@ class QFCReader(QtWidgets.QDialog, Ui_FCEval_dialog):
|
||||
|
||||
@QtCore.pyqtSlot(name='on_savebutton_clicked')
|
||||
def save_path(self):
|
||||
outfile = QtWidgets.QFileDialog.getExistingDirectory(self, caption='Select directory',
|
||||
outfile = QtWidgets.QFileDialog.getExistingDirectory(
|
||||
self,
|
||||
caption='Select directory',
|
||||
directory=self.label.text(),
|
||||
options=QtWidgets.QFileDialog.ShowDirsOnly)
|
||||
options=QtWidgets.QFileDialog.ShowDirsOnly,
|
||||
)
|
||||
if outfile:
|
||||
self.label.setText(outfile)
|
||||
|
||||
@ -110,6 +117,6 @@ class QFCReader(QtWidgets.QDialog, Ui_FCEval_dialog):
|
||||
|
||||
grp = ''
|
||||
if not self.graph_checkbox.isChecked():
|
||||
grp = self.graph_comboBox.currentData(QtCore.Qt.UserRole)
|
||||
grp = self.graph_comboBox.currentData(QtCore.Qt.ItemDataRole.UserRole)
|
||||
|
||||
self.data_read.emit(ret_vals, grp)
|
||||
|
Loading…
Reference in New Issue
Block a user