UI/UserInterface.py

changeset 5604
b047181a4a33
parent 5587
ea526b78ee6c
child 5624
cdd346d8858b
equal deleted inserted replaced
5603:4f2dd0850803 5604:b047181a4a33
3264 """ 3264 """
3265 from QScintilla.MiniEditor import MiniEditor 3265 from QScintilla.MiniEditor import MiniEditor
3266 editor = MiniEditor(parent=self) 3266 editor = MiniEditor(parent=self)
3267 editor.show() 3267 editor.show()
3268 3268
3269 def addE5Actions(self, actions, type): 3269 def addE5Actions(self, actions, actionType):
3270 """ 3270 """
3271 Public method to add actions to the list of actions. 3271 Public method to add actions to the list of actions.
3272 3272
3273 @param actions list of actions to be added (list of E5Action) 3273 @param actions list of actions to be added (list of E5Action)
3274 @param type string denoting the action set to get. 3274 @param actionType string denoting the action set to add to.
3275 It must be one of "ui" or "wizards". 3275 It must be one of "ui" or "wizards".
3276 """ 3276 """
3277 if type == 'ui': 3277 if actionType == 'ui':
3278 self.actions.extend(actions) 3278 self.actions.extend(actions)
3279 elif type == 'wizards': 3279 elif actionType == 'wizards':
3280 self.wizardsActions.extend(actions) 3280 self.wizardsActions.extend(actions)
3281 3281
3282 def removeE5Actions(self, actions, type='ui'): 3282 def removeE5Actions(self, actions, actionType='ui'):
3283 """ 3283 """
3284 Public method to remove actions from the list of actions. 3284 Public method to remove actions from the list of actions.
3285 3285
3286 @param actions list of actions (list of E5Action) 3286 @param actions list of actions (list of E5Action)
3287 @param type string denoting the action set to get. 3287 @param actionType string denoting the action set to remove from.
3288 It must be one of "ui" or "wizards". 3288 It must be one of "ui" or "wizards".
3289 """ 3289 """
3290 for act in actions: 3290 for act in actions:
3291 try: 3291 try:
3292 if type == 'ui': 3292 if actionType == 'ui':
3293 self.actions.remove(act) 3293 self.actions.remove(act)
3294 elif type == 'wizards': 3294 elif actionType == 'wizards':
3295 self.wizardsActions.remove(act) 3295 self.wizardsActions.remove(act)
3296 except ValueError: 3296 except ValueError:
3297 pass 3297 pass
3298 3298
3299 def getActions(self, type): 3299 def getActions(self, actionType):
3300 """ 3300 """
3301 Public method to get a list of all actions. 3301 Public method to get a list of all actions.
3302 3302
3303 @param type string denoting the action set to get. 3303 @param actionType string denoting the action set to get.
3304 It must be one of "ui" or "wizards". 3304 It must be one of "ui" or "wizards".
3305 @return list of all actions (list of E5Action) 3305 @return list of all actions (list of E5Action)
3306 """ 3306 """
3307 if type == 'ui': 3307 if actionType == 'ui':
3308 return self.actions[:] 3308 return self.actions[:]
3309 elif type == 'wizards': 3309 elif actionType == 'wizards':
3310 return self.wizardsActions[:] 3310 return self.wizardsActions[:]
3311 else: 3311 else:
3312 return [] 3312 return []
3313 3313
3314 def getMenuAction(self, menuName, actionName): 3314 def getMenuAction(self, menuName, actionName):
5348 elif WEBKIT_AVAILABLE: 5348 elif WEBKIT_AVAILABLE:
5349 single = single or Preferences.getHelp("SingleHelpWindow") 5349 single = single or Preferences.getHelp("SingleHelpWindow")
5350 if not single or self.helpWindow is None: 5350 if not single or self.helpWindow is None:
5351 if WEBENGINE_AVAILABLE: 5351 if WEBENGINE_AVAILABLE:
5352 from WebBrowser.WebBrowserWindow import WebBrowserWindow 5352 from WebBrowser.WebBrowserWindow import WebBrowserWindow
5353 help = WebBrowserWindow(home, '.', None, 'web_browser', 5353 browser = WebBrowserWindow(home, '.', None, 'web_browser',
5354 True, searchWord=searchWord) 5354 True, searchWord=searchWord)
5355 elif WEBKIT_AVAILABLE: 5355 elif WEBKIT_AVAILABLE:
5356 from Helpviewer.HelpWindow import HelpWindow 5356 from Helpviewer.HelpWindow import HelpWindow
5357 help = HelpWindow(home, '.', None, 'help viewer', True, 5357 browser = HelpWindow(home, '.', None, 'help viewer', True,
5358 searchWord=searchWord) 5358 searchWord=searchWord)
5359 5359
5360 if QApplication.desktop().width() > 400 and \ 5360 if QApplication.desktop().width() > 400 and \
5361 QApplication.desktop().height() > 500: 5361 QApplication.desktop().height() > 500:
5362 help.show() 5362 browser.show()
5363 else: 5363 else:
5364 help.showMaximized() 5364 browser.showMaximized()
5365 5365
5366 if single: 5366 if single:
5367 self.helpWindow = help 5367 self.helpWindow = browser
5368 try: 5368 try:
5369 self.helpWindow.webBrowserWindowClosed.connect( 5369 self.helpWindow.webBrowserWindowClosed.connect(
5370 self.__helpClosed) 5370 self.__helpClosed)
5371 except AttributeError: 5371 except AttributeError:
5372 self.helpWindow.helpClosed.connect(self.__helpClosed) 5372 self.helpWindow.helpClosed.connect(self.__helpClosed)

eric ide

mercurial