Exemplo n.º 1
0
class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.bisect_runner = BisectRunner(self)

        self.bisect_runner.bisector_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStart_a_new_bisection.setDisabled)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStop_the_bisection.setEnabled)

        self.persist = mkdtemp()

        self.read_settings()

    @Slot()
    def clear(self):
        mozfile.remove(self.persist)

    def read_settings(self):
        settings = QSettings()
        self.restoreGeometry(settings.value("mainWin/geometry").toByteArray())
        self.restoreState(settings.value("mainWin/windowState").toByteArray())

    def closeEvent(self, evt):
        settings = QSettings()
        settings.setValue("mainWin/geometry", self.saveGeometry())
        settings.setValue("mainWin/windowState", self.saveState())
        QMainWindow.closeEvent(self, evt)

    @Slot()
    def start_bisection_wizard(self):
        wizard = BisectionWizard(self)
        if wizard.exec_() == wizard.Accepted:
            self.ui.report_view.model().clear()
            self.bisect_runner.bisect(*wizard.options())

    @Slot()
    def stop_bisection(self):
        # stop the bisection without blocking
        self.bisect_runner.stop(False)
        # clear the report model
        model = self.ui.report_view.model()
        model.attach_bisector(None)
        model.clear()
        # clear the build info main panel
        self.ui.build_info_browser.clear()

    @Slot()
    def show_about(self):
        QMessageBox.about(self, "About", ABOUT_TEXT)

    @Slot()
    def edit_global_prefs(self):
        change_prefs_dialog(self)
Exemplo n.º 2
0
class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.bisect_runner = BisectRunner(self)

        self.bisect_runner.bisector_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStart_a_new_bisection.setDisabled)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStop_the_bisection.setEnabled)

        self.read_settings()

    def read_settings(self):
        settings = QSettings()
        self.restoreGeometry(settings.value("mainWin/geometry").toByteArray())
        self.restoreState(settings.value("mainWin/windowState").toByteArray())

    def closeEvent(self, evt):
        settings = QSettings()
        settings.setValue("mainWin/geometry", self.saveGeometry())
        settings.setValue("mainWin/windowState", self.saveState())
        QMainWindow.closeEvent(self, evt)

    @Slot()
    def start_bisection_wizard(self):
        wizard = BisectionWizard(self)
        if wizard.exec_() == wizard.Accepted:
            self.ui.report_view.model().clear()
            self.bisect_runner.bisect(*wizard.options())

    @Slot()
    def stop_bisection(self):
        # stop the bisection without blocking
        self.bisect_runner.stop(False)
        # clear the report model
        model = self.ui.report_view.model()
        model.attach_bisector(None)
        model.clear()
        # clear the build info main panel
        self.ui.build_info_browser.clear()

    @Slot()
    def show_about(self):
        QMessageBox.about(self, "About", ABOUT_TEXT)

    @Slot()
    def edit_global_prefs(self):
        change_prefs_dialog(self)
Exemplo n.º 3
0
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Init MenuViews
        self.ui.actionLogView.setChecked(self.ui.logDockWidget.isVisible())
        self.ui.actionToolBar.setChecked(self.ui.toolBar.isVisible())

        self.bisect_runner = BisectRunner(self)

        self.bisect_runner.bisector_created.connect(
            self.ui.report_view.model().attach_bisector)

        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.report_delegate = ReportItemDelegate()
        self.ui.report_view.setItemDelegateForColumn(0, self.report_delegate)

        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStart_a_new_bisection.setDisabled)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStop_the_bisection.setEnabled)

        self.persist = mkdtemp()

        self.read_settings()
Exemplo n.º 4
0
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.bisect_runner = BisectRunner(self)

        self.bisect_runner.bisector_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStart_a_new_bisection.setDisabled)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStop_the_bisection.setEnabled)

        self.read_settings()
Exemplo n.º 5
0
    def __init__(self):
        QMainWindow.__init__(self)
        MainWindow.INSTANCE = self
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.bisect_runner = BisectRunner(self)
        self.single_runner = SingleBuildRunner(self)
        self.current_runner = None

        self.bisect_runner.worker_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.single_runner.worker_created.connect(
            self.ui.report_view.model().attach_single_runner)

        self.ui.report_view.model().need_evaluate_editor.connect(
            self.bisect_runner.open_evaluate_editor)

        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.report_delegate = ReportItemDelegate()
        self.report_delegate.got_verdict.connect(
            self.bisect_runner.set_verdict)
        self.ui.report_view.setItemDelegateForColumn(0, self.report_delegate)

        for runner in (self.bisect_runner, self.single_runner):
            runner.running_state_changed.connect(
                self.ui.actionStart_a_new_bisection.setDisabled)
            runner.running_state_changed.connect(
                self.ui.actionStop_the_bisection.setEnabled)
            runner.running_state_changed.connect(
                self.ui.actionRun_a_single_build.setDisabled)

        self.persist = mkdtemp()

        self.read_settings()

        initialize_telemetry(get_prefs()["enable_telemetry"])

        # Make sure the toolbar and logviews are visible (in case
        # the user manually turned them off in a previous release
        # where this was possible)
        self.ui.toolBar.setVisible(True)
        self.ui.log_view.setVisible(True)
        self.ui.logDockWidget.setVisible(True)
