eric6/Preferences/ConfigurationPages/MicroPythonPage.py

Mon, 13 Apr 2020 16:26:46 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 13 Apr 2020 16:26:46 +0200
changeset 7535
dac9bc72a0f3
parent 7360
9190402e4505
child 7541
b265a2d0a797
permissions
-rw-r--r--

MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.

7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7328
diff changeset
3 # Copyright (c) 2019 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the MicroPython configuration page.
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
7140
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
11 from E5Gui.E5PathPicker import E5PathPickerModes
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
12
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .ConfigurationPageBase import ConfigurationPageBase
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from .Ui_MicroPythonPage import Ui_MicroPythonPage
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import Preferences
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
7134
21d23ca51680 Renamed "MicroPythonReplWidget" to "MicroPythonWidget".
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7099
diff changeset
18 from MicroPython.MicroPythonWidget import AnsiColorSchemes
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 class MicroPythonPage(ConfigurationPageBase, Ui_MicroPythonPage):
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Class implementing the MicroPython configuration page.
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 def __init__(self, parent=None):
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Constructor
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param parent reference to the parent widget
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @type QWidget
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 super(MicroPythonPage, self).__init__()
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setupUi(self)
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.setObjectName("MicroPythonPage")
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.colorSchemeComboBox.addItems(sorted(AnsiColorSchemes.keys()))
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
38 # populate the chart theme combobox
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
39 try:
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
40 from PyQt5.QtChart import QChart
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
41
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
42 self.chartThemeComboBox.addItem(self.tr("Automatic"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
43 -1)
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
44 self.chartThemeComboBox.addItem(self.tr("Light"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
45 QChart.ChartThemeLight);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
46 self.chartThemeComboBox.addItem(self.tr("Dark"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
47 QChart.ChartThemeDark);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
48 self.chartThemeComboBox.addItem(self.tr("Blue Cerulean"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
49 QChart.ChartThemeBlueCerulean);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
50 self.chartThemeComboBox.addItem(self.tr("Brown Sand"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
51 QChart.ChartThemeBrownSand);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
52 self.chartThemeComboBox.addItem(self.tr("Blue NCS"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
53 QChart.ChartThemeBlueNcs);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
54 self.chartThemeComboBox.addItem(self.tr("High Contrast"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
55 QChart.ChartThemeHighContrast);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
56 self.chartThemeComboBox.addItem(self.tr("Blue Icy"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
57 QChart.ChartThemeBlueIcy);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
58 self.chartThemeComboBox.addItem(self.tr("Qt"),
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
59 QChart.ChartThemeQt);
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
60 except ImportError:
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
61 self.chartThemeComboBox.setEnabled(False)
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
62
7140
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
63 self.mpyCrossPicker.setMode(E5PathPickerModes.OpenFileMode)
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
64 self.mpyCrossPicker.setFilters(self.tr("All Files (*)"))
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
65
7327
71883ddcb762 MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
66 self.dfuUtilPathPicker.setMode(E5PathPickerModes.OpenFileMode)
71883ddcb762 MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
67 self.dfuUtilPathPicker.setFilters(self.tr("All Files (*)"))
71883ddcb762 MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
68
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 # set initial values
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
70 # serial link parameters
7099
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
71 self.timeoutSpinBox.setValue(
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
72 Preferences.getMicroPython("SerialTimeout") / 1000)
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
73 # converted to seconds
7135
44fcfc99b864 MicroPython: added an option to synchronize the device time to the host time after connecting the serial port.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7134
diff changeset
74 self.syncTimeCheckBox.setChecked(
44fcfc99b864 MicroPython: added an option to synchronize the device time to the host time after connecting the serial port.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7134
diff changeset
75 Preferences.getMicroPython("SyncTimeAfterConnect"))
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
76
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
77 # REPL Pane
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.colorSchemeComboBox.setCurrentIndex(
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.colorSchemeComboBox.findText(
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 Preferences.getMicroPython("ColorScheme")))
7099
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
81 self.replWrapCheckBox.setChecked(
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
82 Preferences.getMicroPython("ReplLineWrap"))
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
83
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
84 # Chart Pane
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
85 index = self.chartThemeComboBox.findData(
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
86 Preferences.getMicroPython("ChartColorTheme"))
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
87 if index < 0:
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
88 index = 0
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
89 self.chartThemeComboBox.setCurrentIndex(index)
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
90
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
91 # MPY Cross Compiler
7140
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
92 self.mpyCrossPicker.setText(
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
93 Preferences.getMicroPython("MpyCrossCompiler"))
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
94
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
95 # PyBoard specifics
7327
71883ddcb762 MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
96 self.dfuUtilPathPicker.setText(
71883ddcb762 MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
97 Preferences.getMicroPython("DfuUtilPath"))
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
98
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
99 # firmware URL
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
100 self.micropythonFirmwareUrlLineEdit.setText(
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
101 Preferences.getMicroPython("MicroPythonFirmwareUrl"))
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
102 self.circuitpythonFirmwareUrlLineEdit.setText(
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
103 Preferences.getMicroPython("CircuitPythonFirmwareUrl"))
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
104 self.microbitFirmwareUrlLineEdit.setText(
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
105 Preferences.getMicroPython("MicrobitFirmwareUrl"))
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
106
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
107 # documentation URL
7161
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
108 self.micropythonDocuUrlLineEdit.setText(
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
109 Preferences.getMicroPython("MicroPythonDocuUrl"))
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
110 self.circuitpythonDocuUrlLineEdit.setText(
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
111 Preferences.getMicroPython("CircuitPythonDocuUrl"))
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
112 self.microbitDocuUrlLineEdit.setText(
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
113 Preferences.getMicroPython("MicrobitDocuUrl"))
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 def save(self):
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 Public slot to save the MicroPython configuration.
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 """
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
119 # serial link parameters
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
121 "SerialTimeout",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
122 self.timeoutSpinBox.value() * 1000)
7099
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
123 # converted to milliseconds
89f11ae6bec3 Preferences: added an option to configure the REPL pane line wrap mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7086
diff changeset
124 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
125 "SyncTimeAfterConnect",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
126 self.syncTimeCheckBox.isChecked())
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
127
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
128 # REPL Pane
7135
44fcfc99b864 MicroPython: added an option to synchronize the device time to the host time after connecting the serial port.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7134
diff changeset
129 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
130 "ColorScheme",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
131 self.colorSchemeComboBox.currentText())
7086
b757db426076 Preferences: added config option for the MicroPython serial communication timeout.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7079
diff changeset
132 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
133 "ReplLineWrap",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
134 self.replWrapCheckBox.isChecked())
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
135
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
136 # Chart Pane
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
137 Preferences.setMicroPython(
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
138 "ChartColorTheme",
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
139 self.chartThemeComboBox.currentData())
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
140
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
141 # MPY Cross Compiler
7140
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
142 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
143 "MpyCrossCompiler",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
144 self.mpyCrossPicker.text())
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
145
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
146 # PyBoard specifics
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
147 Preferences.setMicroPython(
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
148 "DfuUtilPath",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
149 self.dfuUtilPathPicker.text())
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
150
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
151 # firmware URL
7161
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
152 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
153 "MicroPythonFirmwareUrl",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
154 self.micropythonFirmwareUrlLineEdit.text())
7327
71883ddcb762 MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
155 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
156 "CircuitPythonFirmwareUrl",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
157 self.circuitpythonFirmwareUrlLineEdit.text())
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
158 Preferences.setMicroPython(
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
159 "MicrobitFirmwareUrl",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
160 self.microbitFirmwareUrlLineEdit.text())
7535
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
161
dac9bc72a0f3 MicroPython: made the chart widget color scheme aware and added a config option to configure a specific chart color theme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
162 # documentation URL
7161
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
163 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
164 "MicroPythonDocuUrl",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
165 self.micropythonDocuUrlLineEdit.text())
7161
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
166 Preferences.setMicroPython(
7328
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
167 "CircuitPythonDocuUrl",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
168 self.circuitpythonDocuUrlLineEdit.text())
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
169 Preferences.setMicroPython(
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
170 "MicrobitDocuUrl",
e2d85ef3fadb MicroPython:
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7327
diff changeset
171 self.microbitDocuUrlLineEdit.text())
7161
728018c32b09 MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7140
diff changeset
172
7079
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 def create(dlg):
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 """
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 Module function to create the configuration page.
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 @param dlg reference to the configuration dialog
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 @return reference to the instantiated page (ConfigurationPageBase)
d1564b590677 Preferences: added a configuration pyge for the MicroPython interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 """
7140
22f5fd76c10f MicroPythonWidget: added menu entries to cross compile a selectable Python file or the current editor to a .mpy file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7135
diff changeset
181 return MicroPythonPage()

eric ide

mercurial