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

Sat, 01 Oct 2022 19:42:50 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 01 Oct 2022 19:42:50 +0200
branch
eric7
changeset 9375
e21b51a3d990
parent 9221
bf71ee032bb4
child 9653
e67609152c5e
permissions
-rw-r--r--

Third Party packages
- upgraded pycodestyle to version 2.9.1

8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8413
diff changeset
3 # Copyright (c) 2021 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
4 #
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
5
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
7 Module implementing a dialog to select the applicable font dialog options.
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt6.QtWidgets import QDialog
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from .Ui_FontDialogOptionsDialog import Ui_FontDialogOptionsDialog
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 class FontDialogOptionsDialog(QDialog, Ui_FontDialogOptionsDialog):
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 """
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
17 Class implementing a dialog to select the applicable font dialog options.
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
19
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
20 def __init__(self, options, parent=None):
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
23
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
24 @param options dictionary with flags for the various dialog options
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
25 @type dict
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 @param parent reference to the parent widget (defaults to None)
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 @type QWidget (optional)
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
29 super().__init__(parent)
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 self.setupUi(self)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
31
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
32 self.noNativeDialogCheckBox.setChecked(options["noNativeDialog"])
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
33 self.scalableCheckBox.setChecked(options["scalableFonts"])
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
34 self.nonScalableCheckBox.setChecked(options["nonScalableFonts"])
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
35 self.monospacedCheckBox.setChecked(options["monospacedFonts"])
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
36 self.proportionalCheckBox.setChecked(options["proportionalFonts"])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
37
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
38 def getOptions(self):
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
40 Public method to get the selected font dialog options.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
41
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
42 @return dictionary with flags for the various dialog options
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
43 @rtype dict
8410
f8d97f05f883 Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
8413
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
45 return {
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
46 "noNativeDialog": self.noNativeDialogCheckBox.isChecked(),
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
47 "scalableFonts": self.scalableCheckBox.isChecked(),
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
48 "nonScalableFonts": self.nonScalableCheckBox.isChecked(),
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
49 "monospacedFonts": self.monospacedCheckBox.isChecked(),
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
50 "proportionalFonts": self.proportionalCheckBox.isChecked(),
65ed18753c40 Font Dialog Wizard: enhanced the wizard to allow the selection of font dialog options.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8410
diff changeset
51 }

eric ide

mercurial