eric7/WebBrowser/OpenSearch/OpenSearchManager.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
14 pyqtSignal, QObject, QUrl, QFile, QDir, QIODevice, QUrlQuery 14 pyqtSignal, QObject, QUrl, QFile, QDir, QIODevice, QUrlQuery
15 ) 15 )
16 from PyQt6.QtWidgets import QLineEdit, QInputDialog 16 from PyQt6.QtWidgets import QLineEdit, QInputDialog
17 from PyQt6.QtNetwork import QNetworkRequest, QNetworkReply 17 from PyQt6.QtNetwork import QNetworkRequest, QNetworkReply
18 18
19 from E5Gui.E5Application import e5App 19 from E5Gui.EricApplication import ericApp
20 from E5Gui import E5MessageBox 20 from E5Gui import EricMessageBox
21 21
22 from Utilities.AutoSaver import AutoSaver 22 from Utilities.AutoSaver import AutoSaver
23 import Utilities 23 import Utilities
24 import Preferences 24 import Preferences
25 25
40 Constructor 40 Constructor
41 41
42 @param parent reference to the parent object (QObject) 42 @param parent reference to the parent object (QObject)
43 """ 43 """
44 if parent is None: 44 if parent is None:
45 parent = e5App() 45 parent = ericApp()
46 super().__init__(parent) 46 super().__init__(parent)
47 47
48 self.__replies = [] 48 self.__replies = []
49 self.__engines = {} 49 self.__engines = {}
50 self.__keywords = {} 50 self.__keywords = {}
242 method = res["method"] 242 method = res["method"]
243 actionUrl = QUrl(res["action"]) 243 actionUrl = QUrl(res["action"])
244 inputName = res["inputName"] 244 inputName = res["inputName"]
245 245
246 if method != "get": 246 if method != "get":
247 E5MessageBox.warning( 247 EricMessageBox.warning(
248 self, 248 self,
249 self.tr("Method not supported"), 249 self.tr("Method not supported"),
250 self.tr( 250 self.tr(
251 """{0} method is not supported.""").format(method.upper())) 251 """{0} method is not supported.""").format(method.upper()))
252 return 252 return
459 if engine is None or not engine.isValid(): 459 if engine is None or not engine.isValid():
460 return False 460 return False
461 461
462 host = QUrl(engine.searchUrlTemplate()).host() 462 host = QUrl(engine.searchUrlTemplate()).host()
463 463
464 res = E5MessageBox.yesNo( 464 res = EricMessageBox.yesNo(
465 None, 465 None,
466 "", 466 "",
467 self.tr( 467 self.tr(
468 """<p>Do you want to add the following engine to your""" 468 """<p>Do you want to add the following engine to your"""
469 """ list of search engines?<br/><br/>Name: {0}<br/>""" 469 """ list of search engines?<br/><br/>Name: {0}<br/>"""

eric ide

mercurial