Paste To The End of the checklist

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2022-10-30 19:55:08 +00:00
parent 13af5f1839
commit 8d12e15f07

View file

@ -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"))