eric7/WebBrowser/OpenSearch/OpenSearchDialog.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
8 """ 8 """
9 9
10 from PyQt6.QtWidgets import QDialog 10 from PyQt6.QtWidgets import QDialog
11 from PyQt6.QtCore import pyqtSlot 11 from PyQt6.QtCore import pyqtSlot
12 12
13 from E5Gui import E5MessageBox, E5FileDialog 13 from E5Gui import EricMessageBox, EricFileDialog
14 14
15 from .OpenSearchEngineModel import OpenSearchEngineModel 15 from .OpenSearchEngineModel import OpenSearchEngineModel
16 16
17 from .Ui_OpenSearchDialog import Ui_OpenSearchDialog 17 from .Ui_OpenSearchDialog import Ui_OpenSearchDialog
18 18
50 @pyqtSlot() 50 @pyqtSlot()
51 def on_addButton_clicked(self): 51 def on_addButton_clicked(self):
52 """ 52 """
53 Private slot to add a new search engine. 53 Private slot to add a new search engine.
54 """ 54 """
55 fileNames = E5FileDialog.getOpenFileNames( 55 fileNames = EricFileDialog.getOpenFileNames(
56 self, 56 self,
57 self.tr("Add search engine"), 57 self.tr("Add search engine"),
58 "", 58 "",
59 self.tr("OpenSearch (*.xml);;All Files (*)")) 59 self.tr("OpenSearch (*.xml);;All Files (*)"))
60 60
61 osm = self.__mw.openSearchManager() 61 osm = self.__mw.openSearchManager()
62 for fileName in fileNames: 62 for fileName in fileNames:
63 if not osm.addEngine(fileName): 63 if not osm.addEngine(fileName):
64 E5MessageBox.critical( 64 EricMessageBox.critical(
65 self, 65 self,
66 self.tr("Add search engine"), 66 self.tr("Add search engine"),
67 self.tr( 67 self.tr(
68 """{0} is not a valid OpenSearch 1.1 description or""" 68 """{0} is not a valid OpenSearch 1.1 description or"""
69 """ is already on your list.""").format(fileName)) 69 """ is already on your list.""").format(fileName))
72 def on_deleteButton_clicked(self): 72 def on_deleteButton_clicked(self):
73 """ 73 """
74 Private slot to delete the selected search engines. 74 Private slot to delete the selected search engines.
75 """ 75 """
76 if self.enginesTable.model().rowCount() == 1: 76 if self.enginesTable.model().rowCount() == 1:
77 E5MessageBox.critical( 77 EricMessageBox.critical(
78 self, 78 self,
79 self.tr("Delete selected engines"), 79 self.tr("Delete selected engines"),
80 self.tr("""You must have at least one search engine.""")) 80 self.tr("""You must have at least one search engine."""))
81 81
82 self.enginesTable.removeSelected() 82 self.enginesTable.removeSelected()

eric ide

mercurial