Plugins/VcsPlugins/vcsMercurial/HgServeDialog.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3302
e92f0dd51979
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
39 self.vcs = vcs 39 self.vcs = vcs
40 self.__repoPath = path 40 self.__repoPath = path
41 41
42 self.__styles = ["paper", "coal", "gitweb", "monoblue", "spartan", ] 42 self.__styles = ["paper", "coal", "gitweb", "monoblue", "spartan", ]
43 43
44 self.setWindowTitle(self.trUtf8("Mercurial Server")) 44 self.setWindowTitle(self.tr("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", 48 os.path.join("VcsPlugins", "vcsMercurial", "icons",
49 "startServer.png")), 49 "startServer.png")),
50 self.trUtf8("Start Server"), self) 50 self.tr("Start Server"), self)
51 self.__startAct.triggered[()].connect(self.__startServer) 51 self.__startAct.triggered[()].connect(self.__startServer)
52 self.__stopAct = QAction( 52 self.__stopAct = QAction(
53 UI.PixmapCache.getIcon( 53 UI.PixmapCache.getIcon(
54 os.path.join("VcsPlugins", "vcsMercurial", "icons", 54 os.path.join("VcsPlugins", "vcsMercurial", "icons",
55 "stopServer.png")), 55 "stopServer.png")),
56 self.trUtf8("Stop Server"), self) 56 self.tr("Stop Server"), self)
57 self.__stopAct.triggered[()].connect(self.__stopServer) 57 self.__stopAct.triggered[()].connect(self.__stopServer)
58 self.__browserAct = QAction( 58 self.__browserAct = QAction(
59 UI.PixmapCache.getIcon("home.png"), 59 UI.PixmapCache.getIcon("home.png"),
60 self.trUtf8("Start Browser"), self) 60 self.tr("Start Browser"), self)
61 self.__browserAct.triggered[()].connect(self.__startBrowser) 61 self.__browserAct.triggered[()].connect(self.__startBrowser)
62 62
63 self.__portSpin = QSpinBox(self) 63 self.__portSpin = QSpinBox(self)
64 self.__portSpin.setMinimum(2048) 64 self.__portSpin.setMinimum(2048)
65 self.__portSpin.setMaximum(65535) 65 self.__portSpin.setMaximum(65535)
66 self.__portSpin.setToolTip(self.trUtf8("Enter the server port")) 66 self.__portSpin.setToolTip(self.tr("Enter the server port"))
67 self.__portSpin.setValue( 67 self.__portSpin.setValue(
68 self.vcs.getPlugin().getPreferences("ServerPort")) 68 self.vcs.getPlugin().getPreferences("ServerPort"))
69 69
70 self.__styleCombo = QComboBox(self) 70 self.__styleCombo = QComboBox(self)
71 self.__styleCombo.addItems(self.__styles) 71 self.__styleCombo.addItems(self.__styles)
72 self.__styleCombo.setToolTip(self.trUtf8("Select the style to use")) 72 self.__styleCombo.setToolTip(self.tr("Select the style to use"))
73 self.__styleCombo.setCurrentIndex(self.__styleCombo.findText( 73 self.__styleCombo.setCurrentIndex(self.__styleCombo.findText(
74 self.vcs.getPlugin().getPreferences("ServerStyle"))) 74 self.vcs.getPlugin().getPreferences("ServerStyle")))
75 75
76 self.__serverToolbar = QToolBar(self.trUtf8("Server"), self) 76 self.__serverToolbar = QToolBar(self.tr("Server"), self)
77 self.__serverToolbar.addAction(self.__startAct) 77 self.__serverToolbar.addAction(self.__startAct)
78 self.__serverToolbar.addAction(self.__stopAct) 78 self.__serverToolbar.addAction(self.__stopAct)
79 self.__serverToolbar.addSeparator() 79 self.__serverToolbar.addSeparator()
80 self.__serverToolbar.addWidget(self.__portSpin) 80 self.__serverToolbar.addWidget(self.__portSpin)
81 self.__serverToolbar.addWidget(self.__styleCombo) 81 self.__serverToolbar.addWidget(self.__styleCombo)
82 82
83 self.__browserToolbar = QToolBar(self.trUtf8("Browser"), self) 83 self.__browserToolbar = QToolBar(self.tr("Browser"), self)
84 self.__browserToolbar.addAction(self.__browserAct) 84 self.__browserToolbar.addAction(self.__browserAct)
85 85
86 self.addToolBar(Qt.TopToolBarArea, self.__serverToolbar) 86 self.addToolBar(Qt.TopToolBarArea, self.__serverToolbar)
87 self.addToolBar(Qt.TopToolBarArea, self.__browserToolbar) 87 self.addToolBar(Qt.TopToolBarArea, self.__browserToolbar)
88 88
135 self.vcs.getPlugin().setPreferences("ServerPort", port) 135 self.vcs.getPlugin().setPreferences("ServerPort", port)
136 self.vcs.getPlugin().setPreferences("ServerStyle", style) 136 self.vcs.getPlugin().setPreferences("ServerStyle", style)
137 else: 137 else:
138 E5MessageBox.critical( 138 E5MessageBox.critical(
139 self, 139 self,
140 self.trUtf8('Process Generation Error'), 140 self.tr('Process Generation Error'),
141 self.trUtf8( 141 self.tr(
142 'The process {0} could not be started. ' 142 'The process {0} could not be started. '
143 'Ensure, that it is in the search path.' 143 'Ensure, that it is in the search path.'
144 ).format('hg')) 144 ).format('hg'))
145 145
146 def __stopServer(self): 146 def __stopServer(self):

eric ide

mercurial