Skip to content

Commit

Permalink
Fixes #9
Browse files Browse the repository at this point in the history
Bump patch number
  • Loading branch information
wsarce committed Apr 14, 2022
1 parent cc02ec6 commit f808d0e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions output_view_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ def add_session_event(self, events):

def undo_last_delete(self):
if self.deleted_event:
if type(self.deleted_event[1]) is list:
self.update_dur_event(self.deleted_event[0], (self.deleted_event[1][1] - self.deleted_event[1][0]))
else:
self.update_freq_event(self.deleted_event[0], 1)
self.add_session_event([self.deleted_event])
self.deleted_event = None

Expand All @@ -922,6 +926,10 @@ def delete_last_event(self):
self.sh_treeview_parents.pop(len(self.event_history) - 1)
self.deleted_event = self.event_history[-1]
self.event_history.pop(len(self.event_history) - 1)
if type(self.deleted_event[1]) is list:
self.update_dur_event(self.deleted_event[0], -(self.deleted_event[1][1] - self.deleted_event[1][0]))
else:
self.update_freq_event(self.deleted_event[0], -1)

def delete_dur_binding(self):
if self.current_selection1:
Expand All @@ -932,6 +940,19 @@ def delete_dur_binding(self):
def add_dur_popup(self):
NewKeyPopup(self, self.frame, True)

def update_freq_event(self, key_char, change):
for i in range(0, len(self.bindings)):
if self.bindings[i][1] == key_char:
self.bindings_freq[i] += change
self.freq_treeview.set(str(i), column="1", value=self.bindings_freq[i])

def update_dur_event(self, key_char, change):
for i in range(0, len(self.dur_bindings)):
if self.dur_bindings[i][1] == key_char:
self.sticky_dur[i] += change
self.sticky_start[i] = 0
self.dur_treeview.set(str(i), column="2", value=self.sticky_dur[i])

def check_key(self, key_char, start_time, current_frame, current_window):
return_bindings = []
for i in range(0, len(self.bindings)):
Expand Down
2 changes: 1 addition & 1 deletion ui_params.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cometrics_version = "1.0.9"
cometrics_version = "1.0.10"
ui_title = f"cometrics v{cometrics_version}"

cometrics_data_root = fr'C:\cometrics'
Expand Down

0 comments on commit f808d0e

Please sign in to comment.