Exemplo n.º 1
0
 def __btn_callback(self, btn):
     if btn == "Historico":
         self.historicoView.show(btn)
     if btn == "Trocas":
         self.trocasView.show(btn)
     if btn == "Transferencias":
         self.transferenciasView.show(btn)
     if btn == "Deposito":
         self.transferenciasView.show(btn)
     if btn == "Logout":
         SubWindow.get_app_gui(self).stop()
Exemplo n.º 2
0
    def __init__(self, app, title):
        SubWindow.__init__(self, app, title)
        SubWindow.set_size(self, "500x400")
        SubWindow.add_label(self, "Trocas")

        prizes = [
            Prize("Meio Ponto da Media", 10),
            Prize("Correcao Mais Leve", 30),
            Prize("Trabalho Mais Facil", 30),
            Prize("Duplas de 3", 50)
        ]

        for p in prizes:
            SubWindow.add_check_box(
                self, p.get_descricao(),
                p.get_descricao() + "\t" + str(p.get_valor()) + " poopts")

        SubWindow.add_btns(self, ["Efetivar Trocas", "Sair das Trocas"],
                           self.__btn_callback)
Exemplo n.º 3
0
 def btn_callback(self, btn):
     if btn == "End Signup":
         new_street = SubWindow.get_entry(self, "St.")
         new_neighborhood = SubWindow.get_entry(self, "Neighborhood")
         new_city = SubWindow.get_entry(self, "City")
         new_state = SubWindow.get_option_box(self, "State")
         new_number = SubWindow.get_spin_box(self, "Number")
         new_address = Address(street=new_street, neighborhood=new_neighborhood, city=new_city,
                               state=new_state, number=new_number)
         new_user = self.__app.getEntry("New Username")
         new_password = self.__app.getEntry("New Password")
         new_cpf = self.__app.getEntry("CPF")
         new_student = Student(address=new_address, username=new_user, cpf=new_cpf, password=new_password)
         if new_student.save():
             self.hide(self.__title)
         else:
             error_view = ErrorView(self.__app, "Signup Error")
             error_view.show(self)
     elif btn == "Cancel Signup":
         self.hide(self.__title)
Exemplo n.º 4
0
    def __init__(self, app, title):
        SubWindow.__init__(self, app, title)
        SubWindow.set_size(self, "500x400")
        SubWindow.add_label(self, "Deposito")

        SubWindow.add_option_box(self, "Aluno a Receber Deposito", ["Hugo", "Romulo"])

        SubWindow.add_entry(self, "Valor Do Deposito")

        SubWindow.add_btns(self, ["Efetivar Deposito", "Sair de Deposito"], self.__btn_callback)
Exemplo n.º 5
0
 def __btn_callback(self, btn):
     if btn == "Sair de Deposito":
         SubWindow.hide(self, "Deposito")
     if btn == "Efetivar Deposito":
         print("logica para Efetivar Deposito")
Exemplo n.º 6
0
 def __init__(self, app, title, user, balance):
     SubWindow.__init__(self, app, title)
     SubWindow.set_size(self, "500x400")
     SubWindow.add_label(self, "Bem vindo," + user + " .")
     SubWindow.add_btns(
         self,
         ["Historico", "Trocas", "Transferencias", "Deposito", "Logout"],
         self.__btn_callback)
     SubWindow.add_label(self, "Seu saldo é " + balance)
     SubWindow.add_label(self, "Sua ultima transação foi ...")
     db_controller = DBController()
     all_users = db_controller.select_data("users")
     all_users_array = []
     for obj in all_users:
         all_users_array.append(obj['username'])
     self.historicoView = HistoricoView(SubWindow.get_app_gui(self),
                                        "Historico")
     self.trocasView = TrocasView(SubWindow.get_app_gui(self), "Trocas")
     self.transferenciasView = TransferenciasView(
         SubWindow.get_app_gui(self), "Transferencias", all_users_array,
         user)
     self.depositoView = DepositoView(SubWindow.get_app_gui(self),
                                      "Deposito")
Exemplo n.º 7
0
 def __init__(self, app, title="Poopt Signup"):
     SubWindow.__init__(self, app, title)
     self.__app = app
     self.__title = title
     SubWindow.add_label_validation_field(self, "New Username")
     SubWindow.add_label_secret_field(self, "New Password")
     SubWindow.add_entry(self, "CPF")
     SubWindow.add_entry(self, "St.")
     SubWindow.add_entry(self, "Neighborhood")
     SubWindow.add_spin_box_range(self, "Number", 1, 9999)
     SubWindow.add_entry(self, "City")
     SubWindow.add_option_box(self, "State", ["AC", "AL", "AM", "AP", "BA", "CE", "DF", "ES", "GO", "MA",
                                               "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN",
                                               "RO", "RS", "RR", "SC", "SE", "SP", "TO"])
     SubWindow.set_btn_callback(self, self.btn_callback)
     SubWindow.add_btn(self, "End Signup")
     SubWindow.add_btn(self, "Cancel Signup")
Exemplo n.º 8
0
    def __init__(self, app, title, all_users, current_user):
        SubWindow.__init__(self, app, title)
        SubWindow.set_size(self, "500x400")
        SubWindow.add_label(self, "Transferencias")

        # so vai aprecer se usuario for professor
        SubWindow.add_option_box(self, "De Aluno", [current_user])

        SubWindow.add_option_box(self, "Para Aluno", all_users)

        SubWindow.add_entry(self, "Valor")

        SubWindow.add_btns(
            self, ["Efetivar Transferencia", "Sair das Transferencias"],
            self.__btn_callback)
Exemplo n.º 9
0
 def __btn_callback(self, btn):
     if btn == "Sair das Trocas":
         SubWindow.hide(self, "Trocas")
     if btn == "Efetivar Trocas":
         print("logica para efetivar trocas")
Exemplo n.º 10
0
 def __btn_callback(self, btn):
     if btn == "Sair das Transferencias":
         SubWindow.hide(self, "Transferencias")
     if btn == "Efetivar Transferencia":
         print("logica para Efetivar Transferencia")
Exemplo n.º 11
0
    def __init__(self, app, title):
        SubWindow.__init__(self, app, title)
        SubWindow.set_size(self, "500x400")
        SubWindow.add_label(self, "Historico de Transacoes")

        # so vai aprecer se usuario for professor
        SubWindow.add_option_box(self, "Aluno", ["Hugo", "Romulo"])

        historico = [
            Transacao("10/10/2017", "Aquisicao de Premio", -10),
            Transacao("15/10/2017", "Bonificacao do Professor", 30),
            Transacao("10/11/2017", "Tranferencia para amigo", -10),
        ]

        for t in historico:
            SubWindow.add_label(self, t.get_data() + "\t" + t.get_descricao() + "\t" + str(t.get_valor()) + " poopts")

        SubWindow.add_btns(self, ["Sair do Historico"], self.__btn_callback)
Exemplo n.º 12
0
 def __btn_callback(self, btn):
     if btn == "Sair do Historico":
         SubWindow.hide(self, "Historico")
Exemplo n.º 13
0
 def __init__(self, app, title):
     self.__app = app
     self.__title = title
     SubWindow.__init__(self, app, title)
     SubWindow.set_size(self, "400x200")
     SubWindow.add_entry(self, "Database Host")
     SubWindow.add_entry(self, "Database Name")
     SubWindow.add_label_secret_field(self, "Database Password")
     SubWindow.add_btn(self, "Confirm")
     SubWindow.set_btn_callback(self, self.confirm_callback)
Exemplo n.º 14
0
 def __init__(self, app, title):
     SubWindow.__init__(self, app, title)