Redesign DataSourcePanel & DataSource handling

Issue #430 resolved
Benjamin Jakimow created an issue
  • add QgsBrowser
  • make DataSourceManager a QAbstractItemModel
  • remove QgsMapLayer instances
  • redesign Drag-and-Drop
  • add spezialized filter modes, i.e. QAbstractListModels to fill QComboBoxes, e.g. with “classification raster layers”
  • silent data source detect (no gdal/ogr warnings in case a path cannot be opened)

Comments (26)

  1. Benjamin Jakimow reporter

    @Andreas Janz I added a HubFlowPyObjectTreeNode to enmapbox/gui/datasourcemanager.py . You can now implement the required actions to the context menu

    class HubFlowPyObjectTreeNode(PyObjectTreeNode):
    
        def __init__(self, *args, **kwds):
            super().__init__(*args, **kwds)
    
        def populateContextMenu(self, menu: QMenu):
            # implement your context menu actions here
    
            if isinstance(self.mPyObject, np.ndarray):
                a = menu.addAction('todo: Copy to clipboard')
    

  2. Andreas Janz

    Thanks @Benjamin Jakimow , shall I edit the HubFlowPyObjectTreeNode class and add the functionality? Or do I need to subclass?

  3. Benjamin Jakimow reporter

    It’s already a subclass of PyQbjectTreeNode, so just enhance it as you like.

  4. Andreas Janz

    Thats kind of an ongoing issue. Note sure if we should better break it up into subissues that can actually be resolved. TBD

  5. Benjamin Jakimow reporter

    addresses #430 re-design of data source handling added new DataSourceManager(TreeModel), DataSourceFactory, DataSources based on QgsDataItems

    → <<cset b26b38b4894f>>

  6. Benjamin Jakimow reporter

    addresses #430 refactored DataSourceManager DataSourceManager is not a TreeModel DataSources now QgsDataItem based DataSources do not store permanent QgsMapLayers moved datasource related classes to enmapbox.gui.datasources moved dock view related classes to enmapbox.gui.dataviews (rename docks to views in future?) simplified several routines

    → <<cset 4b03727679cc>>

  7. Benjamin Jakimow reporter

    addresses #430 re-design of data source handling added new DataSourceManager(TreeModel), DataSourceFactory, DataSources based on QgsDataItems

    → <<cset b26b38b4894f>>

  8. Benjamin Jakimow reporter

    addresses #430 refactored DataSourceManager DataSourceManager is not a TreeModel DataSources now QgsDataItem based DataSources do not store permanent QgsMapLayers moved datasource related classes to enmapbox.gui.datasources moved dock view related classes to enmapbox.gui.dataviews (rename docks to views in future?) simplified several routines

    → <<cset 4b03727679cc>>

  9. Log in to comment