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

Sat, 31 Dec 2022 16:23:21 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 31 Dec 2022 16:23:21 +0100
branch
eric7
changeset 9653
e67609152c5e
parent 9221
bf71ee032bb4
child 10438
4cd7e5a8b3cf
permissions
-rw-r--r--

Updated copyright for 2023.

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

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

"""
Module implementing a dialog to enter the data for a stash operation.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_GitStashDataDialog import Ui_GitStashDataDialog


class GitStashDataDialog(QDialog, Ui_GitStashDataDialog):
    """
    Class implementing a dialog to enter the data for a stash operation.
    """

    NoUntracked = 0
    UntrackedOnly = 1
    UntrackedAndIgnored = 2

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

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

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

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

        @return tuple containing the message (string), a flag indicating to
            keep changes in the staging area (boolean) and an indication to
            stash untracked and/or ignored files (integer)
        """
        if self.noneRadioButton.isChecked():
            untracked = self.NoUntracked
        elif self.untrackedRadioButton.isChecked():
            untracked = self.UntrackedOnly
        else:
            untracked = self.UntrackedAndIgnored

        return (self.messageEdit.text(), self.keepCheckBox.isChecked(), untracked)

eric ide

mercurial