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

# Form implementation generated from reading ui file 'view_info.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_ViewInfo(object):
    def setupUi(self, ViewInfo):
        ViewInfo.setObjectName("ViewInfo")
        ViewInfo.resize(581, 367)
        self.centralwidget = QtWidgets.QWidget(ViewInfo)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName("tabWidget")
        self.authorsTab = QtWidgets.QWidget()
        self.authorsTab.setObjectName("authorsTab")
        self.gridLayout = QtWidgets.QGridLayout(self.authorsTab)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.label_2 = QtWidgets.QLabel(self.authorsTab)
        self.label_2.setText("")
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 1, 4, 1, 2)
        self.author_toYear = QtWidgets.QSpinBox(self.authorsTab)
        self.author_toYear.setEnabled(False)
        self.author_toYear.setMinimum(-10000)
        self.author_toYear.setMaximum(10000)
        self.author_toYear.setValue(1900)
        self.author_toYear.setMaximumSize(QtCore.QSize(60, 16777215))
        self.author_toYear.setObjectName("author_toYear")
        self.gridLayout.addWidget(self.author_toYear, 1, 3, 1, 1)
        self.authors = QtWidgets.QTableView(self.authorsTab)
        self.authors.setObjectName("authors")
        self.gridLayout.addWidget(self.authors, 0, 0, 1, 6)
        self.addAuthor = QtWidgets.QPushButton(self.authorsTab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.addAuthor.sizePolicy().hasHeightForWidth())
        self.addAuthor.setSizePolicy(sizePolicy)
        self.addAuthor.setMinimumSize(QtCore.QSize(200, 0))
        self.addAuthor.setMaximumSize(QtCore.QSize(75, 23))
        self.addAuthor.setObjectName("addAuthor")
        self.gridLayout.addWidget(self.addAuthor, 3, 0, 1, 1)
        self.label = QtWidgets.QLabel(self.authorsTab)
        self.label.setMaximumSize(QtCore.QSize(20, 16777215))
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 2, 1, 1)
        self.onlyBetweenYearsCheckbox = QtWidgets.QCheckBox(self.authorsTab)
        self.onlyBetweenYearsCheckbox.setObjectName("onlyBetweenYearsCheckbox")
        self.gridLayout.addWidget(self.onlyBetweenYearsCheckbox, 1, 0, 1, 1)
        self.author_fromYear = QtWidgets.QSpinBox(self.authorsTab)
        self.author_fromYear.setEnabled(False)
        self.author_fromYear.setMinimum(-10000)
        self.author_fromYear.setMaximum(10000)
        self.author_fromYear.setValue(1900)
        self.author_fromYear.setMaximumSize(QtCore.QSize(60, 16777215))
        self.author_fromYear.setObjectName("author_fromYear")
        self.gridLayout.addWidget(self.author_fromYear, 1, 1, 1, 1)
        self.onlyWithMoreThanNBooksCheckbox = QtWidgets.QCheckBox(self.authorsTab)
        self.onlyWithMoreThanNBooksCheckbox.setObjectName("onlyWithMoreThanNBooksCheckbox")
        self.gridLayout.addWidget(self.onlyWithMoreThanNBooksCheckbox, 2, 0, 1, 1)
        self.author_numOfBooks = QtWidgets.QSpinBox(self.authorsTab)
        self.author_numOfBooks.setEnabled(False)
        self.author_numOfBooks.setMinimum(0)
        self.author_numOfBooks.setMaximum(10000)
        self.author_numOfBooks.setValue(2)
        self.author_numOfBooks.setMaximumSize(QtCore.QSize(60, 16777215))
        self.author_numOfBooks.setObjectName("author_numOfBooks")
        self.gridLayout.addWidget(self.author_numOfBooks, 2, 1, 1, 1)
        self.tabWidget.addTab(self.authorsTab, "")
        self.booksTab = QtWidgets.QWidget()
        self.booksTab.setObjectName("booksTab")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.booksTab)
        self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.books = QtWidgets.QTableView(self.booksTab)
        self.books.setObjectName("books")
        self.gridLayout_2.addWidget(self.books, 0, 0, 1, 3)
        self.onlyFromRussiaCheckbox = QtWidgets.QCheckBox(self.booksTab)
        self.onlyFromRussiaCheckbox.setObjectName("onlyFromRussiaCheckbox")
        self.gridLayout_2.addWidget(self.onlyFromRussiaCheckbox, 1, 0, 1, 1)
        self.onlyWithPagesMoreThanN = QtWidgets.QCheckBox(self.booksTab)
        self.onlyWithPagesMoreThanN.setObjectName("onlyWithPagesMoreThanN")
        self.gridLayout_2.addWidget(self.onlyWithPagesMoreThanN, 2, 0, 1, 1)
        self.countOfPages = QtWidgets.QSpinBox(self.booksTab)
        self.countOfPages.setEnabled(False)
        self.countOfPages.setMinimum(0)
        self.countOfPages.setMaximum(10000)
        self.countOfPages.setValue(250)
        self.countOfPages.setMaximumSize(QtCore.QSize(60, 16777215))
        self.countOfPages.setObjectName("countOfPages")
        self.gridLayout_2.addWidget(self.countOfPages, 2, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.booksTab)
        self.label_3.setMinimumSize(QtCore.QSize(0, 0))
        self.label_3.setText("")
        self.label_3.setObjectName("label_3")
        self.gridLayout_2.addWidget(self.label_3, 2, 2, 1, 1)
        self.addBook = QtWidgets.QPushButton(self.booksTab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.addBook.sizePolicy().hasHeightForWidth())
        self.addBook.setSizePolicy(sizePolicy)
        self.addBook.setMinimumSize(QtCore.QSize(200, 0))
        self.addBook.setMaximumSize(QtCore.QSize(300, 16777215))
        self.addBook.setObjectName("addBook")
        self.gridLayout_2.addWidget(self.addBook, 3, 0, 1, 1)
        self.tabWidget.addTab(self.booksTab, "")
        self.verticalLayout.addWidget(self.tabWidget)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        ViewInfo.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(ViewInfo)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 581, 21))
        self.menubar.setObjectName("menubar")
        self.fileMenu = QtWidgets.QMenu(self.menubar)
        self.fileMenu.setObjectName('fileMenu')
        self.authorsImport = QtWidgets.QAction(ViewInfo)
        self.authorsImport.setObjectName('authorsImport')
        self.authorsExport = QtWidgets.QAction(ViewInfo)
        self.authorsExport.setObjectName('authorsExport')
        self.fileMenu.addAction(self.authorsImport)
        self.fileMenu.addAction(self.authorsExport)
        self.menubar.addMenu(self.fileMenu)
        ViewInfo.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(ViewInfo)
        self.statusbar.setObjectName("statusbar")
        ViewInfo.setStatusBar(self.statusbar)

        self.retranslateUi(ViewInfo)
        self.tabWidget.setCurrentIndex(0)
        self.addAuthor.clicked.connect(ViewInfo.add_author)
        self.addBook.clicked.connect(ViewInfo.add_book)
        self.authorsImport.triggered.connect(ViewInfo.import_authors)
        self.authorsExport.triggered.connect(ViewInfo.export_authors)
        self.onlyBetweenYearsCheckbox \
            .toggled['bool'] \
            .connect(self.author_toYear.setEnabled)
        self.onlyBetweenYearsCheckbox \
            .toggled['bool'] \
            .connect(self.author_fromYear.setEnabled)
        self.onlyWithMoreThanNBooksCheckbox \
            .toggled['bool'] \
            .connect(self.author_numOfBooks.setEnabled)
        self.onlyWithPagesMoreThanN \
            .toggled['bool'] \
            .connect(self.countOfPages.setEnabled)

        for x in (self.onlyBetweenYearsCheckbox,
                  self.onlyWithMoreThanNBooksCheckbox,
                  self.onlyWithPagesMoreThanN,
                  self.onlyFromRussiaCheckbox):
            x.toggled.connect(ViewInfo.reload)

        for x in (self.countOfPages,
                  self.author_fromYear,
                  self.author_toYear,
                  self.author_numOfBooks):
            x.valueChanged.connect(ViewInfo.reload)
        QtCore.QMetaObject.connectSlotsByName(ViewInfo)

    def retranslateUi(self, ViewInfo):
        _translate = QtCore.QCoreApplication.translate
        ViewInfo.setWindowTitle(_translate("ViewInfo", "Просмотр"))
        self.addAuthor.setText(_translate("ViewInfo", "Добавить автора"))
        self.label.setText(_translate("ViewInfo", "и"))
        self.onlyBetweenYearsCheckbox.setText(_translate("ViewInfo", "Показывать авторов, родившихся между"))
        self.onlyWithMoreThanNBooksCheckbox.setText(_translate("ViewInfo", "Показывать авторов с числом книг больше "))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.authorsTab), _translate("ViewInfo", "Авторы"))
        self.onlyFromRussiaCheckbox.setText(_translate("ViewInfo", "Показывать книги из России"))
        self.onlyWithPagesMoreThanN.setText(_translate("ViewInfo", "Показывать книги с количеством страниц больше "))
        self.addBook.setText(_translate("ViewInfo", "Добавить книгу"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.booksTab), _translate("ViewInfo", "Книги"))
        self.fileMenu.setTitle(_translate("ViewInfo", "Файл"))
        self.authorsImport.setText(_translate("ViewInfo", "Импорт авторов..."))
        self.authorsExport.setText(_translate("ViewInfo", "Экспорт авторов..."))

