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 ) |