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

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8881
54e42bc2437a
child 9221
bf71ee032bb4
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2021 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to select the applicable font dialog options.
8 """
9
10 from PyQt6.QtWidgets import QDialog
11
12 from .Ui_FontDialogOptionsDialog import Ui_FontDialogOptionsDialog
13
14
15 class FontDialogOptionsDialog(QDialog, Ui_FontDialogOptionsDialog):
16 """
17 Class implementing a dialog to select the applicable font dialog options.
18 """
19 def __init__(self, options, parent=None):
20 """
21 Constructor
22
23 @param options dictionary with flags for the various dialog options
24 @type dict
25 @param parent reference to the parent widget (defaults to None)
26 @type QWidget (optional)
27 """
28 super().__init__(parent)
29 self.setupUi(self)
30
31 self.noNativeDialogCheckBox.setChecked(options["noNativeDialog"])
32 self.scalableCheckBox.setChecked(options["scalableFonts"])
33 self.nonScalableCheckBox.setChecked(options["nonScalableFonts"])
34 self.monospacedCheckBox.setChecked(options["monospacedFonts"])
35 self.proportionalCheckBox.setChecked(options["proportionalFonts"])
36
37 def getOptions(self):
38 """
39 Public method to get the selected font dialog options.
40
41 @return dictionary with flags for the various dialog options
42 @rtype dict
43 """
44 return {
45 "noNativeDialog": self.noNativeDialogCheckBox.isChecked(),
46 "scalableFonts": self.scalableCheckBox.isChecked(),
47 "nonScalableFonts": self.nonScalableCheckBox.isChecked(),
48 "monospacedFonts": self.monospacedCheckBox.isChecked(),
49 "proportionalFonts": self.proportionalCheckBox.isChecked(),
50 }

eric ide

mercurial