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

branch
eric7
changeset 10489
1800956305ca
parent 10475
ee41fab001f2
child 11090
f5f5f5803935
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitStashDataDialog.py	Sun Jan 07 14:20:42 2024 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitStashDataDialog.py	Sun Jan 07 19:54:03 2024 +0100
@@ -7,21 +7,28 @@
 Module implementing a dialog to enter the data for a stash operation.
 """
 
+import enum
+
 from PyQt6.QtWidgets import QDialog
 
 from .Ui_GitStashDataDialog import Ui_GitStashDataDialog
 
 
+class GitStashKind(enum.Enum):
+    """
+    Class defining the kind of stash to be performed.
+    """
+
+    NoUntracked = 0
+    UntrackedOnly = 1
+    UntrackedAndIgnored = 2
+
+
 class GitStashDataDialog(QDialog, Ui_GitStashDataDialog):
     """
     Class implementing a dialog to enter the data for a stash operation.
     """
 
-    # TODO: change this to an enum
-    NoUntracked = 0
-    UntrackedOnly = 1
-    UntrackedAndIgnored = 2
-
     def __init__(self, parent=None):
         """
         Constructor
@@ -42,13 +49,13 @@
         @return tuple containing the message, a flag indicating to keep changes
             in the staging area and an indication to stash untracked and/or
             ignored files
-        @rtype tuple of (str, bool, int)
+        @rtype tuple of (str, bool, GitStashKind)
         """
         if self.noneRadioButton.isChecked():
-            untracked = self.NoUntracked
+            untracked = GitStashKind.NoUntracked
         elif self.untrackedRadioButton.isChecked():
-            untracked = self.UntrackedOnly
+            untracked = GitStashKind.UntrackedOnly
         else:
-            untracked = self.UntrackedAndIgnored
+            untracked = GitStashKind.UntrackedAndIgnored
 
         return (self.messageEdit.text(), self.keepCheckBox.isChecked(), untracked)

eric ide

mercurial