Thu, 30 Dec 2021 11:17:58 +0100
Updated copyright for 2022.
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 | """ |
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
|
19 | def __init__(self, options, parent=None): |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | """ |
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | Constructor |
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
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
|
23 | @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
|
24 | @type dict |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | @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
|
26 | @type QWidget (optional) |
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | """ |
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
|
28 | super().__init__(parent) |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | self.setupUi(self) |
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | |
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
|
31 | 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
|
32 | 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
|
33 | 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
|
34 | 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
|
35 | self.proportionalCheckBox.setChecked(options["proportionalFonts"]) |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | |
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
|
37 | def getOptions(self): |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | """ |
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
|
39 | Public method to get the selected font dialog options. |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | |
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
|
41 | @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
|
42 | @rtype dict |
8410
f8d97f05f883
Started improving the Font Dialog Wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | """ |
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
|
44 | 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
|
45 | "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
|
46 | "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
|
47 | "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
|
48 | "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
|
49 | "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
|
50 | } |