#!/usr/bin/python
#coding=utf8

from PyQt4.QtGui import QDialog,QDesktopWidget
from PyQt4.QtCore import Qt,SIGNAL

from ui_qss.logoutQss import LogoutQss

class Logout (LogoutQss):

    def __init__(self, parent=None):
        super(Logout, self).__init__(parent)

        self.connect(self.btn_cancle,SIGNAL("clicked()"),self.close)
        self.connect(self.btn_close,SIGNAL("clicked()"),self.close)
        self.connect(self.btn_ok,SIGNAL("clicked()"),self.__sendLogoutSingnal)

    def __sendLogoutSingnal(self):
        try:
            self.emit(SIGNAL("userlogout"))
        finally:
            pass
            #self.close()

##############################
#   单元测试
##############################
if __name__ == "__main__":
    from PyQt4 import QtGui
    from os import environ
    environ["WIN_UI_IMAGES_PATH"]="../../../images"
    app = QtGui.QApplication([])
    win = Logout()
    win.show()
    app.exec_()