class SkipDialog(QDialog): def __init__(self, build_range, parent=None): QDialog.__init__(self, parent) assert len(build_range) > 3 from mozregui.ui.skip_dialog import Ui_SkipDialog self.ui = Ui_SkipDialog() self.ui.setupUi(self) self.scene = SkipChooserScene(build_range) self.scene.selectionChanged.connect(self.on_selection_changed) self.ui.gview.setScene(self.scene) self.ui.gview.build_choosen.connect(self.accept) def on_selection_changed(self): items = self.scene.selectedItems() if items: self.ui.lbl_status.setText("Selected build to test, %s" % items[0]) def build_index(self, item): return self.scene.build_range.future_build_infos.index(item.future_build_info) def choose_next_build(self): if self.exec_() == self.Accepted: items = self.scene.selectedItems() assert len(items) == 1 return self.build_index(items[0])
class SkipDialog(QDialog): def __init__(self, build_range, parent=None): QDialog.__init__(self, parent) assert len(build_range) > 3 from mozregui.ui.skip_dialog import Ui_SkipDialog self.ui = Ui_SkipDialog() self.ui.setupUi(self) self.scene = SkipChooserScene(build_range) self.scene.selectionChanged.connect(self.on_selection_changed) self.ui.gview.setScene(self.scene) self.ui.gview.build_choosen.connect(self.accept) def on_selection_changed(self): items = self.scene.selectedItems() if items: self.ui.lbl_status.setText("Selected build to test, %s" % items[0]) def build_index(self, item): return self.scene.build_range.future_build_infos.index( item.future_build_info) def choose_next_build(self): if self.exec_() == self.Accepted: items = self.scene.selectedItems() assert len(items) == 1 return self.build_index(items[0])
class SkipDialog(QDialog): def __init__(self, build_range, parent=None): QDialog.__init__(self, parent) assert len(build_range) > 3 from mozregui.ui.skip_dialog import Ui_SkipDialog self.ui = Ui_SkipDialog() self.ui.setupUi(self) self.scene = SkipChooserScene(build_range) self.scene.selectionChanged.connect(self.on_selection_changed) self.ui.gview.setScene(self.scene) self.ui.gview.build_choosen.connect(self.accept) def on_selection_changed(self): items = self.scene.selectedItems() if items: self.ui.lbl_status.setText("Selected build to test, %s" % items[0]) def build_index(self, item): return self.scene.build_range.future_build_infos.index( item.future_build_info) def choose_next_build(self): if self.exec_() == self.Accepted: items = self.scene.selectedItems() assert len(items) == 1 return self.build_index(items[0]) def closeEvent(self, evt): if (QMessageBox.warning( self, "Stop the bisection ?", "Closing this dialog will end the bisection. Are you sure" " you want to end the bisection now ?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No, ) == QMessageBox.Yes): evt.accept() else: evt.ignore()
class SkipDialog(QDialog): def __init__(self, build_range, parent=None): QDialog.__init__(self, parent) assert len(build_range) > 3 from mozregui.ui.skip_dialog import Ui_SkipDialog self.ui = Ui_SkipDialog() self.ui.setupUi(self) self.scene = SkipChooserScene(build_range) self.scene.selectionChanged.connect(self.on_selection_changed) self.ui.gview.setScene(self.scene) self.ui.gview.build_choosen.connect(self.accept) def on_selection_changed(self): items = self.scene.selectedItems() if items: self.ui.lbl_status.setText("Selected build to test, %s" % items[0]) def build_index(self, item): return self.scene.build_range.future_build_infos.index( item.future_build_info ) def choose_next_build(self): if self.exec_() == self.Accepted: items = self.scene.selectedItems() assert len(items) == 1 return self.build_index(items[0]) def closeEvent(self, evt): if QMessageBox.warning( self, "Stop the bisection ?", "Closing this dialog will end the bisection. Are you sure" " you want to end the bisection now ?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No) == QMessageBox.Yes: evt.accept() else: evt.ignore()