"""Module for the main window UI of the application."""
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtGui, QtWidgets


class Ui_MainWindow:
    """UI class for the main window of the application."""

    def setupUi(self, MainWindow):
        """Set up the UI components for the main window."""
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(612, 218)

        # Create a new central widget
        self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        MainWindow.setCentralWidget(self.centralwidget)

        # Create a QLabel for displaying the image
        self.imageLabel = QtWidgets.QLabel(parent=self.centralwidget)
        self.imageLabel.setObjectName("imageLabel")

        self.imageLabel.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
        self.imageLabel.setText("Image Placeholder")  # Optional placeholder text

        # Create a new menu bar
        self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 612, 22))
        self.menubar.setObjectName("menubar")

        MainWindow.setMenuBar(self.menubar)

        # add tabs for the menu bar
        self._add_project(MainWindow)
        self._add_3d_viewer(MainWindow)
        self._add_data_viewer(MainWindow)
        self._add_segmentation(MainWindow)
        self._add_steps(MainWindow)
        self._add_help(MainWindow)
        self._add_logging(MainWindow)

        self._add_classification(MainWindow)
        self._add_quantification(MainWindow)
        self._add_properties(MainWindow)
        self._add_view(MainWindow)
        self._add_process(MainWindow)
        self._add_extra(MainWindow)

        # add actions to the menubar
        self.menubar.addAction(self.menuProject.menuAction())
        self.menubar.addAction(self.menu3dviewer.menuAction())
        self.menubar.addAction(self.menuProcess.menuAction())
        # self.menubar.addAction(self.menuDataViewer.menuAction())
        # self.menubar.addAction(self.menuSegmentation.menuAction())
        # self.menubar.addAction(self.menuClassification.menuAction())
        # self.menubar.addAction(self.menuQuantification.menuAction())
        # self.menubar.addAction(self.menuProperties.menuAction())
        # self.menubar.addAction(self.menuView.menuAction())
        self.menubar.addAction(self.menuSteps.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())
        # self.menubar.addAction(self.menuExtra.menuAction())
        self.menubar.addAction(self.menuLog.menuAction())

        # add status bar
        # self._define_statusbar(MainWindow)

        # add toolbar
        # self._define_toolbar(MainWindow)

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

    def _define_statusbar(self, MainWindow):
        # Create a new status bar
        self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

    def _add_data_viewer(self, MainWindow):
        self.menuDataViewer = QtWidgets.QMenu(parent=self.menubar)
        self.menuDataViewer.setObjectName("menuDataViewer")
        self.actionOpenDataViewer = QtGui.QAction(parent=MainWindow)
        self.actionOpenDataViewer.setObjectName("actionOpenDataViewer")
        self.actionCloseDataViewer = QtGui.QAction(parent=MainWindow)
        self.actionCloseDataViewer.setObjectName("actionCloseDataViewer")
        self.menuDataViewer.addAction(self.actionOpenDataViewer)
        self.menuDataViewer.addAction(self.actionCloseDataViewer)

    def _add_3d_viewer(self, MainWindow):
        self.menu3dviewer = QtWidgets.QMenu(parent=self.menubar)
        self.menu3dviewer.setObjectName("menu3dViewer")

        # Create a new QAction for the "Open Image"
        self.actionOpenImage = QtGui.QAction(parent=MainWindow)
        self.actionOpenImage.setObjectName("actionOpenImage")

        # Create a new QAction for the "Close"
        self.actionClose3DViewer = QtGui.QAction(parent=MainWindow)
        self.actionClose3DViewer.setObjectName("action3DViewerClose")

        # Create a new QAction for "segmentation"
        self.actionSegmentation = QtGui.QAction(parent=MainWindow)
        self.actionSegmentation.setObjectName("actionSegmentation")

        self.menu3dviewer.addAction(self.actionOpenImage)
        self.menu3dviewer.addAction(self.actionSegmentation)
        self.menu3dviewer.addAction(self.actionClose3DViewer)

    def _add_extra(self, MainWindow):
        # Create a new menu for "Extra"
        self.menuExtra = QtWidgets.QMenu(parent=self.menubar)
        self.menuExtra.setObjectName("menuExtra")
        # Create a new QAction for the "Histograms16to8bit"
        self.actionHistograms16to8bit = QtGui.QAction(parent=MainWindow)
        self.actionHistograms16to8bit.setObjectName("actionHistograms16to8bit")
        # Create a new QAction for the "NormalizeParticleVolume"
        self.actionNormalizeVolume = QtGui.QAction(parent=MainWindow)
        self.actionNormalizeVolume.setObjectName("actionNormalizeVolume")
        self.menuExtra.addAction(self.actionHistograms16to8bit)
        self.menuExtra.addAction(self.actionNormalizeVolume)

    def _add_view(self, MainWindow):
        # Create a new menu for "View"
        self.menuView = QtWidgets.QMenu(parent=self.menubar)
        self.menuView.setObjectName("menuVextraiew")
        # Create a new QAction for the "Image 2D"
        self.actionImage_2D = QtGui.QAction(parent=MainWindow)
        self.actionImage_2D.setObjectName("actionImage_2D")
        # Create a new QAction for the "Image 3D"
        self.actionImage_3D = QtGui.QAction(parent=MainWindow)
        self.actionImage_3D.setObjectName("actionImage_3D")
        # Create a new QAction for the "Table properties"
        self.actionTable_properties = QtGui.QAction(parent=MainWindow)
        self.actionTable_properties.setObjectName("actionTable_properties")
        # Create a new QAction for the "Table histograms"
        self.actionTable_histograms = QtGui.QAction(parent=MainWindow)
        self.actionTable_histograms.setObjectName("actionTable_histograms")
        # Create a new QAction for the "Console"
        self.actionConsole = QtGui.QAction(parent=MainWindow)
        self.actionConsole.setObjectName("actionConsole")
        # Create a new QAction for the "Plot Properties"
        self.actionPlot_Properties = QtGui.QAction(parent=MainWindow)
        self.actionPlot_Properties.setObjectName("actionPlot_Properties")
        # Create a new QAction for the "Plot Histograms"
        self.actionPlot_Histograms = QtGui.QAction(parent=MainWindow)
        self.actionPlot_Histograms.setObjectName("actionPlot_Histograms")
        self.menuView.addAction(self.actionImage_2D)
        self.menuView.addAction(self.actionImage_3D)
        self.menuView.addAction(self.actionTable_properties)
        self.menuView.addAction(self.actionTable_histograms)
        self.menuView.addAction(self.actionConsole)
        self.menuView.addAction(self.actionPlot_Properties)
        self.menuView.addAction(self.actionPlot_Histograms)

    def _add_properties(self, MainWindow):
        # Create a new menu for "Properties"
        self.menuProperties = QtWidgets.QMenu(parent=self.menubar)
        self.menuProperties.setObjectName("menuProperties")
        # Create a new QAction for the "Mineralogy"
        self.actionMineralogy = QtGui.QAction(parent=MainWindow)
        self.actionMineralogy.setObjectName("actionMineralogy")
        # Create a new QAction for the "Surface"
        self.actionSurface = QtGui.QAction(parent=MainWindow)
        self.actionSurface.setObjectName("actionSurface")
        # Create a new QAction for the "Geometry"
        self.actionGeometry = QtGui.QAction(parent=MainWindow)
        self.actionGeometry.setObjectName("actionGeometry")
        self.menuProperties.addAction(self.actionMineralogy)
        self.menuProperties.addAction(self.actionSurface)
        self.menuProperties.addAction(self.actionGeometry)

    def _add_quantification(self, MainWindow):
        # Create a new menu for "Quantification"
        self.menuQuantification = QtWidgets.QMenu(parent=self.menubar)
        self.menuQuantification.setObjectName("menuQuantification")
        # Create a new QAction for the "Run Quantification"
        self.actionRun_Quantification = QtGui.QAction(parent=MainWindow)
        self.actionRun_Quantification.setObjectName("actionRun_Quantification")
        self.menuQuantification.addAction(self.actionRun_Quantification)

    def _add_help(self, MainWindow):
        # Create a new menu for "Help"
        self.menuHelp = QtWidgets.QMenu(parent=self.menubar)
        self.menuHelp.setObjectName("menuHelp")

        # Create a new QAction for the "About"
        self.actionAbout = QtGui.QAction(parent=MainWindow)
        self.actionAbout.setObjectName("actionAbout")

        # Create a new QAction for the "Code"
        self.actionCode = QtGui.QAction(parent=MainWindow)
        self.actionCode.setObjectName("actionCode")

        # Create a new QAction for the "Documentation"
        self.actionDocumentation = QtGui.QAction(parent=MainWindow)
        self.actionDocumentation.setObjectName("actionDocumentation")

        # Create a new QAction for the "Tutorial"
        self.actionTutorial = QtGui.QAction(parent=MainWindow)
        self.actionTutorial.setObjectName("actionTutorial")

        # Create a new QAction for the "Article"
        self.actionArticle = QtGui.QAction(parent=MainWindow)
        self.actionArticle.setObjectName("actionArticle")

        self.menuHelp.addAction(self.actionAbout)
        self.menuHelp.addAction(self.actionCode)
        self.menuHelp.addAction(self.actionDocumentation)
        self.menuHelp.addAction(self.actionTutorial)
        self.menuHelp.addAction(self.actionArticle)

    def _add_process(self, MainWindow):
        # Create a new menu for "Process"
        self.menuProcess = QtWidgets.QMenu(parent=self.menubar)
        self.menuProcess.setObjectName("menuProcess")
        # Create a new QAction for the "Export histograms"
        self.actionExport_histograms = QtGui.QAction(parent=MainWindow)
        self.actionExport_histograms.setObjectName("actionExport_histograms")

        self.actionOpenDataViewer = QtGui.QAction(parent=MainWindow)
        self.actionOpenDataViewer.setObjectName("actionOpenDataViewer")
        self.actionCloseDataViewer = QtGui.QAction(parent=MainWindow)
        self.actionCloseDataViewer.setObjectName("actionCloseDataViewer")

        self.menuProcess.addAction(self.actionExport_histograms)
        self.menuProcess.addAction(self.actionOpenDataViewer)
        self.menuProcess.addAction(self.actionCloseDataViewer)

    def _add_classification(self, MainWindow):
        # Create a new menu for "Classification"
        self.menuClassification = QtWidgets.QMenu(parent=self.menubar)
        self.menuClassification.setObjectName("menuClassification")
        # Create a new QAction for the "Class List"
        self.actionClass_List = QtGui.QAction(parent=MainWindow)
        self.actionClass_List.setObjectName("actionClass_List")
        # Create a new QAction for the "Class Criteria"
        self.actionClass_Criteria = QtGui.QAction(parent=MainWindow)
        self.actionClass_Criteria.setObjectName("actionClass_Criteria")
        # Create a new QAction for the "Run Classifier"
        self.actionRun_Classifier = QtGui.QAction(parent=MainWindow)
        self.actionRun_Classifier.setObjectName("actionRun_Classifier")
        # Create a new QAction for the "Peak Analysis"
        self.actionPeak_Analysis = QtGui.QAction(parent=MainWindow)
        self.actionPeak_Analysis.setObjectName("actionPeak_Analysis")
        self.menuClassification.addAction(self.actionClass_List)
        self.menuClassification.addAction(self.actionClass_Criteria)
        self.menuClassification.addAction(self.actionRun_Classifier)
        self.menuClassification.addAction(self.actionPeak_Analysis)

    def _add_project(self, MainWindow):
        # Create a new menu for "File"
        self.menuProject = QtWidgets.QMenu(parent=self.menubar)
        self.menuProject.setObjectName("menuFile")

        # Create a new QAction for the "Load project"
        self.actionLoad_project = QtGui.QAction(parent=MainWindow)
        self.actionLoad_project.setObjectName("actionLoad_project")

        # Create a new QAction for the "Create project"
        self.actionCreate_project = QtGui.QAction(parent=MainWindow)
        self.actionCreate_project.setObjectName("actionCreate_project")

        # Create a new QAction for the "Quit"
        self.actionQuit = QtGui.QAction(parent=MainWindow)
        self.actionQuit.setObjectName("actionQuit")

        # add actions to the menu file
        self.menuProject.addAction(self.actionCreate_project)
        self.menuProject.addAction(self.actionLoad_project)
        self.menuProject.addAction(self.actionQuit)

    def _add_segmentation(self, MainWindow):
        # Create a new menu for "Segmentation"
        self.menuSegmentation = QtWidgets.QMenu(parent=self.menubar)
        self.menuSegmentation.setObjectName("menuSegmentation")

        # Create a new QAction for the "Pre-process Grey"
        self.actionPre_process_Grey = QtGui.QAction(parent=MainWindow)
        self.actionPre_process_Grey.setObjectName("actionPre_process_Grey")

        # Create a new QAction for the "ParticleSeg3D"
        self.actionParticleSeg3D = QtGui.QAction(parent=MainWindow)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(
            QtGui.QPixmap(
                "c:\\Users\\daass73\\Desktop\\PlayGUI\\Main GUI\\1109play\\../SegmentIcon.png"
            ),
            QtGui.QIcon.Mode.Normal,
            QtGui.QIcon.State.Off,
        )
        self.actionParticleSeg3D.setIcon(icon2)
        self.actionParticleSeg3D.setObjectName("actionParticleSeg3D")

        # Create a new QAction for the "Threshold"
        self.actionThreshold = QtGui.QAction(parent=MainWindow)
        self.actionThreshold.setObjectName("actionThreshold")

        # Create a new QAction for the "Post-Process Binary"
        self.actionPost_Process_Binary = QtGui.QAction(parent=MainWindow)
        self.actionPost_Process_Binary.setObjectName("actionPost_Process_Binary")

        # Add actions to the menu segmentation
        self.menuSegmentation.addAction(self.actionPre_process_Grey)
        self.menuSegmentation.addAction(self.actionParticleSeg3D)
        self.menuSegmentation.addAction(self.actionThreshold)
        self.menuSegmentation.addAction(self.actionPost_Process_Binary)

    def _add_steps(self, MainWindow):
        # Create a new menu for "Segmentation"
        self.menuSteps = QtWidgets.QMenu(parent=self.menubar)
        self.menuSteps.setObjectName("Steps")

        # Create a new QAction for the "Check new steps"
        self.actionCheck_steps = QtGui.QAction(parent=MainWindow)
        self.actionCheck_steps.setObjectName("actionCheck_steps")

        # Create a new QAction for the "Update new steps"
        self.actionUpdate_steps = QtGui.QAction(parent=MainWindow)
        self.actionUpdate_steps.setObjectName("actionUpdate_steps")

        # Create a new QAction for the "Re-install all steps"
        self.actionReinstall_steps = QtGui.QAction(parent=MainWindow)
        self.actionReinstall_steps.setObjectName("actionReinstall_steps")

        self.menuSteps.addAction(self.actionCheck_steps)
        self.menuSteps.addAction(self.actionUpdate_steps)
        self.menuSteps.addAction(self.actionReinstall_steps)

    def _define_toolbar(self, MainWindow):
        # toolbar
        self.toolBar = QtWidgets.QToolBar(parent=MainWindow)
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(QtCore.Qt.ToolBarArea.TopToolBarArea, self.toolBar)
        # add actions to the toolbar
        self.toolBar.addAction(self.actionLoad_project)
        self.toolBar.addAction(self.actionParticleSeg3D)

    def _add_logging(self, MainWindow):
        # Create a new menu for "Log"
        self.menuLog = QtWidgets.QMenu(parent=self.menubar)
        self.menuLog.setObjectName("menuLog")
        # Create actions for logging levels
        self.actionLogNone = QtGui.QAction(parent=MainWindow)
        self.actionLogNone.setObjectName("actionLogNone")
        self.actionLogInfo = QtGui.QAction(parent=MainWindow)
        self.actionLogInfo.setObjectName("actionLogInfo")
        self.actionLogDebug = QtGui.QAction(parent=MainWindow)
        self.actionLogDebug.setObjectName("actionLogDebug")
        self.actionLogWarning = QtGui.QAction(parent=MainWindow)
        self.actionLogWarning.setObjectName("actionLogWarning")
        # Add actions to the "Log" menu
        self.menuLog.addAction(self.actionLogNone)
        self.menuLog.addAction(self.actionLogInfo)
        self.menuLog.addAction(self.actionLogDebug)
        self.menuLog.addAction(self.actionLogWarning)

    def retranslateUi(self, MainWindow):
        """Set the text for the UI components."""
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "Main_MSPaCMAn"))

        # Set titles for the "Help" menu and its actions
        self.menuHelp.setTitle(_translate("MainWindow", "Help"))
        self.actionAbout.setText(_translate("MainWindow", "About"))
        self.actionCode.setText(_translate("MainWindow", "Code"))
        self.actionDocumentation.setText(_translate("MainWindow", "Documentation"))
        self.actionTutorial.setText(_translate("MainWindow", "Tutorial"))
        self.actionArticle.setText(_translate("MainWindow", "Article"))

        # Set titles for the "Project" menu and its actions
        self.menuProject.setTitle(_translate("MainWindow", "Project"))
        self.actionCreate_project.setText(_translate("MainWindow", "Create project"))
        self.actionLoad_project.setText(_translate("MainWindow", "Load project"))
        self.actionQuit.setText(_translate("MainWindow", "Quit"))

        # Set titles for the "3D Viewer" menu and its actions
        self.menu3dviewer.setTitle(_translate("MainWindow", "3D Viewer"))
        self.actionOpenImage.setText(
            _translate("MainWindow", "Open Image in 3D Viewer")
        )
        self.actionSegmentation.setText(_translate("MainWindow", "Segment Image"))
        self.actionClose3DViewer.setText(_translate("MainWindow", "Close 3D Viewer"))

        # Set titles for the "Data Viewer" menu and its actions
        self.menuDataViewer.setTitle(_translate("MainWindow", "Data Viewer"))
        self.actionOpenDataViewer.setText(_translate("MainWindow", "Open Data Viewer"))
        self.actionCloseDataViewer.setText(
            _translate("MainWindow", "Close Data Viewer")
        )

        # Set titles for the "Classification" menu and its actions
        self.menuClassification.setTitle(_translate("MainWindow", "Classify"))
        self.actionClass_List.setText(_translate("MainWindow", "Class List"))
        self.actionClass_Criteria.setText(_translate("MainWindow", "Class Criteria"))
        self.actionRun_Classifier.setText(_translate("MainWindow", "Run Classifier"))
        self.actionPeak_Analysis.setText(_translate("MainWindow", "Peak Analysis"))

        # Set titles for the "Quantification" menu and its actions
        self.menuQuantification.setTitle(_translate("MainWindow", "Quantify"))
        self.actionRun_Quantification.setText(
            _translate("MainWindow", "Run Quantification")
        )

        # Set titles for the "Properties" menu and its actions
        self.menuProperties.setTitle(_translate("MainWindow", "Properties"))
        self.actionMineralogy.setText(_translate("MainWindow", "Mineralogy"))
        self.actionSurface.setText(_translate("MainWindow", "Surface"))
        self.actionGeometry.setText(_translate("MainWindow", "Geometry"))

        # Set titles for the "View" menu and its actions
        self.menuView.setTitle(_translate("MainWindow", "View"))
        self.actionImage_2D.setText(_translate("MainWindow", "Image 2D"))
        self.actionImage_3D.setText(_translate("MainWindow", "Image 3D"))
        self.actionTable_properties.setText(
            _translate("MainWindow", "Table properties")
        )
        self.actionTable_histograms.setText(
            _translate("MainWindow", "Table histograms")
        )
        self.actionConsole.setText(_translate("MainWindow", "Console"))
        self.actionPlot_Properties.setText(_translate("MainWindow", "Plot Properties"))
        self.actionPlot_Histograms.setText(_translate("MainWindow", "Plot Histograms"))

        # Set titles for the "Process" menu and its actions
        self.menuProcess.setTitle(_translate("MainWindow", "Process"))
        self.actionExport_histograms.setText(
            _translate("MainWindow", "Export histograms")
        )

        # Set titles for the "Extra" menu and its actions
        self.menuExtra.setTitle(_translate("MainWindow", "Extra"))
        self.actionHistograms16to8bit.setText(
            _translate("MainWindow", "Histograms16to8bit")
        )
        self.actionNormalizeVolume.setText(
            _translate("MainWindow", "NormalizeParticleVolume")
        )

        # Set titles for the "Segmentation" menu and its actions
        self.menuSegmentation.setTitle(_translate("MainWindow", "Segment"))
        self.actionPre_process_Grey.setText(
            _translate("MainWindow", "Pre-process Grey")
        )
        self.actionParticleSeg3D.setText(_translate("MainWindow", "ParticleSeg3D"))
        self.actionThreshold.setText(_translate("MainWindow", "Threshold"))
        self.actionPost_Process_Binary.setText(
            _translate("MainWindow", "Post-Process Binary")
        )

        # Set titles for the "Log" menu and its actions
        self.menuLog.setTitle(_translate("MainWindow", "Log"))
        self.actionLogNone.setText(_translate("MainWindow", "None"))
        self.actionLogInfo.setText(_translate("MainWindow", "Info"))
        self.actionLogDebug.setText(_translate("MainWindow", "Debug"))
        self.actionLogWarning.setText(_translate("MainWindow", "Warning"))

        # Set titles for the steps menue and its actions
        self.menuSteps.setTitle(_translate("MainWindow", "Steps"))
        self.actionCheck_steps.setText(_translate("MainWindow", "Check for new Steps"))
        self.actionUpdate_steps.setText(_translate("MainWindow", "Update new Steps"))
        self.actionReinstall_steps.setText(
            _translate("MainWindow", "Reinstall all Steps")
        )

        # toolbar
        # self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar"))
