#coding=utf-8
from PyQt4.QtGui import QWidget
from ui.ui_log_dialog import Ui_Form
from PyQt4 import QtCore, QtGui
from common import common_run

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)


class LogoutQss (QWidget, Ui_Form):
    def __init__(self, parent=None):
        super(LogoutQss, self).__init__(parent)
        self.setupUi(self)

    def set_lable_log_text(self,v):
        __font_size = str(int(common_run.get_width(14.0)))
        self.label_up_log.setText(_translate("Form", "<html><head/><body><p align=\"center\"><span style=\" font-size:"+__font_size+"pt;\">"+v+"</span></p></body></html>", None))