Upload files to 'studio'
This commit is contained in:
parent
1c2d11549b
commit
98e416296d
3 changed files with 100 additions and 7 deletions
|
@ -4,6 +4,12 @@
|
||||||
import os
|
import os
|
||||||
import cairo
|
import cairo
|
||||||
|
|
||||||
|
try:
|
||||||
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gdk
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
#UI modules
|
#UI modules
|
||||||
from UI import UI_elements
|
from UI import UI_elements
|
||||||
from UI import UI_color
|
from UI import UI_color
|
||||||
|
@ -296,14 +302,21 @@ def save(path, data):
|
||||||
indent[0] = indent[0] - 4
|
indent[0] = indent[0] - 4
|
||||||
|
|
||||||
writetasks(data["subtasks"])
|
writetasks(data["subtasks"])
|
||||||
|
|
||||||
|
if path:
|
||||||
|
# Writting to file
|
||||||
|
w = open(path, "w")
|
||||||
|
|
||||||
|
for i in lines:
|
||||||
|
w.write(i+"\n")
|
||||||
|
|
||||||
# Writting to file
|
w.close()
|
||||||
w = open(path, "w")
|
|
||||||
|
ret = ""
|
||||||
for i in lines:
|
for i in lines:
|
||||||
w.write(i+"\n")
|
ret = ret+"\n"+i
|
||||||
|
ret = ret[1:]
|
||||||
w.close()
|
return ret
|
||||||
|
|
||||||
def draw(outlayer, win, path, back="story_editor"):
|
def draw(outlayer, win, path, back="story_editor"):
|
||||||
|
|
||||||
|
@ -1115,6 +1128,43 @@ def draw(outlayer, win, path, back="story_editor"):
|
||||||
win.scroll["checklist"] + cXY[1]+25
|
win.scroll["checklist"] + cXY[1]+25
|
||||||
)
|
)
|
||||||
layer.show_text(talk.text("add_new_task"))
|
layer.show_text(talk.text("add_new_task"))
|
||||||
|
|
||||||
|
cXY[1] = cXY[1] + 100
|
||||||
|
|
||||||
|
|
||||||
|
def do():
|
||||||
|
|
||||||
|
raw = save(False, win.checklists[path])
|
||||||
|
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
|
||||||
|
clipboard.set_text( raw , -1)
|
||||||
|
|
||||||
|
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_checklist_to_clipboard"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -576,6 +576,10 @@ def layer(win, call):
|
||||||
|
|
||||||
def do():
|
def do():
|
||||||
win.current["selecting_render_file_format"] = not win.current["selecting_render_file_format"]
|
win.current["selecting_render_file_format"] = not win.current["selecting_render_file_format"]
|
||||||
|
if win.current["selecting_render_file_format"]:
|
||||||
|
win.scroll["render"] = win.scroll["render"]-50*len(formats)
|
||||||
|
win.current["LMB"] = False
|
||||||
|
win.previous["LMB"] = False
|
||||||
|
|
||||||
UI_elements.roundrect(layer, win,
|
UI_elements.roundrect(layer, win,
|
||||||
x+120,
|
x+120,
|
||||||
|
|
|
@ -1935,6 +1935,42 @@ def layer(win):
|
||||||
layer.set_font_size(20)
|
layer.set_font_size(20)
|
||||||
layer.move_to( x+50, y+(50*num)+25)
|
layer.move_to( x+50, y+(50*num)+25)
|
||||||
layer.show_text(talk.text(shot_options[option]))
|
layer.show_text(talk.text(shot_options[option]))
|
||||||
|
|
||||||
|
# Add checklist from clipboard
|
||||||
|
|
||||||
|
def do():
|
||||||
|
|
||||||
|
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
|
||||||
|
cliptext = str(clipboard.wait_for_text())
|
||||||
|
|
||||||
|
filepath = win.project+"/rnd"+win.cur+"/shot.progress"
|
||||||
|
s = open(filepath, 'w')
|
||||||
|
s.write(cliptext)
|
||||||
|
s.close()
|
||||||
|
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
x,
|
||||||
|
y+(50*num+50),
|
||||||
|
width,
|
||||||
|
40,
|
||||||
|
10,
|
||||||
|
button=do,
|
||||||
|
icon="checklist_new")
|
||||||
|
|
||||||
|
UI_color.set(layer, win, "progress_background")
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
x,
|
||||||
|
y+(50*num+50),
|
||||||
|
width,
|
||||||
|
40,
|
||||||
|
10,
|
||||||
|
fill=False)
|
||||||
|
layer.stroke()
|
||||||
|
|
||||||
|
UI_color.set(layer, win, "text_normal")
|
||||||
|
layer.set_font_size(20)
|
||||||
|
layer.move_to( x+50, y+(50*num+50)+25)
|
||||||
|
layer.show_text(talk.text("new_checklist_from_clipboard"))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
@ -2532,7 +2568,10 @@ def layer(win):
|
||||||
Pb.paint()
|
Pb.paint()
|
||||||
|
|
||||||
imageurl = win.project+"/rnd"+win.cur+"/"+win.current[shotis+"_active_folder"]+"/0001.png"
|
imageurl = win.project+"/rnd"+win.cur+"/"+win.current[shotis+"_active_folder"]+"/0001.png"
|
||||||
|
try:
|
||||||
|
os.makedirs(win.project+"/rnd"+win.cur+"/"+win.current[shotis+"_active_folder"])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
Pc.write_to_png(imageurl)
|
Pc.write_to_png(imageurl)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue