# Path: argos/qt/bindings.py
# API_PYSIDE2 = 'pyside2'
# API_PYQT5 = 'pyqt5'
# ALL_API = [API_PYQT5, API_PYSIDE2]
# QT_API_NAME = os.environ.get('QT_API')
#     QT_API_NAME = None
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
# 
# Path: argos/inspector/registry.py
# class InspectorRegItem(BaseRegItem):
#     """ Class to keep track of a registered Inspector.
#         Has a create() method that functions as an Inspector factory.
#     """
#     FIELDS  = BaseRegItem.FIELDS[:1] + ['shortCut'] + BaseRegItem.FIELDS[1:]
#     TYPES   = BaseRegItem.TYPES[:1] + [RegType.ShortCut] + BaseRegItem.TYPES[1:]
#     LABELS  = BaseRegItem.LABELS[:1] + ['Shortcut'] + BaseRegItem.LABELS[1:]
#     STRETCH = BaseRegItem.STRETCH[:1] + [False] + BaseRegItem.STRETCH[1:]
# 
# 
#     def __init__(self, name='', absClassName='', pythonPath='', shortCut=''):
#         """ Constructor. See the ClassRegItem class doc string for the parameter help.
#         """
#         super(InspectorRegItem, self).__init__(name=name, absClassName=absClassName,
#                                                pythonPath=pythonPath)
#         self._data['shortCut'] = shortCut
# 
# 
#     @property
#     def shortCut(self):
#         """ Keyboard short cut
#         """
#         return self._data['shortCut']
# 
# 
#     @property
#     def axesNames(self):
#         """ The axes names of the inspector.
#         """
#         return [] if self.cls is None else self.cls.axesNames()
# 
#     @property
#     def nDims(self):
#         """ The number of axes of this inspector.
#         """
#         return len(self.axesNames)
# 
# 
#     def create(self, collector, tryImport=True):
#         """ Creates an inspector of the registered and passes the collector to the constructor.
#             Tries to import the class if tryImport is True.
#             Raises ImportError if the class could not be imported.
#         """
#         cls = self.getClass(tryImport=tryImport)
#         if not self.successfullyImported:
#             raise ImportError("Class not successfully imported: {}".format(self.exception))
#         return cls(collector)
# 
# Path: argos/widgets/constants.py
# DOCK_MARGIN  = 0
# 
# DOCK_SPACING = 0
# 
# Path: argos/widgets/misc.py
# def setWidgetSizePolicy(widget, hor=None, ver=None):
#     """ Sets horizontal and/or vertical size policy on a widget
#     """
#     sizePolicy = widget.sizePolicy()
#     logger.debug("widget {} size policy Befor: {} {}"
#                  .format(widget, sizePolicy.horizontalPolicy(), sizePolicy.verticalPolicy()))
# 
#     if hor is not None:
#         sizePolicy.setHorizontalPolicy(hor)
# 
#     if ver is not None:
#         sizePolicy.setVerticalPolicy(ver)
# 
#     widget.setSizePolicy(sizePolicy)
# 
#     sizePolicy = widget.sizePolicy()
#     logger.debug("widget {} size policy AFTER: {} {}"
#                  .format(widget, sizePolicy.horizontalPolicy(), sizePolicy.verticalPolicy()))


import logging
from argos.qt import QtWidgets, QtSlot, Qt
from argos.inspector.registry import InspectorRegItem
from argos.widgets.constants import DOCK_MARGIN, DOCK_SPACING
from argos.widgets.misc import setWidgetSizePolicy

""" Inspector Selection Pane
"""



logger = logging.getLogger(__name__)

NO_INSPECTOR_LABEL = '<No Inspector>'


class InspectorSelectionPane(QtWidgets.QFrame):
    """ Shows the attributes of the selected repo tree item
    """

    def __init__(self, inspectorActionGroup, parent=None):
        super(InspectorSelectionPane, self).__init__(parent=parent)

        # self.setFrameShape(QtWidgets.QFrame.Box)
        self.menuButton = QtWidgets.QPushButton(NO_INSPECTOR_LABEL)
        self.menuButton.setMinimumWidth(10)

        inspectorMenu = QtWidgets.QMenu("Change Inspector", parent=self.menuButton)
        for action in inspectorActionGroup.actions():
            inspectorMenu.addAction(action)
        self.menuButton.setMenu(inspectorMenu)

        self.messageLabel = QtWidgets.QLabel("")
        self.messageLabel.setObjectName("message_label")
        self.messageLabel.setFrameStyle(QtWidgets.QFrame.Panel)

