From 8d12e15f07b072fe7df954df1d0da1b9bb8a6da2 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Sun, 30 Oct 2022 19:55:08 +0000 Subject: [PATCH] Paste To The End of the checklist --- studio/checklist.py | 51 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/studio/checklist.py b/studio/checklist.py index 79d9dca..50c6711 100644 --- a/studio/checklist.py +++ b/studio/checklist.py @@ -188,7 +188,7 @@ def get_fraction(win, path): # This function will return a fraction of a given checklist. It will ignore # complitelly what is the asset / shot / project the checklist is from. - # For sake of making this function actually somewhat useful, aka not bloated + # For sake of making this function actually somewhat useful, aka not bloated3 # I will use it to cashe the whole checklist data objects. So they could be # easily accesable later on. @@ -1164,7 +1164,56 @@ def draw(outlayer, win, path, back="story_editor"): win.scroll["checklist"] + cXY[1]+25 ) layer.show_text(talk.text("copy_checklist_to_clipboard")) + + cXY[1] = cXY[1] + 50 + def do(): + + clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) + cliptext = str(clipboard.wait_for_text()) + + savetext = "" + for i in cliptext.split("\n"): + if "[ ]" in i or "[V]" in i or "[v]" in i: + savetext = savetext + "\n"+i.replace("[V]", "[ ]").replace("[v]", "[ ]") + else: + savetext = savetext + "\n[ ] #"+i + cliptext = savetext[1:] + + + s = open(path, 'ab') + s.write(cliptext.encode("utf-8")) + s.close() + + win.checklists[path] = get_list(path) + + + UI_elements.roundrect(layer, win, + cXY[0], + win.scroll["checklist"] + cXY[1], + width - cXY[0], + 40, + 10, + button=do, + icon="copy_file", + offset=[x,y]) + + UI_color.set(layer, win, "progress_background") + UI_elements.roundrect(layer, win, + cXY[0], + win.scroll["checklist"] + cXY[1], + width - cXY[0], + 40, + 10, + fill=False) + layer.stroke() + + layer.set_font_size(20) + layer.move_to( + cXY[0]+50, + win.scroll["checklist"] + cXY[1]+25 + ) + layer.show_text(talk.text("copy_to_checklist_from_clipboard"))