40 super(EditorHighlightingStylesPage, self).__init__() |
40 super(EditorHighlightingStylesPage, self).__init__() |
41 self.setupUi(self) |
41 self.setupUi(self) |
42 self.setObjectName("EditorHighlightingStylesPage") |
42 self.setObjectName("EditorHighlightingStylesPage") |
43 |
43 |
44 self.__fontButtonMenu = QMenu() |
44 self.__fontButtonMenu = QMenu() |
45 act = self.__fontButtonMenu.addAction(self.trUtf8("Font")) |
45 act = self.__fontButtonMenu.addAction(self.tr("Font")) |
46 act.setData(self.FONT) |
46 act.setData(self.FONT) |
47 self.__fontButtonMenu.addSeparator() |
47 self.__fontButtonMenu.addSeparator() |
48 act = self.__fontButtonMenu.addAction( |
48 act = self.__fontButtonMenu.addAction( |
49 self.trUtf8("Family and Size only")) |
49 self.tr("Family and Size only")) |
50 act.setData(self.FAMILYANDSIZE) |
50 act.setData(self.FAMILYANDSIZE) |
51 act = self.__fontButtonMenu.addAction(self.trUtf8("Family only")) |
51 act = self.__fontButtonMenu.addAction(self.tr("Family only")) |
52 act.setData(self.FAMILYONLY) |
52 act.setData(self.FAMILYONLY) |
53 act = self.__fontButtonMenu.addAction(self.trUtf8("Size only")) |
53 act = self.__fontButtonMenu.addAction(self.tr("Size only")) |
54 act.setData(self.SIZEONLY) |
54 act.setData(self.SIZEONLY) |
55 self.__fontButtonMenu.triggered.connect(self.__fontButtonMenuTriggered) |
55 self.__fontButtonMenu.triggered.connect(self.__fontButtonMenuTriggered) |
56 self.fontButton.setMenu(self.__fontButtonMenu) |
56 self.fontButton.setMenu(self.__fontButtonMenu) |
57 |
57 |
58 self.__allFontsButtonMenu = QMenu() |
58 self.__allFontsButtonMenu = QMenu() |
59 act = self.__allFontsButtonMenu.addAction(self.trUtf8("Font")) |
59 act = self.__allFontsButtonMenu.addAction(self.tr("Font")) |
60 act.setData(self.FONT) |
60 act.setData(self.FONT) |
61 self.__allFontsButtonMenu.addSeparator() |
61 self.__allFontsButtonMenu.addSeparator() |
62 act = self.__allFontsButtonMenu.addAction( |
62 act = self.__allFontsButtonMenu.addAction( |
63 self.trUtf8("Family and Size only")) |
63 self.tr("Family and Size only")) |
64 act.setData(self.FAMILYANDSIZE) |
64 act.setData(self.FAMILYANDSIZE) |
65 act = self.__allFontsButtonMenu.addAction(self.trUtf8("Family only")) |
65 act = self.__allFontsButtonMenu.addAction(self.tr("Family only")) |
66 act.setData(self.FAMILYONLY) |
66 act.setData(self.FAMILYONLY) |
67 act = self.__allFontsButtonMenu.addAction(self.trUtf8("Size only")) |
67 act = self.__allFontsButtonMenu.addAction(self.tr("Size only")) |
68 act.setData(self.SIZEONLY) |
68 act.setData(self.SIZEONLY) |
69 self.__allFontsButtonMenu.triggered.connect( |
69 self.__allFontsButtonMenu.triggered.connect( |
70 self.__allFontsButtonMenuTriggered) |
70 self.__allFontsButtonMenuTriggered) |
71 self.allFontsButton.setMenu(self.__allFontsButtonMenu) |
71 self.allFontsButton.setMenu(self.__allFontsButtonMenu) |
72 |
72 |
324 def on_allEolFillButton_clicked(self): |
324 def on_allEolFillButton_clicked(self): |
325 """ |
325 """ |
326 Private method used to set the eolfill for all styles of a selected |
326 Private method used to set the eolfill for all styles of a selected |
327 lexer. |
327 lexer. |
328 """ |
328 """ |
329 on = self.trUtf8("Enabled") |
329 on = self.tr("Enabled") |
330 off = self.trUtf8("Disabled") |
330 off = self.tr("Disabled") |
331 selection, ok = QInputDialog.getItem( |
331 selection, ok = QInputDialog.getItem( |
332 self, |
332 self, |
333 self.trUtf8("Fill to end of line"), |
333 self.tr("Fill to end of line"), |
334 self.trUtf8("Select fill to end of line for all styles"), |
334 self.tr("Select fill to end of line for all styles"), |
335 [on, off], |
335 [on, off], |
336 0, False) |
336 0, False) |
337 if ok: |
337 if ok: |
338 enabled = selection == on |
338 enabled = selection == on |
339 self.eolfillCheckBox.setChecked(enabled) |
339 self.eolfillCheckBox.setChecked(enabled) |
413 |
413 |
414 @param lexers list of lexer objects for which to export the styles |
414 @param lexers list of lexer objects for which to export the styles |
415 """ |
415 """ |
416 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( |
416 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( |
417 self, |
417 self, |
418 self.trUtf8("Export Highlighting Styles"), |
418 self.tr("Export Highlighting Styles"), |
419 "", |
419 "", |
420 self.trUtf8("Highlighting styles file (*.e4h)"), |
420 self.tr("Highlighting styles file (*.e4h)"), |
421 "", |
421 "", |
422 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) |
422 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) |
423 |
423 |
424 if not fn: |
424 if not fn: |
425 return |
425 return |
436 HighlightingStylesWriter(f, lexers).writeXML() |
436 HighlightingStylesWriter(f, lexers).writeXML() |
437 f.close() |
437 f.close() |
438 else: |
438 else: |
439 E5MessageBox.critical( |
439 E5MessageBox.critical( |
440 self, |
440 self, |
441 self.trUtf8("Export Highlighting Styles"), |
441 self.tr("Export Highlighting Styles"), |
442 self.trUtf8( |
442 self.tr( |
443 """<p>The highlighting styles could not be exported""" |
443 """<p>The highlighting styles could not be exported""" |
444 """ to file <b>{0}</b>.</p><p>Reason: {1}</p>""") |
444 """ to file <b>{0}</b>.</p><p>Reason: {1}</p>""") |
445 .format(fn, f.errorString()) |
445 .format(fn, f.errorString()) |
446 ) |
446 ) |
447 |
447 |