q2rad 0.1.191__tar.gz → 0.1.192__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of q2rad might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: q2rad
3
- Version: 0.1.191
3
+ Version: 0.1.192
4
4
  Summary: RAD - database, GUI, reports
5
5
  Author: Andrei Puchko
6
6
  Author-email: andrei.puchko@gmx.de
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "q2rad"
3
- version = "0.1.191"
3
+ version = "0.1.192"
4
4
  description = "RAD - database, GUI, reports"
5
5
  authors = ["Andrei Puchko <andrei.puchko@gmx.de>"]
6
6
  readme = "README.md"
@@ -220,6 +220,7 @@ class Q2RadApp(Q2App):
220
220
  self.last_root_password = ""
221
221
  self.selected_application = {}
222
222
  self.q2style.font_size = int_(self.settings.get("Style Settings", "font_size", "10")) # noqa F405
223
+ self.q2style.font_name = self.settings.get("Style Settings", "font_name", "Arial") # noqa F405
223
224
  self.set_color_mode(self.settings.get("Style Settings", "color_mode", ""))
224
225
 
225
226
  self.clear_app_info()
@@ -496,7 +497,7 @@ class Q2RadApp(Q2App):
496
497
  self.clear_menu()
497
498
  self.add_menu("File|About", self.about, icon="info.png")
498
499
  self.add_menu("File|Manage", self.run_app_manager, icon="tools.png")
499
- self.add_menu("File|Settings", self.run_stylesettings)
500
+ self.add_menu("File|Style", self.run_stylesettings)
500
501
  self.add_menu("File|Constants", self.run_constants)
501
502
  if not self.frozen:
502
503
  self.add_menu("File|-")
@@ -15,6 +15,8 @@
15
15
 
16
16
  from q2rad import Q2Form
17
17
  from q2rad.q2raddb import int_
18
+ from PyQt6.QtWidgets import QFontDialog
19
+ from PyQt6.QtGui import QFont
18
20
  import logging
19
21
 
20
22
  _logger = logging.getLogger(__name__)
@@ -41,28 +43,53 @@ class AppStyleSettings(Q2Form):
41
43
  self.q2_app.q2style.color_mode, self.q2_app.q2style.get_system_color_mode()
42
44
  ),
43
45
  )
44
-
45
- self.add_control("/h", "Font size")
46
- self.add_control("minus", "-", datatype="int", control="button", valid=self._font_minus)
46
+ self.add_control("/")
47
+ self.add_control("/f", "Font")
48
+ if self.add_control("/h", "Size"):
49
+ self.add_control("minus", "-", datatype="int", control="button", valid=self._font_minus)
50
+
51
+ self.add_control(
52
+ "font_size",
53
+ "",
54
+ datalen=6,
55
+ datatype="int",
56
+ control="line",
57
+ data=self.q2_app.q2style.font_size,
58
+ valid=self.font_size_valid,
59
+ )
60
+ self.add_control("plus", "+", datatype="int", control="button", valid=self._font_plus)
61
+
62
+ self.add_control("/s")
63
+ self.add_control("/")
47
64
 
48
65
  self.add_control(
49
- "font_size",
50
- "",
51
- datalen=6,
52
- datatype="int",
66
+ "font_name",
67
+ "Font",
53
68
  control="line",
54
- data=self.q2_app.q2style.font_size,
55
- valid=self.font_size_valid,
69
+ disabled=1,
70
+ data=self.q2_app.q2style.font_name,
56
71
  )
57
- self.add_control("plus", "+", datatype="int", control="button", valid=self._font_plus)
72
+ self.add_control("get_font", "Change font", datalen=15, control="button", valid=self.change_font)
58
73
  self.add_control("apply", "Apply immediately", control="check", data=True)
59
-
60
- self.add_control("/s")
61
- self.add_control("/")
74
+ self.add_control("reset", "Reset to Arial, 12", control="button", valid=self.reset_font)
62
75
 
63
76
  self.ok_button = 1
64
77
  self.cancel_button = 1
65
78
 
79
+ def reset_font(self):
80
+ self.s.font_size=12
81
+ self.s.font_name="Arial"
82
+ if self.s.apply:
83
+ self.style_valid()
84
+
85
+ def change_font(self):
86
+ font, ok = QFontDialog.getFont(QFont(self.s.font_name, int_(self.s.font_size)))
87
+ if ok:
88
+ self.s.font_name = font.family()
89
+ self.s.font_size = font.pointSize()
90
+ if self.s.apply:
91
+ self.style_valid()
92
+
66
93
  def _font_plus(self):
67
94
  self.s.font_size = int_(self.s.font_size) + 1
68
95
  self.font_size_valid()
@@ -83,6 +110,7 @@ class AppStyleSettings(Q2Form):
83
110
  self.q2_app.q2style.font_size = int_(self.s.font_size)
84
111
  self.q2_app.settings.set("Style Settings", "color_mode", color_mode)
85
112
  self.q2_app.settings.set("Style Settings", "font_size", self.s.font_size)
113
+ self.q2_app.settings.set("Style Settings", "font_name", self.s.font_name)
86
114
  self.q2_app.set_color_mode(color_mode)
87
115
 
88
116
  def font_size_valid(self):
@@ -93,6 +121,7 @@ class AppStyleSettings(Q2Form):
93
121
  self.style_valid()
94
122
 
95
123
  def style_valid(self):
124
+ self.q2_app.q2style.font_name = self.s.font_name
96
125
  self.q2_app.set_color_mode(self.get_color_mode())
97
126
 
98
127
  def close(self):
@@ -0,0 +1 @@
1
+ __version__ = "0.1.192"
@@ -1 +0,0 @@
1
- __version__ = "0.1.191"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes