pyqt5 fixes
This commit is contained in:
		
							parent
							
								
									12a395616c
								
							
						
					
					
						commit
						07b0401a43
					
				
					 7 changed files with 26 additions and 22 deletions
				
			
		|  | @ -1,5 +1,5 @@ | |||
| import plugin_super_class | ||||
| from PySide import QtGui, QtCore | ||||
| from PyQt5 import QtGui, QtCore, QtWidgets | ||||
| 
 | ||||
| 
 | ||||
| class SearchPlugin(plugin_super_class.PluginSuperClass): | ||||
|  | @ -8,23 +8,23 @@ class SearchPlugin(plugin_super_class.PluginSuperClass): | |||
|         super(SearchPlugin, self).__init__('SearchPlugin', 'srch', *args) | ||||
| 
 | ||||
|     def get_message_menu(self, menu, text): | ||||
|         google = QtGui.QAction( | ||||
|             QtGui.QApplication.translate("srch", "Find in Google", None, QtGui.QApplication.UnicodeUTF8), | ||||
|         google = QtWidgets.QAction( | ||||
|             QtWidgets.QApplication.translate("srch", "Find in Google"), | ||||
|             menu) | ||||
|         google.triggered.connect(lambda: self.google(text)) | ||||
| 
 | ||||
|         duck = QtGui.QAction( | ||||
|             QtGui.QApplication.translate("srch", "Find in DuckDuckGo", None, QtGui.QApplication.UnicodeUTF8), | ||||
|         duck = QtWidgets.QAction( | ||||
|             QtWidgets.QApplication.translate("srch", "Find in DuckDuckGo"), | ||||
|             menu) | ||||
|         duck.triggered.connect(lambda: self.duck(text)) | ||||
| 
 | ||||
|         yandex = QtGui.QAction( | ||||
|             QtGui.QApplication.translate("srch", "Find in Yandex", None, QtGui.QApplication.UnicodeUTF8), | ||||
|         yandex = QtWidgets.QAction( | ||||
|             QtWidgets.QApplication.translate("srch", "Find in Yandex"), | ||||
|             menu) | ||||
|         yandex.triggered.connect(lambda: self.yandex(text)) | ||||
| 
 | ||||
|         bing = QtGui.QAction( | ||||
|             QtGui.QApplication.translate("srch", "Find in Bing", None, QtGui.QApplication.UnicodeUTF8), | ||||
|         bing = QtWidgets.QAction( | ||||
|             QtWidgets.QApplication.translate("srch", "Find in Bing"), | ||||
|             menu) | ||||
|         bing.triggered.connect(lambda: self.bing(text)) | ||||
| 
 | ||||
|  | @ -32,16 +32,20 @@ class SearchPlugin(plugin_super_class.PluginSuperClass): | |||
| 
 | ||||
|     def google(self, text): | ||||
|         url = QtCore.QUrl('https://www.google.com/search?q=' + text) | ||||
|         QtGui.QDesktopServices.openUrl(url) | ||||
|         self.open_url(url) | ||||
| 
 | ||||
|     def duck(self, text): | ||||
|         url = QtCore.QUrl('https://duckduckgo.com/?q=' + text) | ||||
|         QtGui.QDesktopServices.openUrl(url) | ||||
|         self.open_url(url) | ||||
| 
 | ||||
|     def yandex(self, text): | ||||
|         url = QtCore.QUrl('https://yandex.com/search/?text=' + text) | ||||
|         QtGui.QDesktopServices.openUrl(url) | ||||
|         self.open_url(url) | ||||
| 
 | ||||
|     def bing(self, text): | ||||
|         url = QtCore.QUrl('https://www.bing.com/search?q=' + text) | ||||
|         self.open_url(url) | ||||
| 
 | ||||
|     def open_url(self, url): | ||||
|         QtGui.QDesktopServices.openUrl(url) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 ingvar1995
						ingvar1995