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

# Form implementation generated from reading ui file 'Features.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# 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
from subprocess import call

class Ui_MainWindow(object):

    def on_clicked(self):
        call(["python", "Login.py"])

    def on_clicked1(self):
        call(["python", "MainWindow.py"])

    def on_clicked2(self):
        call(["python", "facerecog_from_webcam(improved).py"])

    def on_clicked3(self):
        call(["python", "Setting.py"])

    def on_clicked4(self):
        call(["python", "About.py"])

    def on_clicked5(self):
        call(["python", "AboutDev.py"])

    def detector_h(self):
        call(["python", "detector.py",])

    def Generate(self):
        call(["python", "generate_db_from_webcam.py"])

    def Generateweb(self):
        call(["python","generate_db_from_webcam.py"])

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 580)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget.setGeometry(QtCore.QRect(220, 170, 351, 191))
        self.gridLayoutWidget.setObjectName("gridLayoutWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setHorizontalSpacing(5)
        self.gridLayout.setObjectName("gridLayout")
        self.btn_generate = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.btn_generate.setMinimumSize(QtCore.QSize(0, 30))
        self.btn_generate.setMaximumSize(QtCore.QSize(300, 30))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btn_generate.setFont(font)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("images/database.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.btn_generate.setIcon(icon)
        self.btn_generate.setIconSize(QtCore.QSize(25, 25))
        self.btn_generate.setObjectName("btn_generate")
        self.btn_generate.hide()
        self.gridLayout.addWidget(self.btn_generate, 1, 1, 1, 1)
        self.btn_detect = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.btn_detect.setMinimumSize(QtCore.QSize(0, 30))
        self.btn_detect.setMaximumSize(QtCore.QSize(300, 30))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btn_detect.setFont(font)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap("images/detect.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.btn_detect.setIcon(icon1)
        self.btn_detect.setIconSize(QtCore.QSize(30, 25))
        self.btn_detect.setObjectName("btn_detect")
        self.btn_detect.clicked.connect(self.detector_h)
        self.gridLayout.addWidget(self.btn_detect, 0, 1, 1, 1)
        self.btn_Face = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.btn_Face.setMinimumSize(QtCore.QSize(0, 30))
        self.btn_Face.setMaximumSize(QtCore.QSize(300, 30))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btn_Face.setFont(font)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap("images/face.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.btn_Face.setIcon(icon2)
        self.btn_Face.setIconSize(QtCore.QSize(30, 28))
        self.btn_Face.setObjectName("btn_Face")
        self.btn_Face.clicked.connect(self.on_clicked2)
        self.gridLayout.addWidget(self.btn_Face, 0, 0, 1, 1)
        self.btn_capture = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.btn_capture.setMinimumSize(QtCore.QSize(0, 30))
        self.btn_capture.setMaximumSize(QtCore.QSize(300, 30))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.btn_capture.setFont(font)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap("images/addimg.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.btn_capture.setIcon(icon3)
        self.btn_capture.setIconSize(QtCore.QSize(28, 28))
        self.btn_capture.setObjectName("btn_capture")
        self.btn_capture.clicked.connect(self.Generateweb)
        self.gridLayout.addWidget(self.btn_capture, 1, 0, 1, 1)
        self.label_Logo = QtWidgets.QLabel(self.centralwidget)
        self.label_Logo.setGeometry(QtCore.QRect(0, 0, 111, 101))
        self.label_Logo.setText("")
        self.label_Logo.setPixmap(QtGui.QPixmap("images/Logo.png"))
        self.label_Logo.setScaledContents(True)
        self.label_Logo.setObjectName("label_Logo")
        self.label_Title = QtWidgets.QLabel(self.centralwidget)
        self.label_Title.setGeometry(QtCore.QRect(110, 10, 291, 71))
        font = QtGui.QFont()
        font.setFamily("Copperplate Gothic Light")
        font.setPointSize(20)
        font.setBold(False)
        font.setWeight(50)
        self.label_Title.setFont(font)
        self.label_Title.setObjectName("label_Title")
        self.BG = QtWidgets.QLabel(self.centralwidget)
        self.BG.setGeometry(QtCore.QRect(-10, -8, 819, 550))
        self.BG.setText("")
        self.BG.setPixmap(QtGui.QPixmap("images/BG2.png"))
        self.BG.setScaledContents(True)
        self.BG.setObjectName("BG")
        self.SubT_label = QtWidgets.QLabel(self.centralwidget)
        self.SubT_label.setGeometry(QtCore.QRect(310, 140, 181, 31))
        font = QtGui.QFont()
        font.setPointSize(13)
        self.SubT_label.setFont(font)
        self.SubT_label.setObjectName("SubT_label")
        self.exit = QtWidgets.QPushButton(self.centralwidget)
        self.exit.setGeometry(QtCore.QRect(680, 30, 80, 30))
        self.exit.setMinimumSize(QtCore.QSize(80, 30))
        self.exit.setMaximumSize(QtCore.QSize(80, 16777215))
        self.exit.setSizeIncrement(QtCore.QSize(30, 0))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.exit.setFont(font)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap("images/exit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.exit.setIcon(icon2)
        self.exit.setIconSize(QtCore.QSize(50, 70))
        self.exit.setObjectName("exit")
        self.exit.clicked.connect(MainWindow.close)
        self.exit.clicked.connect(self.on_clicked1)

        self.BG.raise_()
        self.gridLayoutWidget.raise_()
        self.label_Logo.raise_()
        self.label_Title.raise_()
        self.SubT_label.raise_()
        self.exit.raise_()

        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
        self.menubar.setObjectName("menubar")
        self.menuCamera = QtWidgets.QMenu(self.menubar)
        self.menuCamera.setObjectName("menuCamera")
        self.menuMain = QtWidgets.QMenu(self.menubar)
        self.menuMain.setObjectName("menuMain")
        self.menuHelp = QtWidgets.QMenu(self.menubar)
        self.menuHelp.setObjectName("menuHelp")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.actionCamera_1 = QtWidgets.QAction(MainWindow)
        self.actionCamera_1.setObjectName("actionCamera_1")
        self.actionCamera_2 = QtWidgets.QAction(MainWindow)
        self.actionCamera_2.setObjectName("actionCamera_2")
        self.actionCamera_3 = QtWidgets.QAction(MainWindow)
        self.actionCamera_3.setObjectName("actionCamera_3")
        self.actionLog_out = QtWidgets.QAction(MainWindow)
        self.actionLog_out.setObjectName("actionLog_out")
        self.actionSettings = QtWidgets.QAction(MainWindow)
        self.actionSettings.setObjectName("actionSettings")
        self.actionHelp = QtWidgets.QAction(MainWindow)
        self.actionHelp.setObjectName("actionHelp")
        self.actionAbout_System = QtWidgets.QAction(MainWindow)
        self.actionAbout_System.setObjectName("actionAbout_System")
        self.actionAbout_Developrs = QtWidgets.QAction(MainWindow)
        self.actionAbout_Developrs.setObjectName("actionAbout_Developrs")
        self.menuCamera.addAction(self.actionCamera_1)
        self.menuCamera.addAction(self.actionCamera_2)
        self.menuMain.addAction(self.actionSettings)
        self.menuMain.addAction(self.actionLog_out)
        self.menuHelp.addAction(self.actionAbout_System)
        self.menuHelp.addAction(self.actionAbout_Developrs)
        self.menubar.addAction(self.menuMain.menuAction())
        self.menubar.addAction(self.menuCamera.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())
        self.actionCamera_1.triggered.connect(self.on_clicked2)
        self.actionCamera_2.triggered.connect(self.detector_h)
        self.actionSettings.triggered.connect(self.on_clicked3)
        self.actionLog_out.triggered.connect(MainWindow.close)
        self.actionLog_out.triggered.connect(self.on_clicked)
        self.actionAbout_System.triggered.connect(self.on_clicked4)
        self.actionAbout_Developrs.triggered.connect(self.on_clicked5)

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

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.btn_generate.setText(_translate("MainWindow", "Generate Database"))
        self.btn_detect.setText(_translate("MainWindow", "Detector"))
        self.btn_Face.setText(_translate("MainWindow", "Recognize Face"))
        self.btn_capture.setText(_translate("MainWindow", "Capture Image"))
        self.label_Title.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:16pt; font-weight:600; color:#ffffff;\">Smart Security System</span></p></body></html>"))
        self.SubT_label.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:16pt; font-weight:600; color:#066f95;\">Main Features</span></p></body></html>"))
        self.menuCamera.setTitle(_translate("MainWindow", "Camera"))
        self.menuMain.setTitle(_translate("MainWindow", "Main"))
        self.menuHelp.setTitle(_translate("MainWindow", "About"))
        self.actionCamera_1.setText(_translate("MainWindow", "Camera 1"))
        self.actionCamera_2.setText(_translate("MainWindow", "Camera 2"))
        self.actionCamera_3.setText(_translate("MainWindow", "Camera 3"))
        self.actionLog_out.setText(_translate("MainWindow", "Log out"))
        self.actionSettings.setText(_translate("MainWindow", "Settings"))
        self.actionHelp.setText(_translate("MainWindow", "Help"))
        self.actionAbout_System.setText(_translate("MainWindow", "About System"))
        self.actionAbout_Developrs.setText(_translate("MainWindow", "About Developrs"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())
