11 |
11 |
12 from PyQt6.QtCore import pyqtSlot |
12 from PyQt6.QtCore import pyqtSlot |
13 from PyQt6.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit |
13 from PyQt6.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit |
14 from PyQt6.Qsci import QsciScintilla |
14 from PyQt6.Qsci import QsciScintilla |
15 |
15 |
16 from E5Gui import E5MessageBox |
16 from E5Gui import EricMessageBox |
17 from E5Gui.E5Application import e5App |
17 from E5Gui.EricApplication import ericApp |
18 |
18 |
19 from .ConfigurationPageBase import ConfigurationPageBase |
19 from .ConfigurationPageBase import ConfigurationPageBase |
20 from .Ui_EditorFilePage import Ui_EditorFilePage |
20 from .Ui_EditorFilePage import Ui_EditorFilePage |
21 |
21 |
22 from Utilities import supportedCodecs |
22 from Utilities import supportedCodecs |
268 """ |
268 """ |
269 if ( |
269 if ( |
270 not self.__showsOpenFilters and |
270 not self.__showsOpenFilters and |
271 fileFilter.count("*") != 1 |
271 fileFilter.count("*") != 1 |
272 ): |
272 ): |
273 E5MessageBox.critical( |
273 EricMessageBox.critical( |
274 self, |
274 self, |
275 self.tr("Add File Filter"), |
275 self.tr("Add File Filter"), |
276 self.tr("""A Save File Filter must contain exactly one""" |
276 self.tr("""A Save File Filter must contain exactly one""" |
277 """ wildcard pattern. Yours contains {0}.""") |
277 """ wildcard pattern. Yours contains {0}.""") |
278 .format(fileFilter.count("*"))) |
278 .format(fileFilter.count("*"))) |
279 return False |
279 return False |
280 |
280 |
281 if fileFilter.count("*") == 0: |
281 if fileFilter.count("*") == 0: |
282 E5MessageBox.critical( |
282 EricMessageBox.critical( |
283 self, |
283 self, |
284 self.tr("Add File Filter"), |
284 self.tr("Add File Filter"), |
285 self.tr("""A File Filter must contain at least one""" |
285 self.tr("""A File Filter must contain at least one""" |
286 """ wildcard pattern.""")) |
286 """ wildcard pattern.""")) |
287 return False |
287 return False |
358 @pyqtSlot() |
358 @pyqtSlot() |
359 def on_previewMarkdownPyMdownInstallPushButton_clicked(self): |
359 def on_previewMarkdownPyMdownInstallPushButton_clicked(self): |
360 """ |
360 """ |
361 Private slot to install the pymdown extensions package via pip. |
361 Private slot to install the pymdown extensions package via pip. |
362 """ |
362 """ |
363 pip = e5App().getObject("Pip") |
363 pip = ericApp().getObject("Pip") |
364 pip.installPackages(["pymdown-extensions"], interpreter=sys.executable) |
364 pip.installPackages(["pymdown-extensions"], interpreter=sys.executable) |
365 self.polishPage() |
365 self.polishPage() |
366 |
366 |
367 def polishPage(self): |
367 def polishPage(self): |
368 """ |
368 """ |