5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog for the configuration of search engines. |
7 Module implementing a dialog for the configuration of search engines. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtGui import QDialog, QFileDialog |
10 from PyQt4.QtGui import QDialog |
11 from PyQt4.QtCore import pyqtSlot |
11 from PyQt4.QtCore import pyqtSlot |
12 |
12 |
13 from E5Gui import E5MessageBox |
13 from E5Gui import E5MessageBox, E5FileDialog |
14 |
14 |
15 from .OpenSearchEngineModel import OpenSearchEngineModel |
15 from .OpenSearchEngineModel import OpenSearchEngineModel |
16 from .OpenSearchEditDialog import OpenSearchEditDialog |
16 from .OpenSearchEditDialog import OpenSearchEditDialog |
17 |
17 |
18 from .Ui_OpenSearchDialog import Ui_OpenSearchDialog |
18 from .Ui_OpenSearchDialog import Ui_OpenSearchDialog |
48 @pyqtSlot() |
48 @pyqtSlot() |
49 def on_addButton_clicked(self): |
49 def on_addButton_clicked(self): |
50 """ |
50 """ |
51 Private slot to add a new search engine. |
51 Private slot to add a new search engine. |
52 """ |
52 """ |
53 fileNames = QFileDialog.getOpenFileNames( |
53 fileNames = E5FileDialog.getOpenFileNames( |
54 self, |
54 self, |
55 self.trUtf8("Add search engine"), |
55 self.trUtf8("Add search engine"), |
56 "", |
56 "", |
57 self.trUtf8("OpenSearch (*.xml);;All Files (*)"), |
57 self.trUtf8("OpenSearch (*.xml);;All Files (*)")) |
58 QFileDialog.DontUseNativeDialog) |
|
59 |
58 |
60 osm = self.__mw.openSearchManager() |
59 osm = self.__mw.openSearchManager() |
61 for fileName in fileNames: |
60 for fileName in fileNames: |
62 if not osm.addEngine(fileName): |
61 if not osm.addEngine(fileName): |
63 E5MessageBox.critical(self, |
62 E5MessageBox.critical(self, |