1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Convert button disabled if no file is on the list

This commit is contained in:
Ciro Mattia Gonano
2013-03-06 23:17:22 +01:00
parent 2dab7a707b
commit 36516fd594

View File

@@ -28,6 +28,7 @@ import comic2ebook
import kindlestrip
from image import ProfileData
from subprocess import call
from subprocess import check_call
import os
import shutil
import stat
@@ -65,6 +66,13 @@ class MainWindow:
for afile in self.filelist:
self.filelocation.insert(END, afile)
self.filelocation.config(state=DISABLED)
try:
if len(self.filelist) > 0:
self.submit['state'] = NORMAL
else:
self.submit['state'] = DISABLED
except AttributeError:
pass
def initialize(self):
self.filelocation = Listbox(self.master)
@@ -124,7 +132,7 @@ class MainWindow:
self.aEntry['state'] = DISABLED
self.aEntry.grid(column=3, row=(self.master.grid_size()[1] - 1), sticky=W + N + S)
self.submit = Button(self.master, text="CONVERT", command=self.start_conversion, fg="red")
self.submit = Button(self.master, text="CONVERT", command=self.start_conversion, fg="red", state=DISABLED)
self.submit.grid(columnspan=4, sticky=W + E + N + S)
aLabel = Label(self.master, text="File progress:", anchor=W, justify=LEFT)
aLabel.grid(column=0, sticky=E)