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

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
28 28
29 def __init__(self, source, parent=None, move=False): 29 def __init__(self, source, parent=None, move=False):
30 """ 30 """
31 Constructor 31 Constructor
32 32
33 @param source name of the source file/directory (string) 33 @param source name of the source file/directory
34 @param parent parent widget (QWidget) 34 @type str
35 @param move flag indicating a move operation (boolean) 35 @param parent parent widget
36 @type QWidget
37 @param move flag indicating a move operation
38 @type bool
36 """ 39 """
37 super().__init__(parent) 40 super().__init__(parent)
38 self.setupUi(self) 41 self.setupUi(self)
39 42
40 self.dirButton.setIcon(EricPixmapCache.getIcon("open")) 43 self.dirButton.setIcon(EricPixmapCache.getIcon("open"))
59 62
60 def getData(self): 63 def getData(self):
61 """ 64 """
62 Public method to retrieve the copy data. 65 Public method to retrieve the copy data.
63 66
64 @return the target name (string) and a flag indicating 67 @return the target name and a flag indicating the operation should be enforced
65 the operation should be enforced (boolean) 68 @rtype tuple of (str, bool)
66 """ 69 """
67 target = self.targetEdit.text() 70 target = self.targetEdit.text()
68 if not os.path.isabs(target): 71 if not os.path.isabs(target):
69 sourceDir = os.path.dirname(self.sourceEdit.text()) 72 sourceDir = os.path.dirname(self.sourceEdit.text())
70 target = os.path.join(sourceDir, target) 73 target = os.path.join(sourceDir, target)
102 @pyqtSlot(str) 105 @pyqtSlot(str)
103 def on_targetEdit_textChanged(self, txt): 106 def on_targetEdit_textChanged(self, txt):
104 """ 107 """
105 Private slot to handle changes of the target. 108 Private slot to handle changes of the target.
106 109
107 @param txt contents of the target edit (string) 110 @param txt contents of the target edit
111 @type str
108 """ 112 """
109 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( 113 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(
110 os.path.isabs(txt) or os.path.dirname(txt) == "" 114 os.path.isabs(txt) or os.path.dirname(txt) == ""
111 ) 115 )

eric ide

mercurial