18 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
19 from E5Gui import E5MessageBox |
19 from E5Gui import E5MessageBox |
20 from E5Gui.E5MainWindow import E5MainWindow |
20 from E5Gui.E5MainWindow import E5MainWindow |
21 |
21 |
22 import UI.PixmapCache |
22 import UI.PixmapCache |
23 |
|
24 import Preferences |
23 import Preferences |
|
24 |
|
25 from .HgUtilities import getHgExecutable |
25 |
26 |
26 |
27 |
27 class HgServeDialog(E5MainWindow): |
28 class HgServeDialog(E5MainWindow): |
28 """ |
29 """ |
29 Class implementing a dialog for the Mercurial server. |
30 Class implementing a dialog for the Mercurial server. |
119 Private slot to start the Mercurial server. |
120 Private slot to start the Mercurial server. |
120 """ |
121 """ |
121 port = self.__portSpin.value() |
122 port = self.__portSpin.value() |
122 style = self.__styleCombo.currentText() |
123 style = self.__styleCombo.currentText() |
123 |
124 |
|
125 exe = getHgExecutable() |
|
126 |
124 args = self.vcs.initCommand("serve") |
127 args = self.vcs.initCommand("serve") |
125 args.append("-v") |
128 args.append("-v") |
126 args.append("--port") |
129 args.append("--port") |
127 args.append(str(port)) |
130 args.append(str(port)) |
128 args.append("--style") |
131 args.append("--style") |
129 args.append(style) |
132 args.append(style) |
130 |
133 |
131 self.process.setWorkingDirectory(self.__repoPath) |
134 self.process.setWorkingDirectory(self.__repoPath) |
132 |
135 |
133 self.process.start('hg', args) |
136 self.process.start(exe, args) |
134 procStarted = self.process.waitForStarted(5000) |
137 procStarted = self.process.waitForStarted(5000) |
135 if procStarted: |
138 if procStarted: |
136 self.__startAct.setEnabled(False) |
139 self.__startAct.setEnabled(False) |
137 self.__stopAct.setEnabled(True) |
140 self.__stopAct.setEnabled(True) |
138 self.__browserAct.setEnabled(True) |
141 self.__browserAct.setEnabled(True) |
145 self, |
148 self, |
146 self.tr('Process Generation Error'), |
149 self.tr('Process Generation Error'), |
147 self.tr( |
150 self.tr( |
148 'The process {0} could not be started. ' |
151 'The process {0} could not be started. ' |
149 'Ensure, that it is in the search path.' |
152 'Ensure, that it is in the search path.' |
150 ).format('hg')) |
153 ).format(exe)) |
151 |
154 |
152 def __stopServer(self): |
155 def __stopServer(self): |
153 """ |
156 """ |
154 Private slot to stop the Mercurial server. |
157 Private slot to stop the Mercurial server. |
155 """ |
158 """ |