eric7/Plugins/VcsPlugins/vcsGit/GitStashDataDialog.py

branch
eric7
changeset 8312
800c432b34c8
parent 8218
7c09585bd960
child 8318
962bce857696
diff -r 4e8b98454baa -r 800c432b34c8 eric7/Plugins/VcsPlugins/vcsGit/GitStashDataDialog.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/Plugins/VcsPlugins/vcsGit/GitStashDataDialog.py	Sat May 15 18:45:04 2021 +0200
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2014 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing a dialog to enter the data for a stash operation.
+"""
+
+from PyQt5.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