Commit 90827451 authored by dwoiwode's avatar dwoiwode
Browse files

Enable GUI when pad is approved

parent 32d77f58
......@@ -46,9 +46,10 @@ class ProtokollGUI(tk.Tk):
self.currentPads = [p for p in self.folders[folderName] if isinstance(p, pter.ProtocolPad)]
for i, pad in enumerate(self.currentPads):
assert isinstance(pad, pter.ProtocolPad)
tk.Label(self.padFrame, text=pad.source.url, anchor=tk.W, bg="red").grid(row=i, column=0,
sticky=tk.W) # URL
tk.Label(self.padFrame,, anchor=tk.W, bg="blue").grid(row=i, column=1) # Date
approvedState = tk.NORMAL if pad.isApproved else tk.DISABLED
color = "green" if pad.isApproved else "red"
tk.Label(self.padFrame,"%Y-%m-%d"), anchor=tk.W).grid(row=i, column=0) # Date
tk.Label(self.padFrame, text=pad.source.url, anchor=tk.W).grid(row=i, column=1, sticky=tk.W) # URL
# Button Download
btnDownload = tk.Button(self.padFrame, text="Download",
btnDownload.grid(row=i, column=2)
......@@ -62,16 +63,16 @@ class ProtokollGUI(tk.Tk):
btnMailFR.grid(row=i, column=4)
# Button Mail FR-Info
btnMailFRInfo = tk.Button(self.padFrame, text="FR-Info Mail", state=tk.DISABLED,
btnMailFRInfo = tk.Button(self.padFrame, text="FR-Info Mail", state=approvedState, bg=color,
btnMailFRInfo.grid(row=i, column=5)
# Button Website
btnWebsite = tk.Button(self.padFrame, text="Approved Website", state=tk.DISABLED, command=pad.uploadToGrav)
btnWebsite = tk.Button(self.padFrame, text="Approved Website", state=approvedState, bg=color, command=pad.uploadToGrav)
btnWebsite.grid(row=i, column=6)
# Button Cloud
btnCloud = tk.Button(self.padFrame, text="Approved Cloud", state=tk.DISABLED, command=pad.uploadToCloud)
btnCloud = tk.Button(self.padFrame, text="Approved Cloud", state=approvedState, bg=color, command=pad.uploadToCloud)
btnCloud.grid(row=i, column=7)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment