src/eric7/Plugins/WizardPlugins/FontDialogWizard/FontDialogOptionsDialog.py

Sat, 26 Apr 2025 12:34:32 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 26 Apr 2025 12:34:32 +0200
branch
eric7
changeset 11240
c48c615c04a3
parent 11090
f5f5f5803935
permissions
-rw-r--r--

MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.

# -*- coding: utf-8 -*-

# Copyright (c) 2021 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to select the applicable font dialog options.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_FontDialogOptionsDialog import Ui_FontDialogOptionsDialog


class FontDialogOptionsDialog(QDialog, Ui_FontDialogOptionsDialog):
    """
    Class implementing a dialog to select the applicable font dialog options.
    """

    def __init__(self, options, parent=None):
        """
        Constructor

        @param options dictionary with flags for the various dialog options
        @type dict
        @param parent reference to the parent widget (defaults to None)
        @type QWidget (optional)
        """
        super().__init__(parent)
        self.setupUi(self)

        self.noNativeDialogCheckBox.setChecked(options["noNativeDialog"])
        self.scalableCheckBox.setChecked(options["scalableFonts"])
        self.nonScalableCheckBox.setChecked(options["nonScalableFonts"])
        self.monospacedCheckBox.setChecked(options["monospacedFonts"])
        self.proportionalCheckBox.setChecked(options["proportionalFonts"])

    def getOptions(self):
        """
        Public method to get the selected font dialog options.

        @return dictionary with flags for the various dialog options
        @rtype dict
        """
        return {
            "noNativeDialog": self.noNativeDialogCheckBox.isChecked(),
            "scalableFonts": self.scalableCheckBox.isChecked(),
            "nonScalableFonts": self.nonScalableCheckBox.isChecked(),
            "monospacedFonts": self.monospacedCheckBox.isChecked(),
            "proportionalFonts": self.proportionalCheckBox.isChecked(),
        }

eric ide

mercurial