Plugins/VcsPlugins/vcsMercurial/HgServeDialog.py

changeset 3008
7848489bcb92
parent 2771
281c9b30dd91
child 3020
542e97d4ecb3
child 3057
10516539f238
equal deleted inserted replaced
3007:bad2e89047e7 3008:7848489bcb92
43 43
44 self.setWindowTitle(self.trUtf8("Mercurial Server")) 44 self.setWindowTitle(self.trUtf8("Mercurial Server"))
45 45
46 self.__startAct = QAction( 46 self.__startAct = QAction(
47 UI.PixmapCache.getIcon( 47 UI.PixmapCache.getIcon(
48 os.path.join("VcsPlugins", "vcsMercurial", "icons", "startServer.png")), 48 os.path.join("VcsPlugins", "vcsMercurial", "icons",
49 "startServer.png")),
49 self.trUtf8("Start Server"), self) 50 self.trUtf8("Start Server"), self)
50 self.__startAct.triggered[()].connect(self.__startServer) 51 self.__startAct.triggered[()].connect(self.__startServer)
51 self.__stopAct = QAction( 52 self.__stopAct = QAction(
52 UI.PixmapCache.getIcon( 53 UI.PixmapCache.getIcon(
53 os.path.join("VcsPlugins", "vcsMercurial", "icons", "stopServer.png")), 54 os.path.join("VcsPlugins", "vcsMercurial", "icons",
55 "stopServer.png")),
54 self.trUtf8("Stop Server"), self) 56 self.trUtf8("Stop Server"), self)
55 self.__stopAct.triggered[()].connect(self.__stopServer) 57 self.__stopAct.triggered[()].connect(self.__stopServer)
56 self.__browserAct = QAction( 58 self.__browserAct = QAction(
57 UI.PixmapCache.getIcon("home.png"), 59 UI.PixmapCache.getIcon("home.png"),
58 self.trUtf8("Start Browser"), self) 60 self.trUtf8("Start Browser"), self)
60 62
61 self.__portSpin = QSpinBox(self) 63 self.__portSpin = QSpinBox(self)
62 self.__portSpin.setMinimum(2048) 64 self.__portSpin.setMinimum(2048)
63 self.__portSpin.setMaximum(65535) 65 self.__portSpin.setMaximum(65535)
64 self.__portSpin.setToolTip(self.trUtf8("Enter the server port")) 66 self.__portSpin.setToolTip(self.trUtf8("Enter the server port"))
65 self.__portSpin.setValue(self.vcs.getPlugin().getPreferences("ServerPort")) 67 self.__portSpin.setValue(
68 self.vcs.getPlugin().getPreferences("ServerPort"))
66 69
67 self.__styleCombo = QComboBox(self) 70 self.__styleCombo = QComboBox(self)
68 self.__styleCombo.addItems(self.__styles) 71 self.__styleCombo.addItems(self.__styles)
69 self.__styleCombo.setToolTip(self.trUtf8("Select the style to use")) 72 self.__styleCombo.setToolTip(self.trUtf8("Select the style to use"))
70 self.__styleCombo.setCurrentIndex(self.__styleCombo.findText( 73 self.__styleCombo.setCurrentIndex(self.__styleCombo.findText(
99 self.process.readyReadStandardOutput.connect(self.__readStdout) 102 self.process.readyReadStandardOutput.connect(self.__readStdout)
100 self.process.readyReadStandardError.connect(self.__readStderr) 103 self.process.readyReadStandardError.connect(self.__readStderr)
101 104
102 self.cNormalFormat = self.__log.currentCharFormat() 105 self.cNormalFormat = self.__log.currentCharFormat()
103 self.cErrorFormat = self.__log.currentCharFormat() 106 self.cErrorFormat = self.__log.currentCharFormat()
104 self.cErrorFormat.setForeground(QBrush(Preferences.getUI("LogStdErrColour"))) 107 self.cErrorFormat.setForeground(
108 QBrush(Preferences.getUI("LogStdErrColour")))
105 109
106 def __startServer(self): 110 def __startServer(self):
107 """ 111 """
108 Private slot to start the Mercurial server. 112 Private slot to start the Mercurial server.
109 """ 113 """
158 def __startBrowser(self): 162 def __startBrowser(self):
159 """ 163 """
160 Private slot to start a browser for the served repository. 164 Private slot to start a browser for the served repository.
161 """ 165 """
162 ui = e5App().getObject("UserInterface") 166 ui = e5App().getObject("UserInterface")
163 ui.launchHelpViewer("http://localhost:{0}".format(self.__portSpin.value())) 167 ui.launchHelpViewer(
168 "http://localhost:{0}".format(self.__portSpin.value()))
164 169
165 def closeEvent(self, e): 170 def closeEvent(self, e):
166 """ 171 """
167 Private slot implementing a close event handler. 172 Private slot implementing a close event handler.
168 173

eric ide

mercurial