eric7/MicroPython/MicroPythonGraphWidget.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8343
242d5dae2937
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
20 QWidget, QHBoxLayout, QVBoxLayout, QToolButton, QSizePolicy, QSpacerItem, 20 QWidget, QHBoxLayout, QVBoxLayout, QToolButton, QSizePolicy, QSpacerItem,
21 QLabel, QSpinBox 21 QLabel, QSpinBox
22 ) 22 )
23 from PyQt6.QtCharts import QChartView, QChart, QLineSeries, QValueAxis 23 from PyQt6.QtCharts import QChartView, QChart, QLineSeries, QValueAxis
24 24
25 from E5Gui import E5MessageBox 25 from E5Gui import EricMessageBox
26 from E5Gui.E5Application import e5App 26 from E5Gui.EricApplication import ericApp
27 27
28 import UI.PixmapCache 28 import UI.PixmapCache
29 import Preferences 29 import Preferences
30 30
31 31
127 """ 127 """
128 chartColorTheme = Preferences.getMicroPython("ChartColorTheme") 128 chartColorTheme = Preferences.getMicroPython("ChartColorTheme")
129 if chartColorTheme == -1: 129 if chartColorTheme == -1:
130 # automatic selection of light or dark depending on desktop 130 # automatic selection of light or dark depending on desktop
131 # color scheme 131 # color scheme
132 if e5App().usesDarkPalette(): 132 if ericApp().usesDarkPalette():
133 self.__chart.setTheme(QChart.ChartTheme.ChartThemeDark) 133 self.__chart.setTheme(QChart.ChartTheme.ChartThemeDark)
134 else: 134 else:
135 self.__chart.setTheme(QChart.ChartTheme.ChartThemeLight) 135 self.__chart.setTheme(QChart.ChartTheme.ChartThemeLight)
136 else: 136 else:
137 self.__chart.setTheme(chartColorTheme) 137 self.__chart.setTheme(chartColorTheme)
325 csvWriter.writerows(self.__rawData) 325 csvWriter.writerows(self.__rawData)
326 326
327 self.__dirty = False 327 self.__dirty = False
328 return True 328 return True
329 except OSError as err: 329 except OSError as err:
330 E5MessageBox.critical( 330 EricMessageBox.critical(
331 self, 331 self,
332 self.tr("Save Chart Data"), 332 self.tr("Save Chart Data"),
333 self.tr( 333 self.tr(
334 """<p>The chart data could not be saved into file""" 334 """<p>The chart data could not be saved into file"""
335 """ <b>{0}</b>.</p><p>Reason: {1}</p>""").format( 335 """ <b>{0}</b>.</p><p>Reason: {1}</p>""").format(

eric ide

mercurial