[GRASS-dev] [GRASS GIS] #734: wxGui sqlbuilder: a few bugs

#734: wxGui sqlbuilder: a few bugs
------------------------+---------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Keywords: sqlbuilder | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Hi, a remaining few bugs moved here from #723 re. the wx SQLbuilder GUI.
It's getting close to being functional. (!)

  * clicking on Column, Operator, Value (get values first) doesn't add the
new text at the end of the statement or at the cursor position. It just
always inserts to the fifth char position?? You can fix it manually.

  * Clicking [Apply] doesn't send the string back to the Attribute Table
Manager GUI.

  * How to add support for multi-layer tables? (see layer from L584 in
dbm.py ?)

  * in 6.4svn you get an error when you click on [Verify]:
{{{
Testing [SELECT * FROM fields WHERE label = '"NO DATA"'] ...
Traceback (most recent call last):
   File
"/.../etc/wxpython/gui_modules/sqlbuilder.py",
line 363, in OnVerify

sql = querystring)
TypeError
:
'int' object is not iterable
}}}

  * in all versions you get an error on [Close]:
{{{
Traceback (most recent call last):
   File
"/.../etc/wxpython/gui_modules/sqlbuilder.py",
line 284, in AddColumnName

idx = self.list_columns.GetSelections()[0]
IndexError
:
tuple index out of range
Traceback (most recent call last):
   File
"/.../etc/wxpython/gui_modules/sqlbuilder.py",
line 289, in AddValue

idx = self.list_values.GetSelections()[0]
IndexError
:
tuple index out of range
}}}

?,
Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: sqlbuilder
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Changes (by martinl):

* cc: grass-dev@lists.osgeo.org (added)
  * owner: grass-dev@lists.osgeo.org => martinl
  * status: new => assigned

Comment:

Please try r38923.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: sqlbuilder
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by hamish):

Much better...!

fine tuning / feedback:

  - Columns and Values text boxes are now a bit too small, only showing 1.5
column names + up/down slider. It would be nice if it were big enough to
at least show more of them.

  - it says "Add on double click" but actually it adds column name on
single click. Or if you have a column name selected from the list and on
the keyboard do up-down-up-down arrows it repeatedly adds those column
names in the Query text box. Rename as "Add on double click as"? Before a
little experimentation I find it hard to know what those radio buttons
did. Possible to have a tooltip there?

  - shouldn't the base text end with "WHERE " ? (ok it shows up once I
select a column name as "(*)values" but why not have it there to begin
with?)

  - [Get sample],[Get all values] fail if the map is not in the current
mapset (e.g. fields@PERMANENT). I had this running recently when it called
the db.select directly; the trick is to pass db.* the full path to the
database table the 4th column from 'v.db.connect -p', or use v.db.select.
In the terminal shell window:
{{{
DBMI-DBF driver error:
Table 'fields' doesn't exist.
Error in db_open_select_cursor()

ERROR: Fetching data from table <fields> failed
}}}

  - open SQL builder for fields@PERMANENT, click on Columns: _cat_, click
on [Close]. you get this error in the main Layer Manager output tab:
{{{
Traceback (most recent call last):
   File "[$GISBASE]/etc/wxpython/gui_modules/sqlbuilder.py",
line 321, in OnAddColumn

if not self.btn_uniquesample.IsEnabled():
   File "/usr/lib/python2.5/site-
packages/wx-2.8-gtk2-unicode/wx/_core.py", line 14314, in
__getattr__

raise PyDeadObjectError(self.attrStr % self._name)
wx._core
.
PyDeadObjectError
:
The C++ part of the Button object has been deleted,
attribute access no longer allowed.
}}}

  - uncheck "Close dialog on apply" by default? (match module GUI
behaviour) It's just a bit surprising when it vanishes. Or change "Apply"
to "Accept"?

  - Verify: show result in pop up window instead of status bar text? It's a
bit less subtle, and the user did ask for reassurance. Or maybe better
change the color of the text in the status bar:
  -- not verified: dark orange or dark yellow
  -- verified: changes to dark green
  -- invalid: changes to dark red.
also as soon as you type/add more into the Query box it should reset to
"not verified".

thanks,
Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: sqlbuilder
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by hamish):

Replying to [comment:2 hamish]:
> - Columns and Values text boxes are now a bit too small,
> only showing 1.5 column names + up/down slider. It would be
> nice if it were big enough to at least show more of them.

note that on an eeePC the default screen resolution is 1024x600,
and the current window height for the SQL builder GUI (I get) is 525, so
after you subtract 20px or so for the window manager taskbar(s) there
isn't much room left for expansion. (The wx startup GUI is better than it
used to be, but still the [enter grass] buttons are slightly crushed
there)

so it would be nice if gui widgets could be packed a little bit tighter
and the starting window heights no taller than (say) 575px.
(maybe smaller buttons for the = > < >= <=; move "Close dialog on apply"
checkbox on to the same row as [Verify][Apply]; or rethink if full DB
connection params are really needed at the top, or could swing down with a
>,v or +,- expansion button?)

thanks,
Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
------------------------+---------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: major | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.0 RCs
Keywords: sqlbuilder | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Changes (by neteler):

  * milestone: 6.4.0 => 6.4.4

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
------------------------+---------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: major | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.0 RCs
Keywords: sqlbuilder | Platform: All
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Changes (by neteler):

  * platform: Linux => All

Comment:

Some feedback on the SQL Query builder in GRASS relbr7, winGRASS
7.0.0beta1:

  * the width should be fixed at some point to avoid that the user squeezes
it too much and the buttons "fly around". However, the starting width is
smaller than the content (Linux is ok)
  * on Windows, selecting columns keeps then selected, unselect not
possible. (Linux is ok)
  * Windows falls into "busy" state, i.e. the wxGUI blocks

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
------------------------+---------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: major | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.0 RCs
Keywords: sqlbuilder | Platform: All
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by martinl):

Replying to [comment:5 neteler]:
> * the width should be fixed at some point to avoid that the user
squeezes it too much and the buttons "fly around". However, the starting
width is smaller than the content (Linux is ok)

done in r59773 (backported to G70), G6 doesn't seems to have this problem.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
------------------------+---------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: major | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.0 RCs
Keywords: sqlbuilder | Platform: All
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by martinl):

Replying to [comment:6 martinl]:

> done in r59773 (backported to G70), G6 doesn't seems to have this
problem.

please note that it only fixes min size and not buttons flying around on
Windows.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#734: wxGui sqlbuilder: a few bugs
------------------------+---------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: major | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.0 RCs
Keywords: sqlbuilder | Platform: All
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by martinl):

Replying to [comment:5 neteler]:

> * Windows falls into "busy" state, i.e. the wxGUI blocks

Do you mean when you click on 'Get all values' or 'Get sample values'? It
should be fixed in r59802.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/734#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>