Opened 5 years ago

Closed 4 years ago

#3510 closed defect (fixed)

wxpython 4: fix warnings for Attribute Table Manager

Reported by: annakrat Owned by: grass-dev@…
Priority: minor Milestone: 7.6.0
Component: wxGUI Version: svn-trunk
Keywords: wxpython 4, attribute table Cc:
CPU: Unspecified Platform: Linux

Description

When Attribute Table Manager is opened, bunch of wxPyDeprecationWarning come up. Some of them can be solved by using wrapped classes in gui/wxpython/gui_core/wrap.py. Some new wrapped classes need to be created to solve these issues by calling the right API depending on wxPython version.

/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:1190: wxPyDeprecationWarning:
Call to deprecated item. Use SetToolTip instead.
  _("Apply SELECT statement and reload data records"))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:1214: wxPyDeprecationWarning:
Call to deprecated item. Use SetToolTip instead.
  "MULTILANE = 'no' AND OBJECTID < 10")
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:1240: wxPyDeprecationWarning:
Call to deprecated item. Use SetToolTip instead.
  "SELECT * FROM roadsmajor WHERE MULTILANE = 'no' AND
OBJECTID < 10")
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2908: wxPyDeprecationWarning:
Call to deprecated item. Use InsertItem instead.
  index = self.InsertStringItem(i, str(column))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2909: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 0, str(column))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2910: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 1,
str(self.table[column]['type']))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2911: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 2,
str(self.table[column]['length']))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2966: wxPyDeprecationWarning:
Call to deprecated item. Use InsertItem instead.
  index = self.InsertStringItem(i, str(layer))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2967: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 0, str(layer))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2972: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 1, driver)
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2973: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 2, database)
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2974: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 3, table)
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:2975: wxPyDeprecationWarning:
Call to deprecated item. Use SetItem instead.
  self.SetStringItem(index, 4, key)
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/base.py:3122: wxPyDeprecationWarning:
Call to deprecated item. Use SetToolTip instead.
  _("You need to add categories " "by v.category module."))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/manager.py:140:
wxPyDeprecationWarning: Call to deprecated item. Use
SetToolTip instead.
  self.btnClose.SetToolTipString(_("Close Attribute Table
Manager"))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/manager.py:143:
wxPyDeprecationWarning: Call to deprecated item. Use
SetToolTip instead.
  _("Reload currently selected attribute data"))
/home/anna/dev/grass/trunk2/dist.x86_64-pc-linux-
gnu/gui/wxpython/dbmgr/manager.py:146:
wxPyDeprecationWarning: Call to deprecated item. Use
SetToolTip instead.
  _("Reload all attribute data (drop current selection)"))

Attachments (1)

patch.diff (7.0 KB ) - added by sanjeet 5 years ago.
Patch file to fix the deprecation warnings/messages for Attribute Table Manager. (Added CheckBox class in wrap.py)

Download all attachments as: .zip

Change History (5)

comment:1 by annakrat, 5 years ago

Thank you, I just have one note, here:

self.addLayerWidgets['addCat'][0].SetToolTip(wx.ToolTip(

it would be better to just use SetToolTip, in this case the widget is wx.CheckBox, so create a new class CheckBox in wrap.py similarly to other classes there and then you won't need to use wx.ToolTip.

Please upload a new patch with this change and I will then apply it.

by sanjeet, 5 years ago

Attachment: patch.diff added

Patch file to fix the deprecation warnings/messages for Attribute Table Manager. (Added CheckBox class in wrap.py)

comment:2 by sanjeet, 5 years ago

I've updated the patch file.

comment:3 by annakrat, 5 years ago

Thank you, I applied the patch in r72331. I will keep this open until I backport it.

comment:4 by annakrat, 4 years ago

Resolution: fixed
Status: newclosed

Backported in r72625.

Note: See TracTickets for help on using tickets.