# Path: argos/info.py
# PROJECT_NAME = "Argos"
# 
# VERSION = '0.4.1'
# 
# DEBUGGING = ('-d' in sys.argv or '--debug' in sys.argv)
# 
# 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/utils/cls.py
# def is_a_string(var, allow_none=False):
#     """ Returns True if var is a string (ascii or unicode)
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   True  False
#          'string literal'  True  True
#         u'unicode literal' True  True
# 
#         Also returns True if the var is a numpy string (numpy.string_, numpy.unicode_).
#     """
#     return isinstance(var, six.string_types) or (var is None and allow_none)
# 
# Path: argos/utils/moduleinfo.py
# NOT_IMPLEMENTED_ERR_MSG = "You must override this abstract property/method."
# def versionStrToTuple(versionStr):
#     def name(self):
#     def module(self):
#     def version(self):
#     def verboseVersion(self):
#     def packagePath(self):
#     def __init__(self,
#                  name='',
#                  module=None,
#                  version='',
#                  verboseVersion='',
#                  packagePath=''):
#     def name(self):
#     def module(self):
#     def version(self):
#     def verboseVersion(self):
#     def packagePath(self):
#     def __init__(self, name,
#                  module=None,
#                  version='',
#                  verboseVersion='',
#                  packagePath=''):
#     def __init__(self):
#     def __init__(self, name,
#                  module=None,
#                  verboseVersion=None,
#                  versionAttribute='__version__',
#                  pathAttribute='__path__'):
#     def tryImportModule(self, name):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
# class AbstractModuleInfo(object):
# class ReadOnlyModuleInfo(AbstractModuleInfo):
# class DuckTypingModuleInfo(object):
# class PythonModuleInfo(ReadOnlyModuleInfo):
# class ImportedModuleInfo(ReadOnlyModuleInfo):
# class ArgosModuleInfo(ImportedModuleInfo):
# class H5pyModuleInfo(ImportedModuleInfo):
# class NetCDF4ModuleInfo(ImportedModuleInfo):
# class PillowInfo(ImportedModuleInfo):
# class QtModuleInfo(ImportedModuleInfo):
# 
# Path: argos/widgets/constants.py
# MONO_FONT = 'Monospace'
# 
# FONT_SIZE = 10


import logging
from argos.info import PROJECT_NAME, VERSION, DEBUGGING
from argos.qt import QtCore, QtGui, QtWidgets
from argos.utils.cls import is_a_string
from argos.utils import moduleinfo as mi
from argos.widgets.constants import MONO_FONT, FONT_SIZE
# ancestors public methods and attributes.
# pylint: disable=R0901, R0902, R0904, W0201


class AboutDialog(QtWidgets.QDialog):
    """ Dialog window that shows dependency information.
    """
    def __init__(self, parent=None):
        """ Constructor
        """
        super(AboutDialog, self).__init__(parent=parent)
        self.setModal(True)

        mainLayout = QtWidgets.QVBoxLayout()
        self.setLayout(mainLayout)

        progVersionLabel = QtWidgets.QLabel()
        progVersionLabel.setText("{} {}{}".format(PROJECT_NAME, VERSION,
                                                  ' (debugging-mode)' if DEBUGGING else ''))
        progVersionLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
        mainLayout.addWidget(progVersionLabel)

        font = QtGui.QFont()
        font.setFamily(MONO_FONT)
        font.setFixedPitch(True)
        font.setPointSize(FONT_SIZE)

        self.editor = QtWidgets.QPlainTextEdit()
        self.editor.setReadOnly(True)
        self.editor.setFont(font)

# Path: argos/info.py
# PROJECT_NAME = "Argos"
# 
# VERSION = '0.4.1'
# 
# DEBUGGING = ('-d' in sys.argv or '--debug' in sys.argv)
# 
# 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/utils/cls.py
# def is_a_string(var, allow_none=False):
#     """ Returns True if var is a string (ascii or unicode)
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   True  False
#          'string literal'  True  True
#         u'unicode literal' True  True
# 
#         Also returns True if the var is a numpy string (numpy.string_, numpy.unicode_).
#     """
#     return isinstance(var, six.string_types) or (var is None and allow_none)
# 
# Path: argos/utils/moduleinfo.py
# NOT_IMPLEMENTED_ERR_MSG = "You must override this abstract property/method."
# def versionStrToTuple(versionStr):
#     def name(self):
#     def module(self):
#     def version(self):
#     def verboseVersion(self):
#     def packagePath(self):
#     def __init__(self,
#                  name='',
#                  module=None,
#                  version='',
#                  verboseVersion='',
#                  packagePath=''):
#     def name(self):
#     def module(self):
#     def version(self):
#     def verboseVersion(self):
#     def packagePath(self):
#     def __init__(self, name,
#                  module=None,
#                  version='',
#                  verboseVersion='',
#                  packagePath=''):
#     def __init__(self):
#     def __init__(self, name,
#                  module=None,
#                  verboseVersion=None,
#                  versionAttribute='__version__',
#                  pathAttribute='__path__'):
#     def tryImportModule(self, name):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
# class AbstractModuleInfo(object):
# class ReadOnlyModuleInfo(AbstractModuleInfo):
# class DuckTypingModuleInfo(object):
# class PythonModuleInfo(ReadOnlyModuleInfo):
# class ImportedModuleInfo(ReadOnlyModuleInfo):
# class ArgosModuleInfo(ImportedModuleInfo):
# class H5pyModuleInfo(ImportedModuleInfo):
# class NetCDF4ModuleInfo(ImportedModuleInfo):
# class PillowInfo(ImportedModuleInfo):
# class QtModuleInfo(ImportedModuleInfo):
# 
# Path: argos/widgets/constants.py
# MONO_FONT = 'Monospace'
# 
# FONT_SIZE = 10


# Path: argos/widgets/aboutdialog.py
import logging
from argos.info import PROJECT_NAME, VERSION, DEBUGGING
from argos.qt import QtCore, QtGui, QtWidgets
from argos.utils.cls import is_a_string
from argos.utils import moduleinfo as mi
from argos.widgets.constants import MONO_FONT, FONT_SIZE

# ancestors public methods and attributes.
# pylint: disable=R0901, R0902, R0904, W0201


class AboutDialog(QtWidgets.QDialog):
    """ Dialog window that shows dependency information.
    """
    def __init__(self, parent=None):
        """ Constructor
        """
        super(AboutDialog, self).__init__(parent=parent)
        self.setModal(True)

        mainLayout = QtWidgets.QVBoxLayout()
        self.setLayout(mainLayout)

        progVersionLabel = QtWidgets.QLabel()
        progVersionLabel.setText("{} {}{}".format(PROJECT_NAME, VERSION,
                                                  ' (debugging-mode)' if DEBUGGING else ''))
        progVersionLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
        mainLayout.addWidget(progVersionLabel)

        font = QtGui.QFont()
        font.setFamily(MONO_FONT)
        font.setFixedPitch(True)
        font.setPointSize(FONT_SIZE)

        self.editor = QtWidgets.QPlainTextEdit()
        self.editor.setReadOnly(True)
        self.editor.setFont(font)

        self.editor.setWordWrapMode(QtGui.QTextOption.NoWrap)