21 ## Below is the factory function to instantiate the appropriate |
21 ## Below is the factory function to instantiate the appropriate |
22 ## viewmanager depending on the configuration settings |
22 ## viewmanager depending on the configuration settings |
23 ###################################################################### |
23 ###################################################################### |
24 |
24 |
25 |
25 |
26 def factory(ui, dbs, pluginManager): |
26 def factory(ui, dbs, remoteServerInterface, pluginManager): |
27 """ |
27 """ |
28 Modul factory function to generate the right viewmanager type. |
28 Modul factory function to generate the right viewmanager type. |
29 |
29 |
30 The viewmanager is instantiated depending on the data set in |
30 The viewmanager is instantiated depending on the data set in |
31 the current preferences. |
31 the current preferences. |
32 |
32 |
33 @param ui reference to the main UI object |
33 @param ui reference to the main UI object |
34 @type UserInterface |
34 @type UserInterface |
35 @param dbs reference to the debug server object |
35 @param dbs reference to the debug server object |
36 @type DebugServer |
36 @type DebugServer |
|
37 @param remoteServerInterface reference to the 'eric-ide' server interface |
|
38 @type EricServerInterface |
37 @param pluginManager reference to the plugin manager object |
39 @param pluginManager reference to the plugin manager object |
38 @type PluginManager |
40 @type PluginManager |
39 @return the instantiated viewmanager |
41 @return the instantiated viewmanager |
40 @rtype ViewManager |
42 @rtype ViewManager |
41 @exception RuntimeError raised if no view manager could be created |
43 @exception RuntimeError raised if no view manager could be created |
46 # load tabview view manager as default |
48 # load tabview view manager as default |
47 vm, err = pluginManager.getPluginObject("viewmanager", "tabview") |
49 vm, err = pluginManager.getPluginObject("viewmanager", "tabview") |
48 if vm is None: |
50 if vm is None: |
49 raise RuntimeError(f"Could not create a viemanager object.\nError: {err}") |
51 raise RuntimeError(f"Could not create a viemanager object.\nError: {err}") |
50 Preferences.setViewManager("tabview") |
52 Preferences.setViewManager("tabview") |
51 vm.setReferences(ui, dbs) |
53 vm.setReferences(ui, dbs, remoteServerInterface) |
52 return vm |
54 return vm |