Skip to content

Commit

Permalink
telas de confirmações (#181)
Browse files Browse the repository at this point in the history
* colocando menu mais detalhado na home

* correção do sub menu alinhado pra cima agr

* mudando icones

mudando icones conforme as atividades na aplicação, tipo mecher no menu ou minimizar e maximizar, etc

* arrumando algumas coisas so e os icones

* colocando menu simplificado e arrumando tabs

fiz um menu novo só com icones agr e arrumei o problema dos tabs tmb, alem de agr os botões ficarem clicados quando escolhem um deles

* mudando nome dos icones e atualizando informações da home e agr puxando telas de edit

* mudando os icones de erro e concluido

* colocando caminho certo no icone de tela cheia

* caminho do icone da tela maximizada agr

* adicionando tela de edit sala

* arrumando tabulação

* mudança na ortografia da tela de cadastro de login

* mudando o nome e zerando txt feadback

* tirando algumas validações q nn funcionam

* tela de concluido com 1 btn pra confirmar

* .

* tela de login funcionando sem erro agr

* comentando erros na tela de login, para tratativa de erro

* agr vai kkk

* wqkjhfweijfgqwiuf

* eygdafoawsd

* colocando telas de validação e confirmação

* passando as tratativas de sair da conta

* mudando formas de chamar o icone  de erro
  • Loading branch information
Surik4to06 authored Dec 9, 2024
1 parent c1265d3 commit 89f55ea
Show file tree
Hide file tree
Showing 8 changed files with 531 additions and 61 deletions.
36 changes: 34 additions & 2 deletions App/view/feadbackErro.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
from PyQt5.QtWidgets import QDialog
from PyQt5.uic import loadUi
from PyQt5.QtCore import Qt

class FeadbackErro(QDialog):
def __init__(self):
def __init__(self, txt):
super().__init__()
loadUi('App/view/ui/feadbackErro.ui',self)

#label do aviso do erro = #texto
self.texto.setText(txt)

# Remove a barra de título e as bordas da janela
self.setWindowFlags(Qt.FramelessWindowHint)

self.btnConfirmar.clicked.connect(self.reject)
self.btnFechar.clicked.connect(self.reject)

def mudarFoto(self, img):
if img == 'Validado':
self.setStyleSheet("""
#icon {
image: url(App/view/ui/icones/iconConcluido.png)
}
""")
else:
self.setStyleSheet("""
#icon {
image: url(App/view/ui/icones/iconErro.png)
}
""")



if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication
resp = FeadbackErro('sla')
app = QApplication([])
if resp.exec_():
print('ok')
else:
print('negado')
11 changes: 9 additions & 2 deletions App/view/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .editarReserva import EditarReserva
from .editarSala import EditarSala
from .reserva import ReservaInterface
from .telaConfirmacao import TelaConfirmacao

from App.controller.login import pegarUsuarioLogado, removerUsuarioLogado

Expand Down Expand Up @@ -66,6 +67,8 @@ def __init__(self):
self.btnEditarSimples.clicked.connect(lambda: self.trocarTelaMenu(self.editar))
self.btnEditar.clicked.connect(lambda: self.trocarTelaMenu(self.editar))

#btns da propria interface

# btns da propria interface
# Forma Corrigida para Setar Interface
#######################################
Expand Down Expand Up @@ -207,8 +210,12 @@ def on_btnFecharMenuQuebrado_clicked(self):
self.subMenuQuebrado.hide()

def fazer_logout(self):
removerUsuarioLogado()
self.close()
confirmacao = TelaConfirmacao("Tem certeza que deseja sair?", "Sim")
if confirmacao.exec_():
removerUsuarioLogado()
self.close()
else:
pass


if __name__ == "__main__":
Expand Down
19 changes: 12 additions & 7 deletions App/view/login.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from PyQt5.QtWidgets import QDialog, QMenu
from PyQt5.QtCore import Qt, QTimer, QPoint
from PyQt5.QtCore import pyqtSlot
from .feadbackErro import FeadbackErro
from PyQt5.uic import loadUi


from App.controller.login import validarLogin

#respostasErros = aviso erros
Expand Down Expand Up @@ -69,19 +71,22 @@ def getEmailSenha(self):
# # self.respostasErros.setText('LOGANDO...')
# QTimer.singleShot(2000, lambda: self.limparCampos(self.respostasErros))

# def dadosInvalidos(self):
# texto = 'DADOS INCOMPLETOS.'
# # self.respostasErros.setText(texto)
# QTimer.singleShot(2000, lambda: self.limparCampos(self.respostasErros))
def dadosInvalidos(self):
texto = 'DADOS INCOMPLETOS.'
resposta = FeadbackErro(texto)
# resposta.mudarFoto("Validado")
if resposta.exec_():
print('erro')



@pyqtSlot()
def on_btnEntrar_clicked(self):
campos = self.getEmailSenha()
if validarLogin(campos[0], campos[1]):
# self.validandoDados()
self.accept()
# else:
# self.dadosInvalidos()
else:
self.dadosInvalidos()

def limparCampos(self, campo):
campo.clear()
Expand Down
28 changes: 28 additions & 0 deletions App/view/telaConfirmacao.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from PyQt5.QtWidgets import QDialog
from PyQt5.uic import loadUi
from PyQt5.QtCore import Qt


class TelaConfirmacao(QDialog):
def __init__(self, aviso, txtBtnOk):
super().__init__()
loadUi('App/view/ui/telaConfirmacao.ui', self)
self.aviso.setText(aviso)
self.btnOk.clicked.connect(self.accept)
self.btnCancelar.clicked.connect(self.reject)
self.btnFechar.clicked.connect(self.reject)

# Remove a barra de título e as bordas da janela
self.setWindowFlags(Qt.FramelessWindowHint)

self.btnOk.setText(txtBtnOk)

if __name__ == "__main__":
from PyQt5.QtWidgets import QApplication
app = QApplication([])
info = TelaConfirmacao('Teste', "Sim")
if info.exec_():
print('ok')
else:
print('negado')

209 changes: 159 additions & 50 deletions App/view/ui/feadbackErro.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>838</width>
<height>144</height>
<height>189</height>
</rect>
</property>
<property name="minimumSize">
Expand All @@ -29,65 +29,174 @@
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
<string notr="true">#btnConfirmar {
border: none;
background-color: #01498a;
color: #FFF;
padding: 7px;
border-radius: 15px;
}

