Skip to content

Commit

Permalink
refactor: verificacao de janela ativa movida para MJanela
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulloClara committed Jan 12, 2020
1 parent 896b6e6 commit 8340f46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
27 changes: 7 additions & 20 deletions src/controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,10 @@ def iniciar(self, view, model) -> None:
self.home.filtrar(None, 'tarefa')

def fechar(self):
if self.view.atividade.cadastro.ativa:
self.view.atividade.cadastro.fechar()

if self.view.grupo.cadastro.ativa:
self.view.grupo.cadastro.fechar()

if self.view.home.cadastro_apresentacao.ativa:
self.view.home.cadastro_apresentacao.fechar()

if self.view.home.cadastro_evento.ativa:
self.view.home.cadastro_evento.fechar()

if self.view.home.cadastro_tarefa.ativa:
self.view.home.cadastro_tarefa.fechar()

if self.view.home.cadastro_apresentacao.ativa:
self.view.home.cadastro_apresentacao.fechar()

if self.view.janela_erro.ativa:
self.view.janela_erro.fechar()
self.view.janela_erro.fechar()
self.view.grupo.cadastro.fechar()
self.view.atividade.cadastro.fechar()
self.view.home.cadastro_evento.fechar()
self.view.home.cadastro_tarefa.fechar()
self.view.home.cadastro_apresentacao.fechar()
self.view.home.cadastro_apresentacao.fechar()
3 changes: 3 additions & 0 deletions src/utils/tk/janela.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def iniciar(self) -> None:

def fechar(self) -> None:
"""Destroi a janela"""
if not self.ativa:
return

if '<Destroy>' in self.defs.mcnf:
self.defs.mcnf['<Destroy>']()

Expand Down

0 comments on commit 8340f46

Please sign in to comment.