Skip to content

Commit 1df123e

Browse files
authored
Add option for OC snapshot
1 parent d5357a7 commit 1df123e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ProperTree.command

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ class ProperTree:
9393
file_menu.add_command(label="Save As ({}Shift+S)".format(sign), command=self.save_plist_as)
9494
file_menu.add_command(label="Duplicate ({}D)".format(sign), command=self.duplicate_plist)
9595
file_menu.add_separator()
96+
file_menu.add_command(label="OC Snapshot ({}R)".format(sign), command=self.oc_snapshot)
97+
file_menu.add_separator()
9698
file_menu.add_command(label="Convert Window ({}T)".format(sign), command=self.show_convert)
9799
file_menu.add_command(label="Strip Comments ({}M)".format(sign), command=self.strip_comments)
98100
file_menu.add_separator()
@@ -115,6 +117,7 @@ class ProperTree:
115117
self.tk.bind_all("<{}-z>".format(key), self.undo)
116118
self.tk.bind_all("<{}-Z>".format(key), self.redo)
117119
self.tk.bind_all("<{}-m>".format(key), self.strip_comments)
120+
self.tk.bind_all("<{}-r>".format(key), self.oc_snapshot)
118121
if not str(sys.platform) == "darwin":
119122
# Rewrite the default Command-Q command
120123
self.tk.bind_all("<{}-q>".format(key), self.quit)
@@ -135,6 +138,16 @@ class ProperTree:
135138
return
136139
window.change_data_display(new_data)
137140

141+
def oc_snapshot(self, event = None):
142+
windows = self.stackorder(self.tk)
143+
if not len(windows):
144+
# Nothing to save
145+
return
146+
window = windows[-1] # Get the last item (most recent)
147+
if window == self.tk:
148+
return
149+
window.oc_snapshot(event)
150+
138151
def close_window(self, event = None, check_close = True):
139152
# Remove the default window that comes from it
140153
if str(sys.platform) == "darwin":
@@ -361,4 +374,4 @@ class ProperTree:
361374
self.tk.destroy()
362375

363376
if __name__ == '__main__':
364-
p = ProperTree()
377+
p = ProperTree()

0 commit comments

Comments
 (0)