16 from E5Gui import E5FileDialog |
16 from E5Gui import E5FileDialog |
17 |
17 |
18 from .Ui_SvnCommandDialog import Ui_SvnCommandDialog |
18 from .Ui_SvnCommandDialog import Ui_SvnCommandDialog |
19 |
19 |
20 import Utilities |
20 import Utilities |
|
21 import UI.PixmapCache |
21 |
22 |
22 |
23 |
23 class SvnCommandDialog(QDialog, Ui_SvnCommandDialog): |
24 class SvnCommandDialog(QDialog, Ui_SvnCommandDialog): |
24 """ |
25 """ |
25 Class implementing the Subversion command dialog. |
26 Class implementing the Subversion command dialog. |
38 @param parent parent widget of this dialog (QWidget) |
39 @param parent parent widget of this dialog (QWidget) |
39 """ |
40 """ |
40 super(SvnCommandDialog, self).__init__(parent) |
41 super(SvnCommandDialog, self).__init__(parent) |
41 self.setupUi(self) |
42 self.setupUi(self) |
42 |
43 |
|
44 self.dirButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
45 |
43 self.workdirCompleter = E5DirCompleter(self.workdirCombo) |
46 self.workdirCompleter = E5DirCompleter(self.workdirCombo) |
44 |
47 |
45 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
48 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
46 self.okButton.setEnabled(False) |
49 self.okButton.setEnabled(False) |
47 |
50 |
59 t = self.commandCombo.whatsThis() |
62 t = self.commandCombo.whatsThis() |
60 if t: |
63 if t: |
61 t += Utilities.getPercentReplacementHelp() |
64 t += Utilities.getPercentReplacementHelp() |
62 self.commandCombo.setWhatsThis(t) |
65 self.commandCombo.setWhatsThis(t) |
63 |
66 |
|
67 msh = self.minimumSizeHint() |
|
68 self.resize(max(self.width(), msh.width()), msh.height()) |
|
69 |
64 @pyqtSlot() |
70 @pyqtSlot() |
65 def on_dirButton_clicked(self): |
71 def on_dirButton_clicked(self): |
66 """ |
72 """ |
67 Private method used to open a directory selection dialog. |
73 Private method used to open a directory selection dialog. |
68 """ |
74 """ |
69 cwd = self.workdirCombo.currentText() |
75 cwd = self.workdirCombo.currentText() |
70 if not cwd: |
76 if not cwd: |
71 cwd = self.projectDirLabel.text() |
77 cwd = self.projectDirLabel.text() |
72 d = E5FileDialog.getExistingDirectory( |
78 d = E5FileDialog.getExistingDirectory( |
73 self, |
79 self, |
74 self.trUtf8("Working directory"), |
80 self.tr("Working directory"), |
75 cwd, |
81 cwd, |
76 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
82 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
77 |
83 |
78 if d: |
84 if d: |
79 self.workdirCombo.setEditText(Utilities.toNativeSeparators(d)) |
85 self.workdirCombo.setEditText(Utilities.toNativeSeparators(d)) |