11 from PyQt6.QtGui import QRegularExpressionValidator |
11 from PyQt6.QtGui import QRegularExpressionValidator |
12 from PyQt6.QtWidgets import QDialog |
12 from PyQt6.QtWidgets import QDialog |
13 |
13 |
14 from eric7 import Preferences |
14 from eric7 import Preferences |
15 from eric7.EricWidgets import EricMessageBox |
15 from eric7.EricWidgets import EricMessageBox |
|
16 from eric7.EricWidgets.EricSimpleHelpDialog import EricSimpleHelpDialog |
|
17 from eric7.QScintilla import Lexers |
16 |
18 |
17 from .Ui_TemplatePropertiesDialog import Ui_TemplatePropertiesDialog |
19 from .Ui_TemplatePropertiesDialog import Ui_TemplatePropertiesDialog |
18 |
20 |
19 |
21 |
20 class TemplatePropertiesDialog(QDialog, Ui_TemplatePropertiesDialog): |
22 class TemplatePropertiesDialog(QDialog, Ui_TemplatePropertiesDialog): |
48 ) |
50 ) |
49 self.__nameValidator = QRegularExpressionValidator( |
51 self.__nameValidator = QRegularExpressionValidator( |
50 QRegularExpression("[a-zA-Z0-9_]+"), self.nameEdit |
52 QRegularExpression("[a-zA-Z0-9_]+"), self.nameEdit |
51 ) |
53 ) |
52 self.nameEdit.setValidator(self.__nameValidator) |
54 self.nameEdit.setValidator(self.__nameValidator) |
53 |
|
54 from eric7.QScintilla import Lexers |
|
55 |
55 |
56 self.languages = [("All", self.tr("All"))] |
56 self.languages = [("All", self.tr("All"))] |
57 supportedLanguages = Lexers.getSupportedLanguages() |
57 supportedLanguages = Lexers.getSupportedLanguages() |
58 languages = sorted(supportedLanguages.keys()) |
58 languages = sorted(supportedLanguages.keys()) |
59 for language in languages: |
59 for language in languages: |
112 def on_helpButton_clicked(self): |
112 def on_helpButton_clicked(self): |
113 """ |
113 """ |
114 Private slot to show some help. |
114 Private slot to show some help. |
115 """ |
115 """ |
116 if self.__helpDialog is None: |
116 if self.__helpDialog is None: |
117 from eric7.EricWidgets.EricSimpleHelpDialog import EricSimpleHelpDialog |
|
118 |
|
119 self.__helpDialog = EricSimpleHelpDialog( |
117 self.__helpDialog = EricSimpleHelpDialog( |
120 title=self.tr("Template Help"), |
118 title=self.tr("Template Help"), |
121 label=self.tr("<b>Template Help</b>"), |
119 label=self.tr("<b>Template Help</b>"), |
122 helpStr=self.tr( |
120 helpStr=self.tr( |
123 """<p>To use variables in a template, you just have to""" |
121 """<p>To use variables in a template, you just have to""" |