Mon, 22 Jul 2019 19:19:06 +0200
Preferences: added a configuration pyge for the MicroPython interface.
--- a/eric6.e4p Mon Jul 22 18:48:27 2019 +0200 +++ b/eric6.e4p Mon Jul 22 19:19:06 2019 +0200 @@ -900,6 +900,7 @@ <Source>eric6/Preferences/ConfigurationPages/IrcPage.py</Source> <Source>eric6/Preferences/ConfigurationPages/LogViewerPage.py</Source> <Source>eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py</Source> + <Source>eric6/Preferences/ConfigurationPages/MicroPythonPage.py</Source> <Source>eric6/Preferences/ConfigurationPages/MimeTypesPage.py</Source> <Source>eric6/Preferences/ConfigurationPages/MultiProjectPage.py</Source> <Source>eric6/Preferences/ConfigurationPages/NetworkPage.py</Source> @@ -2096,6 +2097,7 @@ <Form>eric6/Preferences/ConfigurationPages/IrcPage.ui</Form> <Form>eric6/Preferences/ConfigurationPages/LogViewerPage.ui</Form> <Form>eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.ui</Form> + <Form>eric6/Preferences/ConfigurationPages/MicroPythonPage.ui</Form> <Form>eric6/Preferences/ConfigurationPages/MimeTypesPage.ui</Form> <Form>eric6/Preferences/ConfigurationPages/MultiProjectPage.ui</Form> <Form>eric6/Preferences/ConfigurationPages/NetworkPage.ui</Form>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/Preferences/ConfigurationPages/MicroPythonPage.py Mon Jul 22 19:19:06 2019 +0200 @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing the MicroPython configuration page. +""" + +from __future__ import unicode_literals + +from .ConfigurationPageBase import ConfigurationPageBase +from .Ui_MicroPythonPage import Ui_MicroPythonPage + +import Preferences + +from MicroPython.MicroPythonReplWidget import AnsiColorSchemes + + +class MicroPythonPage(ConfigurationPageBase, Ui_MicroPythonPage): + """ + Class implementing the MicroPython configuration page. + """ + def __init__(self, parent=None): + """ + Constructor + + @param parent reference to the parent widget + @type QWidget + """ + super(MicroPythonPage, self).__init__() + self.setupUi(self) + self.setObjectName("MicroPythonPage") + + self.colorSchemeComboBox.addItems(sorted(AnsiColorSchemes.keys())) + + # set initial values + self.colorSchemeComboBox.setCurrentIndex( + self.colorSchemeComboBox.findText( + Preferences.getMicroPython("ColorScheme"))) + + def save(self): + """ + Public slot to save the MicroPython configuration. + """ + Preferences.setMicroPython( + "ColorScheme", self.colorSchemeComboBox.currentText()) + + +def create(dlg): + """ + Module function to create the configuration page. + + @param dlg reference to the configuration dialog + @return reference to the instantiated page (ConfigurationPageBase) + """ + page = MicroPythonPage() + return page
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/Preferences/ConfigurationPages/MicroPythonPage.ui Mon Jul 22 19:19:06 2019 +0200 @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MicroPythonPage</class> + <widget class="QWidget" name="MicroPythonPage"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>477</width> + <height>346</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="headerLabel"> + <property name="text"> + <string><b>Configure MicroPython</b></string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line9_3"> + <property name="frameShape"> + <enum>QFrame::HLine</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Color Scheme for ANSI Escape Codes:</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="colorSchemeComboBox"> + <property name="toolTip"> + <string>Select the color scheme to be applied for ANSI color escape codes</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>252</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui>