25 |
25 |
26 def __init__(self, source, parent=None, move=False): |
26 def __init__(self, source, parent=None, move=False): |
27 """ |
27 """ |
28 Constructor |
28 Constructor |
29 |
29 |
30 @param source name of the source file/directory (string) |
30 @param source name of the source file/directory |
31 @param parent parent widget (QWidget) |
31 @type str |
32 @param move flag indicating a move operation (boolean) |
32 @param parent parent widget |
|
33 @type QWidget |
|
34 @param move flag indicating a move operation |
|
35 @type bool |
33 """ |
36 """ |
34 super().__init__(parent) |
37 super().__init__(parent) |
35 self.setupUi(self) |
38 self.setupUi(self) |
36 |
39 |
37 self.source = source |
40 self.source = source |
55 def getData(self): |
58 def getData(self): |
56 """ |
59 """ |
57 Public method to retrieve the copy data. |
60 Public method to retrieve the copy data. |
58 |
61 |
59 @return the target name (string) and a flag indicating |
62 @return the target name (string) and a flag indicating |
60 the operation should be enforced (boolean) |
63 the operation should be enforced |
|
64 @rtype bool |
61 """ |
65 """ |
62 target = self.targetPicker.text() |
66 target = self.targetPicker.text() |
63 if not os.path.isabs(target): |
67 if not os.path.isabs(target): |
64 sourceDir = os.path.dirname(self.sourceEdit.text()) |
68 sourceDir = os.path.dirname(self.sourceEdit.text()) |
65 target = os.path.join(sourceDir, target) |
69 target = os.path.join(sourceDir, target) |
68 @pyqtSlot(str) |
72 @pyqtSlot(str) |
69 def on_targetPicker_textChanged(self, txt): |
73 def on_targetPicker_textChanged(self, txt): |
70 """ |
74 """ |
71 Private slot to handle changes of the target. |
75 Private slot to handle changes of the target. |
72 |
76 |
73 @param txt contents of the target edit (string) |
77 @param txt contents of the target edit |
|
78 @type str |
74 """ |
79 """ |
75 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
80 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
76 os.path.isabs(txt) or os.path.dirname(txt) == "" |
81 os.path.isabs(txt) or os.path.dirname(txt) == "" |
77 ) |
82 ) |