# Path: argos/qt/bindings.py
# API_PYSIDE2 = 'pyside2'
# API_PYQT5 = 'pyqt5'
# ALL_API = [API_PYQT5, API_PYSIDE2]
# QT_API_NAME = os.environ.get('QT_API')
#     QT_API_NAME = None
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
# 
# Path: argos/inspector/registry.py
# class InspectorRegItem(BaseRegItem):
#     """ Class to keep track of a registered Inspector.
#         Has a create() method that functions as an Inspector factory.
#     """
#     FIELDS  = BaseRegItem.FIELDS[:1] + ['shortCut'] + BaseRegItem.FIELDS[1:]
#     TYPES   = BaseRegItem.TYPES[:1] + [RegType.ShortCut] + BaseRegItem.TYPES[1:]
#     LABELS  = BaseRegItem.LABELS[:1] + ['Shortcut'] + BaseRegItem.LABELS[1:]
#     STRETCH = BaseRegItem.STRETCH[:1] + [False] + BaseRegItem.STRETCH[1:]
# 
# 
#     def __init__(self, name='', absClassName='', pythonPath='', shortCut=''):
#         """ Constructor. See the ClassRegItem class doc string for the parameter help.
#         """
#         super(InspectorRegItem, self).__init__(name=name, absClassName=absClassName,
#                                                pythonPath=pythonPath)
#         self._data['shortCut'] = shortCut
# 
# 
#     @property
#     def shortCut(self):
#         """ Keyboard short cut
#         """
#         return self._data['shortCut']
# 
# 
#     @property
#     def axesNames(self):
#         """ The axes names of the inspector.
#         """
#         return [] if self.cls is None else self.cls.axesNames()
# 
#     @property
#     def nDims(self):
#         """ The number of axes of this inspector.
#         """
#         return len(self.axesNames)
# 
# 
#     def create(self, collector, tryImport=True):
#         """ Creates an inspector of the registered and passes the collector to the constructor.
#             Tries to import the class if tryImport is True.
#             Raises ImportError if the class could not be imported.
#         """
#         cls = self.getClass(tryImport=tryImport)
#         if not self.successfullyImported:
#             raise ImportError("Class not successfully imported: {}".format(self.exception))
#         return cls(collector)
# 
# Path: argos/widgets/constants.py
# DOCK_MARGIN  = 0
# 
# DOCK_SPACING = 0
# 
# Path: argos/widgets/misc.py
# def setWidgetSizePolicy(widget, hor=None, ver=None):
#     """ Sets horizontal and/or vertical size policy on a widget
#     """
#     sizePolicy = widget.sizePolicy()
#     logger.debug("widget {} size policy Befor: {} {}"
#                  .format(widget, sizePolicy.horizontalPolicy(), sizePolicy.verticalPolicy()))
# 
#     if hor is not None:
#         sizePolicy.setHorizontalPolicy(hor)
# 
#     if ver is not None:
#         sizePolicy.setVerticalPolicy(ver)
# 
#     widget.setSizePolicy(sizePolicy)
# 
#     sizePolicy = widget.sizePolicy()
#     logger.debug("widget {} size policy AFTER: {} {}"
#                  .format(widget, sizePolicy.horizontalPolicy(), sizePolicy.verticalPolicy()))


# Path: argos/inspector/selectionpane.py
import logging
from argos.qt import QtWidgets, QtSlot, Qt
from argos.inspector.registry import InspectorRegItem
from argos.widgets.constants import DOCK_MARGIN, DOCK_SPACING
from argos.widgets.misc import setWidgetSizePolicy


""" Inspector Selection Pane
"""



logger = logging.getLogger(__name__)

NO_INSPECTOR_LABEL = '<No Inspector>'


class InspectorSelectionPane(QtWidgets.QFrame):
    """ Shows the attributes of the selected repo tree item
    """

    def __init__(self, inspectorActionGroup, parent=None):
        super(InspectorSelectionPane, self).__init__(parent=parent)

        # self.setFrameShape(QtWidgets.QFrame.Box)
        self.menuButton = QtWidgets.QPushButton(NO_INSPECTOR_LABEL)
        self.menuButton.setMinimumWidth(10)

        inspectorMenu = QtWidgets.QMenu("Change Inspector", parent=self.menuButton)
        for action in inspectorActionGroup.actions():
            inspectorMenu.addAction(action)
        self.menuButton.setMenu(inspectorMenu)

        self.messageLabel = QtWidgets.QLabel("")
        self.messageLabel.setObjectName("message_label")
        self.messageLabel.setFrameStyle(QtWidgets.QFrame.Panel)

        self.messageLabel.setFrameShadow(QtWidgets.QFrame.Sunken)