95 "Language": "System", |
95 "Language": "System", |
96 "Style": "System", |
96 "Style": "System", |
97 "StyleSheet": "", |
97 "StyleSheet": "", |
98 "ViewManager": "tabview", |
98 "ViewManager": "tabview", |
99 "LayoutType": "Sidebars", |
99 "LayoutType": "Sidebars", |
100 # allowed values are "DockWindows", "FloatingWindows", "Toolboxes" and "Sidebars" |
100 # allowed values are "Toolboxes" and "Sidebars" |
101 "LayoutShellEmbedded": 0, # 0 = separate |
101 "LayoutShellEmbedded": 0, # 0 = separate |
102 # 1 = embedded in debug browser |
102 # 1 = embedded in debug browser |
103 "LayoutFileBrowserEmbedded": 1, # 0 = separate |
103 "LayoutFileBrowserEmbedded": 1, # 0 = separate |
104 # 1 = embedded in debug browser |
104 # 1 = embedded in debug browser |
105 # 2 = embedded in project browser |
105 # 2 = embedded in project browser |
106 "BrowsersListFoldersFirst": True, |
106 "BrowsersListFoldersFirst": True, |
107 "BrowsersHideNonPublic": False, |
107 "BrowsersHideNonPublic": False, |
108 "BrowsersListContentsByOccurrence": False, |
108 "BrowsersListContentsByOccurrence": False, |
126 "ViewProfiles": { |
126 "ViewProfiles": { |
127 "edit": [ |
127 "edit": [ |
128 # visibility (0) |
128 # visibility (0) |
129 [True, False, False, True, True, True, True, True, |
129 [True, False, False, True, True, True, True, True, |
130 True, True, True, True], |
130 True, True, True, True], |
131 # saved state main window with dock windows (1) |
131 # saved state main window with dock windows (1) OBSOLETE |
132 b"", |
132 b"", |
133 # saved states floating windows (2) |
133 # saved states floating windows (2) OBSOLETE |
134 [b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b""], |
134 [b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b""], |
135 # saved state main window with floating windows (3) |
135 # saved state main window with floating windows (3) OBSOLETE |
136 b"", |
136 b"", |
137 # saved state main window with toolbox windows (4) |
137 # saved state main window with toolbox windows (4) |
138 b"", |
138 b"", |
139 # visibility of the toolboxes/sidebars (5) |
139 # visibility of the toolboxes/sidebars (5) |
140 [True, True], |
140 [True, True], |
144 ], |
144 ], |
145 "debug": [ |
145 "debug": [ |
146 # visibility (0) |
146 # visibility (0) |
147 [False, False, True, True, True, True, False, False, |
147 [False, False, True, True, True, True, False, False, |
148 True, False, False, False], |
148 True, False, False, False], |
149 # saved state main window with dock windows (1) |
149 # saved state main window with dock windows (1) OBSOLETE |
150 b"", |
150 b"", |
151 # saved states floating windows (2) |
151 # saved states floating windows (2) OBSOLETE |
152 [b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b""], |
152 [b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b"", b""], |
153 # saved state main window with floating windows (3) |
153 # saved state main window with floating windows (3) OBSOLETE |
154 b"", |
154 b"", |
155 # saved state main window with toolbox windows (4) |
155 # saved state main window with toolbox windows (4) |
156 b"", |
156 b"", |
157 # visibility of the toolboxes/sidebars (5) |
157 # visibility of the toolboxes/sidebars (5) |
158 [False, True], |
158 [False, True], |
203 "RequestDownloadFilename": True, |
203 "RequestDownloadFilename": True, |
204 "CheckErrorLog": True, |
204 "CheckErrorLog": True, |
205 |
205 |
206 "LogStdErrColour": QColor(Qt.red), |
206 "LogStdErrColour": QColor(Qt.red), |
207 } |
207 } |
208 viewProfilesLength = len(uiDefaults["ViewProfiles"]["edit"][2]) |
208 viewProfilesLength = len(uiDefaults["ViewProfiles"]["edit"][0]) |
209 |
209 |
210 iconsDefaults = { |
210 iconsDefaults = { |
211 "Path": [], |
211 "Path": [], |
212 } |
212 } |
213 |
213 |
1211 |
1211 |
1212 @param prefClass preferences class used as the storage area |
1212 @param prefClass preferences class used as the storage area |
1213 @return the UI layout as a tuple of main layout, flag for |
1213 @return the UI layout as a tuple of main layout, flag for |
1214 an embedded shell and a value for an embedded file browser |
1214 an embedded shell and a value for an embedded file browser |
1215 """ |
1215 """ |
1216 layout = ( |
1216 layoutType = prefClass.settings.value("UI/LayoutType", |
1217 prefClass.settings.value("UI/LayoutType", |
1217 prefClass.uiDefaults["LayoutType"]) |
1218 prefClass.uiDefaults["LayoutType"]), |
1218 if layoutType in ["DockWindows", "FloatingWindows"]: |
|
1219 # change old fashioned layouts to the modern default |
|
1220 layoutType = prefClass.uiDefaults["LayoutType"] |
|
1221 layout = (layoutType, |
1219 int(prefClass.settings.value("UI/LayoutShellEmbedded", |
1222 int(prefClass.settings.value("UI/LayoutShellEmbedded", |
1220 prefClass.uiDefaults["LayoutShellEmbedded"])), |
1223 prefClass.uiDefaults["LayoutShellEmbedded"])), |
1221 int(prefClass.settings.value("UI/LayoutFileBrowserEmbedded", |
1224 int(prefClass.settings.value("UI/LayoutFileBrowserEmbedded", |
1222 prefClass.uiDefaults["LayoutFileBrowserEmbedded"])), |
1225 prefClass.uiDefaults["LayoutFileBrowserEmbedded"])), |
1223 ) |
1226 ) |
1298 else: |
1301 else: |
1299 return prefClass.uiDefaults[key] |
1302 return prefClass.uiDefaults[key] |
1300 elif key == "ViewProfiles": |
1303 elif key == "ViewProfiles": |
1301 profiles = prefClass.settings.value("UI/ViewProfiles") |
1304 profiles = prefClass.settings.value("UI/ViewProfiles") |
1302 if profiles is not None: |
1305 if profiles is not None: |
1303 if isinstance(profiles, str): |
1306 viewProfiles = profiles |
1304 # just in case of an old structure |
|
1305 viewProfiles = eval(profiles) |
|
1306 else: |
|
1307 viewProfiles = profiles |
|
1308 for name in ["edit", "debug"]: |
1307 for name in ["edit", "debug"]: |
1309 # adjust entries for individual windows |
1308 # adjust entries for individual windows |
1310 vpLength = len(viewProfiles[name][0]) |
1309 vpLength = len(viewProfiles[name][0]) |
1311 if vpLength < prefClass.viewProfilesLength: |
1310 if vpLength < prefClass.viewProfilesLength: |
1312 viewProfiles[name][0].extend( |
1311 viewProfiles[name][0].extend( |
1313 prefClass.uiDefaults["ViewProfiles"][name][0][vpLength:]) |
1312 prefClass.uiDefaults["ViewProfiles"][name][0][vpLength:]) |
1314 |
|
1315 vpLength = len(viewProfiles[name][2]) |
|
1316 if vpLength < prefClass.viewProfilesLength: |
|
1317 viewProfiles[name][2].extend( |
|
1318 prefClass.uiDefaults["ViewProfiles"][name][2][vpLength:]) |
|
1319 |
1313 |
1320 # adjust profile |
1314 # adjust profile |
1321 vpLength = len(viewProfiles[name]) |
1315 vpLength = len(viewProfiles[name]) |
1322 if vpLength < len(prefClass.uiDefaults["ViewProfiles"][name]): |
1316 if vpLength < len(prefClass.uiDefaults["ViewProfiles"][name]): |
1323 viewProfiles[name].extend( |
1317 viewProfiles[name].extend( |