20 |
20 |
21 from .Ui_SvnOptionsDialog import Ui_SvnOptionsDialog |
21 from .Ui_SvnOptionsDialog import Ui_SvnOptionsDialog |
22 from .Config import ConfigSvnProtocols |
22 from .Config import ConfigSvnProtocols |
23 |
23 |
24 import Utilities |
24 import Utilities |
|
25 import UI.PixmapCache |
25 |
26 |
26 |
27 |
27 class SvnOptionsDialog(QDialog, Ui_SvnOptionsDialog): |
28 class SvnOptionsDialog(QDialog, Ui_SvnOptionsDialog): |
28 """ |
29 """ |
29 Class implementing a dialog to enter options used to start a project in the |
30 Class implementing a dialog to enter options used to start a project in the |
38 @param parent parent widget (QWidget) |
39 @param parent parent widget (QWidget) |
39 """ |
40 """ |
40 super(SvnOptionsDialog, self).__init__(parent) |
41 super(SvnOptionsDialog, self).__init__(parent) |
41 self.setupUi(self) |
42 self.setupUi(self) |
42 |
43 |
|
44 self.vcsUrlButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
|
45 |
43 self.vcsDirectoryCompleter = E5DirCompleter(self.vcsUrlEdit) |
46 self.vcsDirectoryCompleter = E5DirCompleter(self.vcsUrlEdit) |
44 |
47 |
45 self.project = project |
48 self.project = project |
46 |
49 |
47 self.protocolCombo.addItems(ConfigSvnProtocols) |
50 self.protocolCombo.addItems(ConfigSvnProtocols) |
54 |
57 |
55 self.localPath = hd |
58 self.localPath = hd |
56 self.networkPath = "localhost/" |
59 self.networkPath = "localhost/" |
57 self.localProtocol = True |
60 self.localProtocol = True |
58 |
61 |
|
62 msh = self.minimumSizeHint() |
|
63 self.resize(max(self.width(), msh.width()), msh.height()) |
|
64 |
59 @pyqtSlot() |
65 @pyqtSlot() |
60 def on_vcsUrlButton_clicked(self): |
66 def on_vcsUrlButton_clicked(self): |
61 """ |
67 """ |
62 Private slot to display a selection dialog. |
68 Private slot to display a selection dialog. |
63 """ |
69 """ |
64 if self.protocolCombo.currentText() == "file://": |
70 if self.protocolCombo.currentText() == "file://": |
65 directory = E5FileDialog.getExistingDirectory( |
71 directory = E5FileDialog.getExistingDirectory( |
66 self, |
72 self, |
67 self.trUtf8("Select Repository-Directory"), |
73 self.tr("Select Repository-Directory"), |
68 self.vcsUrlEdit.text(), |
74 self.vcsUrlEdit.text(), |
69 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
75 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
70 |
76 |
71 if directory: |
77 if directory: |
72 self.vcsUrlEdit.setText( |
78 self.vcsUrlEdit.setText( |
93 @param protocol selected protocol (string) |
99 @param protocol selected protocol (string) |
94 """ |
100 """ |
95 if protocol == "file://": |
101 if protocol == "file://": |
96 self.networkPath = self.vcsUrlEdit.text() |
102 self.networkPath = self.vcsUrlEdit.text() |
97 self.vcsUrlEdit.setText(self.localPath) |
103 self.vcsUrlEdit.setText(self.localPath) |
98 self.vcsUrlLabel.setText(self.trUtf8("Pat&h:")) |
104 self.vcsUrlLabel.setText(self.tr("Pat&h:")) |
99 self.localProtocol = True |
105 self.localProtocol = True |
100 else: |
106 else: |
101 if self.localProtocol: |
107 if self.localProtocol: |
102 self.localPath = self.vcsUrlEdit.text() |
108 self.localPath = self.vcsUrlEdit.text() |
103 self.vcsUrlEdit.setText(self.networkPath) |
109 self.vcsUrlEdit.setText(self.networkPath) |
104 self.vcsUrlLabel.setText(self.trUtf8("&URL:")) |
110 self.vcsUrlLabel.setText(self.tr("&URL:")) |
105 self.localProtocol = False |
111 self.localProtocol = False |
106 |
112 |
107 @pyqtSlot(str) |
113 @pyqtSlot(str) |
108 def on_vcsUrlEdit_textChanged(self, txt): |
114 def on_vcsUrlEdit_textChanged(self, txt): |
109 """ |
115 """ |