173 """ |
173 """ |
174 Private method to initialize the web tools menu. |
174 Private method to initialize the web tools menu. |
175 """ |
175 """ |
176 self.__menu = QMenu(self.tr("Web")) |
176 self.__menu = QMenu(self.tr("Web")) |
177 |
177 |
178 # TODO: add our actions here |
|
179 self.__html5ToCss3Act = self.__menu.addAction(self.tr( |
178 self.__html5ToCss3Act = self.__menu.addAction(self.tr( |
180 "HTML5 to CSS3"), self.__htm5ToCss3) |
179 "HTML5 to CSS3"), self.__html5ToCss3) |
181 self.__html5ToJsAct = self.__menu.addAction(self.tr( |
180 self.__html5ToJsAct = self.__menu.addAction(self.tr( |
182 "HTML5 to JavaScript"), self.__htm5ToJs) |
181 "HTML5 to JavaScript"), self.__html5ToJs) |
183 self.__menu.addSeparator() |
182 self.__menu.addSeparator() |
184 self.__html5PrettifyAct = self.__menu.addAction(self.tr( |
183 self.__html5PrettifyAct = self.__menu.addAction(self.tr( |
185 "Prettify HTML"), self.__html5Prettify) |
184 "Prettify HTML"), self.__html5Prettify) |
186 |
185 |
187 self.__menu.aboutToShow.connect(self.__menuAboutToShow) |
186 self.__menu.aboutToShow.connect(self.__menuAboutToShow) |
261 act = menu.addSeparator() |
260 act = menu.addSeparator() |
262 self.__editors[editor].append(act) |
261 self.__editors[editor].append(act) |
263 act = menu.addMenu(self.__menu) |
262 act = menu.addMenu(self.__menu) |
264 self.__editors[editor].append(act) |
263 self.__editors[editor].append(act) |
265 |
264 |
266 def __htm5ToCss3(self): |
265 def __html5ToCss3(self): |
267 """ |
266 """ |
268 Private slot handling the HTML5 to CSS3 conversion. |
267 Private slot handling the HTML5 to CSS3 conversion. |
269 """ |
268 """ |
270 from ProjectWeb.Html5ToCss3Converter import Html5ToCss3Converter |
269 from ProjectWeb.Html5ToCss3Converter import Html5ToCss3Converter |
271 vm = e5App().getObject("ViewManager") |
270 vm = e5App().getObject("ViewManager") |
279 vm.newEditor() |
278 vm.newEditor() |
280 newEditor = vm.activeWindow() |
279 newEditor = vm.activeWindow() |
281 newEditor.setText(css3) |
280 newEditor.setText(css3) |
282 newEditor.setLanguage("dummy.css") |
281 newEditor.setLanguage("dummy.css") |
283 |
282 |
284 def __htm5ToJs(self): |
283 def __html5ToJs(self): |
285 """ |
284 """ |
286 Private slot handling the HTML5 to JavaScript conversion. |
285 Private slot handling the HTML5 to JavaScript conversion. |
287 """ |
286 """ |
288 from ProjectWeb.Html5ToJsConverter import Html5ToJsConverter |
287 from ProjectWeb.Html5ToJsConverter import Html5ToJsConverter |
289 vm = e5App().getObject("ViewManager") |
288 vm = e5App().getObject("ViewManager") |