src/eric7/Plugins/VcsPlugins/vcsGit/GitBisectStartDialog.py

Sat, 23 Dec 2023 15:40:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 23 Dec 2023 15:40:23 +0100
branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
permissions
-rw-r--r--

Converted some source code documentation to the new style.

# -*- coding: utf-8 -*-

# Copyright (c) 2014 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to enter the data for an extended bisect start.
"""

from PyQt6.QtCore import pyqtSlot
from PyQt6.QtWidgets import QDialog, QDialogButtonBox

from .Ui_GitBisectStartDialog import Ui_GitBisectStartDialog


class GitBisectStartDialog(QDialog, Ui_GitBisectStartDialog):
    """
    Class implementing a dialog to enter the data for an extended bisect start.
    """

    def __init__(self, parent=None):
        """
        Constructor

        @param parent reference to the parent widget
        @type QWidget
        """
        super().__init__(parent)
        self.setupUi(self)

        self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
        self.okButton.setEnabled(False)

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())

    def __updateOK(self):
        """
        Private method used to enable/disable the OK-button.
        """
        enable = self.badEdit.text() != ""
        self.okButton.setEnabled(enable)

    @pyqtSlot(str)
    def on_badEdit_textChanged(self, txt):
        """
        Private slot to handle a change of the bad commit.

        @param txt bad commit entered
        @type str
        """
        self.__updateOK()

    def getData(self):
        """
        Public method to get the entered data.

        @return tuple containing a bad commit, a list of good commits and
            a flag indicating to not checkout the working tree
        @rtype tuple of (str, list of str, bool)
        """
        return (
            self.badEdit.text().strip(),
            self.goodEdit.text().strip().split(),
            self.noCheckoutCheckBox.isChecked(),
        )

eric ide

mercurial