infomanager.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. """
  2. @package datacatalog.infomanager
  3. @brief Class for managing info messages
  4. in Data Catalog
  5. Classes:
  6. - infomanager::DataCatalogInfoManager
  7. (C) 2020 by the GRASS Development Team
  8. This program is free software under the GNU General Public License
  9. (>=v2). Read the file COPYING that comes with GRASS for details.
  10. @author Linda Kladivova
  11. @author Anna Petrasova <kratochanna gmail.com>
  12. @author Vaclav Petras <wenzeslaus gmail.com>
  13. """
  14. import wx
  15. from grass.script import gisenv
  16. class DataCatalogInfoManager:
  17. """Manager for all things related to info bar in Data Catalog"""
  18. def __init__(self, infobar, giface):
  19. self.infoBar = infobar
  20. self._giface = giface
  21. def ShowDataStructureInfo(self, onCreateLocationHandler):
  22. """Show info about the data hierarchy focused on the first-time user"""
  23. buttons = [("Create new Location", onCreateLocationHandler),
  24. ("Learn More", self._onLearnMore)]
  25. message = _(
  26. "GRASS GIS helps you organize your data using Locations (projects) "
  27. "which contain Mapsets (subprojects). All data in one Location is "
  28. "in the same coordinate reference system (CRS).\n\n"
  29. "You are currently in Mapset PERMANENT in default Location {loc} "
  30. "which uses WGS 84 (EPSG:4326). Consider creating a new Location with a CRS "
  31. "specific to your area. You can do it now or anytime later from "
  32. "the toolbar above."
  33. ).format(loc=gisenv()['LOCATION_NAME'])
  34. self.infoBar.ShowMessage(message, wx.ICON_INFORMATION, buttons)
  35. def _onLearnMore(self, event):
  36. self._giface.Help(entry="grass_database")