5 |
5 |
6 """ |
6 """ |
7 Module implementing the MicroPython configuration page. |
7 Module implementing the MicroPython configuration page. |
8 """ |
8 """ |
9 |
9 |
|
10 |
10 from eric7 import Preferences, Utilities |
11 from eric7 import Preferences, Utilities |
11 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
12 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
12 from eric7.MicroPython.MicroPythonWidget import AnsiColorSchemes |
13 from eric7.MicroPython.MicroPythonWidget import AnsiColorSchemes |
13 |
14 |
14 from .ConfigurationPageBase import ConfigurationPageBase |
15 from .ConfigurationPageBase import ConfigurationPageBase |
15 from .Ui_MicroPythonPage import Ui_MicroPythonPage |
16 from .Ui_MicroPythonPage import Ui_MicroPythonPage |
16 |
17 |
|
18 try: |
|
19 from PyQt6.QtCharts import QChart |
|
20 except ImportError: |
|
21 QChart = None |
|
22 |
17 |
23 |
18 class MicroPythonPage(ConfigurationPageBase, Ui_MicroPythonPage): |
24 class MicroPythonPage(ConfigurationPageBase, Ui_MicroPythonPage): |
19 """ |
25 """ |
20 Class implementing the MicroPython configuration page. |
26 Class implementing the MicroPython configuration page. |
21 """ |
27 """ |
34 self.workspacePicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
40 self.workspacePicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
35 |
41 |
36 self.colorSchemeComboBox.addItems(sorted(AnsiColorSchemes.keys())) |
42 self.colorSchemeComboBox.addItems(sorted(AnsiColorSchemes.keys())) |
37 |
43 |
38 # populate the chart theme combobox |
44 # populate the chart theme combobox |
39 try: |
45 if QChart is not None: |
40 from PyQt6.QtCharts import QChart |
|
41 |
|
42 self.chartThemeComboBox.addItem(self.tr("Automatic"), -1) |
46 self.chartThemeComboBox.addItem(self.tr("Automatic"), -1) |
43 self.chartThemeComboBox.addItem( |
47 self.chartThemeComboBox.addItem( |
44 self.tr("Light"), QChart.ChartTheme.ChartThemeLight |
48 self.tr("Light"), QChart.ChartTheme.ChartThemeLight |
45 ) |
49 ) |
46 self.chartThemeComboBox.addItem( |
50 self.chartThemeComboBox.addItem( |
62 self.tr("Blue Icy"), QChart.ChartTheme.ChartThemeBlueIcy |
66 self.tr("Blue Icy"), QChart.ChartTheme.ChartThemeBlueIcy |
63 ) |
67 ) |
64 self.chartThemeComboBox.addItem( |
68 self.chartThemeComboBox.addItem( |
65 self.tr("Qt"), QChart.ChartTheme.ChartThemeQt |
69 self.tr("Qt"), QChart.ChartTheme.ChartThemeQt |
66 ) |
70 ) |
67 except ImportError: |
71 else: |
68 self.chartThemeComboBox.setEnabled(False) |
72 self.chartThemeComboBox.setEnabled(False) |
69 |
73 |
70 self.mpyCrossPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
74 self.mpyCrossPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
71 self.mpyCrossPicker.setFilters(self.tr("All Files (*)")) |
75 self.mpyCrossPicker.setFilters(self.tr("All Files (*)")) |
72 |
76 |