10 import os.path |
10 import os.path |
11 |
11 |
12 from PyQt6.QtCore import pyqtSlot |
12 from PyQt6.QtCore import pyqtSlot |
13 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
13 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
14 |
14 |
15 from E5Gui.E5Completers import E5FileCompleter, E5DirCompleter |
15 from E5Gui.EricCompleters import EricFileCompleter, EricDirCompleter |
16 from E5Gui import E5FileDialog |
16 from E5Gui import EricFileDialog |
17 |
17 |
18 from .Ui_GitCopyDialog import Ui_GitCopyDialog |
18 from .Ui_GitCopyDialog import Ui_GitCopyDialog |
19 |
19 |
20 import Utilities |
20 import Utilities |
21 import UI.PixmapCache |
21 import UI.PixmapCache |
39 |
39 |
40 self.dirButton.setIcon(UI.PixmapCache.getIcon("open")) |
40 self.dirButton.setIcon(UI.PixmapCache.getIcon("open")) |
41 |
41 |
42 self.source = source |
42 self.source = source |
43 if os.path.isdir(self.source): |
43 if os.path.isdir(self.source): |
44 self.targetCompleter = E5DirCompleter(self.targetEdit) |
44 self.targetCompleter = EricDirCompleter(self.targetEdit) |
45 else: |
45 else: |
46 self.targetCompleter = E5FileCompleter(self.targetEdit) |
46 self.targetCompleter = EricFileCompleter(self.targetEdit) |
47 |
47 |
48 if move: |
48 if move: |
49 self.setWindowTitle(self.tr('Git Move')) |
49 self.setWindowTitle(self.tr('Git Move')) |
50 else: |
50 else: |
51 self.forceCheckBox.setEnabled(False) |
51 self.forceCheckBox.setEnabled(False) |
79 """ |
79 """ |
80 Private slot to handle the button press for selecting the target via a |
80 Private slot to handle the button press for selecting the target via a |
81 selection dialog. |
81 selection dialog. |
82 """ |
82 """ |
83 target = ( |
83 target = ( |
84 E5FileDialog.getExistingDirectory( |
84 EricFileDialog.getExistingDirectory( |
85 self, |
85 self, |
86 self.tr("Select target"), |
86 self.tr("Select target"), |
87 self.targetEdit.text(), |
87 self.targetEdit.text(), |
88 E5FileDialog.ShowDirsOnly) |
88 EricFileDialog.ShowDirsOnly) |
89 if os.path.isdir(self.source) else |
89 if os.path.isdir(self.source) else |
90 E5FileDialog.getSaveFileName( |
90 EricFileDialog.getSaveFileName( |
91 self, |
91 self, |
92 self.tr("Select target"), |
92 self.tr("Select target"), |
93 self.targetEdit.text(), |
93 self.targetEdit.text(), |
94 "", |
94 "", |
95 E5FileDialog.DontConfirmOverwrite) |
95 EricFileDialog.DontConfirmOverwrite) |
96 ) |
96 ) |
97 |
97 |
98 if target: |
98 if target: |
99 self.targetEdit.setText(Utilities.toNativeSeparators(target)) |
99 self.targetEdit.setText(Utilities.toNativeSeparators(target)) |
100 |
100 |