Exemple #1
0
    def __init__(self,
                 parent,
                 giface=None,
                 id=wx.ID_ANY,
                 title=_("Data catalog"),
                 name='catalog',
                 **kwargs):
        """Panel constructor  """
        self.showNotification = Signal('DataCatalog.showNotification')
        self.changeMapset = Signal('DataCatalog.changeMapset')
        self.changeLocation = Signal('DataCatalog.changeLocation')
        self.parent = parent
        self.baseTitle = title
        wx.Panel.__init__(self, parent=parent, id=id, **kwargs)
        self.SetName("DataCatalog")

        Debug.msg(1, "DataCatalog.__init__()")

        # toolbar
        self.toolbar = DataCatalogToolbar(parent=self)

        # tree with layers
        self.tree = DataCatalogTree(self, giface=giface)
        self.thread = gThread()
        self._loaded = False
        self.tree.showNotification.connect(self.showNotification)
        self.tree.changeMapset.connect(self.changeMapset)
        self.tree.changeLocation.connect(self.changeLocation)

        # some layout
        self._layout()
Exemple #2
0
    def __init__(self, parent, giface=None):
        wx.Frame.__init__(self,
                          parent=parent,
                          title=_('GRASS GIS Data Catalog'))
        self.SetName("DataCatalog")
        self.SetIcon(
            wx.Icon(os.path.join(ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))

        self._giface = giface
        self.panel = wx.Panel(self)

        self.toolbar = DataCatalogToolbar(parent=self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != 'darwin':
            self.SetToolBar(self.toolbar)

        # tree
        self.tree = DataCatalogTree(parent=self.panel, giface=self._giface)
        self.tree.ReloadTreeItems()

        # buttons
        self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE)
        self.btnClose.SetToolTip(_("Close GRASS GIS Data Catalog"))
        self.btnClose.SetDefault()

        # events
        self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

        self._layout()
Exemple #3
0
    def __init__(
            self,
            parent,
            giface=None,
            id=wx.ID_ANY,
            title=_("Data catalog"),
            name="catalog",
            **kwargs,
    ):
        """Panel constructor"""
        self.showNotification = Signal("DataCatalog.showNotification")
        self.parent = parent
        self.baseTitle = title
        self.giface = giface
        self._startLoadingTime = 0
        wx.Panel.__init__(self, parent=parent, id=id, **kwargs)
        self.SetName("DataCatalog")

        Debug.msg(1, "DataCatalog.__init__()")

        # toolbar
        self.toolbar = DataCatalogToolbar(parent=self)

        # tree with layers
        self.tree = DataCatalogTree(self, giface=giface)
        self.tree.showNotification.connect(self.showNotification)

        # infobar for data catalog
        delay = 2000
        self.infoBar = InfoBar(self)
        self.giface.currentMapsetChanged.connect(self.dismissInfobar)

        # infobar manager for data catalog
        self.infoManager = DataCatalogInfoManager(infobar=self.infoBar,
                                                  giface=self.giface)
        self.tree.showImportDataInfo.connect(self.showImportDataInfo)
        self.tree.loadingDone.connect(self._loadingDone)

        # some layout
        self._layout()

        # show infobar for first-time user if applicable
        if is_first_time_user():
            # show data structure infobar for first-time user
            wx.CallLater(delay, self.showDataStructureInfo)

        # show infobar if last used mapset is not usable
        if is_fallback_session():
            # get reason why last used mapset is not usable
            last_mapset_path = gisenv()["LAST_MAPSET_PATH"]
            self.reason_id = get_reason_id_mapset_not_usable(last_mapset_path)
            if self.reason_id in ("non-existent", "invalid",
                                  "different-owner"):
                # show non-standard situation info
                wx.CallLater(delay, self.showFallbackSessionInfo)
            elif self.reason_id == "locked":
                # show info allowing to switch to locked mapset
                wx.CallLater(delay, self.showLockedMapsetInfo)
Exemple #4
0
    def __init__(self,
                 parent,
                 giface=None,
                 id=wx.ID_ANY,
                 title=_("Data catalog"),
                 name='catalog',
                 **kwargs):
        """Panel constructor  """
        self.showNotification = Signal('DataCatalog.showNotification')
        self.parent = parent
        self.baseTitle = title
        self.giface = giface
        wx.Panel.__init__(self, parent=parent, id=id, **kwargs)
        self.SetName("DataCatalog")

        Debug.msg(1, "DataCatalog.__init__()")

        # toolbar
        self.toolbar = DataCatalogToolbar(parent=self)

        # tree with layers
        self.tree = DataCatalogTree(self, giface=giface)
        self.tree.showNotification.connect(self.showNotification)

        # infobar for data catalog
        self.infoBar = InfoBar(self)

        # infobar manager for data catalog
        self.infoManager = DataCatalogInfoManager(infobar=self.infoBar,
                                                  giface=self.giface)
        self.tree.showImportDataInfo.connect(self.showImportDataInfo)

        # some layout
        self._layout()

        # show data structure infobar for first-time user with proper layout
        if is_current_mapset_in_demolocation():
            wx.CallLater(2000, self.showDataStructureInfo)
Exemple #5
0
    def __init__(self, parent, giface=None):
        wx.Frame.__init__(self,
                          parent=parent,
                          title=_('GRASS GIS Data Catalog'))
        self.SetName("DataCatalog")
        self.SetIcon(
            wx.Icon(os.path.join(ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))

        self._giface = giface
        self.panel = wx.Panel(self)

        self.toolbar = DataCatalogToolbar(parent=self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != 'darwin':
            self.SetToolBar(self.toolbar)

        # tree
        self.tree = DataCatalogTree(parent=self.panel, giface=self._giface)
        self.tree.InitTreeItems()
        self.tree.UpdateCurrentDbLocationMapsetNode()
        self.tree.ExpandCurrentMapset()
        self.tree.changeMapset.connect(
            lambda mapset: self.ChangeDbLocationMapset(location=None,
                                                       mapset=mapset))
        self.tree.changeLocation.connect(
            lambda mapset, location, dbase: self.ChangeDbLocationMapset(
                dbase=dbase, location=location, mapset=mapset))

        # buttons
        self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE)
        self.btnClose.SetToolTip(_("Close GRASS GIS Data Catalog"))
        self.btnClose.SetDefault()

        # events
        self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

        self._layout()