#!/usr/bin/env python3

"""
tab_modeswitch_button.py
"""

__author__ = ["Benjamin Mummery", "Tiago Sarmento"]
__credits__ = ["Benjamin Mummery", "Dónal Murray", "Tim Powell", "Tiago Sarmento"]
__license__ = "GPL"
__version__ = "0.0.1"
__maintainer__ = "Tiago Sarmento"
__email__ = "tiago.sarmento@stfc.ac.uk"
__status__ = "Prototype"

from PySide2 import QtCore, QtGui, QtWidgets
from widget_library.ok_cancel_buttons_widget import OkButtonWidget, CancelButtonWidget
import json

# from global_widgets.global_ok_cancel_buttons import okButton, cancelButton


class MessagePopup(QtWidgets.QWidget):
    modeSwitched = QtCore.Signal(str)

    def __init__(self, NativeUI, *args, **kwargs):
        super().__init__(*args, **kwargs)

        vlayout = QtWidgets.QVBoxLayout()
        self.label = QtWidgets.QLabel("messagepopup")
        self.label.setFont(NativeUI.value_font)
        self.label.setStyleSheet("color: " + NativeUI.colors["label_foreground"].name())
        vlayout.addWidget(self.label)

        buttonLayout = QtWidgets.QHBoxLayout()
        self.okButton = OkButtonWidget(NativeUI)
        buttonLayout.addWidget(self.okButton)
        self.cancelButton = CancelButtonWidget(NativeUI)
        self.okButton.setEnabled(True)
        self.cancelButton.setEnabled(True)
        buttonLayout.addWidget(self.cancelButton)
        vlayout.addLayout(buttonLayout)
        self.setLayout(vlayout)

        self.NativeUI = NativeUI

    def setLabelText(self, text):
        self.label.setText(text)