5 |
5 |
6 """ |
6 """ |
7 Module implementing a menu to select the user agent string. |
7 Module implementing a menu to select the user agent string. |
8 """ |
8 """ |
9 |
9 |
|
10 import os |
10 |
11 |
11 from PyQt5.QtCore import QXmlStreamReader, QFile, QIODevice |
12 from PyQt5.QtCore import QXmlStreamReader, QFile, QIODevice |
12 from PyQt5.QtWidgets import ( |
13 from PyQt5.QtWidgets import ( |
13 QMenu, QAction, QActionGroup, QInputDialog, QLineEdit |
14 QMenu, QAction, QActionGroup, QInputDialog, QLineEdit |
14 ) |
15 ) |
124 """ |
125 """ |
125 Private slot to add the default user agent entries. |
126 Private slot to add the default user agent entries. |
126 |
127 |
127 @return flag indicating that a user agent entry is checked (boolean) |
128 @return flag indicating that a user agent entry is checked (boolean) |
128 """ |
129 """ |
129 # TODO: convert this to not use .qrc |
130 defaultUserAgents = QFile(os.path.join( |
130 from . import UserAgentDefaults_rc # __IGNORE_WARNING__ |
131 os.path.dirname(__file__), "UserAgentDefaults.xml")) |
131 defaultUserAgents = QFile(":/UserAgentDefaults.xml") |
|
132 defaultUserAgents.open(QIODevice.ReadOnly) |
132 defaultUserAgents.open(QIODevice.ReadOnly) |
133 |
133 |
134 menuStack = [] |
134 menuStack = [] |
135 isChecked = False |
135 isChecked = False |
136 |
136 |