1+ import logging
12from collections .abc import Callable
23
34from PyQt6 .QtCore import Qt
45from PyQt6 .QtWidgets import QComboBox , QPushButton
56
67from ert .gui .icon_utils import load_icon
8+ from ert .gui .plotting .utils .logging_utils import log_plot_option_usage_once
79from ert .gui .plotting .utils .plot_color_palettes import PALETTES_WITH_DESCRIPTIONS
810from ert .gui .plotting .widgets .plot_controls import CustomPaletteDialog
911
12+ logger = logging .getLogger (__name__ )
13+
1014
1115class PlotColorPaletteSelector (QComboBox ):
1216 CUSTOM_PALETTE_NAME = "Custom"
@@ -31,6 +35,7 @@ def __init__(self, connection_point: Callable[..., object]) -> None:
3135 Qt .ItemDataRole .ToolTipRole ,
3236 )
3337 self .activated .connect (connection_point )
38+ log_plot_option_usage_once (self .activated , logger , "Color palette" )
3439 self .custom_palette_button = QPushButton (
3540 load_icon ("add_circle_outlined.svg" ), "Create custom palette"
3641 )
@@ -39,6 +44,9 @@ def __init__(self, connection_point: Callable[..., object]) -> None:
3944 "The selected palette will be applied to all plots."
4045 )
4146 self .custom_palette_button .clicked .connect (self ._open_custom_palette_dialog )
47+ log_plot_option_usage_once (
48+ self .custom_palette_button .clicked , logger , "Create custom palette"
49+ )
4250
4351 def _open_custom_palette_dialog (self ) -> None :
4452 if self .CUSTOM_PALETTE_NAME in PALETTES_WITH_DESCRIPTIONS :
0 commit comments