q2rad 0.1.168__tar.gz → 0.1.169__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.168
3
+ Version: 0.1.169
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.168"
3
+ version = "0.1.169"
4
4
  description = "RAD - database, GUI, reports"
5
5
  authors = ["Andrei Puchko <andrei.puchko@gmx.de>"]
6
6
  readme = "README.md"
@@ -45,7 +45,20 @@ SQL_DATATYPES = (
45
45
  )
46
46
  HAS_DATADEC = ("dec", "numeric", "num")
47
47
  HAS_DATALEN = ("char", "varchar") + HAS_DATADEC
48
- WIDGETS = ("line", "text", "code", "button", "check", "radio", "combo", "list", "spin", "image", "widget")
48
+ WIDGETS = (
49
+ "line",
50
+ "text",
51
+ "code",
52
+ "button",
53
+ "check",
54
+ "radio",
55
+ "combo",
56
+ "list",
57
+ "spin",
58
+ "image",
59
+ "widget",
60
+ "label",
61
+ )
49
62
  # "date;"
50
63
  # "frame;"
51
64
  # "grid;"
@@ -78,6 +91,8 @@ class Q2Lines(Q2Form, Q2_save_and_run):
78
91
 
79
92
  self.add_action("Run", self.form_runner, hotkey="F4")
80
93
  self.add_action("Fill", self.filler)
94
+ self.add_action("-")
95
+ self.add_action("Select panel", icon="⭥", worker=self.select_panel, hotkey="Ctrl+F3")
81
96
 
82
97
  def create_form(self):
83
98
  self.add_control("id", "", datatype="int", pk="*", ai="*", noform=1, nogrid=1)
@@ -89,7 +104,7 @@ class Q2Lines(Q2Form, Q2_save_and_run):
89
104
  to_column="name",
90
105
  related="name",
91
106
  datatype="char",
92
- datalen=100
107
+ datalen=100,
93
108
  )
94
109
  self.add_control("column", _("Column name"), datalen=50)
95
110
  self.add_control("/")
@@ -124,7 +139,6 @@ class Q2Lines(Q2Form, Q2_save_and_run):
124
139
  self.add_control("/")
125
140
 
126
141
  if self.add_control("/h", _("Data type")):
127
-
128
142
  self.add_control(
129
143
  "datatype",
130
144
  gridlabel=_("Data type"),
@@ -140,7 +154,6 @@ class Q2Lines(Q2Form, Q2_save_and_run):
140
154
  self.add_control("/")
141
155
 
142
156
  if self.add_control("/h"): # Db
143
-
144
157
  self.add_control(
145
158
  "migrate",
146
159
  _("Migrate"),
@@ -256,6 +269,45 @@ class Q2Lines(Q2Form, Q2_save_and_run):
256
269
  self.controls.delete("save_and_run_actions_visible")
257
270
  self.system_controls.insert(2, self._save_and_run_control)
258
271
 
272
+ def select_panel(self):
273
+ first_row = last_row = self.current_row
274
+
275
+ def is_panel_start():
276
+ return self.r.column in ("/f", "/h", "/v")
277
+
278
+ def is_panel_end():
279
+ return self.r.column == "/"
280
+
281
+ def seek_end():
282
+ nonlocal last_row
283
+ while last_row < self.model.row_count():
284
+ self.set_grid_index(last_row)
285
+ # if is_panel_start():
286
+ # break
287
+ if is_panel_end():
288
+ break
289
+ last_row += 1
290
+
291
+ def seek_start():
292
+ in_panel = -1 if is_panel_end() else 0
293
+ nonlocal first_row
294
+ while first_row > 0:
295
+ self.set_grid_index(first_row)
296
+ if is_panel_start():
297
+ if in_panel == 0:
298
+ break
299
+ else:
300
+ in_panel -= 1
301
+ elif is_panel_end():
302
+ in_panel += 1
303
+ first_row -= 1
304
+
305
+ if not is_panel_start():
306
+ seek_start()
307
+ if not is_panel_end():
308
+ seek_end()
309
+ self.set_grid_selected_rows([x for x in range(first_row, last_row + 1)])
310
+
259
311
  def filler(self):
260
312
  if self.model.row_count() > 0:
261
313
  if q2AskYN("Lines list is not empty! Are you sure") != 2:
@@ -0,0 +1 @@
1
+ __version__ = "0.1.169"
@@ -1 +0,0 @@
1
- __version__ = "0.1.168"
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