from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox
from telas import telaAdd, Remover, telaEditar, telaEditForm, telaBuscar, telaVerLivro, loginWindows, telaAddUser, telaEditUser
import sys

class Ui_MainWindow(object):

    def openAdd(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = telaAdd.Add_Form()
        self.ui.setupUi(self.window)
        self.window.show()

    def openEditar(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = telaEditar.Editar_Form()
        self.ui.setupUi(self.window)
        self.window.show()

    def openRemove(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = Remover.Ui_RemoveWindow()
        self.ui.setupUi(self.window)
        self.window.show()

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(577, 502)
        MainWindow.setFixedSize(577, 502)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.label = QtWidgets.QLabel(MainWindow)
        self.label.setGeometry(QtCore.QRect(10, 10, 561, 131))
        self.label.setText("")
        self.label.setPixmap(QtGui.QPixmap("icons/bibworld.png"))
        self.label.setScaledContents(True)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")

        """ self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(50, 10, 551, 91))
        self.label.setText("")
        pixmap = QtGui.QPixmap("icons/bibworld.png")
        pixmap3 = pixmap.scaled(561, 120, QtCore.Qt.KeepAspectRatio)
        self.label.setPixmap(pixmap3)
        self.label.setObjectName("label") """
        self.labelUser = QtWidgets.QLabel(self.centralwidget)
        self.labelUser.setGeometry(QtCore.QRect(280, 150, 54, 17)) 
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)

        self.labelUser.setFont(font)
        self.labelUser.setObjectName("labelUser")
        self.labelUser1 = QtWidgets.QLabel(self.centralwidget)
        self.labelUser1.setGeometry(QtCore.QRect(340, 150, 141, 17))
        self.labelUser1.setObjectName("labelUser1")
        self.labelUser1.setFont(font)
        self.buttonAddBook = QtWidgets.QPushButton(self.centralwidget)
        self.buttonAddBook.setGeometry(QtCore.QRect(130, 260, 140, 30))
        self.buttonAddBook.setStyleSheet('background-color:#1f4c73')
        self.buttonAddBook.setIcon(QtGui.QIcon('icons/plus.png'))
        self.buttonAddBook.setIconSize(QtCore.QSize(24,24))
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.buttonAddBook.setFont(font)
        self.buttonAddBook.setObjectName("buttonAddBook")

        self.buttonEditUser = QtWidgets.QPushButton(self.centralwidget)
        self.buttonEditUser.setGeometry(QtCore.QRect(480, 140, 30, 30))
        self.buttonEditUser.setIcon(QtGui.QIcon('icons/user.png'))
        self.buttonEditUser.setIconSize(QtCore.QSize(24,24))
        self.buttonEditUser.setStyleSheet('background-color:#1f4c73')
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.buttonEditUser.setFont(font)
        self.buttonEditUser.setText("")
        self.buttonEditUser.setObjectName("buttonEditUser")
        
        self.buttonExit = QtWidgets.QPushButton(self.centralwidget)
        self.buttonExit.setGeometry(QtCore.QRect(520, 140, 30, 30))
        self.buttonExit.setIcon(QtGui.QIcon('icons/logout.png'))
        self.buttonExit.setIconSize(QtCore.QSize(24,24))
        self.buttonExit.setStyleSheet('background-color:#1f4c73')
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.buttonExit.setFont(font)
        self.buttonExit.setText("")
        self.buttonExit.setObjectName("buttonExit")

        self.buttonRemoveBook = QtWidgets.QPushButton(self.centralwidget)
        self.buttonRemoveBook.setGeometry(QtCore.QRect(310, 260, 140, 30))
        self.buttonRemoveBook.setStyleSheet('background-color:#1f4c73')
        self.buttonRemoveBook.setIcon(QtGui.QIcon('icons/delete.png'))
        self.buttonRemoveBook.setIconSize(QtCore.QSize(24,24))
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.buttonRemoveBook.setFont(font)
        self.buttonRemoveBook.setObjectName("buttonRemoveBook")

        self.buttonSearch = QtWidgets.QPushButton(self.centralwidget)
        self.buttonSearch.setGeometry(QtCore.QRect(130, 330, 140, 30))
        self.buttonSearch.setStyleSheet('background-color:#1f4c73')
        self.buttonSearch.setIcon(QtGui.QIcon('icons/search.png'))
        self.buttonSearch.setIconSize(QtCore.QSize(24,24))
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.buttonSearch.setFont(font)
        self.buttonSearch.setObjectName("buttonSearch")

        self.buttonEditBook = QtWidgets.QPushButton(self.centralwidget)
        self.buttonEditBook.setGeometry(QtCore.QRect(310, 330, 140, 30))
        self.buttonEditBook.setStyleSheet('background-color:#1f4c73')
        self.buttonEditBook.setIcon(QtGui.QIcon('icons/edit.png'))
        self.buttonEditBook.setIconSize(QtCore.QSize(24,24))
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.buttonEditBook.setFont(font)
        self.buttonEditBook.setObjectName("buttonEditBook")

        self.labelTitulo = QtWidgets.QLabel(self.centralwidget)
        self.labelTitulo.setGeometry(QtCore.QRect(150, 200, 301, 17))
        font = QtGui.QFont()
        font.setFamily("KacstOne")
        font.setBold(True)
        font.setWeight(75)
        self.labelTitulo.setFont(font)
        self.labelTitulo.setObjectName("labelTitulo")

        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 577, 23))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

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

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.labelUser.setText(_translate("MainWindow", "Usuário:"))
        self.labelUser1.setText(_translate("MainWindow", "TextLabel"))
        self.buttonAddBook.setText(_translate("MainWindow", " Cadastrar livro"))
        self.buttonRemoveBook.setText(_translate("MainWindow", " Remover livro"))
        self.buttonSearch.setText(_translate("MainWindow", " Buscar livro"))
        self.buttonEditBook.setText(_translate("MainWindow", " Editar livro"))
        self.labelTitulo.setText(_translate("MainWindow", "SISTEMA DE GERENCIAMENTO DE LIVROS"))

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