Plugins/VcsPlugins/vcsPySvn/SvnCopyDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3366
6084bb3c3911
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
18 from E5Gui import E5FileDialog 18 from E5Gui import E5FileDialog
19 19
20 from .Ui_SvnCopyDialog import Ui_SvnCopyDialog 20 from .Ui_SvnCopyDialog import Ui_SvnCopyDialog
21 21
22 import Utilities 22 import Utilities
23 import UI.PixmapCache
23 24
24 25
25 class SvnCopyDialog(QDialog, Ui_SvnCopyDialog): 26 class SvnCopyDialog(QDialog, Ui_SvnCopyDialog):
26 """ 27 """
27 Class implementing a dialog to enter the data for a copy or rename 28 Class implementing a dialog to enter the data for a copy or rename
37 @param force flag indicating a forced operation (boolean) 38 @param force flag indicating a forced operation (boolean)
38 """ 39 """
39 super(SvnCopyDialog, self).__init__(parent) 40 super(SvnCopyDialog, self).__init__(parent)
40 self.setupUi(self) 41 self.setupUi(self)
41 42
43 self.dirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
44
42 self.source = source 45 self.source = source
43 if os.path.isdir(self.source): 46 if os.path.isdir(self.source):
44 self.targetCompleter = E5DirCompleter(self.targetEdit) 47 self.targetCompleter = E5DirCompleter(self.targetEdit)
45 else: 48 else:
46 self.targetCompleter = E5FileCompleter(self.targetEdit) 49 self.targetCompleter = E5FileCompleter(self.targetEdit)
47 50
48 if move: 51 if move:
49 self.setWindowTitle(self.trUtf8('Subversion Move')) 52 self.setWindowTitle(self.tr('Subversion Move'))
50 else: 53 else:
51 self.forceCheckBox.setEnabled(False) 54 self.forceCheckBox.setEnabled(False)
52 self.forceCheckBox.setChecked(force) 55 self.forceCheckBox.setChecked(force)
53 56
54 self.sourceEdit.setText(source) 57 self.sourceEdit.setText(source)
55 58
56 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 59 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
60
61 msh = self.minimumSizeHint()
62 self.resize(max(self.width(), msh.width()), msh.height())
57 63
58 def getData(self): 64 def getData(self):
59 """ 65 """
60 Public method to retrieve the copy data. 66 Public method to retrieve the copy data.
61 67
76 selection dialog. 82 selection dialog.
77 """ 83 """
78 if os.path.isdir(self.source): 84 if os.path.isdir(self.source):
79 target = E5FileDialog.getExistingDirectory( 85 target = E5FileDialog.getExistingDirectory(
80 None, 86 None,
81 self.trUtf8("Select target"), 87 self.tr("Select target"),
82 self.targetEdit.text(), 88 self.targetEdit.text(),
83 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 89 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
84 else: 90 else:
85 target = E5FileDialog.getSaveFileName( 91 target = E5FileDialog.getSaveFileName(
86 None, 92 None,
87 self.trUtf8("Select target"), 93 self.tr("Select target"),
88 self.targetEdit.text(), 94 self.targetEdit.text(),
89 "", 95 "",
90 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) 96 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
91 97
92 if target: 98 if target:

eric ide

mercurial