Skip to content

Commit

Permalink
Clean up destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Feb 16, 2015
1 parent 07c1bbb commit 2894291
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions khal/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,23 +527,16 @@ def edit(self, event):
:param event: event to edit
:type event: khal.event.Event
"""
self.destroy()
self.editor = True
editor = EventEditor(self.pane, event)

def teardown(data):
self.editor = False
self.update(self.date)
self.destroy()
self.pane.window.open(editor, callback=teardown)

def destroy(self, _=None, refresh=False):
"""
if an EventViewer or EventEditor is displayed, remove it
"""
if refresh and self.date is not None:
self.update(self.date)
self.editor = False
def destroy(self):
"""if an event is displayed, remove it"""
if (len(self.container.contents) > 2 and
isinstance(self.container.contents[2][0], EventDisplay)):
self.container.contents.pop()
Expand Down

0 comments on commit 2894291

Please sign in to comment.