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

# Form implementation generated from reading ui file 'main_page.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 QtWidgets, QtCore
# from PyQt5.QtWidgets import QApplication, QMainWindow
#
# import sys
#
#
# class Window(QMainWindow):
#     def __init__(self):
#         super(Window, self).__init__()
#
#         self.setWindowTitle("Test")
#         self.resize(800, 596)
#         self.setStyleSheet("background-color: #E9E9E9")
#
#         self.centralwidget = QtWidgets.QWidget(self)
#         self.label = QtWidgets.QLabel(self.centralwidget)
#         self.label.setGeometry(QtCore.QRect(-6, -5, 241, 601))
#         self.label.setStyleSheet("background-color: rgb(43, 87, 154);")
#         self.label.setText("")
#
#
# def application():
#     app = QApplication(sys.argv)
#     window = Window()
#
#
#
#
#     window.show()
#     sys.exit(app.exec_())
#
#
# if __name__ == "__main__":
#     application()


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 596)
        MainWindow.setStyleSheet("background-color: #E9E9E9;\n"
                                 "font: \'Roboto\', sans-serif;")


        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.blueRect = QtWidgets.QLabel(self.centralwidget)
        self.blueRect.setGeometry(QtCore.QRect(-6, -5, 241, 601))
        self.blueRect.setStyleSheet("background-color: rgb(43, 87, 154);")
        self.blueRect.setText("")
        self.blueRect.setObjectName("blueRect")

        self.whiteRect = QtWidgets.QLabel(self.centralwidget)
        self.whiteRect.setGeometry(QtCore.QRect(210, 0, 591, 71))
        self.whiteRect.setStyleSheet("background-color: rgb(255, 255, 255);")
        self.whiteRect.setText("")
        self.whiteRect.setObjectName("whiteRect")

        self.whiteBottomBox = QtWidgets.QLabel(self.centralwidget)
        self.whiteBottomBox.setGeometry(QtCore.QRect(230, 530, 591, 71))
        self.whiteBottomBox.setStyleSheet("background-color: rgb(255, 255, 255);")
        self.whiteBottomBox.setText("")
        self.whiteBottomBox.setObjectName("whiteBottomBox")

        self.checkBox = QtWidgets.QCheckBox(self.centralwidget) # Чекбокс с "Выгрузка логов"
        self.checkBox.setGeometry(QtCore.QRect(30, 80, 141, 51))
        self.checkBox.setStyleSheet("background-color: rgb(43, 87, 154);\n"
"color: #ffffff;\n"
"font-size: 15px;")
        self.checkBox.setObjectName("checkBox")


        self.checkBox_2 = QtWidgets.QCheckBox(self.centralwidget) # Чекбокс с "Разделить обработанные чертежи"
        self.checkBox_2.setGeometry(QtCore.QRect(30, 160, 121, 51))
        self.checkBox_2.setStyleSheet("background-color: #2B579A;\n"
"color: #ffffff;\n"
"font-size: 15px")
        self.checkBox_2.setObjectName("checkBox_2")


        self.checkBox_3 = QtWidgets.QCheckBox(self.centralwidget) # Чекбокс с "Пометить найденные элементы"
        self.checkBox_3.setGeometry(QtCore.QRect(30, 250, 111, 51))
        self.checkBox_3.setStyleSheet("background-color: #2B579A;\n"
"color: #ffffff;\n"
"font-size: 15px;")
        self.checkBox_3.setObjectName("checkBox_3")


        self.KZ = QtWidgets.QLabel(self.centralwidget)
        self.KZ.setGeometry(QtCore.QRect(40, 540, 35, 35))
        self.KZ.setStyleSheet("background-color: #2B579A;\n"
"color: #ffffff;\n"
"font-size: 18px")
        self.KZ.setObjectName("KZ")

        self.RU = QtWidgets.QLabel(self.centralwidget)
        self.RU.setGeometry(QtCore.QRect(90, 540, 35, 35))
        self.RU.setStyleSheet("background-color: #2B579A;\n"
"color: #ffffff;\n"
"font-size: 18px")
        self.RU.setObjectName("RU")


        self.EN = QtWidgets.QLabel(self.centralwidget)
        self.EN.setGeometry(QtCore.QRect(140, 540, 35, 35))
        self.EN.setStyleSheet("background-color: #2B579A;\n"
"color: #ffffff;\n"
"font-size: 18px")
        self.EN.setObjectName("EN")


        self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget) # Кнопка "Загрузите файлы"
        self.pushButton_2.setGeometry(QtCore.QRect(500, 100, 131, 31))
        self.pushButton_2.setStyleSheet("background-color: white;\n"
"border: 1px solid white;\n"
"border-radius: 15px;")
        self.pushButton_2.setObjectName("pushButton_2")
        self.pushButton_2.clicked.connect(self.fileDialog)


        self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget) # Кнопка "Загрузите символы"
        self.pushButton_3.setGeometry(QtCore.QRect(310, 100, 131, 31))
        self.pushButton_3.setStyleSheet("background-color: white;\n"
"border: 1px solid white;\n"
"border-radius: 15px;")
        self.pushButton_3.setObjectName("pushButton_3")


        # Перемещение на верхние слоты
        self.whiteBottomBox.raise_()
        self.whiteRect.raise_()
        self.blueRect.raise_()
        self.checkBox.raise_()
        self.checkBox_2.raise_()
        self.checkBox_3.raise_()
        self.KZ.raise_()
        self.RU.raise_()
        self.EN.raise_()
        self.pushButton_2.raise_()
        self.pushButton_3.raise_()
        MainWindow.setCentralWidget(self.centralwidget)

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


    def retranslateUi(self, MainWindow): # Тут ставится текст
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.checkBox.setText(_translate("MainWindow", "Выгрузка логов"))
        self.checkBox_2.setText(_translate("MainWindow", "Разделить \n"
"обработанные\n"
"чертежи"))
        self.checkBox_3.setText(_translate("MainWindow", "Пометить\n"
"найденные\n"
"элементы"))
        self.KZ.setText(_translate("MainWindow", "KZ"))
        self.RU.setText(_translate("MainWindow", "RU"))
        self.EN.setText(_translate("MainWindow", "EN"))
        self.pushButton_2.setText(_translate("MainWindow", "Загрузите файлы"))
        self.pushButton_3.setText(_translate("MainWindow", "Загрузите символ"))


    def fileDialog(self): # Открытие диалогового окна (можно выбрать 1 файл только)
        print("Button pressed")

        fileName = QtWidgets.QFileDialog.getOpenFileName()
        path = fileName[0]
        # print(fileName) # Показ путь к файлу
        #
        # with open(path, "r") as f: # Чтение файла
        #     print(f.readline())


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_())


