Skip to content

Commit

Permalink
Merge pull request #51 from davidfokkema/fix-dirty-timer
Browse files Browse the repository at this point in the history
Correctly restart dirty flag timer
  • Loading branch information
davidfokkema authored Apr 12, 2022
2 parents 5e5c88f + 7bafb55 commit 17b36b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tailor/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def __init__(self):
# store reference to this code in data tab
self.ui.data.code = self

# set up dirty timer
self._dirty_timer = QtCore.QTimer()
self._dirty_timer.timeout.connect(self.mark_project_dirty)

# clear all program state
self.clear_all()

# Enable close buttons...
Expand Down Expand Up @@ -293,7 +298,7 @@ def mark_project_dirty(self, is_dirty=True):
self.update_window_title()
if not is_dirty:
# FIXME: this can be implemented much better by actually detecting changes.
QtCore.QTimer.singleShot(DIRTY_TIMEOUT, self.mark_project_dirty)
self._dirty_timer.start(DIRTY_TIMEOUT)

def column_moved(self, logidx, oldidx, newidx):
"""Move column in reaction to UI signal.
Expand Down

0 comments on commit 17b36b0

Please sign in to comment.