q2rad 0.1.198__tar.gz → 0.1.200__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.198
3
+ Version: 0.1.200
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.198"
3
+ version = "0.1.200"
4
4
  description = "RAD - database, GUI, reports"
5
5
  authors = ["Andrei Puchko <andrei.puchko@gmx.de>"]
6
6
  readme = "README.md"
@@ -43,7 +43,7 @@ SQL_DATATYPES = (
43
43
  "time",
44
44
  "datetime",
45
45
  )
46
- HAS_DATADEC = ("dec", "numeric", "num")
46
+ HAS_DATADEC = ("dec", "numeric", "num", "decimal")
47
47
  HAS_DATALEN = ("char", "varchar") + HAS_DATADEC
48
48
  WIDGETS = (
49
49
  "line",
@@ -72,7 +72,7 @@ WIDGETS = (
72
72
  # "toolbar;"
73
73
  # "toolbutton;"
74
74
 
75
- HAS_PIC = "radio;" "combo;" "list;"
75
+ HAS_PIC = "radio;" "combo;" "list;" "line;"
76
76
 
77
77
 
78
78
  class Q2Lines(Q2Form, Q2_save_and_run):
@@ -94,6 +94,7 @@ _logger = logging.getLogger(__name__)
94
94
  class ReturnEvent(Exception):
95
95
  pass
96
96
 
97
+
97
98
  def get_report(report_name="", style={}):
98
99
  if report_name == "":
99
100
  return Q2RadReport(style=style)
@@ -1017,6 +1018,7 @@ class Q2RadApp(Q2App):
1017
1018
  , gridlabel
1018
1019
  , tag
1019
1020
  , mess
1021
+ , alignment
1020
1022
  , nogrid
1021
1023
  , noform
1022
1024
  , `check`
@@ -91,6 +91,7 @@ class Q2RadReport(Q2Report):
91
91
  form.heap.mode = mode
92
92
  form.close()
93
93
 
94
+ form.add_control("/s")
94
95
  form.add_control("/h")
95
96
  form.add_control("/s")
96
97
  form.add_control("/v")
@@ -121,6 +122,24 @@ class Q2RadReport(Q2Report):
121
122
  form.add_control("/")
122
123
  form.add_control("/s")
123
124
  form.add_control("/")
125
+
126
+ def repo_edit():
127
+ report_edit_form = Q2ReportEdit()
128
+ report_edit_form.after_form_show = lambda: report_edit_form.set_content(self.report_content)
129
+ report_edit_form.data.update(self.data)
130
+ report_edit_form.data_sets.update(self.data_sets)
131
+ report_edit_form.run()
132
+ form.close()
133
+
134
+ if q2app.q2_app.dev_mode:
135
+ form.add_control("/s")
136
+ form.add_control("/h")
137
+ form.add_control("/s")
138
+ form.add_control("edit", "Edit", control="button", datalen=8, valid=repo_edit)
139
+ form.add_control("/s")
140
+ form.add_control("/")
141
+ form.add_control("/s")
142
+
124
143
  form.cancel_button = 1
125
144
  form.do_not_save_geometry = 1
126
145
  form.run()
@@ -325,6 +344,8 @@ class ReportForm:
325
344
  class Q2ReportEdit(Q2Form):
326
345
  def __init__(self):
327
346
  super().__init__("Report Edit")
347
+ self.data = {}
348
+ self.data_sets = {}
328
349
 
329
350
  def on_init(self):
330
351
  self.query_edit = Q2QueryEdit()
@@ -594,6 +615,8 @@ class Q2ReportReport(Q2Form):
594
615
 
595
616
  def run_report(self, output_file="html"):
596
617
  rep = Q2RadReport(self.report_edit_form.get_content())
618
+ rep.data.update(self.report_edit_form.data)
619
+ rep.data_sets.update(self.report_edit_form.data_sets)
597
620
  rep.run(output_file)
598
621
 
599
622
  def set_default_report_content(self):
@@ -663,7 +686,8 @@ class Q2ReportReport(Q2Form):
663
686
  prop_key = prop_name.replace("_", "-")
664
687
 
665
688
  if not self.w.__getattr__(prop_name).check.is_checked():
666
- del self.current_propertys[prop_key]
689
+ if prop_key in self.current_propertys:
690
+ del self.current_propertys[prop_key]
667
691
  else:
668
692
  self.current_propertys[prop_key] = prop_value
669
693
  self.style_changed()
@@ -1985,6 +2009,9 @@ class Q2ReportRows(Q2Form, ReportForm):
1985
2009
  cell_data = self.rows_data.cells.get(f"{row},{column}", {})
1986
2010
 
1987
2011
  self.rows_sheet.cell_styles[f"{row},{column}"] = cell_data.get("style", {})
2012
+ self.rows_sheet.cell_styles[f"{row},{column}"]["border-color"] = (
2013
+ "white" if self.q2_app.q2style.color_mode == "dark" else "black"
2014
+ )
1988
2015
  rowspan = cell_data.get("rowspan", 1)
1989
2016
  colspan = cell_data.get("colspan", 1)
1990
2017
  if rowspan > 1 or colspan > 1:
@@ -131,7 +131,9 @@ class Q2Form(_Q2Form):
131
131
 
132
132
  report = get_report(style=get_report().make_style(font_size=q2app.q2_app.q2style.font_size))
133
133
 
134
- report.data_sets["cursor"] = [{"_n_n_n_": x} for x in range(self.model.row_count())]
134
+ report.data_sets["cursor"] = [
135
+ {"_n_n_n_": x} for x in range(self.model.row_count()) if not self.model.is_hidden(x)
136
+ ]
135
137
 
136
138
  detail_rows = report.new_rows()
137
139
  detail_rows.rows["role"] = "table"
@@ -0,0 +1 @@
1
+ __version__ = "0.1.200"
@@ -1 +0,0 @@
1
- __version__ = "0.1.198"
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