Exemple #1
0
    def log_in_success(self):
        """Determines if a player or administrator can enter to the game or
        player's administrator respectively"""
        self.language = LANGUAGE.get(self.lang)
        self.username = self.name_tf.text()
        self.password = Hash.encrypt(self.pass_tf.text())

        database = DbMethods()

        response = database.user_log_in(self.username, self.password)

        if response == 2:
            from adminWindow import AdminWindow
            self.admin = AdminWindow(self.lang)
            self.admin.show()
            self.close()
        elif response == 1:
            from menuWindow import Menu
            self.menu = Menu(self.lang, self.username)
            self.menu.show()
            self.close()
        elif response == 0:
            message = Message(self.language["wrong_pass"],
                              self.language["wrong_pass_text"])
            information_mess = message.create_iw_message(
                self.language["ok"], "information")
            information_mess.exec()
        elif response == -1:
            message = Message(self.language["user_no"],
                              self.language["fail_user"])
            information_mess = message.create_iw_message(
                self.language["ok"], "information")
            information_mess.exec()
        elif response == None:
            print("ERrrp")
	def reload_text(self):
		"""Change the language of the window according to the chosen previously"""
		self.language = LANGUAGE.get(self.lang)
		self.setWindowTitle(self.language["admin"])
		self.back_button.setText(self.language["log_out"])
		self.add_button.setText(self.language["add_users"])
		self.search_button.setText(self.language["search_users"])
Exemple #3
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.leaderboards_button.setText(self.language["leaderboards"])
     self.exit_button.setText(self.language["exit"])
     self.setWindowTitle(self.language["menu"])
     self.play_button.setText(self.language["play"])
Exemple #4
0
 def rotate(self):
     """Changes the value of the boolean variable 'upright'"""
     self.language = LANGUAGE.get(self.lang)
     self.upright = not self.upright
     if self.upright == True:
         self.rotation.setText(self.language["upright"])
     else:
         self.rotation.setText(self.language["horizontal"])
Exemple #5
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["set_ships"])
     self.shipsGroup.setTitle(self.language["ships"])
     self.rotate_button.setText(self.language["rotate"])
     self.clear_button.setText(self.language["clear_button"])
     self.ready_button.setText(self.language["ready"])
Exemple #6
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["add_user"])
     self.user_name_label.setText(self.language["username"])
     self.pass_label.setText(self.language["password"])
     self.confirm_pass_label.setText(self.language["confirm_pass"])
     self.add_button.setText(self.language["add_user"])
     self.back_button.setText(self.language["back"])
Exemple #7
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["change_pass"])
     self.username_label.setText(self.language["username"])
     self.password_label.setText(self.language["password"])
     self.password_text.setPlaceholderText(self.language["new_pass"])
     self.save_button.setText(self.language["save"])
     self.cancel_button.setText(self.language["cancel"])
Exemple #8
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["search"])
     self.back_button.setText(self.language["back"])
     self.edit_button.setText(self.language["change_pass"])
     self.delete_button.setText(self.language["delete"])
     self.search_text.setPlaceholderText(self.language["search"])
     self.result_table.setHorizontalHeaderItem(
         0, QTableWidgetItem(self.language["user_header"]))
Exemple #9
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["leaderboards"])
     self.leader_label.setText(self.language["leaderboards"])
     self.back_button.setText(self.language["back"])
     self.leader_table.setHorizontalHeaderItem(
         0, QTableWidgetItem(self.language["player"]))
     self.leader_table.setHorizontalHeaderItem(
         1, QTableWidgetItem(self.language["score"]))
Exemple #10
0
    def confirm_delete(self):
        """Ask if the administrator is sure to delete a player"""
        self.language = LANGUAGE.get(self.lang)
        message = Message(self.language["del_user"], self.language["del_info"])
        delete_message = message.create_question_message(self.language["yes"])
        response = delete_message.exec()

        if response == QMessageBox.Yes:
            self.delete_user()
        elif response == QMessageBox.No:
            delete_message.close()
Exemple #11
0
 def reload_text(self):
     """Change the language of the window according to the chosen
     previously"""
     self.language = LANGUAGE.get(self.lang)
     self.username_label.setText(self.language["username"])
     self.name_tf.setPlaceholderText(
         self.language["username_placeholder_input"])
     self.password_label.setText(self.language["password"])
     self.pass_tf.setPlaceholderText(
         self.language["password_placeholder_input"])
     self.log_in_button.setText(self.language["log_in"])
     self.setWindowTitle(self.language["log_in"])
Exemple #12
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["win_title"])
     self.win_label.setText(self.language["win_text"])
     self.win_button.setText(self.language["return_to_menu"])
Exemple #13
0
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.setWindowTitle(self.language["story"])
     self.video = self.language["video"]
 def reload_text(self):
     """Change the language of the window according to the chosen previously"""
     self.language = LANGUAGE.get(self.lang)
     self.choose_label.setText(self.language["choose"])
     self.play_button.setText(self.language["play"])
     self.setWindowTitle(self.language["choose"])