1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
class Files_copy_setup(Tkinter.Tk): #Copy the selected file(s) in local
def __init__(self, parent):
Tkinter.Tk.__init__(self, parent)
self.parent = parent
self.initialize()
def initialize(self):
self.grid()
texte = Tkinter.Label(self, text = copied_files_text, fg = "white", bg = "blue")
texte.grid(row = 0, sticky = 'EWN')
j = 0
for elt in input_values.files_to_detect:
self.texte = Tkinter.Label(self, text=elt, fg = "black", bg = "red")
self.texte.grid(row = 2 + j)
j = j + 1
button_continue = ttk.Button(self, text = u"Continue", command = self.OnButtonClickContinue)
button_continue.grid(row = (len(input_values.files_to_detect) + 3), sticky = 'S')
button_back = Tkinter.Button(self, text = u"Back", command = self.OnButtonClickBack)
button_back.grid(row = (len(input_values.files_to_detect) + 4), sticky = 'S')
button_kill = Tkinter.Button(self, text = u"Quit", command = self.OnButtonClickKill)
button_kill.grid(row = (len(input_values.files_to_detect) + 5), sticky = 'S')
self.alive = ttk.Progressbar(self, orient = "horizontal", length = 200, mode = "indeterminate")
self.alive.grid(row = (len(input_values.files_to_detect) + 6), sticky = 'S')
self.update()
self.geometry("%dx%d+%d+%d" % (self.winfo_reqwidth(), self.winfo_reqheight(), (self.winfo_screenwidth() - self.winfo_reqwidth()) / 2, (self.winfo_screenheight() - self.winfo_reqheight()) / 2))
self.resizable(False, False)
self.geometry(self.geometry())
self.mainloop()
def OnButtonClickContinue(self):
self.alive.start()
input_values.completion = 1
for i in input_values.files_to_detect:
full_file_name2 = os.path.join(input_values.path_video, i)
if not(os.path.isfile(full_file_name2)):
thread_copy = threading.Thread(shutil.copy(os.path.join(input_values.path_video_remote, i), input_values.path_video))
thread_copy.start()
self.destroy()
def OnButtonClickBack(self):
app = Fourth_Variable_Choice_remote(None)
input_values.completion = 0
self.destroy()
def OnButtonClickKill(self):
input_values.completion = 0
input_values.next_step_var = 1
self.destroy() |
Partager