src/eric7/Preferences/ConfigurationDialog.py

branch
eric7
changeset 10518
1682f3203ae5
parent 10439
21c28b0f9e41
child 10531
3308e8349e4c
child 10683
779cda568acb
equal deleted inserted replaced
10517:aecd5a8c958c 10518:1682f3203ae5
88 WEBBROWSERMODE = 3 88 WEBBROWSERMODE = 3
89 EDITORMODE = 4 89 EDITORMODE = 4
90 PDFVIEWERMODE = 5 90 PDFVIEWERMODE = 5
91 PIPMANAGERMODE = 6 91 PIPMANAGERMODE = 6
92 SHELLMODE = 7 92 SHELLMODE = 7
93 MICROPYTHONMODE = 8
93 94
94 95
95 class ConfigurationWidget(QWidget): 96 class ConfigurationWidget(QWidget):
96 """ 97 """
97 Class implementing a dialog for the configuration of eric. 98 Class implementing a dialog for the configuration of eric.
525 "jedi", 526 "jedi",
526 "EditorMouseClickHandlerJediPage", 527 "EditorMouseClickHandlerJediPage",
527 "1editorMouseClickHandlers", 528 "1editorMouseClickHandlers",
528 None, 529 None,
529 ], 530 ],
530 "0helpPage": [self.tr("Help"), "preferences-help", None, None, None], 531 "0helpPage": [
532 self.tr("Help"),
533 "preferences-help",
534 None,
535 None,
536 None,
537 ],
531 "helpDocumentationPage": [ 538 "helpDocumentationPage": [
532 self.tr("Help Documentation"), 539 self.tr("Help Documentation"),
533 "preferences-helpdocumentation", 540 "preferences-helpdocumentation",
534 "HelpDocumentationPage", 541 "HelpDocumentationPage",
535 "0helpPage", 542 "0helpPage",
931 "preferences-interface", 938 "preferences-interface",
932 "InterfaceLightPage", 939 "InterfaceLightPage",
933 None, 940 None,
934 None, 941 None,
935 ], 942 ],
943 "networkProxyPage": [
944 self.tr("Network Proxy"),
945 "preferences-network",
946 "NetworkProxyPage",
947 None,
948 None,
949 ],
936 "pipPage": [ 950 "pipPage": [
937 self.tr("Python Package Management"), 951 self.tr("Python Package Management"),
938 "pypi", 952 "pypi",
939 "PipPage", 953 "PipPage",
940 None, 954 None,
1044 "editorPropertiesPage": [ 1058 "editorPropertiesPage": [
1045 self.tr("Properties"), 1059 self.tr("Properties"),
1046 "preferences-properties", 1060 "preferences-properties",
1047 "EditorPropertiesPage", 1061 "EditorPropertiesPage",
1048 "1editorLexerPage", 1062 "1editorLexerPage",
1063 None,
1064 ],
1065 }
1066
1067 elif displayMode == ConfigurationMode.MICROPYTHONMODE:
1068 self.configItems = {
1069 # key : [display string, pixmap name, dialog module name or
1070 # page creation function, parent key,
1071 # reference to configuration page (must always be last)]
1072 # The dialog module must have the module function 'create' to
1073 # create the configuration page. This must have the method
1074 # 'save' to save the settings.
1075 "iconsPage": [
1076 self.tr("Icons"),
1077 "preferences-icons",
1078 "IconsPage",
1079 None,
1080 None,
1081 ],
1082 "interfacePage": [
1083 self.tr("Interface"),
1084 "preferences-interface",
1085 self.__createInterfaceLightPageWithSidebars,
1086 None,
1087 None,
1088 ],
1089 "microPythonPage": [
1090 self.tr("MicroPython"),
1091 "micropython",
1092 "MicroPythonPage",
1093 None,
1094 None,
1095 ],
1096 "networkProxyPage": [
1097 self.tr("Network Proxy"),
1098 "preferences-network",
1099 "NetworkProxyPage",
1100 None,
1049 None, 1101 None,
1050 ], 1102 ],
1051 } 1103 }
1052 1104
1053 else: 1105 else:
1350 @type list 1402 @type list
1351 @return reference to the initialized page 1403 @return reference to the initialized page
1352 @rtype ConfigurationPageBase 1404 @rtype ConfigurationPageBase
1353 """ 1405 """
1354 page = None 1406 page = None
1355 if isinstance(pageData[2], types.FunctionType): 1407 if isinstance(
1408 pageData[2],
1409 (types.FunctionType, types.LambdaType, types.MethodType),
1410 ):
1356 page = pageData[2](self) 1411 page = pageData[2](self)
1357 else: 1412 else:
1358 mod = self.__importConfigurationPage(pageData[2]) 1413 mod = self.__importConfigurationPage(pageData[2])
1359 if mod: 1414 if mod:
1360 page = mod.create(self) 1415 page = mod.create(self)
1420 if sb: 1475 if sb:
1421 sb.setValue(0) 1476 sb.setValue(0)
1422 1477
1423 self.__currentConfigurationPageName = pageName 1478 self.__currentConfigurationPageName = pageName
1424 1479
1480 def __createInterfaceLightPageWithSidebars(self, configDlg): # noqa: U100
1481 """
1482 Private method to create the interface configuration page in light mode.
1483
1484 @param configDlg reference to the configuration dialog
1485 @type ConfigurationWidget
1486 @return reference to the configuration page
1487 @rtype InterfaceLightPage
1488 """
1489 from .ConfigurationPages import InterfaceLightPage
1490
1491 page = InterfaceLightPage.create(self, withSidebars=True)
1492 return page
1493
1425 def resizeEvent(self, evt): 1494 def resizeEvent(self, evt):
1426 """ 1495 """
1427 Protected method to handle the resizing of the widget. 1496 Protected method to handle the resizing of the widget.
1428 1497
1429 @param evt reference to the event object 1498 @param evt reference to the event object

eric ide

mercurial