#btnFechar:hover {
background-color: #FF0000;
icon: url(&quot;App/view/ui/icones/iconCloseBranco.png&quot;);
}

#btnFechar {
border: none;
background-color: transparent;
}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="icon">
<property name="minimumSize">
<size>
<width>91</width>
<height>91</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>97</width>
<height>97</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>91</width>
<height>0</height>
</size>
</property>
<property name="midLineWidth">
<number>0</number>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="btnFechar">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>icones/iconErro.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="texto">
<property name="minimumSize">
<size>
<width>701</width>
<height>91</height>
</size>
<property name="icon">
<iconset>
<normaloff>icones/iconClosePreto.png</normaloff>icones/iconClosePreto.png</iconset>
</property>
<property name="maximumSize">
<property name="iconSize">
<size>
<width>999999</width>
<height>999999</height>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>17</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string/>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="icon">
<property name="minimumSize">
<size>
<width>91</width>
<height>91</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>97</width>
<height>97</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>91</width>
<height>0</height>
</size>
</property>
<property name="midLineWidth">
<number>0</number>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>icones/iconErro.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="texto">
<property name="minimumSize">
<size>
<width>701</width>
<height>91</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>999999</width>
<height>999999</height>
</size>
</property>
<property name="font">
<font>
<pointsize>17</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="btnConfirmar">
<property name="minimumSize">
<size>
<width>150</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
Expand Down
Binary file added App/view/ui/icones/iconAviso.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added App/view/ui/icones/iconExclamacao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 89f55ea

Please sign in to comment.