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

Sat, 31 Dec 2022 16:23:21 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 31 Dec 2022 16:23:21 +0100
branch
eric7
changeset 9653
e67609152c5e
parent 9221
bf71ee032bb4
child 10439
21c28b0f9e41
permissions
-rw-r--r--

Updated copyright for 2023.

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

# Copyright (c) 2021 - 2023 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