# Path: alignak_app/utils/config.py
# class Settings(object):
#     def __init__(self):
#     def init_config(self):
#     def get_config(self, section, option, boolean=False):
#     def set_config(self, section, option, new_value):
#     def get_image(self, name):
#     def init_css(self):
# def open_url(endpoint='login'):  # pragma: no cover
# def get_url_endpoint_from_icon_name(icon_name):
# 
# Path: alignak_app/qobjects/common/widgets.py
# def center_widget(widget):
#     """
#     Center QWidget
# 
#     :param widget: widget to center
#     :type widget: QWidget
#     """
# 
#     screen = QApplication.desktop().screenNumber(QApplication.desktop().cursor().pos())
#     center = QApplication.desktop().screenGeometry(screen).center()
#     widget.move(center.x() - (widget.width() / 2), center.y() - (widget.height() / 2))
# 
# def get_logo_widget(child_widget, title, exitapp=False):
#     """
#     Return LogoQWidget with alignak logo
# 
#     :param child_widget: widget child of LogoQWidget, needed for action button and layout
#     :type child_widget: QWidget
#     :param title: title of widget
#     :type title: str
#     :param exitapp: define if close button close application or just child QWidget
#     :type exitapp: bool
#     :return: Logo QWidget with buttons and child QWidget
#     :rtype: QWidget
#     """
# 
#     logo_widget = LogoQWidget()
#     logo_widget.initialize(child_widget, title, exitapp)
# 
#     return logo_widget


from logging import getLogger
from PyQt5.Qt import QTextEdit, Qt, QIcon, QDialog, QVBoxLayout, QWidget, QLabel, QPushButton
from PyQt5.Qt import QLineEdit, QRegExpValidator, QRegExp
from alignak_app.utils.config import settings
from alignak_app.qobjects.common.widgets import center_widget, get_logo_widget

    def __init__(self, parent=None):
        super(MessageQDialog, self).__init__(parent)
        self.setWindowFlags(Qt.FramelessWindowHint)
        self.setStyleSheet(settings.css_style)
        self.setWindowIcon(QIcon(settings.get_image('icon')))
        self.setFixedSize(500, 200)
        self.setObjectName('dialog')

    def initialize(self, widgettitle, dialog, title, text):
        """
        Initialize QDialog for PasswordDialog

        :param widgettitle: title of the QDialog
        :type widgettitle: str
        :param dialog: type of dialog ('text' or 'error')
        :type dialog: str
        :param title: title of text to display
        :type title: str
        :param text: text to display
        :type text: str
        """

        center_widget(self)

        # Main status_layout
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(main_layout)


# Path: alignak_app/utils/config.py
# class Settings(object):
#     def __init__(self):
#     def init_config(self):
#     def get_config(self, section, option, boolean=False):
#     def set_config(self, section, option, new_value):
#     def get_image(self, name):
#     def init_css(self):
# def open_url(endpoint='login'):  # pragma: no cover
# def get_url_endpoint_from_icon_name(icon_name):
# 
# Path: alignak_app/qobjects/common/widgets.py
# def center_widget(widget):
#     """
#     Center QWidget
# 
#     :param widget: widget to center
#     :type widget: QWidget
#     """
# 
#     screen = QApplication.desktop().screenNumber(QApplication.desktop().cursor().pos())
#     center = QApplication.desktop().screenGeometry(screen).center()
#     widget.move(center.x() - (widget.width() / 2), center.y() - (widget.height() / 2))
# 
# def get_logo_widget(child_widget, title, exitapp=False):
#     """
#     Return LogoQWidget with alignak logo
# 
#     :param child_widget: widget child of LogoQWidget, needed for action button and layout
#     :type child_widget: QWidget
#     :param title: title of widget
#     :type title: str
#     :param exitapp: define if close button close application or just child QWidget
#     :type exitapp: bool
#     :return: Logo QWidget with buttons and child QWidget
#     :rtype: QWidget
#     """
# 
#     logo_widget = LogoQWidget()
#     logo_widget.initialize(child_widget, title, exitapp)
# 
#     return logo_widget


# Path: alignak_app/qobjects/common/dialogs.py
from logging import getLogger
from PyQt5.Qt import QTextEdit, Qt, QIcon, QDialog, QVBoxLayout, QWidget, QLabel, QPushButton
from PyQt5.Qt import QLineEdit, QRegExpValidator, QRegExp
from alignak_app.utils.config import settings
from alignak_app.qobjects.common.widgets import center_widget, get_logo_widget


    def __init__(self, parent=None):
        super(MessageQDialog, self).__init__(parent)
        self.setWindowFlags(Qt.FramelessWindowHint)
        self.setStyleSheet(settings.css_style)
        self.setWindowIcon(QIcon(settings.get_image('icon')))
        self.setFixedSize(500, 200)
        self.setObjectName('dialog')

    def initialize(self, widgettitle, dialog, title, text):
        """
        Initialize QDialog for PasswordDialog

        :param widgettitle: title of the QDialog
        :type widgettitle: str
        :param dialog: type of dialog ('text' or 'error')
        :type dialog: str
        :param title: title of text to display
        :type title: str
        :param text: text to display
        :type text: str
        """

        center_widget(self)

        # Main status_layout
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(main_layout)


        main_layout.addWidget(get_logo_widget(self, widgettitle))