Esempio n. 1
0
    def createteam(self):
        # sends team data to the mainwindow.py
        team_name = self.teamname.text()
        if len(team_name) == 0:
            self.alert = QtWidgets.QWidget()
            self.ui = Ui_alert(self, 'Please enter a team name')
            self.ui.setupUi(self.alert)
            self.alert.show()
        else:
            team1 = self.team1.currentText()
            team2 = self.team2.currentText()
            team1_id = 0
            team2_id = 1

            for team in self.teams:
                if team1 == team[1]:
                    team1_id = team[0]
                if team2 == team[1]:
                    team2_id = team[0]

            self.parent.createteam(team_name, team1_id, team2_id)
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.ui = Ui_alert()
     self.ui.setupUi(self)
Esempio n. 3
0
 def user_alert(self, message):
     # opens the alert.py window with message in it
     self.alert = QtWidgets.QWidget()
     self.ui = Ui_alert(self, message)
     self.ui.setupUi(self.alert)
     self.alert.show()