eric6/Plugins/VcsPlugins/vcsGit/GitCopyDialog.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8259
2bbec88047dd
equal deleted inserted replaced
8190:fb0ef164f536 8273:698ae46f40a4
32 32
33 @param source name of the source file/directory (string) 33 @param source name of the source file/directory (string)
34 @param parent parent widget (QWidget) 34 @param parent parent widget (QWidget)
35 @param move flag indicating a move operation (boolean) 35 @param move flag indicating a move operation (boolean)
36 """ 36 """
37 super(GitCopyDialog, self).__init__(parent) 37 super().__init__(parent)
38 self.setupUi(self) 38 self.setupUi(self)
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
78 def on_dirButton_clicked(self): 78 def on_dirButton_clicked(self):
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 if os.path.isdir(self.source): 83 target = (
84 target = E5FileDialog.getExistingDirectory( 84 E5FileDialog.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.Options(E5FileDialog.ShowDirsOnly)) 88 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
89 else: 89 if os.path.isdir(self.source) else
90 target = E5FileDialog.getSaveFileName( 90 E5FileDialog.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.Options(E5FileDialog.DontConfirmOverwrite)) 95 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
96 )
96 97
97 if target: 98 if target:
98 self.targetEdit.setText(Utilities.toNativeSeparators(target)) 99 self.targetEdit.setText(Utilities.toNativeSeparators(target))
99 100
100 @pyqtSlot(str) 101 @pyqtSlot(str)

eric ide

mercurial