# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MadiRadioUI1MainWindow.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 QtCore, QtGui, QtWidgets
#windows
from MadiRadioUI2NameWindow import Ui_MainWindowName
from MadiRadioUI3ChatWindow import Ui_MainWindowServer

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        #   MainWindow
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1000, 900)
        MainWindow.setMinimumSize(QtCore.QSize(550, 500))
        MainWindow.setTabShape(QtWidgets.QTabWidget.Rounded)
        #   StartMenu
        self.StartMenu = QtWidgets.QWidget(MainWindow)
        self.StartMenu.setObjectName("StartMenu")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.StartMenu)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        #   mainFrame
        self.mainFrame = QtWidgets.QFrame(self.StartMenu)
        font = QtGui.QFont()
        self.mainFrame.setFont(font)
        self.mainFrame.setFocusPolicy(QtCore.Qt.ClickFocus)
        self.mainFrame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.mainFrame.setFrameShadow(QtWidgets.QFrame.Plain)
        self.mainFrame.setLineWidth(6)
        self.mainFrame.setMidLineWidth(8)
        self.mainFrame.setObjectName("mainFrame")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.mainFrame)
        self.verticalLayout.setSpacing(18)
        self.verticalLayout.setObjectName("verticalLayout")
        #   TahaRadioLogo
        self.TahaRadioLogo = QtWidgets.QLabel(self.mainFrame)
        self.TahaRadioLogo.setObjectName("TahaRadioLogo")
        self.verticalLayout.addWidget(self.TahaRadioLogo)
        #   BUTTONS::
        #   selectnamePushButton
        self.selectnamePushButton_1 = QtWidgets.QPushButton(self.mainFrame)
        font = QtGui.QFont()
        font.setPointSize(14)
        self.selectnamePushButton_1.setFont(font)
        self.selectnamePushButton_1.setObjectName("selectnamePushButton_1")
        # self.MainWindowName_UI = Ui_MainWindowName()
        self.selectnamePushButton_1.clicked.connect(lambda: self.buttonOpenWindow(ui=Ui_MainWindowName()) )######
        self.verticalLayout.addWidget(self.selectnamePushButton_1)
        #   joinserverPushButton
        self.joinserverPushButton_2 = QtWidgets.QPushButton(self.mainFrame)
        font = QtGui.QFont()
        font.setPointSize(14)
        self.joinserverPushButton_2.setFont(font)
        self.joinserverPushButton_2.setObjectName("joinserverPushButton_2")
        self.joinserverPushButton_2.clicked.connect(lambda: self.buttonOpenWindow(ui=Ui_MainWindowServer()) )######
        self.verticalLayout.addWidget(self.joinserverPushButton_2)
        #   exitPushButton
        self.exitPushButton_3 = QtWidgets.QPushButton(self.mainFrame)
        font = QtGui.QFont()
        font.setPointSize(14)
        self.exitPushButton_3.setFont(font)
        self.exitPushButton_3.setObjectName("exitPushButton_3")
        self.exitPushButton_3.clicked.connect(lambda: sys.exit(app.exec_()) )######
        self.verticalLayout.addWidget(self.exitPushButton_3)

        self.verticalLayout_2.addWidget(self.mainFrame)
        MainWindow.setCentralWidget(self.StartMenu)
        # self.menubar = QtWidgets.QMenuBar(MainWindow)
        # self.menubar.setGeometry(QtCore.QRect(0, 0, 600, 22))
        # self.menubar.setObjectName("menubar")
        # MainWindow.setMenuBar(self.menubar)
        # self.statusbar = QtWidgets.QStatusBar(MainWindow)
        # self.statusbar.setObjectName("statusbar")
        # MainWindow.setStatusBar(self.statusbar)
        # self.TahaRadioLogo.setBuddy(self.TahaRadioLogo)

        self.retranslateUi(MainWindow)
        # QtCore.QMetaObject.connectSlotsByName(MainWindow)
        # MainWindow.setTabOrder(self.selectnamePushButton_1, self.joinserverPushButton_2)
        # MainWindow.setTabOrder(self.joinserverPushButton_2, self.exitPushButton_3)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "Madi Radio"))
        MainWindow.setStyleSheet('''
            .QMainWindow{
                background-color: rgba(38,8,24,255);
            }
            .QPushButton{
                border: 3px solid #440f2b;
                border-style: outset;
                background-color: #4c1130;
                color: white;
                margin-left: 100px;
                margin-right: 100px;
                padding: 5px;
                border-radius: 15px;
            }
            .QPushButton::hover{
                border: 3px solid #6b1e47;
                background-color: #591539;
                color: pink;
            }
                
        ''')
        self.TahaRadioLogo.setText(_translate("MainWindow", 
        """<html>
            <head/>
                <body>
                    <p align="center">
                        <span style="font:45px; color:#ffffff;">Taha's Radio<br/>Welcome</span>
                    </p>
                </body>
            </html>"""))
        self.TahaRadioLogo.setStyleSheet("margin: 50%;")
        self.selectnamePushButton_1.setText(_translate("MainWindow", "Select Name"))

        self.selectnamePushButton_1.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.joinserverPushButton_2.setText(_translate("MainWindow", "Join Server"))

        self.joinserverPushButton_2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.exitPushButton_3.setText(_translate("MainWindow", "Exit"))
        self.exitPushButton_3.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))

    def buttonOpenWindow(self,ui):
        self.Window = QtWidgets.QMainWindow()
        self.ui = ui
        self.ui.setupUi(self.Window)
        windowName = self.Window.objectName()
        if  windowName == 'MainWindowName':
            # MainWindow.setWindowFlag
            pass

        if windowName == 'MainWindowServer':
            MainWindow.hide()
        
        self.Window.show()
        

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