# Path: PyContact/core/LoadConfiguration.py
# class Configuration(object):
#     """Sets the current configuration."""
#     def __init__(self, psf, dcd, cutoff, hbondcutoff, hbondcutangle, sel1text, sel2text):
#         super(Configuration, self).__init__()
#         self.psf = psf
#         self.dcd = dcd
#         self.cutoff = cutoff
#         self.hbondcutoff = hbondcutoff
#         self.hbondcutangle = hbondcutangle
#         self.sel1text = sel1text
#         self.sel2text = sel2text
# 
# Path: PyContact/gui/HelpButton.py
# class HelpButton(PicButton):
#     def __init__(self, parent=None):
#         helpImage = QImage("/home/max/help.png")
#         helpPixmap = QPixmap.fromImage(helpImage)
#         super(HelpButton, self).__init__(helpPixmap, parent)


from PyQt5.QtWidgets import QDialog, QGridLayout, QPushButton, QLabel, QLineEdit, QDialogButtonBox, QFileDialog, QCheckBox
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QDoubleValidator
from ..core.LoadConfiguration import Configuration
from .HelpButton import HelpButton
        grid.addWidget(self.cutoffHbondField, 5, 1)
        grid.addWidget(self.selection1Field, 6, 1)
        grid.addWidget(self.selection2Field, 7, 1)

        # OK and Cancel buttons
        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
            Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        grid.addWidget(buttons, 8, 0)

    def pick_psf(self):
        """Pick topology file."""
        psfname = QFileDialog.getOpenFileNames(self, "Open topology")
        for file in psfname[0]:
            self.psf = file
            self.topFileDisplay.setText(self.psf.split("/")[-1])
            break

    def pick_dcd(self):
        """Pick trajectory file."""
        dcdname = QFileDialog.getOpenFileNames(self, "Open trajectory")
        for file in dcdname[0]:
            self.dcd = file
            self.trajFileDisplay.setText(self.dcd.split("/")[-1])
            break

    def configuration(self):
        """Returns the chosen configuration."""

# Path: PyContact/core/LoadConfiguration.py
# class Configuration(object):
#     """Sets the current configuration."""
#     def __init__(self, psf, dcd, cutoff, hbondcutoff, hbondcutangle, sel1text, sel2text):
#         super(Configuration, self).__init__()
#         self.psf = psf
#         self.dcd = dcd
#         self.cutoff = cutoff
#         self.hbondcutoff = hbondcutoff
#         self.hbondcutangle = hbondcutangle
#         self.sel1text = sel1text
#         self.sel2text = sel2text
# 
# Path: PyContact/gui/HelpButton.py
# class HelpButton(PicButton):
#     def __init__(self, parent=None):
#         helpImage = QImage("/home/max/help.png")
#         helpPixmap = QPixmap.fromImage(helpImage)
#         super(HelpButton, self).__init__(helpPixmap, parent)


# Path: PyContact/gui/Dialogues.py
from PyQt5.QtWidgets import QDialog, QGridLayout, QPushButton, QLabel, QLineEdit, QDialogButtonBox, QFileDialog, QCheckBox
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QDoubleValidator
from ..core.LoadConfiguration import Configuration
from .HelpButton import HelpButton

        grid.addWidget(self.cutoffHbondField, 5, 1)
        grid.addWidget(self.selection1Field, 6, 1)
        grid.addWidget(self.selection2Field, 7, 1)

        # OK and Cancel buttons
        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
            Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        grid.addWidget(buttons, 8, 0)

    def pick_psf(self):
        """Pick topology file."""
        psfname = QFileDialog.getOpenFileNames(self, "Open topology")
        for file in psfname[0]:
            self.psf = file
            self.topFileDisplay.setText(self.psf.split("/")[-1])
            break

    def pick_dcd(self):
        """Pick trajectory file."""
        dcdname = QFileDialog.getOpenFileNames(self, "Open trajectory")
        for file in dcdname[0]:
            self.dcd = file
            self.trajFileDisplay.setText(self.dcd.split("/")[-1])
            break

    def configuration(self):
        """Returns the chosen configuration."""

        config = Configuration(self.psf, self.dcd, float(self.cutoffField.text()), float(self.cutoffHbondField.text()),