eric7/Plugins/VcsPlugins/vcsMercurial/HgServeDialog.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
13 from PyQt6.QtGui import QAction, QTextCursor, QBrush 13 from PyQt6.QtGui import QAction, QTextCursor, QBrush
14 from PyQt6.QtWidgets import ( 14 from PyQt6.QtWidgets import (
15 QToolBar, QPlainTextEdit, QSpinBox, QComboBox 15 QToolBar, QPlainTextEdit, QSpinBox, QComboBox
16 ) 16 )
17 17
18 from E5Gui.E5Application import e5App 18 from E5Gui.EricApplication import ericApp
19 from E5Gui import E5MessageBox 19 from E5Gui import EricMessageBox
20 from E5Gui.E5MainWindow import E5MainWindow 20 from E5Gui.EricMainWindow import EricMainWindow
21 21
22 import UI.PixmapCache 22 import UI.PixmapCache
23 import Preferences 23 import Preferences
24 24
25 from .HgUtilities import getHgExecutable 25 from .HgUtilities import getHgExecutable
26 26
27 27
28 class HgServeDialog(E5MainWindow): 28 class HgServeDialog(EricMainWindow):
29 """ 29 """
30 Class implementing a dialog for the Mercurial server. 30 Class implementing a dialog for the Mercurial server.
31 """ 31 """
32 def __init__(self, vcs, path, parent=None): 32 def __init__(self, vcs, path, parent=None):
33 """ 33 """
47 47
48 self.__styles = ["paper", "coal", "gitweb", "monoblue", "spartan", ] 48 self.__styles = ["paper", "coal", "gitweb", "monoblue", "spartan", ]
49 49
50 self.setWindowTitle(self.tr("Mercurial Server")) 50 self.setWindowTitle(self.tr("Mercurial Server"))
51 51
52 iconSuffix = "dark" if e5App().usesDarkPalette() else "light" 52 iconSuffix = "dark" if ericApp().usesDarkPalette() else "light"
53 53
54 self.__startAct = QAction( 54 self.__startAct = QAction(
55 UI.PixmapCache.getIcon( 55 UI.PixmapCache.getIcon(
56 os.path.join("VcsPlugins", "vcsMercurial", "icons", 56 os.path.join("VcsPlugins", "vcsMercurial", "icons",
57 "startServer-{0}.svg".format(iconSuffix))), 57 "startServer-{0}.svg".format(iconSuffix))),
142 self.__portSpin.setEnabled(False) 142 self.__portSpin.setEnabled(False)
143 self.__styleCombo.setEnabled(False) 143 self.__styleCombo.setEnabled(False)
144 self.vcs.getPlugin().setPreferences("ServerPort", port) 144 self.vcs.getPlugin().setPreferences("ServerPort", port)
145 self.vcs.getPlugin().setPreferences("ServerStyle", style) 145 self.vcs.getPlugin().setPreferences("ServerStyle", style)
146 else: 146 else:
147 E5MessageBox.critical( 147 EricMessageBox.critical(
148 self, 148 self,
149 self.tr('Process Generation Error'), 149 self.tr('Process Generation Error'),
150 self.tr( 150 self.tr(
151 'The process {0} could not be started. ' 151 'The process {0} could not be started. '
152 'Ensure, that it is in the search path.' 152 'Ensure, that it is in the search path.'
173 173
174 def __startBrowser(self): 174 def __startBrowser(self):
175 """ 175 """
176 Private slot to start a browser for the served repository. 176 Private slot to start a browser for the served repository.
177 """ 177 """
178 ui = e5App().getObject("UserInterface") 178 ui = ericApp().getObject("UserInterface")
179 ui.launchHelpViewer( 179 ui.launchHelpViewer(
180 "http://localhost:{0}".format(self.__portSpin.value())) 180 "http://localhost:{0}".format(self.__portSpin.value()))
181 181
182 def closeEvent(self, e): 182 def closeEvent(self, e):
183 """ 183 """

eric ide

mercurial