

from PyQt5 import QtCore, QtGui, QtWidgets
import controller.tab1_controller.Invoker as invoker

class Tab1Create:



    def intiate(self,Ui_MainWindow):
        Ui_MainWindow.tab1 = QtWidgets.QWidget()
        Ui_MainWindow.tab1.setObjectName("tab1")
        Ui_MainWindow.horizontalLayout = QtWidgets.QHBoxLayout(Ui_MainWindow.tab1)
        Ui_MainWindow.horizontalLayout.setObjectName("horizontalLayout")
        Ui_MainWindow.tab1_groupBox = QtWidgets.QGroupBox(Ui_MainWindow.tab1)
        font = QtGui.QFont()
        font.setPointSize(9)
        Ui_MainWindow.tab1_groupBox.setFont(font)
        Ui_MainWindow.tab1_groupBox.setObjectName("tab1_groupBox")
        Ui_MainWindow.verticalLayout_3 = QtWidgets.QVBoxLayout(Ui_MainWindow.tab1_groupBox)
        Ui_MainWindow.verticalLayout_3.setObjectName("verticalLayout_3")
        Ui_MainWindow.tab1_page_view = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox)
        font = QtGui.QFont()
        font.setPointSize(9)
        Ui_MainWindow.tab1_page_view.setFont(font)
        Ui_MainWindow.tab1_page_view.setAlignment(QtCore.Qt.AlignCenter)
        Ui_MainWindow.tab1_page_view.setObjectName("tab1_page_view")
        Ui_MainWindow.verticalLayout_3.addWidget(Ui_MainWindow.tab1_page_view)
        Ui_MainWindow.tab1_page_rotate = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox)
        Ui_MainWindow.tab1_page_rotate.setObjectName("tab1_page_rotate")
        Ui_MainWindow.verticalLayout_3.addWidget(Ui_MainWindow.tab1_page_rotate)
        Ui_MainWindow.horizontalLayout.addWidget(Ui_MainWindow.tab1_groupBox)
        Ui_MainWindow.verticalLayout_2 = QtWidgets.QVBoxLayout()
        Ui_MainWindow.verticalLayout_2.setObjectName("verticalLayout_2")
        Ui_MainWindow.tab1_groupBox_3 = QtWidgets.QGroupBox(Ui_MainWindow.tab1)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_groupBox_3.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_groupBox_3.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_groupBox_3.setMinimumSize(QtCore.QSize(0, 80))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(True)
        font.setWeight(75)
        Ui_MainWindow.tab1_groupBox_3.setFont(font)
        Ui_MainWindow.tab1_groupBox_3.setObjectName("tab1_groupBox_3")
        Ui_MainWindow.horizontalLayout_4 = QtWidgets.QHBoxLayout(Ui_MainWindow.tab1_groupBox_3)
        Ui_MainWindow.horizontalLayout_4.setObjectName("horizontalLayout_4")
        Ui_MainWindow.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        Ui_MainWindow.horizontalLayout_3.setObjectName("horizontalLayout_3")
        Ui_MainWindow.tab1_book_name = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox_3)
        Ui_MainWindow.tab1_book_name.setObjectName("tab1_book_name")
        Ui_MainWindow.horizontalLayout_3.addWidget(Ui_MainWindow.tab1_book_name)
        Ui_MainWindow.tab1_new_book_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_new_book_button.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_new_book_button.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_new_book_button.setObjectName("tab1_new_book_button")
        Ui_MainWindow.horizontalLayout_3.addWidget(Ui_MainWindow.tab1_new_book_button)
        Ui_MainWindow.tab1_select_book_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_select_book_button.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_select_book_button.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_select_book_button.setObjectName("tab1_select_book_button")
        Ui_MainWindow.horizontalLayout_3.addWidget(Ui_MainWindow.tab1_select_book_button)
        Ui_MainWindow.tab1_delete_book_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_delete_book_button.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_delete_book_button.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_delete_book_button.setObjectName("tab1_delete_book_button")
        Ui_MainWindow.horizontalLayout_3.addWidget(Ui_MainWindow.tab1_delete_book_button)
        Ui_MainWindow.horizontalLayout_4.addLayout(Ui_MainWindow.horizontalLayout_3)
        Ui_MainWindow.verticalLayout_2.addWidget(Ui_MainWindow.tab1_groupBox_3)
        Ui_MainWindow.tab1_groupBox_2 = QtWidgets.QGroupBox(Ui_MainWindow.tab1)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_groupBox_2.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_groupBox_2.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_groupBox_2.setMinimumSize(QtCore.QSize(0, 80))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(True)
        font.setWeight(75)
        Ui_MainWindow.tab1_groupBox_2.setFont(font)
        Ui_MainWindow.tab1_groupBox_2.setObjectName("tab1_groupBox_2")
        Ui_MainWindow.horizontalLayout_6 = QtWidgets.QHBoxLayout(Ui_MainWindow.tab1_groupBox_2)
        Ui_MainWindow.horizontalLayout_6.setObjectName("horizontalLayout_6")
        Ui_MainWindow.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        Ui_MainWindow.horizontalLayout_5.setObjectName("horizontalLayout_5")
        Ui_MainWindow.tab1_chapter_name = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox_2)
        Ui_MainWindow.tab1_chapter_name.setObjectName("tab1_chapter_name")
        Ui_MainWindow.horizontalLayout_5.addWidget(Ui_MainWindow.tab1_chapter_name)
        Ui_MainWindow.tab1_new_chapter_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_2)
        Ui_MainWindow.tab1_new_chapter_button.setObjectName("tab1_new_chapter_button")
        Ui_MainWindow.horizontalLayout_5.addWidget(Ui_MainWindow.tab1_new_chapter_button)
        Ui_MainWindow.tab1_select_chapter_combobox = QtWidgets.QComboBox(Ui_MainWindow.tab1_groupBox_2)
        Ui_MainWindow.tab1_select_chapter_combobox.setCurrentText("")
        Ui_MainWindow.tab1_select_chapter_combobox.setObjectName("tab1_select_chapter_combobox")
        Ui_MainWindow.horizontalLayout_5.addWidget(Ui_MainWindow.tab1_select_chapter_combobox)
        Ui_MainWindow.tab1_delete_picture_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_2)
        Ui_MainWindow.tab1_delete_picture_button.setObjectName("tab1_delete_picture_button")
        Ui_MainWindow.horizontalLayout_5.addWidget(Ui_MainWindow.tab1_delete_picture_button)
        Ui_MainWindow.horizontalLayout_6.addLayout(Ui_MainWindow.horizontalLayout_5)
        Ui_MainWindow.verticalLayout_2.addWidget(Ui_MainWindow.tab1_groupBox_2)
        Ui_MainWindow.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        Ui_MainWindow.horizontalLayout_2.setObjectName("horizontalLayout_2")
        Ui_MainWindow.tab1_groupBox_4 = QtWidgets.QGroupBox(Ui_MainWindow.tab1)
        font = QtGui.QFont()
        font.setPointSize(9)
        Ui_MainWindow.tab1_groupBox_4.setFont(font)
        Ui_MainWindow.tab1_groupBox_4.setObjectName("tab1_groupBox_4")
        Ui_MainWindow.verticalLayout_4 = QtWidgets.QVBoxLayout(Ui_MainWindow.tab1_groupBox_4)
        Ui_MainWindow.verticalLayout_4.setObjectName("verticalLayout_4")
        Ui_MainWindow.tab1_page_listwidget = QtWidgets.QListWidget(Ui_MainWindow.tab1_groupBox_4)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_page_listwidget.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_page_listwidget.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_page_listwidget.setObjectName("tab1_page_listwidget")
        Ui_MainWindow.verticalLayout_4.addWidget(Ui_MainWindow.tab1_page_listwidget)
        Ui_MainWindow.tab1_delete_page_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_4)
        Ui_MainWindow.tab1_delete_page_button.setObjectName("tab1_delete_page_button")
        Ui_MainWindow.verticalLayout_4.addWidget(Ui_MainWindow.tab1_delete_page_button)
        Ui_MainWindow.horizontalLayout_2.addWidget(Ui_MainWindow.tab1_groupBox_4)
        Ui_MainWindow.tab1_groupBox_5 = QtWidgets.QGroupBox(Ui_MainWindow.tab1)
        font = QtGui.QFont()
        font.setPointSize(9)
        Ui_MainWindow.tab1_groupBox_5.setFont(font)
        Ui_MainWindow.tab1_groupBox_5.setObjectName("tab1_groupBox_5")
        Ui_MainWindow.verticalLayout_5 = QtWidgets.QVBoxLayout(Ui_MainWindow.tab1_groupBox_5)
        Ui_MainWindow.verticalLayout_5.setObjectName("verticalLayout_5")
        Ui_MainWindow.tab1_select_picture_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_select_picture_button.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_select_picture_button.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_select_picture_button.setObjectName("tab1_select_picture_button")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_select_picture_button)
        Ui_MainWindow.tab1_take_picture_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_5)
        Ui_MainWindow.tab1_take_picture_button.setObjectName("tab1_take_picture_button")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_take_picture_button)
        Ui_MainWindow.tab1_spacer1 = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_spacer1.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_spacer1.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_spacer1.setText("")
        Ui_MainWindow.tab1_spacer1.setAlignment(QtCore.Qt.AlignCenter)
        Ui_MainWindow.tab1_spacer1.setObjectName("tab1_spacer1")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_spacer1)
        Ui_MainWindow.tab1_manualcrop_picture_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_5)
        Ui_MainWindow.tab1_manualcrop_picture_button.setObjectName("tab1_manualcrop_picture_button")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_manualcrop_picture_button)
        Ui_MainWindow.tab1_spacer2 = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_spacer2.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_spacer2.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_spacer2.setText("")
        Ui_MainWindow.tab1_spacer2.setAlignment(QtCore.Qt.AlignCenter)
        Ui_MainWindow.tab1_spacer2.setObjectName("tab1_spacer2")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_spacer2)
        Ui_MainWindow.tab1_page_name = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox_5)
        Ui_MainWindow.tab1_page_name.setObjectName("tab1_page_name")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_page_name)
        Ui_MainWindow.tab1_page_name_input = QtWidgets.QLineEdit(Ui_MainWindow.tab1_groupBox_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_page_name_input.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_page_name_input.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_page_name_input.setObjectName("tab1_page_name_input")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_page_name_input)
        Ui_MainWindow.tab1_spacer3 = QtWidgets.QLabel(Ui_MainWindow.tab1_groupBox_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Ui_MainWindow.tab1_spacer3.sizePolicy().hasHeightForWidth())
        Ui_MainWindow.tab1_spacer3.setSizePolicy(sizePolicy)
        Ui_MainWindow.tab1_spacer3.setText("")
        Ui_MainWindow.tab1_spacer3.setAlignment(QtCore.Qt.AlignCenter)
        Ui_MainWindow.tab1_spacer3.setObjectName("tab1_spacer3")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_spacer3)
        Ui_MainWindow.tab1_save_page_button = QtWidgets.QPushButton(Ui_MainWindow.tab1_groupBox_5)
        Ui_MainWindow.tab1_save_page_button.setObjectName("tab1_save_page_button")
        Ui_MainWindow.verticalLayout_5.addWidget(Ui_MainWindow.tab1_save_page_button)
        Ui_MainWindow.horizontalLayout_2.addWidget(Ui_MainWindow.tab1_groupBox_5)
        Ui_MainWindow.verticalLayout_2.addLayout(Ui_MainWindow.horizontalLayout_2)
        Ui_MainWindow.horizontalLayout.addLayout(Ui_MainWindow.verticalLayout_2)
        Tab1Create.__retranslate_ui(Ui_MainWindow)
        Tab1Create.__set_up_click_events(Ui_MainWindow)

        
        
    def __retranslate_ui(Ui_MainWindow):
        _translate = QtCore.QCoreApplication.translate
        Ui_MainWindow.tab1_groupBox.setTitle(_translate("MainWindow", "Page Preview"))
        Ui_MainWindow.tab1_page_view.setText(_translate("MainWindow", "Page preview"))
        Ui_MainWindow.tab1_page_rotate.setText(_translate("MainWindow", "Rotate"))
        Ui_MainWindow.tab1_groupBox_3.setTitle(_translate("MainWindow", "Book"))
        Ui_MainWindow.tab1_book_name.setText(_translate("MainWindow", "Name"))
        Ui_MainWindow.tab1_new_book_button.setText(_translate("MainWindow", "New"))
        Ui_MainWindow.tab1_select_book_button.setText(_translate("MainWindow", "Select"))
        Ui_MainWindow.tab1_delete_book_button.setText(_translate("MainWindow", "Delete"))
        Ui_MainWindow.tab1_groupBox_2.setTitle(_translate("MainWindow", "Chapter"))
        Ui_MainWindow.tab1_chapter_name.setText(_translate("MainWindow", "Default"))
        Ui_MainWindow.tab1_new_chapter_button.setText(_translate("MainWindow", "New"))
        Ui_MainWindow.tab1_delete_picture_button.setText(_translate("MainWindow", "Delete"))
        Ui_MainWindow.tab1_groupBox_4.setTitle(_translate("MainWindow", "Pages"))
        Ui_MainWindow.tab1_delete_page_button.setText(_translate("MainWindow", "Delete Page"))
        Ui_MainWindow.tab1_groupBox_5.setTitle(_translate("MainWindow", "Page Creation"))
        Ui_MainWindow.tab1_select_picture_button.setText(_translate("MainWindow", "Select Picture"))
        Ui_MainWindow.tab1_take_picture_button.setText(_translate("MainWindow", "Take Picture"))
        Ui_MainWindow.tab1_manualcrop_picture_button.setText(_translate("MainWindow", "Manual Crop"))
        Ui_MainWindow.tab1_page_name.setText(_translate("MainWindow", "Page Name : "))
        Ui_MainWindow.tab1_save_page_button.setText(_translate("MainWindow", "Save"))





    def __set_tool_tips(Ui_MainWindow):

        pass

    def __set_up_click_events(Ui_MainWindow):
        Ui_MainWindow.invoker_tab1 = invoker.Invoker(Ui_MainWindow)

        Ui_MainWindow.tab1_select_book_button.clicked.connect(Ui_MainWindow.invoker_tab1.select_book)
        Ui_MainWindow.tab1_new_book_button.clicked.connect(Ui_MainWindow.invoker_tab1.new_book)
        Ui_MainWindow.tab1_page_listwidget.itemClicked.connect(Ui_MainWindow.invoker_tab1.select_page)

        # Ui_MainWindow.tab1_delete_book_button.clicked.connect(Ui_MainWindow.invoker_tab1.delete_book)

        Ui_MainWindow.tab1_new_chapter_button.clicked.connect(Ui_MainWindow.invoker_tab1.new_chapter)
        # Ui_MainWindow.tab1_delete_chapter_button.clicked.connect(Ui_MainWindow.invoker_tab1.delete_chapter)
        Ui_MainWindow.tab1_select_chapter_combobox.activated.connect(Ui_MainWindow.invoker_tab1.select_chapter)
        # Ui_MainWindow.tab1_select_chapter_combobox.addItem("help")
        # Ui_MainWindow.tab1_page_rotate.clicked.connect(Ui_MainWindow.invoker_tab1.rotate_image)

        # Ui_MainWindow.tab1_delete_page_button.clicked.connect(Ui_MainWindow.invoker_tab1.delete_page)

        Ui_MainWindow.tab1_take_picture_button.clicked.connect(Ui_MainWindow.invoker_tab1.take_picture)
        Ui_MainWindow.tab1_select_picture_button.clicked.connect(Ui_MainWindow.invoker_tab1.select_picture)
        Ui_MainWindow.tab1_manualcrop_picture_button.clicked.connect(Ui_MainWindow.invoker_tab1.manual_crop)
        Ui_MainWindow.tab1_save_page_button.clicked.connect(Ui_MainWindow.invoker_tab1.save_page)





