def make_filter_box(self): filter_box = QtWidgets.QWidget() layout = QtWidgets.QGridLayout() layout.setSpacing(10) prefix_label = QtWidgets.QLabel('File Prefix') self.prefix_box = QtWidgets.QLineEdit() self.prefix_box.editingFinished.connect(self.set_range) extension_label = QtWidgets.QLabel('File Extension') self.extension_box = QtWidgets.QLineEdit() self.extension_box.editingFinished.connect(self.set_extension) suffix_label = QtWidgets.QLabel('File Suffix') self.suffix_box = QtWidgets.QLineEdit('') self.suffix_box.editingFinished.connect(self.get_prefixes) layout.addWidget(prefix_label, 0, 0) layout.addWidget(self.prefix_box, 0, 1) layout.addWidget(extension_label, 0, 2) layout.addWidget(self.extension_box, 0, 3) layout.addWidget(suffix_label, 0, 4) layout.addWidget(self.suffix_box, 0, 5) self.prefix_combo = QtWidgets.QComboBox() self.prefix_combo.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self.prefix_combo.activated.connect(self.choose_prefix) self.extension_combo = QtWidgets.QComboBox() self.extension_combo.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self.extension_combo.activated.connect(self.choose_extension) layout.addWidget(self.prefix_combo, 1, 1, alignment=QtCore.Qt.AlignHCenter) layout.addWidget(self.extension_combo, 1, 3, alignment=QtCore.Qt.AlignHCenter) filter_box.setLayout(layout) filter_box.setVisible(False) return filter_box
def make_output_box(self): """ Creates a text box and button for selecting the output file. """ output_box = QtWidgets.QWidget() layout = QtWidgets.QHBoxLayout() file_button = QtWidgets.QPushButton("Choose Output File") file_button.clicked.connect(self.choose_output_file) self.output_file = QtWidgets.QLineEdit(self) self.output_file.setMinimumWidth(300) layout.addWidget(file_button) layout.addWidget(self.output_file) output_box.setLayout(layout) output_box.setVisible(False) return output_box
def make_rangebox(self): rangebox = QtWidgets.QWidget() layout = QtWidgets.QHBoxLayout() rangeminlabel = QtWidgets.QLabel("Min. index") self.rangemin = QtWidgets.QLineEdit() self.rangemin.setFixedWidth(150) self.rangemin.setAlignment(QtCore.Qt.AlignRight) rangemaxlabel = QtWidgets.QLabel("Max. index") self.rangemax = QtWidgets.QLineEdit() self.rangemax.setFixedWidth(150) self.rangemax.setAlignment(QtCore.Qt.AlignRight) layout.addWidget(rangeminlabel) layout.addWidget(self.rangemin) layout.addStretch() layout.addWidget(rangemaxlabel) layout.addWidget(self.rangemax) rangebox.setLayout(layout) rangebox.setVisible(False) return rangebox