UI/UserInterface.py

branch
maintenance
changeset 5680
b93cb6353cc0
parent 5655
884cd9c9ce05
parent 5654
d75dfc0d10f2
child 5730
6422afc7adc4
equal deleted inserted replaced
5655:884cd9c9ce05 5680:b93cb6353cc0
3263 """ 3263 """
3264 from QScintilla.MiniEditor import MiniEditor 3264 from QScintilla.MiniEditor import MiniEditor
3265 editor = MiniEditor(parent=self) 3265 editor = MiniEditor(parent=self)
3266 editor.show() 3266 editor.show()
3267 3267
3268 def addE5Actions(self, actions, type): 3268 def addE5Actions(self, actions, actionType):
3269 """ 3269 """
3270 Public method to add actions to the list of actions. 3270 Public method to add actions to the list of actions.
3271 3271
3272 @param actions list of actions to be added (list of E5Action) 3272 @param actions list of actions to be added (list of E5Action)
3273 @param type string denoting the action set to get. 3273 @param actionType string denoting the action set to add to.
3274 It must be one of "ui" or "wizards". 3274 It must be one of "ui" or "wizards".
3275 """ 3275 """
3276 if type == 'ui': 3276 if actionType == 'ui':
3277 self.actions.extend(actions) 3277 self.actions.extend(actions)
3278 elif type == 'wizards': 3278 elif actionType == 'wizards':
3279 self.wizardsActions.extend(actions) 3279 self.wizardsActions.extend(actions)
3280 3280
3281 def removeE5Actions(self, actions, type='ui'): 3281 def removeE5Actions(self, actions, actionType='ui'):
3282 """ 3282 """
3283 Public method to remove actions from the list of actions. 3283 Public method to remove actions from the list of actions.
3284 3284
3285 @param actions list of actions (list of E5Action) 3285 @param actions list of actions (list of E5Action)
3286 @param type string denoting the action set to get. 3286 @param actionType string denoting the action set to remove from.
3287 It must be one of "ui" or "wizards". 3287 It must be one of "ui" or "wizards".
3288 """ 3288 """
3289 for act in actions: 3289 for act in actions:
3290 try: 3290 try:
3291 if type == 'ui': 3291 if actionType == 'ui':
3292 self.actions.remove(act) 3292 self.actions.remove(act)
3293 elif type == 'wizards': 3293 elif actionType == 'wizards':
3294 self.wizardsActions.remove(act) 3294 self.wizardsActions.remove(act)
3295 except ValueError: 3295 except ValueError:
3296 pass 3296 pass
3297 3297
3298 def getActions(self, type): 3298 def getActions(self, actionType):
3299 """ 3299 """
3300 Public method to get a list of all actions. 3300 Public method to get a list of all actions.
3301 3301
3302 @param type string denoting the action set to get. 3302 @param actionType string denoting the action set to get.
3303 It must be one of "ui" or "wizards". 3303 It must be one of "ui" or "wizards".
3304 @return list of all actions (list of E5Action) 3304 @return list of all actions (list of E5Action)
3305 """ 3305 """
3306 if type == 'ui': 3306 if actionType == 'ui':
3307 return self.actions[:] 3307 return self.actions[:]
3308 elif type == 'wizards': 3308 elif actionType == 'wizards':
3309 return self.wizardsActions[:] 3309 return self.wizardsActions[:]
3310 else: 3310 else:
3311 return [] 3311 return []
3312 3312
3313 def getMenuAction(self, menuName, actionName): 3313 def getMenuAction(self, menuName, actionName):
5347 elif WEBKIT_AVAILABLE: 5347 elif WEBKIT_AVAILABLE:
5348 single = single or Preferences.getHelp("SingleHelpWindow") 5348 single = single or Preferences.getHelp("SingleHelpWindow")
5349 if not single or self.helpWindow is None: 5349 if not single or self.helpWindow is None:
5350 if WEBENGINE_AVAILABLE: 5350 if WEBENGINE_AVAILABLE:
5351 from WebBrowser.WebBrowserWindow import WebBrowserWindow 5351 from WebBrowser.WebBrowserWindow import WebBrowserWindow
5352 help = WebBrowserWindow(home, '.', None, 'web_browser', 5352 browser = WebBrowserWindow(home, '.', None, 'web_browser',
5353 True, searchWord=searchWord) 5353 True, searchWord=searchWord)
5354 elif WEBKIT_AVAILABLE: 5354 elif WEBKIT_AVAILABLE:
5355 from Helpviewer.HelpWindow import HelpWindow 5355 from Helpviewer.HelpWindow import HelpWindow
5356 help = HelpWindow(home, '.', None, 'help viewer', True, 5356 browser = HelpWindow(home, '.', None, 'help viewer', True,
5357 searchWord=searchWord) 5357 searchWord=searchWord)
5358 5358
5359 if QApplication.desktop().width() > 400 and \ 5359 if QApplication.desktop().width() > 400 and \
5360 QApplication.desktop().height() > 500: 5360 QApplication.desktop().height() > 500:
5361 help.show() 5361 browser.show()
5362 else: 5362 else:
5363 help.showMaximized() 5363 browser.showMaximized()
5364 5364
5365 if single: 5365 if single:
5366 self.helpWindow = help 5366 self.helpWindow = browser
5367 try: 5367 try:
5368 self.helpWindow.webBrowserWindowClosed.connect( 5368 self.helpWindow.webBrowserWindowClosed.connect(
5369 self.__helpClosed) 5369 self.__helpClosed)
5370 except AttributeError: 5370 except AttributeError:
5371 self.helpWindow.helpClosed.connect(self.__helpClosed) 5371 self.helpWindow.helpClosed.connect(self.__helpClosed)
6103 from PluginManager.PluginInfoDialog import PluginInfoDialog 6103 from PluginManager.PluginInfoDialog import PluginInfoDialog
6104 self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self) 6104 self.__pluginInfoDialog = PluginInfoDialog(self.pluginManager, self)
6105 self.__pluginInfoDialog.show() 6105 self.__pluginInfoDialog.show()
6106 6106
6107 @pyqtSlot() 6107 @pyqtSlot()
6108 def __installPlugins(self, pluginFileNames=[]): 6108 def __installPlugins(self, pluginFileNames=None):
6109 """ 6109 """
6110 Private slot to show a dialog to install a new plugin. 6110 Private slot to show a dialog to install a new plugin.
6111 6111
6112 @param pluginFileNames list of plugin files suggested for 6112 @param pluginFileNames list of plugin files suggested for
6113 installation list of strings 6113 installation list of strings
6114 """ 6114 """
6115 from PluginManager.PluginInstallDialog import PluginInstallDialog 6115 from PluginManager.PluginInstallDialog import PluginInstallDialog
6116 dlg = PluginInstallDialog(self.pluginManager, pluginFileNames, self) 6116 dlg = PluginInstallDialog(
6117 self.pluginManager,
6118 [] if pluginFileNames is None else pluginFileNames[:],
6119 self)
6117 dlg.exec_() 6120 dlg.exec_()
6118 if dlg.restartNeeded(): 6121 if dlg.restartNeeded():
6119 self.__restart() 6122 self.__restart()
6120 6123
6121 def __deinstallPlugin(self): 6124 def __deinstallPlugin(self):

eric ide

mercurial