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 from PyQt4.QtCore import QByteArray, QXmlStreamReader |
10 from PyQt4.QtCore import QXmlStreamReader, QFile, QIODevice |
11 from PyQt4.QtGui import QMenu, QAction, QActionGroup, QInputDialog, QLineEdit |
11 from PyQt4.QtGui import QMenu, QAction, QActionGroup, QInputDialog, QLineEdit |
12 |
12 |
13 from E5Gui import E5MessageBox |
13 from E5Gui import E5MessageBox |
14 |
14 |
15 |
15 |
119 """ |
119 """ |
120 Private slot to add the default user agent entries. |
120 Private slot to add the default user agent entries. |
121 |
121 |
122 @return flag indicating that a user agent entry is checked (boolean) |
122 @return flag indicating that a user agent entry is checked (boolean) |
123 """ |
123 """ |
124 from .UserAgentDefaults import UserAgentDefaults |
124 from . import UserAgentDefaults_rc # __IGNORE_WARNING__ |
|
125 defaultUserAgents = QFile(":/UserAgentDefaults.xml") |
|
126 defaultUserAgents.open(QIODevice.ReadOnly) |
|
127 |
125 menuStack = [] |
128 menuStack = [] |
126 isChecked = False |
129 isChecked = False |
127 defaultUserAgents = QByteArray(UserAgentDefaults) |
|
128 |
130 |
129 if self.__url: |
131 if self.__url: |
130 currentUserAgentString = self.__manager.userAgentForUrl(self.__url) |
132 currentUserAgentString = self.__manager.userAgentForUrl(self.__url) |
131 else: |
133 else: |
132 from Helpviewer.HelpBrowserWV import HelpWebPage |
134 from Helpviewer.HelpBrowserWV import HelpWebPage |