# Path: source/helpers/interface_pandoc.py
# def get_pandoc_options():
#     """
#     Get the Options of the Pandoc help section
#     """
#     settings = QSettings('Pandoc', 'PanConvert')
#     path_pandoc = settings.value('path_pandoc','')
#     if os.path.isfile(path_pandoc):
# 
#         version = get_pandoc_version()
# 
#         if version < 1.18:
# 
#             p = subprocess.Popen(
#                     [path_pandoc, '-h'],
#                     stdin=subprocess.PIPE,
#                     stdout=subprocess.PIPE)
#             help_text = p.communicate()[0].decode().splitlines(True)
# 
# 
#             aux = help_text[15:89]
# 
#             return aux
# 
# 
#         else:
# 
#             p = subprocess.Popen(
#                     [path_pandoc, '-h'],
#                     stdin=subprocess.PIPE,
#                     stdout=subprocess.PIPE)
#             help_text = p.communicate()[0].decode().splitlines(True)
#             aux = help_text
# 
#             return aux
# 
#     else:
#         path_pandoc = get_path_pandoc()
#         path_pandoc = settings.value('path_pandoc','')
#         if not os.path.isfile(path_pandoc):
#             message = error_converter_path()
#             return message
# 
# def get_path_pandoc():
# 
#     settings = QSettings('Pandoc', 'PanConvert')
#     path_pandoc_tmp = settings.value('path_pandoc','')
#     path_pandoc = str(path_pandoc_tmp)
# 
#     if not os.path.isfile(path_pandoc):
# 
#         if platform.system() == 'Darwin' or os.name == 'posix':
#             path_pandoc = which("pandoc")
#             settings.setValue('path_pandoc', path_pandoc)
#             settings.sync()
#         else:
#             path_pandoc = where("pandoc.exe")
#             settings.setValue('path_pandoc', path_pandoc)
#             settings.sync()
# 
# Path: source/gui/panconvert_diag_info.py
# class Ui_Information_Dialog(object):
#     def setupUi(self, Information_Dialog):
#         Information_Dialog.setObjectName("Information_Dialog")
#         Information_Dialog.resize(707, 575)
#         self.gridLayout_2 = QtWidgets.QGridLayout(Information_Dialog)
#         self.gridLayout_2.setObjectName("gridLayout_2")
#         self.gridLayout = QtWidgets.QGridLayout()
#         self.gridLayout.setObjectName("gridLayout")
#         self.ButtonCancel = QtWidgets.QPushButton(Information_Dialog)
#         self.ButtonCancel.setObjectName("ButtonCancel")
#         self.gridLayout.addWidget(self.ButtonCancel, 0, 0, 1, 1)
#         self.ButtonInfo = QtWidgets.QPushButton(Information_Dialog)
#         self.ButtonInfo.setObjectName("ButtonInfo")
#         self.gridLayout.addWidget(self.ButtonInfo, 0, 2, 1, 1)
#         self.ButtonMoreInfo = QtWidgets.QPushButton(Information_Dialog)
#         self.ButtonMoreInfo.setObjectName("ButtonMoreInfo")
#         self.gridLayout.addWidget(self.ButtonMoreInfo, 0, 1, 1, 1)
#         self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1)
#         self.textBrowser = QtWebEngineWidgets.QWebEngineView(Information_Dialog)
#         self.textBrowser.setObjectName("textBrowser")
#         self.gridLayout_2.addWidget(self.textBrowser, 0, 0, 1, 1)
# 
#         self.retranslateUi(Information_Dialog)
#         QtCore.QMetaObject.connectSlotsByName(Information_Dialog)
# 
#     def retranslateUi(self, Information_Dialog):
#         _translate = QtCore.QCoreApplication.translate
#         Information_Dialog.setWindowTitle(_translate("Information_Dialog", "Information"))
#         self.ButtonCancel.setText(_translate("Information_Dialog", "Cancel"))
#         self.ButtonInfo.setText(_translate("Information_Dialog", "Pandoc-Options"))
#         self.ButtonMoreInfo.setText(_translate("Information_Dialog", "More Information"))


from source.helpers.interface_pandoc import get_pandoc_options, get_path_pandoc
from source.gui.panconvert_diag_info import Ui_Information_Dialog
from source.language.messages import *
        self.resize(settings.value("Option_size", QSize(270, 225)))
        self.move(settings.value("Option_pos", QPoint(50, 50)))

        if not os.path.isfile(path_pandoc):
            path_pandoc = get_path_pandoc()
            path_pandoc = settings.value('path_pandoc')

        if os.path.isfile(path_pandoc):
            options =  get_pandoc_options()
            data = '<pre>' + '<br>'.join(options) + '</pre>'
            self.ui.textBrowser.setHtml(data)
        else:
            message = error_converter_path()
            self.ui.textBrowser.setHtml(message)


     def closeEvent(self, event):

        settings = QSettings('Pandoc', 'PanConvert')
        Dialog_Size = settings.value('Dialog_Size')
        if Dialog_Size is True or Dialog_Size == 'true':
            settings.setValue("Option_size", self.size())
            settings.setValue("Option_pos", self.pos())


        settings.sync()
        settings.status()
        InfoDialog.close(self)

     def info(self):

