Helpviewer/HelpWindow.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2847
1843ef6e2656
parent 2999
28c75409a78f
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
13 except (NameError): 13 except (NameError):
14 pass 14 pass
15 15
16 import os 16 import os
17 17
18 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, QUrl, \ 18 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \
19 QThread, QTextCodec 19 QUrl, QThread, QTextCodec
20 from PyQt4.QtGui import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \ 20 from PyQt4.QtGui import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \
21 QDesktopServices, QKeySequence, QComboBox, QFont, QFontMetrics, QLabel, \ 21 QDesktopServices, QKeySequence, QComboBox, QFont, QFontMetrics, QLabel, \
22 QSplitter, QMenu, QToolButton, QLineEdit, QApplication, QWhatsThis, QDialog, \ 22 QSplitter, QMenu, QToolButton, QLineEdit, QApplication, QWhatsThis, \
23 QHBoxLayout, QProgressBar, QAction, QIcon 23 QDialog, QHBoxLayout, QProgressBar, QAction, QIcon
24 from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest 24 from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest
25 from PyQt4.QtWebKit import QWebSettings, QWebDatabase, QWebSecurityOrigin, QWebPage 25 from PyQt4.QtWebKit import QWebSettings, QWebDatabase, QWebSecurityOrigin, \
26 QWebPage
26 try: 27 try:
27 from PyQt4.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery 28 from PyQt4.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery
28 QTHELP_AVAILABLE = True 29 QTHELP_AVAILABLE = True
29 except ImportError: 30 except ImportError:
30 QTHELP_AVAILABLE = False 31 QTHELP_AVAILABLE = False
54 class HelpWindow(E5MainWindow): 55 class HelpWindow(E5MainWindow):
55 """ 56 """
56 Class implementing the web browser main window. 57 Class implementing the web browser main window.
57 58
58 @signal helpClosed() emitted after the window was requested to close down 59 @signal helpClosed() emitted after the window was requested to close down
59 @signal zoomTextOnlyChanged(bool) emitted after the zoom text only setting was 60 @signal zoomTextOnlyChanged(bool) emitted after the zoom text only setting
60 changed 61 was changed
61 """ 62 """
62 zoomTextOnlyChanged = pyqtSignal(bool) 63 zoomTextOnlyChanged = pyqtSignal(bool)
63 helpClosed = pyqtSignal() 64 helpClosed = pyqtSignal()
64 privacyChanged = pyqtSignal(bool) 65 privacyChanged = pyqtSignal(bool)
65 66
93 94
94 @param home the URL to be shown (string) 95 @param home the URL to be shown (string)
95 @param path the path of the working dir (usually '.') (string) 96 @param path the path of the working dir (usually '.') (string)
96 @param parent parent widget of this window (QWidget) 97 @param parent parent widget of this window (QWidget)
97 @param name name of this window (string) 98 @param name name of this window (string)
98 @param fromEric flag indicating whether it was called from within eric5 (boolean) 99 @param fromEric flag indicating whether it was called from within
99 @keyparam initShortcutsOnly flag indicating to just initialize the keyboard 100 eric5 (boolean)
100 shortcuts (boolean) 101 @keyparam initShortcutsOnly flag indicating to just initialize the
102 keyboard shortcuts (boolean)
101 @keyparam searchWord word to search for (string) 103 @keyparam searchWord word to search for (string)
102 """ 104 """
103 super(HelpWindow, self).__init__(parent) 105 super(HelpWindow, self).__init__(parent)
104 self.setObjectName(name) 106 self.setObjectName(name)
105 self.setWindowTitle(self.trUtf8("eric5 Web Browser")) 107 self.setWindowTitle(self.trUtf8("eric5 Web Browser"))
128 from .VirusTotalApi import VirusTotalAPI 130 from .VirusTotalApi import VirusTotalAPI
129 131
130 HelpWindow.setUseQtHelp(self.fromEric) 132 HelpWindow.setUseQtHelp(self.fromEric)
131 133
132 if not self.fromEric: 134 if not self.fromEric:
133 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) 135 self.setStyle(Preferences.getUI("Style"),
136 Preferences.getUI("StyleSheet"))
134 137
135 if self.useQtHelp: 138 if self.useQtHelp:
136 self.__helpEngine = \ 139 self.__helpEngine = \
137 QHelpEngine(os.path.join(Utilities.getConfigDir(), 140 QHelpEngine(os.path.join(Utilities.getConfigDir(),
138 "browser", "eric5help.qhc"), self) 141 "browser", "eric5help.qhc"), self)
140 self.__helpEngine.warning.connect(self.__warning) 143 self.__helpEngine.warning.connect(self.__warning)
141 else: 144 else:
142 self.__helpEngine = None 145 self.__helpEngine = None
143 self.__helpInstaller = None 146 self.__helpInstaller = None
144 147
145 self.__zoomWidget = E5ZoomWidget(UI.PixmapCache.getPixmap("zoomOut.png"), 148 self.__zoomWidget = E5ZoomWidget(
149 UI.PixmapCache.getPixmap("zoomOut.png"),
146 UI.PixmapCache.getPixmap("zoomIn.png"), 150 UI.PixmapCache.getPixmap("zoomIn.png"),
147 UI.PixmapCache.getPixmap("zoomReset.png"), self) 151 UI.PixmapCache.getPixmap("zoomReset.png"), self)
148 self.statusBar().addPermanentWidget(self.__zoomWidget) 152 self.statusBar().addPermanentWidget(self.__zoomWidget)
149 self.__zoomWidget.setMapping( 153 self.__zoomWidget.setMapping(
150 HelpBrowser.ZoomLevels, HelpBrowser.ZoomLevelDefault) 154 HelpBrowser.ZoomLevels, HelpBrowser.ZoomLevelDefault)
153 self.tabWidget = HelpTabWidget(self) 157 self.tabWidget = HelpTabWidget(self)
154 self.tabWidget.currentChanged[int].connect(self.__currentChanged) 158 self.tabWidget.currentChanged[int].connect(self.__currentChanged)
155 self.tabWidget.titleChanged.connect(self.__titleChanged) 159 self.tabWidget.titleChanged.connect(self.__titleChanged)
156 self.tabWidget.showMessage.connect(self.statusBar().showMessage) 160 self.tabWidget.showMessage.connect(self.statusBar().showMessage)
157 self.tabWidget.browserClosed.connect(self.__browserClosed) 161 self.tabWidget.browserClosed.connect(self.__browserClosed)
158 self.tabWidget.browserZoomValueChanged.connect(self.__zoomWidget.setValue) 162 self.tabWidget.browserZoomValueChanged.connect(
163 self.__zoomWidget.setValue)
159 164
160 self.findDlg = SearchWidget(self, self) 165 self.findDlg = SearchWidget(self, self)
161 centralWidget = QWidget() 166 centralWidget = QWidget()
162 layout = QVBoxLayout() 167 layout = QVBoxLayout()
163 layout.setContentsMargins(1, 1, 1, 1) 168 layout.setContentsMargins(1, 1, 1, 1)
187 # setup the search widget 192 # setup the search widget
188 self.__searchWord = searchWord 193 self.__searchWord = searchWord
189 self.__indexing = False 194 self.__indexing = False
190 self.__indexingProgress = None 195 self.__indexingProgress = None
191 self.__searchEngine = self.__helpEngine.searchEngine() 196 self.__searchEngine = self.__helpEngine.searchEngine()
192 self.__searchEngine.indexingStarted.connect(self.__indexingStarted) 197 self.__searchEngine.indexingStarted.connect(
193 self.__searchEngine.indexingFinished.connect(self.__indexingFinished) 198 self.__indexingStarted)
194 self.__searchWindow = HelpSearchWidget(self.__searchEngine, self) 199 self.__searchEngine.indexingFinished.connect(
200 self.__indexingFinished)
201 self.__searchWindow = HelpSearchWidget(
202 self.__searchEngine, self)
195 self.__searchDock = QDockWidget(self.trUtf8("Search"), self) 203 self.__searchDock = QDockWidget(self.trUtf8("Search"), self)
196 self.__searchDock.setObjectName("SearchWindow") 204 self.__searchDock.setObjectName("SearchWindow")
197 self.__searchDock.setWidget(self.__searchWindow) 205 self.__searchDock.setWidget(self.__searchWindow)
198 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock) 206 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock)
199 207
225 233
226 self.__class__.helpwindows.append(self) 234 self.__class__.helpwindows.append(self)
227 235
228 self.__adBlockIcon = AdBlockIcon(self) 236 self.__adBlockIcon = AdBlockIcon(self)
229 self.statusBar().addPermanentWidget(self.__adBlockIcon) 237 self.statusBar().addPermanentWidget(self.__adBlockIcon)
230 self.__adBlockIcon.setEnabled(Preferences.getHelp("AdBlockEnabled")) 238 self.__adBlockIcon.setEnabled(
231 self.tabWidget.currentChanged[int].connect(self.__adBlockIcon.currentChanged) 239 Preferences.getHelp("AdBlockEnabled"))
232 self.tabWidget.sourceChanged.connect(self.__adBlockIcon.sourceChanged) 240 self.tabWidget.currentChanged[int].connect(
241 self.__adBlockIcon.currentChanged)
242 self.tabWidget.sourceChanged.connect(
243 self.__adBlockIcon.sourceChanged)
233 244
234 QDesktopServices.setUrlHandler("http", self.__linkActivated) 245 QDesktopServices.setUrlHandler("http", self.__linkActivated)
235 QDesktopServices.setUrlHandler("https", self.__linkActivated) 246 QDesktopServices.setUrlHandler("https", self.__linkActivated)
236 247
237 # setup connections 248 # setup connections
238 self.__activating = False 249 self.__activating = False
239 if self.useQtHelp: 250 if self.useQtHelp:
240 # TOC window 251 # TOC window
241 self.__tocWindow.linkActivated.connect(self.__linkActivated) 252 self.__tocWindow.linkActivated.connect(self.__linkActivated)
242 self.__tocWindow.escapePressed.connect(self.__activateCurrentBrowser) 253 self.__tocWindow.escapePressed.connect(
254 self.__activateCurrentBrowser)
243 # index window 255 # index window
244 self.__indexWindow.linkActivated.connect(self.__linkActivated) 256 self.__indexWindow.linkActivated.connect(self.__linkActivated)
245 self.__indexWindow.linksActivated.connect(self.__linksActivated) 257 self.__indexWindow.linksActivated.connect(
246 self.__indexWindow.escapePressed.connect(self.__activateCurrentBrowser) 258 self.__linksActivated)
259 self.__indexWindow.escapePressed.connect(
260 self.__activateCurrentBrowser)
247 # search window 261 # search window
248 self.__searchWindow.linkActivated.connect(self.__linkActivated) 262 self.__searchWindow.linkActivated.connect(
249 self.__searchWindow.escapePressed.connect(self.__activateCurrentBrowser) 263 self.__linkActivated)
264 self.__searchWindow.escapePressed.connect(
265 self.__activateCurrentBrowser)
250 266
251 state = Preferences.getHelp("HelpViewerState") 267 state = Preferences.getHelp("HelpViewerState")
252 self.restoreState(state) 268 self.restoreState(state)
253 269
254 self.__initHelpDb() 270 self.__initHelpDb()
255 271
256 self.__virusTotal = VirusTotalAPI(self) 272 self.__virusTotal = VirusTotalAPI(self)
257 self.__virusTotal.submitUrlError.connect(self.__virusTotalSubmitUrlError) 273 self.__virusTotal.submitUrlError.connect(
258 self.__virusTotal.urlScanReport.connect(self.__virusTotalUrlScanReport) 274 self.__virusTotalSubmitUrlError)
259 self.__virusTotal.fileScanReport.connect(self.__virusTotalFileScanReport) 275 self.__virusTotal.urlScanReport.connect(
276 self.__virusTotalUrlScanReport)
277 self.__virusTotal.fileScanReport.connect(
278 self.__virusTotalFileScanReport)
260 279
261 self.__previewer = None 280 self.__previewer = None
262 self.__shutdownCalled = False 281 self.__shutdownCalled = False
263 282
264 if self.useQtHelp: 283 if self.useQtHelp:
291 fixedFont = Preferences.getHelp("FixedFont") 310 fixedFont = Preferences.getHelp("FixedFont")
292 311
293 settings = QWebSettings.globalSettings() 312 settings = QWebSettings.globalSettings()
294 settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True) 313 settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
295 314
296 settings.setFontFamily(QWebSettings.StandardFont, standardFont.family()) 315 settings.setFontFamily(QWebSettings.StandardFont,
297 settings.setFontSize(QWebSettings.DefaultFontSize, standardFont.pointSize()) 316 standardFont.family())
317 settings.setFontSize(QWebSettings.DefaultFontSize,
318 standardFont.pointSize())
298 settings.setFontFamily(QWebSettings.FixedFont, fixedFont.family()) 319 settings.setFontFamily(QWebSettings.FixedFont, fixedFont.family())
299 settings.setFontSize(QWebSettings.DefaultFixedFontSize, fixedFont.pointSize()) 320 settings.setFontSize(QWebSettings.DefaultFixedFontSize,
321 fixedFont.pointSize())
300 322
301 styleSheet = Preferences.getHelp("UserStyleSheet") 323 styleSheet = Preferences.getHelp("UserStyleSheet")
302 settings.setUserStyleSheetUrl(self.__userStyleSheet(styleSheet)) 324 settings.setUserStyleSheetUrl(self.__userStyleSheet(styleSheet))
303 325
304 settings.setAttribute(QWebSettings.AutoLoadImages, 326 settings.setAttribute(QWebSettings.AutoLoadImages,
325 Utilities.getConfigDir(), "browser", "webdatabases") 347 Utilities.getConfigDir(), "browser", "webdatabases")
326 if not os.path.exists(webDatabaseDir): 348 if not os.path.exists(webDatabaseDir):
327 os.makedirs(webDatabaseDir) 349 os.makedirs(webDatabaseDir)
328 settings.setOfflineStoragePath(webDatabaseDir) 350 settings.setOfflineStoragePath(webDatabaseDir)
329 settings.setOfflineStorageDefaultQuota( 351 settings.setOfflineStorageDefaultQuota(
330 Preferences.getHelp("OfflineStorageDatabaseQuota") * 1024 * 1024) 352 Preferences.getHelp("OfflineStorageDatabaseQuota") * \
353 1024 * 1024)
331 354
332 if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"): 355 if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"):
333 settings.setAttribute(QWebSettings.OfflineWebApplicationCacheEnabled, 356 settings.setAttribute(
357 QWebSettings.OfflineWebApplicationCacheEnabled,
334 Preferences.getHelp("OfflineWebApplicationCacheEnabled")) 358 Preferences.getHelp("OfflineWebApplicationCacheEnabled"))
335 appCacheDir = os.path.join( 359 appCacheDir = os.path.join(
336 Utilities.getConfigDir(), "browser", "webappcaches") 360 Utilities.getConfigDir(), "browser", "webappcaches")
337 if not os.path.exists(appCacheDir): 361 if not os.path.exists(appCacheDir):
338 os.makedirs(appCacheDir) 362 os.makedirs(appCacheDir)
339 settings.setOfflineWebApplicationCachePath(appCacheDir) 363 settings.setOfflineWebApplicationCachePath(appCacheDir)
340 settings.setOfflineWebApplicationCacheQuota( 364 settings.setOfflineWebApplicationCacheQuota(
341 Preferences.getHelp("OfflineWebApplicationCacheQuota") * 1024 * 1024) 365 Preferences.getHelp("OfflineWebApplicationCacheQuota") * \
366 1024 * 1024)
342 367
343 if hasattr(QWebSettings, "LocalStorageEnabled"): 368 if hasattr(QWebSettings, "LocalStorageEnabled"):
344 settings.setAttribute(QWebSettings.LocalStorageEnabled, 369 settings.setAttribute(QWebSettings.LocalStorageEnabled,
345 Preferences.getHelp("LocalStorageEnabled")) 370 Preferences.getHelp("LocalStorageEnabled"))
346 localStorageDir = os.path.join( 371 localStorageDir = os.path.join(
471 )) 496 ))
472 if not self.initShortcutsOnly: 497 if not self.initShortcutsOnly:
473 self.savePageScreenAct.triggered[()].connect(self.__savePageScreen) 498 self.savePageScreenAct.triggered[()].connect(self.__savePageScreen)
474 self.__actions.append(self.savePageScreenAct) 499 self.__actions.append(self.savePageScreenAct)
475 500
476 self.saveVisiblePageScreenAct = E5Action(self.trUtf8('Save Visible Page Screen'), 501 self.saveVisiblePageScreenAct = E5Action(
502 self.trUtf8('Save Visible Page Screen'),
477 UI.PixmapCache.getIcon("fileSaveVisiblePixmap.png"), 503 UI.PixmapCache.getIcon("fileSaveVisiblePixmap.png"),
478 self.trUtf8('Save Visible Page Screen...'), 504 self.trUtf8('Save Visible Page Screen...'),
479 0, 0, self, 'help_file_save_visible_page_screen') 505 0, 0, self, 'help_file_save_visible_page_screen')
480 self.saveVisiblePageScreenAct.setStatusTip( 506 self.saveVisiblePageScreenAct.setStatusTip(
481 self.trUtf8('Save the visible part of the current page as a screen shot')) 507 self.trUtf8('Save the visible part of the current page as a'
508 ' screen shot'))
482 self.saveVisiblePageScreenAct.setWhatsThis(self.trUtf8( 509 self.saveVisiblePageScreenAct.setWhatsThis(self.trUtf8(
483 """<b>Save Visible Page Screen...</b>""" 510 """<b>Save Visible Page Screen...</b>"""
484 """<p>Saves the visible part of the current page as a screen shot.</p>""" 511 """<p>Saves the visible part of the current page as a"""
512 """ screen shot.</p>"""
485 )) 513 ))
486 if not self.initShortcutsOnly: 514 if not self.initShortcutsOnly:
487 self.saveVisiblePageScreenAct.triggered[()].connect( 515 self.saveVisiblePageScreenAct.triggered[()].connect(
488 self.__saveVisiblePageScreen) 516 self.__saveVisiblePageScreen)
489 self.__actions.append(self.saveVisiblePageScreenAct) 517 self.__actions.append(self.saveVisiblePageScreenAct)
533 561
534 self.printPdfAct = E5Action(self.trUtf8('Print as PDF'), 562 self.printPdfAct = E5Action(self.trUtf8('Print as PDF'),
535 UI.PixmapCache.getIcon("printPdf.png"), 563 UI.PixmapCache.getIcon("printPdf.png"),
536 self.trUtf8('Print as PDF'), 564 self.trUtf8('Print as PDF'),
537 0, 0, self, 'help_file_print_pdf') 565 0, 0, self, 'help_file_print_pdf')
538 self.printPdfAct.setStatusTip(self.trUtf8('Print the displayed help as PDF')) 566 self.printPdfAct.setStatusTip(self.trUtf8(
567 'Print the displayed help as PDF'))
539 self.printPdfAct.setWhatsThis(self.trUtf8( 568 self.printPdfAct.setWhatsThis(self.trUtf8(
540 """<b>Print as PDF</b>""" 569 """<b>Print as PDF</b>"""
541 """<p>Print the displayed help text as a PDF file.</p>""" 570 """<p>Print the displayed help text as a PDF file.</p>"""
542 )) 571 ))
543 if not self.initShortcutsOnly: 572 if not self.initShortcutsOnly:
544 self.printPdfAct.triggered[()].connect(self.tabWidget.printBrowserPdf) 573 self.printPdfAct.triggered[()].connect(
574 self.tabWidget.printBrowserPdf)
545 self.__actions.append(self.printPdfAct) 575 self.__actions.append(self.printPdfAct)
546 576
547 self.printPreviewAct = E5Action(self.trUtf8('Print Preview'), 577 self.printPreviewAct = E5Action(self.trUtf8('Print Preview'),
548 UI.PixmapCache.getIcon("printPreview.png"), 578 UI.PixmapCache.getIcon("printPreview.png"),
549 self.trUtf8('Print Preview'), 579 self.trUtf8('Print Preview'),
553 self.printPreviewAct.setWhatsThis(self.trUtf8( 583 self.printPreviewAct.setWhatsThis(self.trUtf8(
554 """<b>Print Preview</b>""" 584 """<b>Print Preview</b>"""
555 """<p>Print preview of the displayed help text.</p>""" 585 """<p>Print preview of the displayed help text.</p>"""
556 )) 586 ))
557 if not self.initShortcutsOnly: 587 if not self.initShortcutsOnly:
558 self.printPreviewAct.triggered[()].connect(self.tabWidget.printPreviewBrowser) 588 self.printPreviewAct.triggered[()].connect(
589 self.tabWidget.printPreviewBrowser)
559 self.__actions.append(self.printPreviewAct) 590 self.__actions.append(self.printPreviewAct)
560 591
561 self.closeAct = E5Action(self.trUtf8('Close'), 592 self.closeAct = E5Action(self.trUtf8('Close'),
562 UI.PixmapCache.getIcon("close.png"), 593 UI.PixmapCache.getIcon("close.png"),
563 self.trUtf8('&Close'), 594 self.trUtf8('&Close'),
564 QKeySequence(self.trUtf8("Ctrl+W", "File|Close")), 595 QKeySequence(self.trUtf8("Ctrl+W", "File|Close")),
565 0, self, 'help_file_close') 596 0, self, 'help_file_close')
566 self.closeAct.setStatusTip(self.trUtf8('Close the current help window')) 597 self.closeAct.setStatusTip(self.trUtf8(
598 'Close the current help window'))
567 self.closeAct.setWhatsThis(self.trUtf8( 599 self.closeAct.setWhatsThis(self.trUtf8(
568 """<b>Close</b>""" 600 """<b>Close</b>"""
569 """<p>Closes the current help window.</p>""" 601 """<p>Closes the current help window.</p>"""
570 )) 602 ))
571 if not self.initShortcutsOnly: 603 if not self.initShortcutsOnly:
572 self.closeAct.triggered[()].connect(self.tabWidget.closeBrowser) 604 self.closeAct.triggered[()].connect(self.tabWidget.closeBrowser)
573 self.__actions.append(self.closeAct) 605 self.__actions.append(self.closeAct)
574 606
579 self.closeAllAct.setWhatsThis(self.trUtf8( 611 self.closeAllAct.setWhatsThis(self.trUtf8(
580 """<b>Close All</b>""" 612 """<b>Close All</b>"""
581 """<p>Closes all help windows except the first one.</p>""" 613 """<p>Closes all help windows except the first one.</p>"""
582 )) 614 ))
583 if not self.initShortcutsOnly: 615 if not self.initShortcutsOnly:
584 self.closeAllAct.triggered[()].connect(self.tabWidget.closeAllBrowsers) 616 self.closeAllAct.triggered[()].connect(
617 self.tabWidget.closeAllBrowsers)
585 self.__actions.append(self.closeAllAct) 618 self.__actions.append(self.closeAllAct)
586 619
587 self.privateBrowsingAct = E5Action(self.trUtf8('Private Browsing'), 620 self.privateBrowsingAct = E5Action(self.trUtf8('Private Browsing'),
588 UI.PixmapCache.getIcon("privateBrowsing.png"), 621 UI.PixmapCache.getIcon("privateBrowsing.png"),
589 self.trUtf8('Private &Browsing'), 622 self.trUtf8('Private &Browsing'),
593 """<b>Private Browsing</b>""" 626 """<b>Private Browsing</b>"""
594 """<p>Enables private browsing. In this mode no history is""" 627 """<p>Enables private browsing. In this mode no history is"""
595 """ recorded anymore.</p>""" 628 """ recorded anymore.</p>"""
596 )) 629 ))
597 if not self.initShortcutsOnly: 630 if not self.initShortcutsOnly:
598 self.privateBrowsingAct.triggered[()].connect(self.__privateBrowsing) 631 self.privateBrowsingAct.triggered[()].connect(
632 self.__privateBrowsing)
599 self.privateBrowsingAct.setCheckable(True) 633 self.privateBrowsingAct.setCheckable(True)
600 self.__actions.append(self.privateBrowsingAct) 634 self.__actions.append(self.privateBrowsingAct)
601 635
602 self.exitAct = E5Action(self.trUtf8('Quit'), 636 self.exitAct = E5Action(self.trUtf8('Quit'),
603 UI.PixmapCache.getIcon("exit.png"), 637 UI.PixmapCache.getIcon("exit.png"),
636 UI.PixmapCache.getIcon("forward.png"), 670 UI.PixmapCache.getIcon("forward.png"),
637 self.trUtf8('&Forward'), 671 self.trUtf8('&Forward'),
638 QKeySequence(self.trUtf8("Alt+Right", "Go|Forward")), 672 QKeySequence(self.trUtf8("Alt+Right", "Go|Forward")),
639 QKeySequence(self.trUtf8("Shift+Backspace", "Go|Forward")), 673 QKeySequence(self.trUtf8("Shift+Backspace", "Go|Forward")),
640 self, 'help_go_foreward') 674 self, 'help_go_foreward')
641 self.forwardAct.setStatusTip(self.trUtf8('Move one help screen forward')) 675 self.forwardAct.setStatusTip(self.trUtf8(
676 'Move one help screen forward'))
642 self.forwardAct.setWhatsThis(self.trUtf8( 677 self.forwardAct.setWhatsThis(self.trUtf8(
643 """<b>Forward</b>""" 678 """<b>Forward</b>"""
644 """<p>Moves one help screen forward. If none is""" 679 """<p>Moves one help screen forward. If none is"""
645 """ available, this action is disabled.</p>""" 680 """ available, this action is disabled.</p>"""
646 )) 681 ))
647 if not self.initShortcutsOnly: 682 if not self.initShortcutsOnly:
648 self.forwardAct.triggered[()].connect(self.__forward) 683 self.forwardAct.triggered[()].connect(self.__forward)
649 self.__actions.append(self.forwardAct) 684 self.__actions.append(self.forwardAct)
650 685
651 self.homeAct = E5Action(self.trUtf8('Home'), 686 self.homeAct = E5Action(self.trUtf8('Home'),
652 UI.PixmapCache.getIcon("home.png"), 687 UI.PixmapCache.getIcon("home.png"),
653 self.trUtf8('&Home'), 688 self.trUtf8('&Home'),
654 QKeySequence(self.trUtf8("Ctrl+Home", "Go|Home")), 689 QKeySequence(self.trUtf8("Ctrl+Home", "Go|Home")),
655 0, self, 'help_go_home') 690 0, self, 'help_go_home')
656 self.homeAct.setStatusTip(self.trUtf8('Move to the initial help screen')) 691 self.homeAct.setStatusTip(self.trUtf8(
692 'Move to the initial help screen'))
657 self.homeAct.setWhatsThis(self.trUtf8( 693 self.homeAct.setWhatsThis(self.trUtf8(
658 """<b>Home</b>""" 694 """<b>Home</b>"""
659 """<p>Moves to the initial help screen.</p>""" 695 """<p>Moves to the initial help screen.</p>"""
660 )) 696 ))
661 if not self.initShortcutsOnly: 697 if not self.initShortcutsOnly:
662 self.homeAct.triggered[()].connect(self.__home) 698 self.homeAct.triggered[()].connect(self.__home)
663 self.__actions.append(self.homeAct) 699 self.__actions.append(self.homeAct)
664 700
666 UI.PixmapCache.getIcon("reload.png"), 702 UI.PixmapCache.getIcon("reload.png"),
667 self.trUtf8('&Reload'), 703 self.trUtf8('&Reload'),
668 QKeySequence(self.trUtf8("Ctrl+R", "Go|Reload")), 704 QKeySequence(self.trUtf8("Ctrl+R", "Go|Reload")),
669 QKeySequence(self.trUtf8("F5", "Go|Reload")), 705 QKeySequence(self.trUtf8("F5", "Go|Reload")),
670 self, 'help_go_reload') 706 self, 'help_go_reload')
671 self.reloadAct.setStatusTip(self.trUtf8('Reload the current help screen')) 707 self.reloadAct.setStatusTip(self.trUtf8(
708 'Reload the current help screen'))
672 self.reloadAct.setWhatsThis(self.trUtf8( 709 self.reloadAct.setWhatsThis(self.trUtf8(
673 """<b>Reload</b>""" 710 """<b>Reload</b>"""
674 """<p>Reloads the current help screen.</p>""" 711 """<p>Reloads the current help screen.</p>"""
675 )) 712 ))
676 if not self.initShortcutsOnly: 713 if not self.initShortcutsOnly:
677 self.reloadAct.triggered[()].connect(self.__reload) 714 self.reloadAct.triggered[()].connect(self.__reload)
678 self.__actions.append(self.reloadAct) 715 self.__actions.append(self.reloadAct)
679 716
723 self.findNextAct = E5Action(self.trUtf8('Find next'), 760 self.findNextAct = E5Action(self.trUtf8('Find next'),
724 UI.PixmapCache.getIcon("findNext.png"), 761 UI.PixmapCache.getIcon("findNext.png"),
725 self.trUtf8('Find &next'), 762 self.trUtf8('Find &next'),
726 QKeySequence(self.trUtf8("F3", "Edit|Find next")), 763 QKeySequence(self.trUtf8("F3", "Edit|Find next")),
727 0, self, 'help_edit_find_next') 764 0, self, 'help_edit_find_next')
728 self.findNextAct.setStatusTip(self.trUtf8('Find next occurrence of text in page')) 765 self.findNextAct.setStatusTip(self.trUtf8(
766 'Find next occurrence of text in page'))
729 self.findNextAct.setWhatsThis(self.trUtf8( 767 self.findNextAct.setWhatsThis(self.trUtf8(
730 """<b>Find next</b>""" 768 """<b>Find next</b>"""
731 """<p>Find the next occurrence of text in the current page.</p>""" 769 """<p>Find the next occurrence of text in the current page.</p>"""
732 )) 770 ))
733 if not self.initShortcutsOnly: 771 if not self.initShortcutsOnly:
734 self.findNextAct.triggered[()].connect(self.findDlg.findNext) 772 self.findNextAct.triggered[()].connect(self.findDlg.findNext)
735 self.__actions.append(self.findNextAct) 773 self.__actions.append(self.findNextAct)
736 774
740 QKeySequence(self.trUtf8("Shift+F3", "Edit|Find previous")), 778 QKeySequence(self.trUtf8("Shift+F3", "Edit|Find previous")),
741 0, self, 'help_edit_find_previous') 779 0, self, 'help_edit_find_previous')
742 self.findPrevAct.setStatusTip( 780 self.findPrevAct.setStatusTip(
743 self.trUtf8('Find previous occurrence of text in page')) 781 self.trUtf8('Find previous occurrence of text in page'))
744 self.findPrevAct.setWhatsThis(self.trUtf8( 782 self.findPrevAct.setWhatsThis(self.trUtf8(
745 """<b>Find previous</b>""" 783 """<b>Find previous</b>"""
746 """<p>Find the previous occurrence of text in the current page.</p>""" 784 """<p>Find the previous occurrence of text in the current"""
785 """ page.</p>"""
747 )) 786 ))
748 if not self.initShortcutsOnly: 787 if not self.initShortcutsOnly:
749 self.findPrevAct.triggered[()].connect(self.findDlg.findPrevious) 788 self.findPrevAct.triggered[()].connect(self.findDlg.findPrevious)
750 self.__actions.append(self.findPrevAct) 789 self.__actions.append(self.findPrevAct)
751 790
758 self.bookmarksManageAct.setWhatsThis(self.trUtf8( 797 self.bookmarksManageAct.setWhatsThis(self.trUtf8(
759 """<b>Manage Bookmarks...</b>""" 798 """<b>Manage Bookmarks...</b>"""
760 """<p>Open a dialog to manage the bookmarks.</p>""" 799 """<p>Open a dialog to manage the bookmarks.</p>"""
761 )) 800 ))
762 if not self.initShortcutsOnly: 801 if not self.initShortcutsOnly:
763 self.bookmarksManageAct.triggered[()].connect(self.__showBookmarksDialog) 802 self.bookmarksManageAct.triggered[()].connect(
803 self.__showBookmarksDialog)
764 self.__actions.append(self.bookmarksManageAct) 804 self.__actions.append(self.bookmarksManageAct)
765 805
766 self.bookmarksAddAct = E5Action(self.trUtf8('Add Bookmark'), 806 self.bookmarksAddAct = E5Action(self.trUtf8('Add Bookmark'),
767 UI.PixmapCache.getIcon("addBookmark.png"), 807 UI.PixmapCache.getIcon("addBookmark.png"),
768 self.trUtf8('Add &Bookmark...'), 808 self.trUtf8('Add &Bookmark...'),
769 QKeySequence(self.trUtf8("Ctrl+D", "Help|Add bookmark")), 809 QKeySequence(self.trUtf8("Ctrl+D", "Help|Add bookmark")),
770 0, self, 'help_bookmark_add') 810 0, self, 'help_bookmark_add')
771 self.bookmarksAddAct.setIconVisibleInMenu(False) 811 self.bookmarksAddAct.setIconVisibleInMenu(False)
772 self.bookmarksAddAct.setStatusTip(self.trUtf8('Open a dialog to add a bookmark.')) 812 self.bookmarksAddAct.setStatusTip(self.trUtf8(
813 'Open a dialog to add a bookmark.'))
773 self.bookmarksAddAct.setWhatsThis(self.trUtf8( 814 self.bookmarksAddAct.setWhatsThis(self.trUtf8(
774 """<b>Add Bookmark</b>""" 815 """<b>Add Bookmark</b>"""
775 """<p>Open a dialog to add the current URL as a bookmark.</p>""" 816 """<p>Open a dialog to add the current URL as a bookmark.</p>"""
776 )) 817 ))
777 if not self.initShortcutsOnly: 818 if not self.initShortcutsOnly:
778 self.bookmarksAddAct.triggered[()].connect(self.__addBookmark) 819 self.bookmarksAddAct.triggered[()].connect(self.__addBookmark)
779 self.__actions.append(self.bookmarksAddAct) 820 self.__actions.append(self.bookmarksAddAct)
780 821
786 self.bookmarksAddFolderAct.setWhatsThis(self.trUtf8( 827 self.bookmarksAddFolderAct.setWhatsThis(self.trUtf8(
787 """<b>Add Folder...</b>""" 828 """<b>Add Folder...</b>"""
788 """<p>Open a dialog to add a new bookmarks folder.</p>""" 829 """<p>Open a dialog to add a new bookmarks folder.</p>"""
789 )) 830 ))
790 if not self.initShortcutsOnly: 831 if not self.initShortcutsOnly:
791 self.bookmarksAddFolderAct.triggered[()].connect(self.__addBookmarkFolder) 832 self.bookmarksAddFolderAct.triggered[()].connect(
833 self.__addBookmarkFolder)
792 self.__actions.append(self.bookmarksAddFolderAct) 834 self.__actions.append(self.bookmarksAddFolderAct)
793 835
794 self.bookmarksAllTabsAct = E5Action(self.trUtf8('Bookmark All Tabs'), 836 self.bookmarksAllTabsAct = E5Action(self.trUtf8('Bookmark All Tabs'),
795 self.trUtf8('Bookmark All Tabs...'), 837 self.trUtf8('Bookmark All Tabs...'),
796 0, 0, self, 'help_bookmark_all_tabs') 838 0, 0, self, 'help_bookmark_all_tabs')
810 self.trUtf8('&What\'s This?'), 852 self.trUtf8('&What\'s This?'),
811 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")), 853 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")),
812 0, self, 'help_help_whats_this') 854 0, self, 'help_help_whats_this')
813 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) 855 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help'))
814 self.whatsThisAct.setWhatsThis(self.trUtf8( 856 self.whatsThisAct.setWhatsThis(self.trUtf8(
815 """<b>Display context sensitive help</b>""" 857 """<b>Display context sensitive help</b>"""
816 """<p>In What's This? mode, the mouse cursor shows an arrow with a""" 858 """<p>In What's This? mode, the mouse cursor shows an arrow"""
817 """ question mark, and you can click on the interface elements to get""" 859 """ with a question mark, and you can click on the interface"""
818 """ a short description of what they do and how to use them. In""" 860 """ elements to get a short description of what they do and how"""
819 """ dialogs, this feature can be accessed using the context help button""" 861 """ to use them. In dialogs, this feature can be accessed using"""
820 """ in the titlebar.</p>""" 862 """ the context help button in the titlebar.</p>"""
821 )) 863 ))
822 if not self.initShortcutsOnly: 864 if not self.initShortcutsOnly:
823 self.whatsThisAct.triggered[()].connect(self.__whatsThis) 865 self.whatsThisAct.triggered[()].connect(self.__whatsThis)
824 self.__actions.append(self.whatsThisAct) 866 self.__actions.append(self.whatsThisAct)
825 867
826 self.aboutAct = E5Action(self.trUtf8('About'), 868 self.aboutAct = E5Action(self.trUtf8('About'),
827 self.trUtf8('&About'), 869 self.trUtf8('&About'),
828 0, 0, self, 'help_help_about') 870 0, 0, self, 'help_help_about')
829 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) 871 self.aboutAct.setStatusTip(self.trUtf8(
872 'Display information about this software'))
830 self.aboutAct.setWhatsThis(self.trUtf8( 873 self.aboutAct.setWhatsThis(self.trUtf8(
831 """<b>About</b>""" 874 """<b>About</b>"""
832 """<p>Display some information about this software.</p>""" 875 """<p>Display some information about this software.</p>"""
833 )) 876 ))
834 if not self.initShortcutsOnly: 877 if not self.initShortcutsOnly:
835 self.aboutAct.triggered[()].connect(self.__about) 878 self.aboutAct.triggered[()].connect(self.__about)
836 self.__actions.append(self.aboutAct) 879 self.__actions.append(self.aboutAct)
837 880
881 self.zoomResetAct = E5Action(self.trUtf8('Zoom reset'), 924 self.zoomResetAct = E5Action(self.trUtf8('Zoom reset'),
882 UI.PixmapCache.getIcon("zoomReset.png"), 925 UI.PixmapCache.getIcon("zoomReset.png"),
883 self.trUtf8('Zoom &reset'), 926 self.trUtf8('Zoom &reset'),
884 QKeySequence(self.trUtf8("Ctrl+0", "View|Zoom reset")), 927 QKeySequence(self.trUtf8("Ctrl+0", "View|Zoom reset")),
885 0, self, 'help_view_zoom_reset') 928 0, self, 'help_view_zoom_reset')
886 self.zoomResetAct.setStatusTip(self.trUtf8('Reset the zoom of the text')) 929 self.zoomResetAct.setStatusTip(self.trUtf8(
930 'Reset the zoom of the text'))
887 self.zoomResetAct.setWhatsThis(self.trUtf8( 931 self.zoomResetAct.setWhatsThis(self.trUtf8(
888 """<b>Zoom reset</b>""" 932 """<b>Zoom reset</b>"""
889 """<p>Reset the zoom of the text. """ 933 """<p>Reset the zoom of the text. """
890 """This sets the zoom factor to 100%.</p>""" 934 """This sets the zoom factor to 100%.</p>"""
891 )) 935 ))
892 if not self.initShortcutsOnly: 936 if not self.initShortcutsOnly:
893 self.zoomResetAct.triggered[()].connect(self.__zoomReset) 937 self.zoomResetAct.triggered[()].connect(self.__zoomReset)
894 self.__actions.append(self.zoomResetAct) 938 self.__actions.append(self.zoomResetAct)
895 939
903 self.zoomTextOnlyAct.setWhatsThis(self.trUtf8( 947 self.zoomTextOnlyAct.setWhatsThis(self.trUtf8(
904 """<b>Zoom text only</b>""" 948 """<b>Zoom text only</b>"""
905 """<p>Zoom text only; pictures remain constant.</p>""" 949 """<p>Zoom text only; pictures remain constant.</p>"""
906 )) 950 ))
907 if not self.initShortcutsOnly: 951 if not self.initShortcutsOnly:
908 self.zoomTextOnlyAct.triggered[bool].connect(self.__zoomTextOnly) 952 self.zoomTextOnlyAct.triggered[bool].connect(
953 self.__zoomTextOnly)
909 self.__actions.append(self.zoomTextOnlyAct) 954 self.__actions.append(self.zoomTextOnlyAct)
910 else: 955 else:
911 self.zoomTextOnlyAct = None 956 self.zoomTextOnlyAct = None
912 957
913 self.pageSourceAct = E5Action(self.trUtf8('Show page source'), 958 self.pageSourceAct = E5Action(self.trUtf8('Show page source'),
914 self.trUtf8('Show page source'), 959 self.trUtf8('Show page source'),
915 QKeySequence(self.trUtf8('Ctrl+U')), 0, 960 QKeySequence(self.trUtf8('Ctrl+U')), 0,
916 self, 'help_show_page_source') 961 self, 'help_show_page_source')
917 self.pageSourceAct.setStatusTip(self.trUtf8('Show the page source in an editor')) 962 self.pageSourceAct.setStatusTip(self.trUtf8(
963 'Show the page source in an editor'))
918 self.pageSourceAct.setWhatsThis(self.trUtf8( 964 self.pageSourceAct.setWhatsThis(self.trUtf8(
919 """<b>Show page source</b>""" 965 """<b>Show page source</b>"""
920 """<p>Show the page source in an editor.</p>""" 966 """<p>Show the page source in an editor.</p>"""
921 )) 967 ))
922 if not self.initShortcutsOnly: 968 if not self.initShortcutsOnly:
923 self.pageSourceAct.triggered[()].connect(self.__showPageSource) 969 self.pageSourceAct.triggered[()].connect(self.__showPageSource)
924 self.__actions.append(self.pageSourceAct) 970 self.__actions.append(self.pageSourceAct)
925 self.addAction(self.pageSourceAct) 971 self.addAction(self.pageSourceAct)
962 self.addAction(self.switchTabAct) 1008 self.addAction(self.switchTabAct)
963 1009
964 self.prefAct = E5Action(self.trUtf8('Preferences'), 1010 self.prefAct = E5Action(self.trUtf8('Preferences'),
965 UI.PixmapCache.getIcon("configure.png"), 1011 UI.PixmapCache.getIcon("configure.png"),
966 self.trUtf8('&Preferences...'), 0, 0, self, 'help_preferences') 1012 self.trUtf8('&Preferences...'), 0, 0, self, 'help_preferences')
967 self.prefAct.setStatusTip(self.trUtf8('Set the prefered configuration')) 1013 self.prefAct.setStatusTip(self.trUtf8(
1014 'Set the prefered configuration'))
968 self.prefAct.setWhatsThis(self.trUtf8( 1015 self.prefAct.setWhatsThis(self.trUtf8(
969 """<b>Preferences</b>""" 1016 """<b>Preferences</b>"""
970 """<p>Set the configuration items of the application""" 1017 """<p>Set the configuration items of the application"""
971 """ with your prefered values.</p>""" 1018 """ with your prefered values.</p>"""
972 )) 1019 ))
973 if not self.initShortcutsOnly: 1020 if not self.initShortcutsOnly:
974 self.prefAct.triggered[()].connect(self.__showPreferences) 1021 self.prefAct.triggered[()].connect(self.__showPreferences)
975 self.__actions.append(self.prefAct) 1022 self.__actions.append(self.prefAct)
976 1023
977 self.acceptedLanguagesAct = E5Action(self.trUtf8('Languages'), 1024 self.acceptedLanguagesAct = E5Action(
1025 self.trUtf8('Languages'),
978 UI.PixmapCache.getIcon("flag.png"), 1026 UI.PixmapCache.getIcon("flag.png"),
979 self.trUtf8('&Languages...'), 0, 0, self, 'help_accepted_languages') 1027 self.trUtf8('&Languages...'), 0, 0,
1028 self, 'help_accepted_languages')
980 self.acceptedLanguagesAct.setStatusTip(self.trUtf8( 1029 self.acceptedLanguagesAct.setStatusTip(self.trUtf8(
981 'Configure the accepted languages for web pages')) 1030 'Configure the accepted languages for web pages'))
982 self.acceptedLanguagesAct.setWhatsThis(self.trUtf8( 1031 self.acceptedLanguagesAct.setWhatsThis(self.trUtf8(
983 """<b>Languages</b>""" 1032 """<b>Languages</b>"""
984 """<p>Configure the accepted languages for web pages.</p>""" 1033 """<p>Configure the accepted languages for web pages.</p>"""
985 )) 1034 ))
986 if not self.initShortcutsOnly: 1035 if not self.initShortcutsOnly:
987 self.acceptedLanguagesAct.triggered[()].connect(self.__showAcceptedLanguages) 1036 self.acceptedLanguagesAct.triggered[()].connect(
1037 self.__showAcceptedLanguages)
988 self.__actions.append(self.acceptedLanguagesAct) 1038 self.__actions.append(self.acceptedLanguagesAct)
989 1039
990 self.cookiesAct = E5Action(self.trUtf8('Cookies'), 1040 self.cookiesAct = E5Action(self.trUtf8('Cookies'),
991 UI.PixmapCache.getIcon("cookie.png"), 1041 UI.PixmapCache.getIcon("cookie.png"),
992 self.trUtf8('C&ookies...'), 0, 0, self, 'help_cookies') 1042 self.trUtf8('C&ookies...'), 0, 0, self, 'help_cookies')
995 self.cookiesAct.setWhatsThis(self.trUtf8( 1045 self.cookiesAct.setWhatsThis(self.trUtf8(
996 """<b>Cookies</b>""" 1046 """<b>Cookies</b>"""
997 """<p>Configure cookies handling.</p>""" 1047 """<p>Configure cookies handling.</p>"""
998 )) 1048 ))
999 if not self.initShortcutsOnly: 1049 if not self.initShortcutsOnly:
1000 self.cookiesAct.triggered[()].connect(self.__showCookiesConfiguration) 1050 self.cookiesAct.triggered[()].connect(
1051 self.__showCookiesConfiguration)
1001 self.__actions.append(self.cookiesAct) 1052 self.__actions.append(self.cookiesAct)
1002 1053
1003 self.offlineStorageAct = E5Action(self.trUtf8('Offline Storage'), 1054 self.offlineStorageAct = E5Action(self.trUtf8('Offline Storage'),
1004 UI.PixmapCache.getIcon("preferences-html5.png"), 1055 UI.PixmapCache.getIcon("preferences-html5.png"),
1005 self.trUtf8('Offline &Storage...'), 0, 0, self, 'help_offline_storage') 1056 self.trUtf8('Offline &Storage...'), 0, 0,
1057 self, 'help_offline_storage')
1006 self.offlineStorageAct.setStatusTip(self.trUtf8( 1058 self.offlineStorageAct.setStatusTip(self.trUtf8(
1007 'Configure offline storage')) 1059 'Configure offline storage'))
1008 self.offlineStorageAct.setWhatsThis(self.trUtf8( 1060 self.offlineStorageAct.setWhatsThis(self.trUtf8(
1009 """<b>Offline Storage</b>""" 1061 """<b>Offline Storage</b>"""
1010 """<p>Opens a dialog to configure offline storage.</p>""" 1062 """<p>Opens a dialog to configure offline storage.</p>"""
1021 self, 'help_personal_information') 1073 self, 'help_personal_information')
1022 self.personalDataAct.setStatusTip(self.trUtf8( 1074 self.personalDataAct.setStatusTip(self.trUtf8(
1023 'Configure personal information for completing form fields')) 1075 'Configure personal information for completing form fields'))
1024 self.personalDataAct.setWhatsThis(self.trUtf8( 1076 self.personalDataAct.setWhatsThis(self.trUtf8(
1025 """<b>Personal Information...</b>""" 1077 """<b>Personal Information...</b>"""
1026 """<p>Opens a dialog to configure the personal information used for""" 1078 """<p>Opens a dialog to configure the personal information"""
1027 """ completing form fields.</p>""" 1079 """ used for completing form fields.</p>"""
1028 )) 1080 ))
1029 if not self.initShortcutsOnly: 1081 if not self.initShortcutsOnly:
1030 self.personalDataAct.triggered[()].connect( 1082 self.personalDataAct.triggered[()].connect(
1031 self.__showPersonalInformationDialog) 1083 self.__showPersonalInformationDialog)
1032 self.__actions.append(self.personalDataAct) 1084 self.__actions.append(self.personalDataAct)
1038 self, 'help_greasemonkey') 1090 self, 'help_greasemonkey')
1039 self.greaseMonkeyAct.setStatusTip(self.trUtf8( 1091 self.greaseMonkeyAct.setStatusTip(self.trUtf8(
1040 'Configure the GreaseMonkey Scripts')) 1092 'Configure the GreaseMonkey Scripts'))
1041 self.greaseMonkeyAct.setWhatsThis(self.trUtf8( 1093 self.greaseMonkeyAct.setWhatsThis(self.trUtf8(
1042 """<b>GreaseMonkey Scripts...</b>""" 1094 """<b>GreaseMonkey Scripts...</b>"""
1043 """<p>Opens a dialog to configure the available GreaseMonkey Scripts.</p>""" 1095 """<p>Opens a dialog to configure the available GreaseMonkey"""
1096 """ Scripts.</p>"""
1044 )) 1097 ))
1045 if not self.initShortcutsOnly: 1098 if not self.initShortcutsOnly:
1046 self.greaseMonkeyAct.triggered[()].connect( 1099 self.greaseMonkeyAct.triggered[()].connect(
1047 self.__showGreaseMonkeyConfigDialog) 1100 self.__showGreaseMonkeyConfigDialog)
1048 self.__actions.append(self.greaseMonkeyAct) 1101 self.__actions.append(self.greaseMonkeyAct)
1049 1102
1050 self.editMessageFilterAct = E5Action(self.trUtf8('Edit Message Filters'), 1103 self.editMessageFilterAct = E5Action(
1051 UI.PixmapCache.getIcon("warning.png"), 1104 self.trUtf8('Edit Message Filters'),
1052 self.trUtf8('Edit Message Filters...'), 0, 0, self, 1105 UI.PixmapCache.getIcon("warning.png"),
1053 'help_manage_message_filters') 1106 self.trUtf8('Edit Message Filters...'), 0, 0, self,
1107 'help_manage_message_filters')
1054 self.editMessageFilterAct.setStatusTip(self.trUtf8( 1108 self.editMessageFilterAct.setStatusTip(self.trUtf8(
1055 'Edit the message filters used to suppress unwanted messages')) 1109 'Edit the message filters used to suppress unwanted messages'))
1056 self.editMessageFilterAct.setWhatsThis(self.trUtf8( 1110 self.editMessageFilterAct.setWhatsThis(self.trUtf8(
1057 """<b>Edit Message Filters</b>""" 1111 """<b>Edit Message Filters</b>"""
1058 """<p>Opens a dialog to edit the message filters used to suppress""" 1112 """<p>Opens a dialog to edit the message filters used to"""
1059 """ unwanted messages been shown in an error window.</p>""" 1113 """ suppress unwanted messages been shown in an error"""
1114 """ window.</p>"""
1060 )) 1115 ))
1061 if not self.initShortcutsOnly: 1116 if not self.initShortcutsOnly:
1062 self.editMessageFilterAct.triggered[()].connect( 1117 self.editMessageFilterAct.triggered[()].connect(
1063 E5ErrorMessage.editMessageFilters) 1118 E5ErrorMessage.editMessageFilters)
1064 self.__actions.append(self.editMessageFilterAct) 1119 self.__actions.append(self.editMessageFilterAct)
1065 1120
1066 if self.useQtHelp or self.initShortcutsOnly: 1121 if self.useQtHelp or self.initShortcutsOnly:
1067 self.syncTocAct = E5Action(self.trUtf8('Sync with Table of Contents'), 1122 self.syncTocAct = E5Action(
1123 self.trUtf8('Sync with Table of Contents'),
1068 UI.PixmapCache.getIcon("syncToc.png"), 1124 UI.PixmapCache.getIcon("syncToc.png"),
1069 self.trUtf8('Sync with Table of Contents'), 1125 self.trUtf8('Sync with Table of Contents'),
1070 0, 0, self, 'help_sync_toc') 1126 0, 0, self, 'help_sync_toc')
1071 self.syncTocAct.setStatusTip(self.trUtf8( 1127 self.syncTocAct.setStatusTip(self.trUtf8(
1072 'Synchronizes the table of contents with current page')) 1128 'Synchronizes the table of contents with current page'))
1073 self.syncTocAct.setWhatsThis(self.trUtf8( 1129 self.syncTocAct.setWhatsThis(self.trUtf8(
1074 """<b>Sync with Table of Contents</b>""" 1130 """<b>Sync with Table of Contents</b>"""
1075 """<p>Synchronizes the table of contents with current page.</p>""" 1131 """<p>Synchronizes the table of contents with current"""
1132 """ page.</p>"""
1076 )) 1133 ))
1077 if not self.initShortcutsOnly: 1134 if not self.initShortcutsOnly:
1078 self.syncTocAct.triggered[()].connect(self.__syncTOC) 1135 self.syncTocAct.triggered[()].connect(self.__syncTOC)
1079 self.__actions.append(self.syncTocAct) 1136 self.__actions.append(self.syncTocAct)
1080 1137
1112 self.showSearchAct.setWhatsThis(self.trUtf8( 1169 self.showSearchAct.setWhatsThis(self.trUtf8(
1113 """<b>Search</b>""" 1170 """<b>Search</b>"""
1114 """<p>Shows the search window.</p>""" 1171 """<p>Shows the search window.</p>"""
1115 )) 1172 ))
1116 if not self.initShortcutsOnly: 1173 if not self.initShortcutsOnly:
1117 self.showSearchAct.triggered[()].connect(self.__showSearchWindow) 1174 self.showSearchAct.triggered[()].connect(
1175 self.__showSearchWindow)
1118 self.__actions.append(self.showSearchAct) 1176 self.__actions.append(self.showSearchAct)
1119 1177
1120 self.manageQtHelpDocsAct = E5Action(self.trUtf8('Manage QtHelp Documents'), 1178 self.manageQtHelpDocsAct = E5Action(
1179 self.trUtf8('Manage QtHelp Documents'),
1121 self.trUtf8('Manage QtHelp &Documents'), 1180 self.trUtf8('Manage QtHelp &Documents'),
1122 0, 0, self, 'help_qthelp_documents') 1181 0, 0, self, 'help_qthelp_documents')
1123 self.manageQtHelpDocsAct.setStatusTip(self.trUtf8( 1182 self.manageQtHelpDocsAct.setStatusTip(self.trUtf8(
1124 'Shows a dialog to manage the QtHelp documentation set')) 1183 'Shows a dialog to manage the QtHelp documentation set'))
1125 self.manageQtHelpDocsAct.setWhatsThis(self.trUtf8( 1184 self.manageQtHelpDocsAct.setWhatsThis(self.trUtf8(
1126 """<b>Manage QtHelp Documents</b>""" 1185 """<b>Manage QtHelp Documents</b>"""
1127 """<p>Shows a dialog to manage the QtHelp documentation set.</p>""" 1186 """<p>Shows a dialog to manage the QtHelp documentation"""
1187 """ set.</p>"""
1128 )) 1188 ))
1129 if not self.initShortcutsOnly: 1189 if not self.initShortcutsOnly:
1130 self.manageQtHelpDocsAct.triggered[()].connect( 1190 self.manageQtHelpDocsAct.triggered[()].connect(
1131 self.__manageQtHelpDocumentation) 1191 self.__manageQtHelpDocumentation)
1132 self.__actions.append(self.manageQtHelpDocsAct) 1192 self.__actions.append(self.manageQtHelpDocsAct)
1133 1193
1134 self.manageQtHelpFiltersAct = E5Action(self.trUtf8('Manage QtHelp Filters'), 1194 self.manageQtHelpFiltersAct = E5Action(
1195 self.trUtf8('Manage QtHelp Filters'),
1135 self.trUtf8('Manage QtHelp &Filters'), 1196 self.trUtf8('Manage QtHelp &Filters'),
1136 0, 0, self, 'help_qthelp_filters') 1197 0, 0, self, 'help_qthelp_filters')
1137 self.manageQtHelpFiltersAct.setStatusTip(self.trUtf8( 1198 self.manageQtHelpFiltersAct.setStatusTip(self.trUtf8(
1138 'Shows a dialog to manage the QtHelp filters')) 1199 'Shows a dialog to manage the QtHelp filters'))
1139 self.manageQtHelpFiltersAct.setWhatsThis(self.trUtf8( 1200 self.manageQtHelpFiltersAct.setWhatsThis(self.trUtf8(
1143 if not self.initShortcutsOnly: 1204 if not self.initShortcutsOnly:
1144 self.manageQtHelpFiltersAct.triggered[()].connect( 1205 self.manageQtHelpFiltersAct.triggered[()].connect(
1145 self.__manageQtHelpFilters) 1206 self.__manageQtHelpFilters)
1146 self.__actions.append(self.manageQtHelpFiltersAct) 1207 self.__actions.append(self.manageQtHelpFiltersAct)
1147 1208
1148 self.reindexDocumentationAct = E5Action(self.trUtf8('Reindex Documentation'), 1209 self.reindexDocumentationAct = E5Action(
1210 self.trUtf8('Reindex Documentation'),
1149 self.trUtf8('&Reindex Documentation'), 1211 self.trUtf8('&Reindex Documentation'),
1150 0, 0, self, 'help_qthelp_reindex') 1212 0, 0, self, 'help_qthelp_reindex')
1151 self.reindexDocumentationAct.setStatusTip(self.trUtf8( 1213 self.reindexDocumentationAct.setStatusTip(self.trUtf8(
1152 'Reindexes the documentation set')) 1214 'Reindexes the documentation set'))
1153 self.reindexDocumentationAct.setWhatsThis(self.trUtf8( 1215 self.reindexDocumentationAct.setWhatsThis(self.trUtf8(
1161 1223
1162 self.clearPrivateDataAct = E5Action(self.trUtf8('Clear private data'), 1224 self.clearPrivateDataAct = E5Action(self.trUtf8('Clear private data'),
1163 self.trUtf8('&Clear private data'), 1225 self.trUtf8('&Clear private data'),
1164 0, 0, 1226 0, 0,
1165 self, 'help_clear_private_data') 1227 self, 'help_clear_private_data')
1166 self.clearPrivateDataAct.setStatusTip(self.trUtf8('Clear private data')) 1228 self.clearPrivateDataAct.setStatusTip(self.trUtf8(
1229 'Clear private data'))
1167 self.clearPrivateDataAct.setWhatsThis(self.trUtf8( 1230 self.clearPrivateDataAct.setWhatsThis(self.trUtf8(
1168 """<b>Clear private data</b>""" 1231 """<b>Clear private data</b>"""
1169 """<p>Clears the private data like browsing history, search history""" 1232 """<p>Clears the private data like browsing history, search"""
1170 """ or the favicons database.</p>""" 1233 """ history or the favicons database.</p>"""
1171 )) 1234 ))
1172 if not self.initShortcutsOnly: 1235 if not self.initShortcutsOnly:
1173 self.clearPrivateDataAct.triggered[()].connect(self.__clearPrivateData) 1236 self.clearPrivateDataAct.triggered[()].connect(
1237 self.__clearPrivateData)
1174 self.__actions.append(self.clearPrivateDataAct) 1238 self.__actions.append(self.clearPrivateDataAct)
1175 1239
1176 self.clearIconsAct = E5Action(self.trUtf8('Clear icons database'), 1240 self.clearIconsAct = E5Action(self.trUtf8('Clear icons database'),
1177 self.trUtf8('Clear &icons database'), 1241 self.trUtf8('Clear &icons database'),
1178 0, 0, 1242 0, 0,
1179 self, 'help_clear_icons_db') 1243 self, 'help_clear_icons_db')
1180 self.clearIconsAct.setStatusTip(self.trUtf8('Clear the database of favicons')) 1244 self.clearIconsAct.setStatusTip(self.trUtf8(
1245 'Clear the database of favicons'))
1181 self.clearIconsAct.setWhatsThis(self.trUtf8( 1246 self.clearIconsAct.setWhatsThis(self.trUtf8(
1182 """<b>Clear icons database</b>""" 1247 """<b>Clear icons database</b>"""
1183 """<p>Clears the database of favicons of previously visited URLs.</p>""" 1248 """<p>Clears the database of favicons of previously visited"""
1249 """ URLs.</p>"""
1184 )) 1250 ))
1185 if not self.initShortcutsOnly: 1251 if not self.initShortcutsOnly:
1186 self.clearIconsAct.triggered[()].connect(self.__clearIconsDatabase) 1252 self.clearIconsAct.triggered[()].connect(self.__clearIconsDatabase)
1187 self.__actions.append(self.clearIconsAct) 1253 self.__actions.append(self.clearIconsAct)
1188 1254
1189 self.searchEnginesAct = E5Action(self.trUtf8('Configure Search Engines'), 1255 self.searchEnginesAct = E5Action(
1190 self.trUtf8('Configure Search &Engines...'), 1256 self.trUtf8('Configure Search Engines'),
1191 0, 0, 1257 self.trUtf8('Configure Search &Engines...'),
1192 self, 'help_search_engines') 1258 0, 0,
1259 self, 'help_search_engines')
1193 self.searchEnginesAct.setStatusTip(self.trUtf8( 1260 self.searchEnginesAct.setStatusTip(self.trUtf8(
1194 'Configure the available search engines')) 1261 'Configure the available search engines'))
1195 self.searchEnginesAct.setWhatsThis(self.trUtf8( 1262 self.searchEnginesAct.setWhatsThis(self.trUtf8(
1196 """<b>Configure Search Engines...</b>""" 1263 """<b>Configure Search Engines...</b>"""
1197 """<p>Opens a dialog to configure the available search engines.</p>""" 1264 """<p>Opens a dialog to configure the available search"""
1265 """ engines.</p>"""
1198 )) 1266 ))
1199 if not self.initShortcutsOnly: 1267 if not self.initShortcutsOnly:
1200 self.searchEnginesAct.triggered[()].connect( 1268 self.searchEnginesAct.triggered[()].connect(
1201 self.__showEnginesConfigurationDialog) 1269 self.__showEnginesConfigurationDialog)
1202 self.__actions.append(self.searchEnginesAct) 1270 self.__actions.append(self.searchEnginesAct)
1220 UI.PixmapCache.getIcon("adBlockPlus.png"), 1288 UI.PixmapCache.getIcon("adBlockPlus.png"),
1221 self.trUtf8('&Ad Block...'), 1289 self.trUtf8('&Ad Block...'),
1222 0, 0, 1290 0, 0,
1223 self, 'help_adblock') 1291 self, 'help_adblock')
1224 self.adblockAct.setStatusTip(self.trUtf8( 1292 self.adblockAct.setStatusTip(self.trUtf8(
1225 'Configure AdBlock subscriptions and rules')) 1293 'Configure AdBlock subscriptions and rules'))
1226 self.adblockAct.setWhatsThis(self.trUtf8( 1294 self.adblockAct.setWhatsThis(self.trUtf8(
1227 """<b>Ad Block...</b>""" 1295 """<b>Ad Block...</b>"""
1228 """<p>Opens a dialog to configure AdBlock subscriptions and rules.</p>""" 1296 """<p>Opens a dialog to configure AdBlock subscriptions and"""
1297 """ rules.</p>"""
1229 )) 1298 ))
1230 if not self.initShortcutsOnly: 1299 if not self.initShortcutsOnly:
1231 self.adblockAct.triggered[()].connect(self.__showAdBlockDialog) 1300 self.adblockAct.triggered[()].connect(self.__showAdBlockDialog)
1232 self.__actions.append(self.adblockAct) 1301 self.__actions.append(self.adblockAct)
1233 1302
1235 UI.PixmapCache.getIcon("flashBlock.png"), 1304 UI.PixmapCache.getIcon("flashBlock.png"),
1236 self.trUtf8('&ClickToFlash...'), 1305 self.trUtf8('&ClickToFlash...'),
1237 0, 0, 1306 0, 0,
1238 self, 'help_flashblock') 1307 self, 'help_flashblock')
1239 self.flashblockAct.setStatusTip(self.trUtf8( 1308 self.flashblockAct.setStatusTip(self.trUtf8(
1240 'Configure ClickToFlash whitelist')) 1309 'Configure ClickToFlash whitelist'))
1241 self.flashblockAct.setWhatsThis(self.trUtf8( 1310 self.flashblockAct.setWhatsThis(self.trUtf8(
1242 """<b>ClickToFlash...</b>""" 1311 """<b>ClickToFlash...</b>"""
1243 """<p>Opens a dialog to configure the ClickToFlash whitelist.</p>""" 1312 """<p>Opens a dialog to configure the ClickToFlash"""
1244 )) 1313 """ whitelist.</p>"""
1245 if not self.initShortcutsOnly: 1314 ))
1246 self.flashblockAct.triggered[()].connect(self.__showClickToFlashDialog) 1315 if not self.initShortcutsOnly:
1316 self.flashblockAct.triggered[()].connect(
1317 self.__showClickToFlashDialog)
1247 self.__actions.append(self.flashblockAct) 1318 self.__actions.append(self.flashblockAct)
1248 1319
1249 if SSL_AVAILABLE: 1320 if SSL_AVAILABLE:
1250 self.certificatesAct = E5Action(self.trUtf8('Manage SSL Certificates'), 1321 self.certificatesAct = E5Action(
1251 UI.PixmapCache.getIcon("certificates.png"), 1322 self.trUtf8('Manage SSL Certificates'),
1252 self.trUtf8('Manage SSL Certificates...'), 1323 UI.PixmapCache.getIcon("certificates.png"),
1253 0, 0, 1324 self.trUtf8('Manage SSL Certificates...'),
1254 self, 'help_manage_certificates') 1325 0, 0,
1326 self, 'help_manage_certificates')
1255 self.certificatesAct.setStatusTip(self.trUtf8( 1327 self.certificatesAct.setStatusTip(self.trUtf8(
1256 'Manage the saved SSL certificates')) 1328 'Manage the saved SSL certificates'))
1257 self.certificatesAct.setWhatsThis(self.trUtf8( 1329 self.certificatesAct.setWhatsThis(self.trUtf8(
1258 """<b>Manage SSL Certificates...</b>""" 1330 """<b>Manage SSL Certificates...</b>"""
1259 """<p>Opens a dialog to manage the saved SSL certificates.</p>""" 1331 """<p>Opens a dialog to manage the saved SSL"""
1332 """ certificates.</p>"""
1260 )) 1333 ))
1261 if not self.initShortcutsOnly: 1334 if not self.initShortcutsOnly:
1262 self.certificatesAct.triggered[()].connect(self.__showCertificatesDialog) 1335 self.certificatesAct.triggered[()].connect(
1336 self.__showCertificatesDialog)
1263 self.__actions.append(self.certificatesAct) 1337 self.__actions.append(self.certificatesAct)
1264 1338
1265 self.toolsMonitorAct = E5Action(self.trUtf8('Network Monitor'), 1339 self.toolsMonitorAct = E5Action(self.trUtf8('Network Monitor'),
1266 self.trUtf8('&Network Monitor...'), 1340 self.trUtf8('&Network Monitor...'),
1267 0, 0, 1341 0, 0,
1268 self, 'help_tools_network_monitor') 1342 self, 'help_tools_network_monitor')
1269 self.toolsMonitorAct.setStatusTip(self.trUtf8('Show the network monitor dialog')) 1343 self.toolsMonitorAct.setStatusTip(self.trUtf8(
1344 'Show the network monitor dialog'))
1270 self.toolsMonitorAct.setWhatsThis(self.trUtf8( 1345 self.toolsMonitorAct.setWhatsThis(self.trUtf8(
1271 """<b>Network Monitor...</b>""" 1346 """<b>Network Monitor...</b>"""
1272 """<p>Shows the network monitor dialog.</p>""" 1347 """<p>Shows the network monitor dialog.</p>"""
1273 )) 1348 ))
1274 if not self.initShortcutsOnly: 1349 if not self.initShortcutsOnly:
1275 self.toolsMonitorAct.triggered[()].connect(self.__showNetworkMonitor) 1350 self.toolsMonitorAct.triggered[()].connect(
1351 self.__showNetworkMonitor)
1276 self.__actions.append(self.toolsMonitorAct) 1352 self.__actions.append(self.toolsMonitorAct)
1277 1353
1278 self.showDownloadManagerAct = E5Action(self.trUtf8('Downloads'), 1354 self.showDownloadManagerAct = E5Action(self.trUtf8('Downloads'),
1279 self.trUtf8('Downloads'), 1355 self.trUtf8('Downloads'),
1280 0, 0, self, 'help_show_downloads') 1356 0, 0, self, 'help_show_downloads')
1283 self.showDownloadManagerAct.setWhatsThis(self.trUtf8( 1359 self.showDownloadManagerAct.setWhatsThis(self.trUtf8(
1284 """<b>Downloads</b>""" 1360 """<b>Downloads</b>"""
1285 """<p>Shows the downloads window.</p>""" 1361 """<p>Shows the downloads window.</p>"""
1286 )) 1362 ))
1287 if not self.initShortcutsOnly: 1363 if not self.initShortcutsOnly:
1288 self.showDownloadManagerAct.triggered[()].connect(self.__showDownloadsWindow) 1364 self.showDownloadManagerAct.triggered[()].connect(
1365 self.__showDownloadsWindow)
1289 self.__actions.append(self.showDownloadManagerAct) 1366 self.__actions.append(self.showDownloadManagerAct)
1290 1367
1291 self.feedsManagerAct = E5Action(self.trUtf8('RSS Feeds Dialog'), 1368 self.feedsManagerAct = E5Action(self.trUtf8('RSS Feeds Dialog'),
1292 UI.PixmapCache.getIcon("rss22.png"), 1369 UI.PixmapCache.getIcon("rss22.png"),
1293 self.trUtf8('&RSS Feeds Dialog...'), 1370 self.trUtf8('&RSS Feeds Dialog...'),
1294 QKeySequence(self.trUtf8("Ctrl+Shift+F", "Help|RSS Feeds Dialog")), 1371 QKeySequence(self.trUtf8("Ctrl+Shift+F", "Help|RSS Feeds Dialog")),
1295 0, self, 'help_rss_feeds') 1372 0, self, 'help_rss_feeds')
1296 self.feedsManagerAct.setStatusTip(self.trUtf8( 1373 self.feedsManagerAct.setStatusTip(self.trUtf8(
1297 'Open a dialog showing the configured RSS feeds.')) 1374 'Open a dialog showing the configured RSS feeds.'))
1298 self.feedsManagerAct.setWhatsThis(self.trUtf8( 1375 self.feedsManagerAct.setWhatsThis(self.trUtf8(
1299 """<b>RSS Feeds Dialog...</b>""" 1376 """<b>RSS Feeds Dialog...</b>"""
1300 """<p>Open a dialog to show the configured RSS feeds.""" 1377 """<p>Open a dialog to show the configured RSS feeds."""
1301 """ It can be used to mange the feeds and to show their contents.</p>""" 1378 """ It can be used to mange the feeds and to show their"""
1379 """ contents.</p>"""
1302 )) 1380 ))
1303 if not self.initShortcutsOnly: 1381 if not self.initShortcutsOnly:
1304 self.feedsManagerAct.triggered[()].connect(self.__showFeedsManager) 1382 self.feedsManagerAct.triggered[()].connect(self.__showFeedsManager)
1305 self.__actions.append(self.feedsManagerAct) 1383 self.__actions.append(self.feedsManagerAct)
1306 1384
1308 UI.PixmapCache.getIcon("helpAbout.png"), 1386 UI.PixmapCache.getIcon("helpAbout.png"),
1309 self.trUtf8('&Siteinfo Dialog...'), 1387 self.trUtf8('&Siteinfo Dialog...'),
1310 QKeySequence(self.trUtf8("Ctrl+Shift+I", "Help|Siteinfo Dialog")), 1388 QKeySequence(self.trUtf8("Ctrl+Shift+I", "Help|Siteinfo Dialog")),
1311 0, self, 'help_siteinfo') 1389 0, self, 'help_siteinfo')
1312 self.siteInfoAct.setStatusTip(self.trUtf8( 1390 self.siteInfoAct.setStatusTip(self.trUtf8(
1313 'Open a dialog showing some information about the current site.')) 1391 'Open a dialog showing some information about the current site.'))
1314 self.siteInfoAct.setWhatsThis(self.trUtf8( 1392 self.siteInfoAct.setWhatsThis(self.trUtf8(
1315 """<b>Siteinfo Dialog...</b>""" 1393 """<b>Siteinfo Dialog...</b>"""
1316 """<p>Opens a dialog showing some information about the current""" 1394 """<p>Opens a dialog showing some information about the current"""
1317 """ site.</p>""" 1395 """ site.</p>"""
1318 )) 1396 ))
1319 if not self.initShortcutsOnly: 1397 if not self.initShortcutsOnly:
1320 self.siteInfoAct.triggered[()].connect(self.__showSiteinfoDialog) 1398 self.siteInfoAct.triggered[()].connect(self.__showSiteinfoDialog)
1321 self.__actions.append(self.siteInfoAct) 1399 self.__actions.append(self.siteInfoAct)
1322 1400
1323 self.userAgentManagerAct = E5Action(self.trUtf8('Manage User Agent Settings'), 1401 self.userAgentManagerAct = E5Action(
1402 self.trUtf8('Manage User Agent Settings'),
1324 self.trUtf8('Manage &User Agent Settings'), 1403 self.trUtf8('Manage &User Agent Settings'),
1325 0, 0, self, 'help_user_agent_settings') 1404 0, 0, self, 'help_user_agent_settings')
1326 self.userAgentManagerAct.setStatusTip(self.trUtf8( 1405 self.userAgentManagerAct.setStatusTip(self.trUtf8(
1327 'Shows a dialog to manage the User Agent settings')) 1406 'Shows a dialog to manage the User Agent settings'))
1328 self.userAgentManagerAct.setWhatsThis(self.trUtf8( 1407 self.userAgentManagerAct.setWhatsThis(self.trUtf8(
1337 self.synchronizationAct = E5Action(self.trUtf8('Synchronize data'), 1416 self.synchronizationAct = E5Action(self.trUtf8('Synchronize data'),
1338 UI.PixmapCache.getIcon("sync.png"), 1417 UI.PixmapCache.getIcon("sync.png"),
1339 self.trUtf8('&Synchronize Data...'), 1418 self.trUtf8('&Synchronize Data...'),
1340 0, 0, self, 'help_synchronize_data') 1419 0, 0, self, 'help_synchronize_data')
1341 self.synchronizationAct.setStatusTip(self.trUtf8( 1420 self.synchronizationAct.setStatusTip(self.trUtf8(
1342 'Shows a dialog to synchronize data via the network')) 1421 'Shows a dialog to synchronize data via the network'))
1343 self.synchronizationAct.setWhatsThis(self.trUtf8( 1422 self.synchronizationAct.setWhatsThis(self.trUtf8(
1344 """<b>Synchronize Data...</b>""" 1423 """<b>Synchronize Data...</b>"""
1345 """<p>This shows a dialog to synchronize data via the network.</p>""" 1424 """<p>This shows a dialog to synchronize data via the"""
1425 """ network.</p>"""
1346 )) 1426 ))
1347 if not self.initShortcutsOnly: 1427 if not self.initShortcutsOnly:
1348 self.synchronizationAct.triggered[()].connect( 1428 self.synchronizationAct.triggered[()].connect(
1349 self.__showSyncDialog) 1429 self.__showSyncDialog)
1350 self.__actions.append(self.synchronizationAct) 1430 self.__actions.append(self.synchronizationAct)
1408 menu.addAction(self.zoomTextOnlyAct) 1488 menu.addAction(self.zoomTextOnlyAct)
1409 menu.addSeparator() 1489 menu.addSeparator()
1410 menu.addAction(self.pageSourceAct) 1490 menu.addAction(self.pageSourceAct)
1411 menu.addAction(self.fullScreenAct) 1491 menu.addAction(self.fullScreenAct)
1412 if hasattr(QWebSettings, 'defaultTextEncoding'): 1492 if hasattr(QWebSettings, 'defaultTextEncoding'):
1413 self.__textEncodingMenu = menu.addMenu(self.trUtf8("Text Encoding")) 1493 self.__textEncodingMenu = menu.addMenu(
1494 self.trUtf8("Text Encoding"))
1414 self.__textEncodingMenu.aboutToShow.connect( 1495 self.__textEncodingMenu.aboutToShow.connect(
1415 self.__aboutToShowTextEncodingMenu) 1496 self.__aboutToShowTextEncodingMenu)
1416 self.__textEncodingMenu.triggered.connect(self.__setTextEncoding) 1497 self.__textEncodingMenu.triggered.connect(self.__setTextEncoding)
1417 1498
1418 menu = mb.addMenu(self.trUtf8('&Go')) 1499 menu = mb.addMenu(self.trUtf8('&Go'))
1575 self.filterCombo.setMinimumWidth( 1656 self.filterCombo.setMinimumWidth(
1576 QFontMetrics(QFont()).width("ComboBoxWithEnoughWidth")) 1657 QFontMetrics(QFont()).width("ComboBoxWithEnoughWidth"))
1577 filtertb.addWidget(QLabel(self.trUtf8("Filtered by: "))) 1658 filtertb.addWidget(QLabel(self.trUtf8("Filtered by: ")))
1578 filtertb.addWidget(self.filterCombo) 1659 filtertb.addWidget(self.filterCombo)
1579 self.__helpEngine.setupFinished.connect(self.__setupFilterCombo) 1660 self.__helpEngine.setupFinished.connect(self.__setupFilterCombo)
1580 self.filterCombo.activated[str].connect(self.__filterQtHelpDocumentation) 1661 self.filterCombo.activated[str].connect(
1662 self.__filterQtHelpDocumentation)
1581 self.__setupFilterCombo() 1663 self.__setupFilterCombo()
1582 1664
1583 settingstb = self.addToolBar(self.trUtf8("Settings")) 1665 settingstb = self.addToolBar(self.trUtf8("Settings"))
1584 settingstb.setObjectName("SettingsToolBar") 1666 settingstb.setObjectName("SettingsToolBar")
1585 settingstb.setIconSize(UI.Config.ToolBarIconSize) 1667 settingstb.setIconSize(UI.Config.ToolBarIconSize)
1639 backButton.setMenu(self.backMenu) 1721 backButton.setMenu(self.backMenu)
1640 backButton.setPopupMode(QToolButton.MenuButtonPopup) 1722 backButton.setPopupMode(QToolButton.MenuButtonPopup)
1641 1723
1642 self.forwardMenu = QMenu(self) 1724 self.forwardMenu = QMenu(self)
1643 self.forwardMenu.aboutToShow.connect(self.__showForwardMenu) 1725 self.forwardMenu.aboutToShow.connect(self.__showForwardMenu)
1644 self.forwardMenu.triggered.connect(self.__navigationMenuActionTriggered) 1726 self.forwardMenu.triggered.connect(
1727 self.__navigationMenuActionTriggered)
1645 forwardButton = gotb.widgetForAction(self.forwardAct) 1728 forwardButton = gotb.widgetForAction(self.forwardAct)
1646 forwardButton.setMenu(self.forwardMenu) 1729 forwardButton.setMenu(self.forwardMenu)
1647 forwardButton.setPopupMode(QToolButton.MenuButtonPopup) 1730 forwardButton.setPopupMode(QToolButton.MenuButtonPopup)
1648 1731
1649 from .Bookmarks.BookmarksToolBar import BookmarksToolBar 1732 from .Bookmarks.BookmarksToolBar import BookmarksToolBar
1663 vttb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) 1746 vttb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
1664 self.virustotalSearchEdit = QLineEdit() 1747 self.virustotalSearchEdit = QLineEdit()
1665 self.virustotalSearchEdit.setMaximumWidth(250) 1748 self.virustotalSearchEdit.setMaximumWidth(250)
1666 self.virustotalSearchEdit.setWhatsThis(self.trUtf8( 1749 self.virustotalSearchEdit.setWhatsThis(self.trUtf8(
1667 """<h2>File search</h2>""" 1750 """<h2>File search</h2>"""
1668 """<p>In order to search for the last VirusTotal report on a given file""" 1751 """<p>In order to search for the last VirusTotal report on a"""
1669 """ just enter its hash. Currently the allowed hashes are MD5, SHA1 and""" 1752 """ given file just enter its hash. Currently the allowed"""
1670 """ SHA256. You can also search for a particular file report by typing""" 1753 """ hashes are MD5, SHA1 and SHA256. You can also search for"""
1671 """ in its permalink id.</p>""" 1754 """ a particular file report by typing in its permalink id.</p>"""
1672 """<h2>URL search</h2>""" 1755 """<h2>URL search</h2>"""
1673 """<p>URL searches are simple, just type in the given URL, the application""" 1756 """<p>URL searches are simple, just type in the given URL, the"""
1674 """ will normalize it and compare it with the entries in VirusTotal's""" 1757 """ application will normalize it and compare it with the"""
1675 """ database. Alternatively you may enter the MD5 hash of an URL preceded""" 1758 """ entries in VirusTotal's database. Alternatively you may"""
1676 """ by "url:", e.g. url:7f911bbcf618f052ac6b9928600d2820.</p>""" 1759 """ enter the MD5 hash of an URL preceded by "url:", e.g."""
1760 """ url:7f911bbcf618f052ac6b9928600d2820.</p>"""
1677 """<h2>User search</h2>""" 1761 """<h2>User search</h2>"""
1678 """<p>Do you want to know whether a friend has a VT Community account?""" 1762 """<p>Do you want to know whether a friend has a VT Community"""
1679 """ Simply type in his nick preceded by the symbol "@", e.g.""" 1763 """ account? Simply type in his nick preceded by the symbol"""
1680 """ @EmilianoMartinez.</p>""" 1764 """ "@", e.g. @EmilianoMartinez.</p>"""
1681 """<h2>Search through comments</h2>""" 1765 """<h2>Search through comments</h2>"""
1682 """<p>The comments in VT Community may often help in disinfecting your PC""" 1766 """<p>The comments in VT Community may often help in"""
1683 """ or may proof themselves useful when analysing a particular malware""" 1767 """ disinfecting your PC or may proof themselves useful when"""
1684 """ sample, comment tags enable users to search through the VT Community""" 1768 """ analysing a particular malware sample, comment tags enable"""
1685 """ reviews. The standard file tags are: {0} The standard URL tags are: {1}""" 1769 """ users to search through the VT Community reviews. The"""
1770 """ standard file tags are: {0} The standard URL tags are: {1}"""
1686 """User generated tags are preceded by the symbol "#", e.g.""" 1771 """User generated tags are preceded by the symbol "#", e.g."""
1687 """ #disinfect.</p>""" 1772 """ #disinfect.</p>"""
1688 ).format( 1773 ).format(
1689 """<ul>""" 1774 """<ul>"""
1690 """<li>goodware</li>""" 1775 """<li>goodware</li>"""
1702 """<li>phishingsite</li>""" 1787 """<li>phishingsite</li>"""
1703 """<li>browserexploit</li>""" 1788 """<li>browserexploit</li>"""
1704 """<li>spamlink</li>""" 1789 """<li>spamlink</li>"""
1705 """</ul>""", 1790 """</ul>""",
1706 )) 1791 ))
1707 self.virustotalSearchEdit.textChanged.connect(self.__virusTotalSearchChanged) 1792 self.virustotalSearchEdit.textChanged.connect(
1708 self.virustotalSearchEdit.returnPressed.connect(self.__virusTotalSearch) 1793 self.__virusTotalSearchChanged)
1794 self.virustotalSearchEdit.returnPressed.connect(
1795 self.__virusTotalSearch)
1709 vttb.addWidget(self.virustotalSearchEdit) 1796 vttb.addWidget(self.virustotalSearchEdit)
1710 self.virustotalSearchAct = vttb.addAction( 1797 self.virustotalSearchAct = vttb.addAction(
1711 UI.PixmapCache.getIcon("virustotal.png"), 1798 UI.PixmapCache.getIcon("virustotal.png"),
1712 self.trUtf8("Search VirusTotal"), 1799 self.trUtf8("Search VirusTotal"),
1713 self.__virusTotalSearch) 1800 self.__virusTotalSearch)
1742 if fwidget: 1829 if fwidget:
1743 fwidget.prevTab() 1830 fwidget.prevTab()
1744 1831
1745 def __switchTab(self): 1832 def __switchTab(self):
1746 """ 1833 """
1747 Private slot used to switch between the current and the previous current tab. 1834 Private slot used to switch between the current and the previous
1835 current tab.
1748 """ 1836 """
1749 fwidget = QApplication.focusWidget() 1837 fwidget = QApplication.focusWidget()
1750 while fwidget and not hasattr(fwidget, 'switchTab'): 1838 while fwidget and not hasattr(fwidget, 'switchTab'):
1751 fwidget = fwidget.parent() 1839 fwidget = fwidget.parent()
1752 if fwidget: 1840 if fwidget:
1877 self.currentBrowser(), visibleOnly=visibleOnly) 1965 self.currentBrowser(), visibleOnly=visibleOnly)
1878 self.__pageScreen.show() 1966 self.__pageScreen.show()
1879 1967
1880 def __saveVisiblePageScreen(self): 1968 def __saveVisiblePageScreen(self):
1881 """ 1969 """
1882 Private slot to save the visible part of the current page as a screen shot. 1970 Private slot to save the visible part of the current page as a screen
1971 shot.
1883 """ 1972 """
1884 self.__savePageScreen(visibleOnly=True) 1973 self.__savePageScreen(visibleOnly=True)
1885 1974
1886 def __about(self): 1975 def __about(self):
1887 """ 1976 """
1888 Private slot to show the about information. 1977 Private slot to show the about information.
1889 """ 1978 """
1890 E5MessageBox.about(self, self.trUtf8("eric5 Web Browser"), self.trUtf8( 1979 E5MessageBox.about(self, self.trUtf8("eric5 Web Browser"), self.trUtf8(
1891 """<b>eric5 Web Browser - {0}</b>""" 1980 """<b>eric5 Web Browser - {0}</b>"""
1892 """<p>The eric5 Web Browser is a combined help file and HTML browser.""" 1981 """<p>The eric5 Web Browser is a combined help file and HTML"""
1893 """ It is part of the eric5 development toolset.</p>""" 1982 """ browser. It is part of the eric5 development toolset.</p>"""
1894 ).format(Version)) 1983 ).format(Version))
1895 1984
1896 def __aboutQt(self): 1985 def __aboutQt(self):
1897 """ 1986 """
1898 Private slot to show info about Qt. 1987 Private slot to show info about Qt.
1909 1998
1910 def setForwardAvailable(self, b): 1999 def setForwardAvailable(self, b):
1911 """ 2000 """
1912 Public slot called when forward references are available. 2001 Public slot called when forward references are available.
1913 2002
1914 @param b flag indicating the availability of the forwards action (boolean) 2003 @param b flag indicating the availability of the forwards action
2004 (boolean)
1915 """ 2005 """
1916 self.forwardAct.setEnabled(b) 2006 self.forwardAct.setEnabled(b)
1917 2007
1918 def setLoadingActions(self, b): 2008 def setLoadingActions(self, b):
1919 """ 2009 """
2078 state = self.saveState() 2168 state = self.saveState()
2079 Preferences.setHelp("HelpViewerState", state) 2169 Preferences.setHelp("HelpViewerState", state)
2080 2170
2081 if Preferences.getHelp("SaveGeometry"): 2171 if Preferences.getHelp("SaveGeometry"):
2082 if not self.__isFullScreen(): 2172 if not self.__isFullScreen():
2083 Preferences.setGeometry("HelpViewerGeometry", self.saveGeometry()) 2173 Preferences.setGeometry("HelpViewerGeometry",
2174 self.saveGeometry())
2084 else: 2175 else:
2085 Preferences.setGeometry("HelpViewerGeometry", QByteArray()) 2176 Preferences.setGeometry("HelpViewerGeometry", QByteArray())
2086 2177
2087 try: 2178 try:
2088 if self.fromEric or len(self.__class__.helpwindows) > 1: 2179 if self.fromEric or len(self.__class__.helpwindows) > 1:
2089 del self.__class__.helpwindows[self.__class__.helpwindows.index(self)] 2180 del self.__class__.helpwindows[
2181 self.__class__.helpwindows.index(self)]
2090 except ValueError: 2182 except ValueError:
2091 pass 2183 pass
2092 2184
2093 if not self.fromEric: 2185 if not self.fromEric:
2094 Preferences.syncPreferences() 2186 Preferences.syncPreferences()
2159 """ 2251 """
2160 Private slot called to handle the zoom text only action. 2252 Private slot called to handle the zoom text only action.
2161 2253
2162 @param textOnly flag indicating to zoom text only (boolean) 2254 @param textOnly flag indicating to zoom text only (boolean)
2163 """ 2255 """
2164 QWebSettings.globalSettings().setAttribute(QWebSettings.ZoomTextOnly, textOnly) 2256 QWebSettings.globalSettings().setAttribute(
2257 QWebSettings.ZoomTextOnly, textOnly)
2165 self.zoomTextOnlyChanged.emit(textOnly) 2258 self.zoomTextOnlyChanged.emit(textOnly)
2166 2259
2167 def __viewFullScreen(self,): 2260 def __viewFullScreen(self,):
2168 """ 2261 """
2169 Private slot called to toggle fullscreen mode. 2262 Private slot called to toggle fullscreen mode.
2170 """ 2263 """
2171 if self.__isFullScreen(): 2264 if self.__isFullScreen():
2172 # switch back to normal 2265 # switch back to normal
2173 self.setWindowState(self.windowState() & ~Qt.WindowFullScreen) 2266 self.setWindowState(self.windowState() & ~Qt.WindowFullScreen)
2174 self.menuBar().show() 2267 self.menuBar().show()
2175 self.fullScreenAct.setIcon(UI.PixmapCache.getIcon("windowFullscreen.png")) 2268 self.fullScreenAct.setIcon(
2269 UI.PixmapCache.getIcon("windowFullscreen.png"))
2176 self.fullScreenAct.setIconText(self.trUtf8('Full Screen')) 2270 self.fullScreenAct.setIconText(self.trUtf8('Full Screen'))
2177 else: 2271 else:
2178 # switch to full screen 2272 # switch to full screen
2179 self.setWindowState(self.windowState() | Qt.WindowFullScreen) 2273 self.setWindowState(self.windowState() | Qt.WindowFullScreen)
2180 self.menuBar().hide() 2274 self.menuBar().hide()
2181 self.fullScreenAct.setIcon(UI.PixmapCache.getIcon("windowRestore.png")) 2275 self.fullScreenAct.setIcon(
2276 UI.PixmapCache.getIcon("windowRestore.png"))
2182 self.fullScreenAct.setIconText(self.trUtf8('Restore Window')) 2277 self.fullScreenAct.setIconText(self.trUtf8('Restore Window'))
2183 2278
2184 def __isFullScreen(self): 2279 def __isFullScreen(self):
2185 """ 2280 """
2186 Private method to determine, if the window is in full screen mode. 2281 Private method to determine, if the window is in full screen mode.
2200 Private slot to switch private browsing. 2295 Private slot to switch private browsing.
2201 """ 2296 """
2202 settings = QWebSettings.globalSettings() 2297 settings = QWebSettings.globalSettings()
2203 pb = settings.testAttribute(QWebSettings.PrivateBrowsingEnabled) 2298 pb = settings.testAttribute(QWebSettings.PrivateBrowsingEnabled)
2204 if not pb: 2299 if not pb:
2205 txt = self.trUtf8("""<b>Are you sure you want to turn on private""" 2300 txt = self.trUtf8(
2206 """ browsing?</b><p>When private browsing is turned on,""" 2301 """<b>Are you sure you want to turn on private"""
2207 """ web pages are not added to the history, searches""" 2302 """ browsing?</b><p>When private browsing is turned on,"""
2208 """ are not added to the list of recent searches and""" 2303 """ web pages are not added to the history, searches"""
2209 """ web site icons and cookies are not stored.""" 2304 """ are not added to the list of recent searches and"""
2210 """ HTML5 offline storage will be deactivated.""" 2305 """ web site icons and cookies are not stored."""
2211 """ Until you close the window, you can still click""" 2306 """ HTML5 offline storage will be deactivated."""
2212 """ the Back and Forward buttons to return to the""" 2307 """ Until you close the window, you can still click"""
2213 """ web pages you have opened.</p>""") 2308 """ the Back and Forward buttons to return to the"""
2309 """ web pages you have opened.</p>""")
2214 res = E5MessageBox.yesNo(self, "", txt) 2310 res = E5MessageBox.yesNo(self, "", txt)
2215 if res: 2311 if res:
2216 self.setPrivateMode(True) 2312 self.setPrivateMode(True)
2217 else: 2313 else:
2218 self.setPrivateMode(False) 2314 self.setPrivateMode(False)
2240 """ 2336 """
2241 return self.tabWidget.currentBrowser() 2337 return self.tabWidget.currentBrowser()
2242 2338
2243 def browserAt(self, index): 2339 def browserAt(self, index):
2244 """ 2340 """
2245 Public method to get a reference to the help browser with the given index. 2341 Public method to get a reference to the help browser with the given
2342 index.
2246 2343
2247 @param index index of the browser to get (integer) 2344 @param index index of the browser to get (integer)
2248 @return reference to the indexed help browser (HelpBrowser) 2345 @return reference to the indexed help browser (HelpBrowser)
2249 """ 2346 """
2250 return self.tabWidget.browserAt(index) 2347 return self.tabWidget.browserAt(index)
2276 def __showPreferences(self): 2373 def __showPreferences(self):
2277 """ 2374 """
2278 Private slot to set the preferences. 2375 Private slot to set the preferences.
2279 """ 2376 """
2280 from Preferences.ConfigurationDialog import ConfigurationDialog 2377 from Preferences.ConfigurationDialog import ConfigurationDialog
2281 dlg = ConfigurationDialog(self, 'Configuration', True, 2378 dlg = ConfigurationDialog(
2282 fromEric=self.fromEric, 2379 self, 'Configuration', True, fromEric=self.fromEric,
2283 displayMode=ConfigurationDialog.HelpBrowserMode) 2380 displayMode=ConfigurationDialog.HelpBrowserMode)
2284 dlg.preferencesChanged.connect(self.preferencesChanged) 2381 dlg.preferencesChanged.connect(self.preferencesChanged)
2285 dlg.masterPasswordChanged.connect(self.masterPasswordChanged) 2382 dlg.masterPasswordChanged.connect(self.masterPasswordChanged)
2286 dlg.show() 2383 dlg.show()
2287 if self.__lastConfigurationPageName: 2384 if self.__lastConfigurationPageName:
2288 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) 2385 dlg.showConfigurationPageByName(self.__lastConfigurationPageName)
2299 def preferencesChanged(self): 2396 def preferencesChanged(self):
2300 """ 2397 """
2301 Public slot to handle a change of preferences. 2398 Public slot to handle a change of preferences.
2302 """ 2399 """
2303 if not self.fromEric: 2400 if not self.fromEric:
2304 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) 2401 self.setStyle(Preferences.getUI("Style"),
2402 Preferences.getUI("StyleSheet"))
2305 2403
2306 self.__initWebSettings() 2404 self.__initWebSettings()
2307 2405
2308 self.networkAccessManager().preferencesChanged() 2406 self.networkAccessManager().preferencesChanged()
2309 2407
2348 2446
2349 def __showCookiesConfiguration(self): 2447 def __showCookiesConfiguration(self):
2350 """ 2448 """
2351 Private slot to configure the cookies handling. 2449 Private slot to configure the cookies handling.
2352 """ 2450 """
2353 from .CookieJar.CookiesConfigurationDialog import CookiesConfigurationDialog 2451 from .CookieJar.CookiesConfigurationDialog import \
2452 CookiesConfigurationDialog
2354 dlg = CookiesConfigurationDialog(self) 2453 dlg = CookiesConfigurationDialog(self)
2355 dlg.exec_() 2454 dlg.exec_()
2356 2455
2357 def __showOfflineStorageConfiguration(self): 2456 def __showOfflineStorageConfiguration(self):
2358 """ 2457 """
2359 Private slot to configure the offline storage. 2458 Private slot to configure the offline storage.
2360 """ 2459 """
2361 from .OfflineStorage.OfflineStorageConfigDialog import OfflineStorageConfigDialog 2460 from .OfflineStorage.OfflineStorageConfigDialog import \
2461 OfflineStorageConfigDialog
2362 dlg = OfflineStorageConfigDialog(self) 2462 dlg = OfflineStorageConfigDialog(self)
2363 if dlg.exec_() == QDialog.Accepted: 2463 if dlg.exec_() == QDialog.Accepted:
2364 dlg.storeData() 2464 dlg.storeData()
2365 self.__initWebSettings() 2465 self.__initWebSettings()
2366 2466
2588 self.__indexing = True 2688 self.__indexing = True
2589 if self.__indexingProgress is None: 2689 if self.__indexingProgress is None:
2590 self.__indexingProgress = QWidget() 2690 self.__indexingProgress = QWidget()
2591 layout = QHBoxLayout(self.__indexingProgress) 2691 layout = QHBoxLayout(self.__indexingProgress)
2592 layout.setContentsMargins(0, 0, 0, 0) 2692 layout.setContentsMargins(0, 0, 0, 0)
2593 sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum) 2693 sizePolicy = QSizePolicy(QSizePolicy.Preferred,
2694 QSizePolicy.Maximum)
2594 2695
2595 label = QLabel(self.trUtf8("Updating search index")) 2696 label = QLabel(self.trUtf8("Updating search index"))
2596 label.setSizePolicy(sizePolicy) 2697 label.setSizePolicy(sizePolicy)
2597 layout.addWidget(label) 2698 layout.addWidget(label)
2598 2699
2601 progressBar.setTextVisible(False) 2702 progressBar.setTextVisible(False)
2602 progressBar.setFixedHeight(16) 2703 progressBar.setFixedHeight(16)
2603 progressBar.setSizePolicy(sizePolicy) 2704 progressBar.setSizePolicy(sizePolicy)
2604 layout.addWidget(progressBar) 2705 layout.addWidget(progressBar)
2605 2706
2606 self.statusBar().insertPermanentWidget(0, self.__indexingProgress) 2707 self.statusBar().insertPermanentWidget(
2708 0, self.__indexingProgress)
2607 2709
2608 def __indexingFinished(self): 2710 def __indexingFinished(self):
2609 """ 2711 """
2610 Private slot to handle the start of the indexing process. 2712 Private slot to handle the start of the indexing process.
2611 """ 2713 """
2618 2720
2619 def __searchForWord(self): 2721 def __searchForWord(self):
2620 """ 2722 """
2621 Private slot to search for a word. 2723 Private slot to search for a word.
2622 """ 2724 """
2623 if self.useQtHelp and not self.__indexing and self.__searchWord is not None: 2725 if self.useQtHelp and not self.__indexing and \
2726 self.__searchWord is not None:
2624 self.__searchDock.show() 2727 self.__searchDock.show()
2625 self.__searchDock.raise_() 2728 self.__searchDock.raise_()
2626 query = QHelpSearchQuery(QHelpSearchQuery.DEFAULT, [self.__searchWord]) 2729 query = QHelpSearchQuery(QHelpSearchQuery.DEFAULT,
2730 [self.__searchWord])
2627 self.__searchEngine.search([query]) 2731 self.__searchEngine.search([query])
2628 self.__searchWord = None 2732 self.__searchWord = None
2629 2733
2630 def search(self, word): 2734 def search(self, word):
2631 """ 2735 """
2651 Private slot to look for new documentation to be loaded into the 2755 Private slot to look for new documentation to be loaded into the
2652 help database. 2756 help database.
2653 """ 2757 """
2654 if self.useQtHelp: 2758 if self.useQtHelp:
2655 from .HelpDocsInstaller import HelpDocsInstaller 2759 from .HelpDocsInstaller import HelpDocsInstaller
2656 self.__helpInstaller = HelpDocsInstaller(self.__helpEngine.collectionFile()) 2760 self.__helpInstaller = HelpDocsInstaller(
2657 self.__helpInstaller.errorMessage.connect(self.__showInstallationError) 2761 self.__helpEngine.collectionFile())
2762 self.__helpInstaller.errorMessage.connect(
2763 self.__showInstallationError)
2658 self.__helpInstaller.docsInstalled.connect(self.__docsInstalled) 2764 self.__helpInstaller.docsInstalled.connect(self.__docsInstalled)
2659 2765
2660 self.statusBar().showMessage(self.trUtf8("Looking for Documentation...")) 2766 self.statusBar().showMessage(
2767 self.trUtf8("Looking for Documentation..."))
2661 self.__helpInstaller.installDocs() 2768 self.__helpInstaller.installDocs()
2662 2769
2663 def __showInstallationError(self, message): 2770 def __showInstallationError(self, message):
2664 """ 2771 """
2665 Private slot to show installation errors. 2772 Private slot to show installation errors.
2672 2779
2673 def __docsInstalled(self, installed): 2780 def __docsInstalled(self, installed):
2674 """ 2781 """
2675 Private slot handling the end of documentation installation. 2782 Private slot handling the end of documentation installation.
2676 2783
2677 @param installed flag indicating that documents were installed (boolean) 2784 @param installed flag indicating that documents were installed
2785 (boolean)
2678 """ 2786 """
2679 if self.useQtHelp: 2787 if self.useQtHelp:
2680 if installed: 2788 if installed:
2681 self.__helpEngine.setupData() 2789 self.__helpEngine.setupData()
2682 self.statusBar().clearMessage() 2790 self.statusBar().clearMessage()
2713 2821
2714 def __aboutToShowSettingsMenu(self): 2822 def __aboutToShowSettingsMenu(self):
2715 """ 2823 """
2716 Private slot to show the Settings menu. 2824 Private slot to show the Settings menu.
2717 """ 2825 """
2718 self.editMessageFilterAct.setEnabled(E5ErrorMessage.messageHandlerInstalled()) 2826 self.editMessageFilterAct.setEnabled(
2827 E5ErrorMessage.messageHandlerInstalled())
2719 2828
2720 def __showBackMenu(self): 2829 def __showBackMenu(self):
2721 """ 2830 """
2722 Private slot showing the backwards navigation menu. 2831 Private slot showing the backwards navigation menu.
2723 """ 2832 """
2753 2862
2754 def __navigationMenuActionTriggered(self, act): 2863 def __navigationMenuActionTriggered(self, act):
2755 """ 2864 """
2756 Private slot to go to the selected page. 2865 Private slot to go to the selected page.
2757 2866
2758 @param act reference to the action selected in the navigation menu (QAction) 2867 @param act reference to the action selected in the navigation menu
2868 (QAction)
2759 """ 2869 """
2760 offset = act.data() 2870 offset = act.data()
2761 history = self.currentBrowser().history() 2871 history = self.currentBrowser().history()
2762 historyCount = history.count() 2872 historyCount = history.count()
2763 if offset < 0: 2873 if offset < 0:
2810 Preferences.Prefs.settings.value("Help/AcceptLanguages", 2920 Preferences.Prefs.settings.value("Help/AcceptLanguages",
2811 HelpLanguagesDialog.defaultAcceptLanguages())) 2921 HelpLanguagesDialog.defaultAcceptLanguages()))
2812 if languages: 2922 if languages:
2813 language = languages[0] 2923 language = languages[0]
2814 langCode = language.split("[")[1][:2] 2924 langCode = language.split("[")[1][:2]
2815 self.newTab("http://www.macromedia.com/support/documentation/" 2925 self.newTab(
2816 "{0}/flashplayer/help/settings_manager07.html".format( 2926 "http://www.macromedia.com/support/documentation/"
2817 langCode)) 2927 "{0}/flashplayer/help/settings_manager07.html".format(
2928 langCode))
2818 2929
2819 def __showEnginesConfigurationDialog(self): 2930 def __showEnginesConfigurationDialog(self):
2820 """ 2931 """
2821 Private slot to show the search engines configuration dialog. 2932 Private slot to show the search engines configuration dialog.
2822 """ 2933 """
2825 dlg = OpenSearchDialog(self) 2936 dlg = OpenSearchDialog(self)
2826 dlg.exec_() 2937 dlg.exec_()
2827 2938
2828 def searchEnginesAction(self): 2939 def searchEnginesAction(self):
2829 """ 2940 """
2830 Public method to get a reference to the search engines configuration action. 2941 Public method to get a reference to the search engines configuration
2942 action.
2831 2943
2832 @return reference to the search engines configuration action (QAction) 2944 @return reference to the search engines configuration action (QAction)
2833 """ 2945 """
2834 return self.searchEnginesAct 2946 return self.searchEnginesAct
2835 2947
2922 hostUrl.setScheme(url.scheme()) 3034 hostUrl.setScheme(url.scheme())
2923 hostUrl.setHost(url.host()) 3035 hostUrl.setHost(url.host())
2924 icon = HelpWindow.__getWebIcon(hostUrl) 3036 icon = HelpWindow.__getWebIcon(hostUrl)
2925 3037
2926 if icon.isNull(): 3038 if icon.isNull():
2927 pixmap = QWebSettings.webGraphic(QWebSettings.DefaultFrameIconGraphic) 3039 pixmap = QWebSettings.webGraphic(
3040 QWebSettings.DefaultFrameIconGraphic)
2928 if pixmap.isNull(): 3041 if pixmap.isNull():
2929 pixmap = UI.PixmapCache.getPixmap("defaultIcon.png") 3042 pixmap = UI.PixmapCache.getPixmap("defaultIcon.png")
2930 QWebSettings.setWebGraphic(QWebSettings.DefaultFrameIconGraphic, pixmap) 3043 QWebSettings.setWebGraphic(
3044 QWebSettings.DefaultFrameIconGraphic, pixmap)
2931 return QIcon(pixmap) 3045 return QIcon(pixmap)
2932 3046
2933 return icon 3047 return icon
2934 3048
2935 @staticmethod 3049 @staticmethod
3057 @classmethod 3171 @classmethod
3058 def personalInformationManager(cls): 3172 def personalInformationManager(cls):
3059 """ 3173 """
3060 Class method to get a reference to the personal information manager. 3174 Class method to get a reference to the personal information manager.
3061 3175
3062 @return reference to the personal information manager (PersonalInformationManager) 3176 @return reference to the personal information manager
3177 (PersonalInformationManager)
3063 """ 3178 """
3064 if cls._personalInformationManager is None: 3179 if cls._personalInformationManager is None:
3065 from .PersonalInformationManager.PersonalInformationManager import \ 3180 from .PersonalInformationManager.PersonalInformationManager \
3066 PersonalInformationManager 3181 import PersonalInformationManager
3067 cls._personalInformationManager = PersonalInformationManager() 3182 cls._personalInformationManager = PersonalInformationManager()
3068 3183
3069 return cls._personalInformationManager 3184 return cls._personalInformationManager
3070 3185
3071 @classmethod 3186 @classmethod
3119 codecs = [] 3234 codecs = []
3120 for codec in QTextCodec.availableCodecs(): 3235 for codec in QTextCodec.availableCodecs():
3121 codecs.append(str(codec, encoding="utf-8").lower()) 3236 codecs.append(str(codec, encoding="utf-8").lower())
3122 codecs.sort() 3237 codecs.sort()
3123 3238
3124 defaultTextEncoding = QWebSettings.globalSettings().defaultTextEncoding().lower() 3239 defaultTextEncoding = \
3240 QWebSettings.globalSettings().defaultTextEncoding().lower()
3125 if defaultTextEncoding in codecs: 3241 if defaultTextEncoding in codecs:
3126 currentCodec = defaultTextEncoding 3242 currentCodec = defaultTextEncoding
3127 else: 3243 else:
3128 currentCodec = "" 3244 currentCodec = ""
3129 3245
3153 act.setCheckable(True) 3269 act.setCheckable(True)
3154 if currentCodec == codec: 3270 if currentCodec == codec:
3155 act.setChecked(True) 3271 act.setChecked(True)
3156 isDefaultEncodingUsed = False 3272 isDefaultEncodingUsed = False
3157 3273
3158 act = self.__textEncodingMenu.addAction(self.trUtf8("Default Encoding")) 3274 act = self.__textEncodingMenu.addAction(
3275 self.trUtf8("Default Encoding"))
3159 act.setData("") 3276 act.setData("")
3160 act.setCheckable(True) 3277 act.setCheckable(True)
3161 act.setChecked(isDefaultEncodingUsed) 3278 act.setChecked(isDefaultEncodingUsed)
3162 self.__textEncodingMenu.addMenu(uniMenu) 3279 self.__textEncodingMenu.addMenu(uniMenu)
3163 self.__textEncodingMenu.addMenu(isoMenu) 3280 self.__textEncodingMenu.addMenu(isoMenu)
3388 requestData = VirusTotalAPI.getSearchRequestData(search) 3505 requestData = VirusTotalAPI.getSearchRequestData(search)
3389 self.newTab(requestData=requestData) 3506 self.newTab(requestData=requestData)
3390 3507
3391 def __virusTotalScanCurrentSite(self): 3508 def __virusTotalScanCurrentSite(self):
3392 """ 3509 """
3393 Private slot to ask VirusTotal for a scan of the URL of the current browser. 3510 Private slot to ask VirusTotal for a scan of the URL of the current
3511 browser.
3394 """ 3512 """
3395 cb = self.currentBrowser() 3513 cb = self.currentBrowser()
3396 if cb is not None: 3514 if cb is not None:
3397 url = cb.url() 3515 url = cb.url()
3398 if url.scheme() in ["http", "https", "ftp"]: 3516 if url.scheme() in ["http", "https", "ftp"]:
3460 userStyle += fileData 3578 userStyle += fileData
3461 except IOError: 3579 except IOError:
3462 pass 3580 pass
3463 3581
3464 encodedStyle = bytes(QByteArray(userStyle).toBase64()).decode() 3582 encodedStyle = bytes(QByteArray(userStyle).toBase64()).decode()
3465 dataString = "data:text/css;charset=utf-8;base64,{0}".format(encodedStyle) 3583 dataString = "data:text/css;charset=utf-8;base64,{0}".format(
3584 encodedStyle)
3466 3585
3467 return QUrl(dataString) 3586 return QUrl(dataString)
3468 3587
3469 ########################################## 3588 ##########################################
3470 ## Support for desktop notifications below 3589 ## Support for desktop notifications below
3478 @param icon icon to be shown in the notification (QPixmap) 3597 @param icon icon to be shown in the notification (QPixmap)
3479 @param heading heading of the notification (string) 3598 @param heading heading of the notification (string)
3480 @param text text of the notification (string) 3599 @param text text of the notification (string)
3481 """ 3600 """
3482 if cls._fromEric: 3601 if cls._fromEric:
3483 e5App().getObject("UserInterface").showNotification(icon, heading, text) 3602 e5App().getObject("UserInterface").showNotification(
3603 icon, heading, text)
3484 else: 3604 else:
3485 if Preferences.getUI("NotificationsEnabled"): 3605 if Preferences.getUI("NotificationsEnabled"):
3486 if cls._notification is None: 3606 if cls._notification is None:
3487 from UI.NotificationWidget import NotificationWidget 3607 from UI.NotificationWidget import NotificationWidget
3488 cls._notification = NotificationWidget() 3608 cls._notification = NotificationWidget()
3489 cls._notification.setPixmap(icon) 3609 cls._notification.setPixmap(icon)
3490 cls._notification.setHeading(heading) 3610 cls._notification.setHeading(heading)
3491 cls._notification.setText(text) 3611 cls._notification.setText(text)
3492 cls._notification.setTimeout(Preferences.getUI("NotificationTimeout")) 3612 cls._notification.setTimeout(
3493 cls._notification.move(Preferences.getUI("NotificationPosition")) 3613 Preferences.getUI("NotificationTimeout"))
3614 cls._notification.move(
3615 Preferences.getUI("NotificationPosition"))
3494 cls._notification.show() 3616 cls._notification.show()
3495 3617
3496 @classmethod 3618 @classmethod
3497 def notificationsEnabled(cls): 3619 def notificationsEnabled(cls):
3498 """ 3620 """

eric ide

mercurial