def update_image_format_push_button_clicked(self): """runs when update_image_format_pushButton is clicked """ try: # PySide accepted = QtWidgets.QDialog.DialogCode.Accepted except AttributeError: # PyQt4 accepted = QtWidgets.QDialog.Accepted image_format = self.get_current_image_format() from anima.ui import image_format_dialog update_image_format_dialog = \ image_format_dialog.MainDialog(parent=self, image_format=image_format) update_image_format_dialog.exec_() result = update_image_format_dialog.result() if result == accepted: image_format = update_image_format_dialog.image_format # select the created image format self.fill_image_format_combo_box() index = self.image_format_comboBox.findData(image_format.id) if index: self.image_format_comboBox.setCurrentIndex(index) update_image_format_dialog.deleteLater()
def create_push_button_clicked(self): """runs when create_image_format_pushButton is clicked """ try: # PySide accepted = QtWidgets.QDialog.DialogCode.Accepted except AttributeError: # PyQt4 accepted = QtWidgets.QDialog.Accepted from anima.ui import image_format_dialog create_image_format_dialog = \ image_format_dialog.MainDialog(parent=self.parent) create_image_format_dialog.exec_() result = create_image_format_dialog.result() if result == accepted: image_format = create_image_format_dialog.image_format # select the created image format self.fill_combo_box() self.set_current_image_format(image_format.id) create_image_format_dialog.deleteLater()