12 |
12 |
13 from PyQt6.QtCore import QXmlStreamReader, QFile, QIODevice |
13 from PyQt6.QtCore import QXmlStreamReader, QFile, QIODevice |
14 from PyQt6.QtGui import QAction, QActionGroup |
14 from PyQt6.QtGui import QAction, QActionGroup |
15 from PyQt6.QtWidgets import QMenu, QInputDialog, QLineEdit |
15 from PyQt6.QtWidgets import QMenu, QInputDialog, QLineEdit |
16 |
16 |
17 from E5Gui import E5MessageBox |
17 from E5Gui import EricMessageBox |
18 |
18 |
19 |
19 |
20 class UserAgentMenu(QMenu): |
20 class UserAgentMenu(QMenu): |
21 """ |
21 """ |
22 Class implementing a menu to select the user agent string. |
22 Class implementing a menu to select the user agent string. |
182 |
182 |
183 if xml.isEndElement() and xml.name() == "useragentmenu": |
183 if xml.isEndElement() and xml.name() == "useragentmenu": |
184 menuStack.pop() |
184 menuStack.pop() |
185 |
185 |
186 if xml.hasError(): |
186 if xml.hasError(): |
187 E5MessageBox.critical( |
187 EricMessageBox.critical( |
188 self, |
188 self, |
189 self.tr("Parsing default user agents"), |
189 self.tr("Parsing default user agents"), |
190 self.tr( |
190 self.tr( |
191 """<p>Error parsing default user agents.</p><p>{0}</p>""") |
191 """<p>Error parsing default user agents.</p><p>{0}</p>""") |
192 .format(xml.errorString())) |
192 .format(xml.errorString())) |