# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'UI.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
import shutil
import os

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1200, 800)
        MainWindow.setFont(QtGui.QFont("Microsoft YaHei"))
        self.setWindowFlags(QtCore.Qt.WindowMinimizeButtonHint | QtCore.Qt.WindowCloseButtonHint)
        MainWindow.setFixedSize(MainWindow.width(), MainWindow.height())

        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.centralwidget.setStyleSheet("background-image:url(./icons/background.png);")

        self.faceLabel = QtWidgets.QLabel(self.centralwidget)
        self.faceLabel.setGeometry(QtCore.QRect(50, 200, 300, 400))
        self.faceLabel.setText("")
        self.faceLabel.setScaledContents(False)
        self.faceLabel.setObjectName("faceLabel")

        self.facePushButton = QtWidgets.QPushButton(QtGui.QIcon("./icons/choose.png"), "Choose face picture",self.centralwidget)
        self.facePushButton.setGeometry(QtCore.QRect(125, 610, 180, 50))
        self.facePushButton.setObjectName("facePushButton")
        self.facePushButton.setStyleSheet("font-size:15px;font-weight:600;background-image:url(./icons/button.png);border-radius:10px;border:2px solid gray;border-style:outset;")

        self.swapPushButton = QtWidgets.QPushButton(QtGui.QIcon("./icons/swap.png"), "Swap", self.centralwidget)
        self.swapPushButton.setGeometry(QtCore.QRect(545, 700, 110, 40))
        self.swapPushButton.setObjectName("swapPushButton")
        self.swapPushButton.setStyleSheet("font-size:20px;font-weight:600;background-image:url(./icons/button.png);border-radius:10px;border:2px solid gray;border-style:outset;")

        self.titleLabel = QtWidgets.QLabel(self.centralwidget)
        self.titleLabel.setGeometry(QtCore.QRect(350, 20, 500, 100))
        self.titleLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.titleLabel.setObjectName("titleLabel")
        self.titleLabel.setStyleSheet("border-radius: 30%;")

        self.faceTitleLabel = QtWidgets.QLabel(self.centralwidget)
        self.faceTitleLabel.setGeometry(QtCore.QRect(50, 130, 300, 50))
        self.faceTitleLabel.setObjectName("faceTitleLabel")
        self.faceTitleLabel.setStyleSheet("border-radius:10px;border:2px solid gray;border-style:outset;")

        self.savePushButton = QtWidgets.QPushButton(QtGui.QIcon("./icons/save.png"), "Save result as", self.centralwidget)
        self.savePushButton.setGeometry(QtCore.QRect(525, 610, 180, 50))
        self.savePushButton.setObjectName("savePushButton")
        self.savePushButton.setStyleSheet("font-size:20px;font-weight:600;background-image:url(./icons/button.png);border-radius:10px;border:2px solid gray;border-style:outset;")

        self.headLabel = QtWidgets.QLabel(self.centralwidget)
        self.headLabel.setGeometry(QtCore.QRect(850, 200, 300, 400))
        self.headLabel.setText("")
        self.headLabel.setScaledContents(False)
        self.headLabel.setObjectName("headLabel")

        self.headTitleLabel = QtWidgets.QLabel(self.centralwidget)
        self.headTitleLabel.setGeometry(QtCore.QRect(850, 130, 300, 50))
        self.headTitleLabel.setObjectName("headTitleLabel")
        self.headTitleLabel.setStyleSheet("border-radius:10px;border:2px solid gray;border-style:outset;")

        self.headPushButton = QtWidgets.QPushButton(QtGui.QIcon("./icons/choose.png"), "Choose head picture", self.centralwidget)
        self.headPushButton.setGeometry(QtCore.QRect(925, 610, 180, 50))
        self.headPushButton.setObjectName("headPushButton")
        self.headPushButton.setStyleSheet("font-size:15px;font-weight:600;background-image:url(./icons/button.png);border-radius:10px;border:2px solid gray;border-style:outset;")
        self.headPushButton.setFlat(True)

        self.resultLabel = QtWidgets.QLabel(self.centralwidget)
        self.resultLabel.setGeometry(QtCore.QRect(450, 200, 300, 400))
        self.resultLabel.setText("")
        self.resultLabel.setScaledContents(False)
        self.resultLabel.setObjectName("resultLabel")

        self.resultTitleLabel = QtWidgets.QLabel(self.centralwidget)
        self.resultTitleLabel.setGeometry(QtCore.QRect(450, 130, 300, 50))
        self.resultTitleLabel.setObjectName("resultTitleLabel")
        self.resultTitleLabel.setStyleSheet("border-radius:10px;border:2px solid gray;border-style:outset;")

        self.clearPushButton = QtWidgets.QPushButton(QtGui.QIcon("./icons/clear.png"), "Clear", self.centralwidget)
        self.clearPushButton.setGeometry(QtCore.QRect(380, 700, 110, 40))
        self.clearPushButton.setObjectName("clearPushButton")
        self.clearPushButton.setStyleSheet("font-size:20px;font-weight:600;background-image:url(./icons/button.png);border-radius:10px;border:2px solid gray;border-style:outset;")

        self.exitPushButton = QtWidgets.QPushButton(QtGui.QIcon("./icons/exit.png"), "Exit", self.centralwidget)
        self.exitPushButton.setGeometry(QtCore.QRect(710, 700, 110, 40))
        self.exitPushButton.setObjectName("exitPushButton")
        self.exitPushButton.setStyleSheet("font-size:20px;font-weight:600;background-image:url(./icons/button.png);border-radius:10px;border:2px solid gray;border-style:outset;")

        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def closeEvent(self, event):
        shutil.rmtree("tmp")
        os.mkdir("tmp")

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "Picture Faceswap"))
        self.facePushButton.setText(_translate("MainWindow", "Choose face picture"))
        self.swapPushButton.setText(_translate("MainWindow", "Swap"))
        self.titleLabel.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:28pt; font-weight:600;\">Picture FaceSwap</span></p></body></html>"))
        self.faceTitleLabel.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:18pt; font-weight:600;\">Face Picture</span></p></body></html>"))
        self.savePushButton.setText(_translate("MainWindow", "Save result as"))
        self.headTitleLabel.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:18pt; font-weight:600;\">Head Picture</span></p></body></html>"))
        self.headPushButton.setText(_translate("MainWindow", "Choose head picture"))
        self.resultTitleLabel.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:18pt; font-weight:600;\">Result</span></p></body></html>"))
        self.clearPushButton.setText(_translate("MainWindow", "Clear"))
        self.exitPushButton.setText(_translate("MainWindow", "Exit"))

def suppress_qt_warnings():
    os.environ["QT_DEVICE_PIXEL_RATIO"] = "0"
    os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
    os.environ["QT_SCREEN_SCALE_FACTORS"] = "1"
    os.environ["QT_SCALE_FACTOR"] = "1"

suppress_qt_warnings()