# Path: source/helpers/interface_pandoc.py
# def get_pandoc_options():
#     """
#     Get the Options of the Pandoc help section
#     """
#     settings = QSettings('Pandoc', 'PanConvert')
#     path_pandoc = settings.value('path_pandoc','')
#     if os.path.isfile(path_pandoc):
# 
#         version = get_pandoc_version()
# 
#         if version < 1.18:
# 
#             p = subprocess.Popen(
#                     [path_pandoc, '-h'],
#                     stdin=subprocess.PIPE,
#                     stdout=subprocess.PIPE)
#             help_text = p.communicate()[0].decode().splitlines(True)
# 
# 
#             aux = help_text[15:89]
# 
#             return aux
# 
# 
#         else:
# 
#             p = subprocess.Popen(
#                     [path_pandoc, '-h'],
#                     stdin=subprocess.PIPE,
#                     stdout=subprocess.PIPE)
#             help_text = p.communicate()[0].decode().splitlines(True)
#             aux = help_text
# 
#             return aux
# 
#     else:
#         path_pandoc = get_path_pandoc()
#         path_pandoc = settings.value('path_pandoc','')
#         if not os.path.isfile(path_pandoc):
#             message = error_converter_path()
#             return message
# 
# def get_path_pandoc():
# 
#     settings = QSettings('Pandoc', 'PanConvert')
#     path_pandoc_tmp = settings.value('path_pandoc','')
#     path_pandoc = str(path_pandoc_tmp)
# 
#     if not os.path.isfile(path_pandoc):
# 
#         if platform.system() == 'Darwin' or os.name == 'posix':
#             path_pandoc = which("pandoc")
#             settings.setValue('path_pandoc', path_pandoc)
#             settings.sync()
#         else:
#             path_pandoc = where("pandoc.exe")
#             settings.setValue('path_pandoc', path_pandoc)
#             settings.sync()
# 
# Path: source/gui/panconvert_diag_info.py
# class Ui_Information_Dialog(object):
#     def setupUi(self, Information_Dialog):
#         Information_Dialog.setObjectName("Information_Dialog")
#         Information_Dialog.resize(707, 575)
#         self.gridLayout_2 = QtWidgets.QGridLayout(Information_Dialog)
#         self.gridLayout_2.setObjectName("gridLayout_2")
#         self.gridLayout = QtWidgets.QGridLayout()
#         self.gridLayout.setObjectName("gridLayout")
#         self.ButtonCancel = QtWidgets.QPushButton(Information_Dialog)
#         self.ButtonCancel.setObjectName("ButtonCancel")
#         self.gridLayout.addWidget(self.ButtonCancel, 0, 0, 1, 1)
#         self.ButtonInfo = QtWidgets.QPushButton(Information_Dialog)
#         self.ButtonInfo.setObjectName("ButtonInfo")
#         self.gridLayout.addWidget(self.ButtonInfo, 0, 2, 1, 1)
#         self.ButtonMoreInfo = QtWidgets.QPushButton(Information_Dialog)
#         self.ButtonMoreInfo.setObjectName("ButtonMoreInfo")
#         self.gridLayout.addWidget(self.ButtonMoreInfo, 0, 1, 1, 1)
#         self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1)
#         self.textBrowser = QtWebEngineWidgets.QWebEngineView(Information_Dialog)
#         self.textBrowser.setObjectName("textBrowser")
#         self.gridLayout_2.addWidget(self.textBrowser, 0, 0, 1, 1)
# 
#         self.retranslateUi(Information_Dialog)
#         QtCore.QMetaObject.connectSlotsByName(Information_Dialog)
# 
#     def retranslateUi(self, Information_Dialog):
#         _translate = QtCore.QCoreApplication.translate
#         Information_Dialog.setWindowTitle(_translate("Information_Dialog", "Information"))
#         self.ButtonCancel.setText(_translate("Information_Dialog", "Cancel"))
#         self.ButtonInfo.setText(_translate("Information_Dialog", "Pandoc-Options"))
#         self.ButtonMoreInfo.setText(_translate("Information_Dialog", "More Information"))


# Path: source/dialogs/dialog_options.py
from source.helpers.interface_pandoc import get_pandoc_options, get_path_pandoc
from source.gui.panconvert_diag_info import Ui_Information_Dialog
from source.language.messages import *

        self.resize(settings.value("Option_size", QSize(270, 225)))
        self.move(settings.value("Option_pos", QPoint(50, 50)))

        if not os.path.isfile(path_pandoc):
            path_pandoc = get_path_pandoc()
            path_pandoc = settings.value('path_pandoc')

        if os.path.isfile(path_pandoc):
            options =  get_pandoc_options()
            data = '<pre>' + '<br>'.join(options) + '</pre>'
            self.ui.textBrowser.setHtml(data)
        else:
            message = error_converter_path()
            self.ui.textBrowser.setHtml(message)


     def closeEvent(self, event):

        settings = QSettings('Pandoc', 'PanConvert')
        Dialog_Size = settings.value('Dialog_Size')
        if Dialog_Size is True or Dialog_Size == 'true':
            settings.setValue("Option_size", self.size())
            settings.setValue("Option_pos", self.pos())


        settings.sync()
        settings.status()
        InfoDialog.close(self)

     def info(self):

        options =  get_pandoc_options()