# 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 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
# 
# 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))


import sys
from logging import getLogger
from PyQt5.Qt import QLineEdit, Qt, QIcon, QLabel, QVBoxLayout, QWidget, QDialog, QPushButton
from alignak_app.utils.config import settings
from alignak_app.qobjects.common.widgets import get_logo_widget, center_widget
        server_widget = QWidget()
        server_widget.setObjectName('dialog')
        server_layout = QVBoxLayout(server_widget)

        # Title
        title_lbl = QLabel(_('Alignak Backend'))
        title_lbl.setObjectName('itemtitle')
        server_layout.addWidget(title_lbl)
        server_layout.setAlignment(title_lbl, Qt.AlignTop)

        # Description
        desc_label = QLabel(
            _('Here you can define alignak settings. Be sure to enter a valid address.')
        )
        desc_label.setWordWrap(True)
        server_layout.addWidget(desc_label)

        # Server URL
        server_lbl = QLabel(_('Server'))
        server_layout.addWidget(server_lbl)

        self.server_url.setText(settings.get_config('Alignak', 'url'))
        self.server_url.setPlaceholderText(_('alignak backend url...'))
        self.server_url.setFixedHeight(25)
        server_layout.addWidget(self.server_url)

        # Server Port
        port_lbl = QLabel(_('Port'))
        server_layout.addWidget(port_lbl)


# 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 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
# 
# 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))


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

        server_widget = QWidget()
        server_widget.setObjectName('dialog')
        server_layout = QVBoxLayout(server_widget)

        # Title
        title_lbl = QLabel(_('Alignak Backend'))
        title_lbl.setObjectName('itemtitle')
        server_layout.addWidget(title_lbl)
        server_layout.setAlignment(title_lbl, Qt.AlignTop)

        # Description
        desc_label = QLabel(
            _('Here you can define alignak settings. Be sure to enter a valid address.')
        )
        desc_label.setWordWrap(True)
        server_layout.addWidget(desc_label)

        # Server URL
        server_lbl = QLabel(_('Server'))
        server_layout.addWidget(server_lbl)

        self.server_url.setText(settings.get_config('Alignak', 'url'))
        self.server_url.setPlaceholderText(_('alignak backend url...'))
        self.server_url.setFixedHeight(25)
        server_layout.addWidget(self.server_url)

        # Server Port
        port_lbl = QLabel(_('Port'))
        server_layout.addWidget(port_lbl)


        cur_port = settings.get_config('Alignak', 'backend').split(':')[2]