ProjectDjangoTagsMenu/IeCommentDialog.py

branch
eric7
changeset 72
529f1c17c93e
parent 70
ce1c2effa0e0
child 74
a25b858e18a7
equal deleted inserted replaced
71:fc1ab84c242f 72:529f1c17c93e
50 self.conditionalComboBox.itemData(self.conditionalComboBox.currentIndex()), 50 self.conditionalComboBox.itemData(self.conditionalComboBox.currentIndex()),
51 self.versionSpinBox.value(), 51 self.versionSpinBox.value(),
52 ) 52 )
53 53
54 @staticmethod 54 @staticmethod
55 def getTag(selectedText): 55 def getTag(selectedText, parent=None):
56 """ 56 """
57 Public static method to get the formatted tag. 57 Public static method to get the formatted tag.
58 58
59 @param selectedText selected text to embed 59 @param selectedText selected text to embed
60 @type str 60 @type str
61 @param parent reference to the parent widget (defaults to None)
62 @type QWidget (optional)
61 @return formatted tag and a flag indicating the acceptance state 63 @return formatted tag and a flag indicating the acceptance state
62 @rtype tuple of (str, bool) 64 @rtype tuple of (str, bool)
63 """ 65 """
64 dlg = IeCommentDialog() 66 dlg = IeCommentDialog(parent=parent)
65 if dlg.exec() == QDialog.DialogCode.Accepted: 67 if dlg.exec() == QDialog.DialogCode.Accepted:
66 condition, version = dlg.getData() 68 condition, version = dlg.getData()
67 tag = "[if{0} IE {1}]> {2} <![endif]".format( 69 tag = "[if{0} IE {1}]> {2} <![endif]".format(
68 condition, version, selectedText 70 condition, version, selectedText
69 ) 71 )

eric ide

mercurial