Exemplo n.º 6
0
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.bisect_runner = BisectRunner(self)

        self.bisect_runner.bisector_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStart_a_new_bisection.setDisabled)
        self.bisect_runner.running_state_changed.connect(
            self.ui.actionStop_the_bisection.setEnabled)

        self.persist = mkdtemp()

        self.read_settings()
    def __init__(self):
        QMainWindow.__init__(self)
        MainWindow.INSTANCE = self
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Init MenuViews
        self.ui.actionLogView.setChecked(self.ui.logDockWidget.isVisible())
        self.ui.actionToolBar.setChecked(self.ui.toolBar.isVisible())

        self.bisect_runner = BisectRunner(self)
        self.single_runner = SingleBuildRunner(self)
        self.current_runner = None

        self.bisect_runner.worker_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.single_runner.worker_created.connect(
            self.ui.report_view.model().attach_single_runner)

        self.ui.report_view.model().need_evaluate_editor.connect(
            self.bisect_runner.open_evaluate_editor)

        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.report_delegate = ReportItemDelegate()
        self.report_delegate.got_verdict.connect(
            self.bisect_runner.set_verdict
        )
        self.ui.report_view.setItemDelegateForColumn(0, self.report_delegate)

        for runner in (self.bisect_runner, self.single_runner):
            runner.running_state_changed.connect(
                self.ui.actionStart_a_new_bisection.setDisabled)
            runner.running_state_changed.connect(
                self.ui.actionStop_the_bisection.setEnabled)
            runner.running_state_changed.connect(
                self.ui.actionRun_a_single_build.setDisabled)

        self.persist = mkdtemp()

        self.read_settings()
Exemplo n.º 8
0
class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Init MenuViews
        self.ui.actionLogView.setChecked(self.ui.logDockWidget.isVisible())
        self.ui.actionToolBar.setChecked(self.ui.toolBar.isVisible())

        self.bisect_runner = BisectRunner(self)
        self.single_runner = SingleBuildRunner(self)
        self.current_runner = None

        self.bisect_runner.worker_created.connect(
            self.ui.report_view.model().attach_bisector)
        self.single_runner.worker_created.connect(
            self.ui.report_view.model().attach_single_runner)

        self.ui.report_view.step_report_changed.connect(
            self.ui.build_info_browser.update_content)
        self.report_delegate = ReportItemDelegate()
        self.ui.report_view.setItemDelegateForColumn(0, self.report_delegate)

        for runner in (self.bisect_runner, self.single_runner):
            runner.running_state_changed.connect(
                self.ui.actionStart_a_new_bisection.setDisabled)
            runner.running_state_changed.connect(
                self.ui.actionStop_the_bisection.setEnabled)
            runner.running_state_changed.connect(
                self.ui.actionRun_a_single_build.setDisabled)

        self.persist = mkdtemp()

        self.read_settings()

    @Slot()
    def clear(self):
        mozfile.remove(self.persist)

    def read_settings(self):
        settings = QSettings()
        self.restoreGeometry(settings.value("mainWin/geometry").toByteArray())
        self.restoreState(settings.value("mainWin/windowState").toByteArray())

    def closeEvent(self, evt):
        settings = QSettings()
        settings.setValue("mainWin/geometry", self.saveGeometry())
        settings.setValue("mainWin/windowState", self.saveState())
        QMainWindow.closeEvent(self, evt)

    @Slot()
    def start_bisection_wizard(self):
        wizard = BisectionWizard(self)
        if wizard.exec_() == wizard.Accepted:
            self.current_runner = self.bisect_runner
            self.ui.report_view.model().clear()
            self.bisect_runner.start(*wizard.options())

    @Slot()
    def stop_bisection(self):
        # stop the bisection or the single runner without blocking
        model = self.ui.report_view.model()
        model.attach_bisector(None)
        self.current_runner.stop(False)
        # clear the report model
        model.clear()
        # clear the build info main panel
        self.ui.build_info_browser.clear()

    @Slot()
    def single_run(self):
        wizard = SingleRunWizard(self)
        if wizard.exec_() == wizard.Accepted:
            self.current_runner = self.single_runner
            self.single_runner.start(*wizard.options())

    @Slot()
    def show_about(self):
        QMessageBox.about(self, "About", ABOUT_TEXT)

    @Slot()
    def edit_global_prefs(self):
        change_prefs_dialog(self)