Index: bk_manager/trunk/functions/functions.py =================================================================== diff --git a/bk_manager/trunk/functions/functions.py b/bk_manager/trunk/functions/functions.py --- a/bk_manager/trunk/functions/functions.py (revision 48) +++ b/bk_manager/trunk/functions/functions.py (revision 49) @@ -126,7 +126,7 @@ var_tmp += var_size_i #Se acumulan el tamaño de los archivos de la lista #Si el tamaño acumulado es mayor que el de el DVD - if var_tmp > self.var_Dcapacity: + if var_tmp > (self.var_Dcapacity * 1024): var_tmp -= var_size_i #se quita el tamaño sumado para mostrar el tamaño real #se crea un archivo con numeral en el sufijo y extension .dat var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w") Index: bk_manager/trunk/functions/functions2.py =================================================================== diff --git a/bk_manager/trunk/functions/functions2.py b/bk_manager/trunk/functions/functions2.py --- a/bk_manager/trunk/functions/functions2.py (revision 48) +++ b/bk_manager/trunk/functions/functions2.py (revision 49) @@ -64,4 +64,40 @@ self.chkDevD.setChecked(False) self.chkDevD.setEnabled(False) +def enabled_items1(var_bool, self): + self.tabParameters.setEnabled(not(var_bool)) + self.lstDcapacity.setEnabled(not(var_bool)) + self.txtDcapacity.setEnabled(not(var_bool)) + self.btnGbkp.setEnabled(not(var_bool)) + self.btnRestart.setEnabled(var_bool) + self.btnStartburn.setEnabled(var_bool) + +def make_parameters_conf(self): + var_file = open("parameters.conf","w") + + var_file.write(self.var_Dpath+"\n") + var_file.write(self.var_Rpath+"\n") + var_file.write(str(self.var_lstDtype)+"\n") + var_file.write(self.var_Dtype+"\n") + var_file.write(self.var_Elabel+"\n") + var_file.write(str(self.var_Copys)+"\n") + var_file.write(str(self.var_lstDcapacity)+"\n") + var_file.write(str(self.var_Dcapacity)+"\n") + var_file.close() + + +def get_parameters_conf(self): + var_file = open("parameters.conf","w") + + var_file.write(self.var_Dpath+"\n") + var_file.write(self.var_Rpath+"\n") + var_file.write(str(self.var_lstDtype)+"\n") + var_file.write(self.var_Dtype+"\n") + var_file.write(self.var_Elabel+"\n") + var_file.write(str(self.var_Copys)+"\n") + var_file.write(str(self.var_lstDcapacity)+"\n") + var_file.write(str(self.var_Dcapacity)+"\n") + + var_file.close() + Index: bk_manager/trunk/ui/MainWindow.py =================================================================== diff --git a/bk_manager/trunk/ui/MainWindow.py b/bk_manager/trunk/ui/MainWindow.py --- a/bk_manager/trunk/ui/MainWindow.py (revision 48) +++ b/bk_manager/trunk/ui/MainWindow.py (revision 49) @@ -29,6 +29,19 @@ def setupUi2(self): + sys.stdout = self + + var_tmp = os.path.isfile("parameters.conf") + + if var_tmp == True: + self.txtInfo.append("Archivo de configuracion encontrado") + functions2.get_parameters_conf(self) + + else: + self.txtInfo.append("Elija los parametros de configuracion") + +# os.remove("parameters.conf") + self.statusDpath = False self.statusRpath = False @@ -36,10 +49,12 @@ self.var_Dpath = self.txtDpath.text() self.var_Rpath = self.txtRpath.text() + self.var_lstDtype = self.lstDtype.currentIndex() self.var_Dtype = self.txtDtype.text() self.var_Elabel = self.txtElabel.text() self.var_Copys = self.txtCopys.value() - self.var_Dcapacity = self.txtDcapacity.value() * 1024 + self.var_lstDcapacity = self.lstDcapacity.currentIndex() + self.var_Dcapacity = self.txtDcapacity.value() self.var_n_discs=0 self.var_list=[] @@ -135,8 +150,8 @@ @pyqtSignature("") def on_txtDcapacity_editingFinished(self): - self.var_Dcapacity = self.txtDcapacity.value() * 1024 #tamaño en KB - + self.var_Dcapacity = self.txtDcapacity.value() + @pyqtSignature("int") #CLOSED def on_lstStartDay_activated(self, index): @@ -192,7 +207,7 @@ self.txtDcapacity.setValue(100.0) self.txtDcapacity.setReadOnly(False) - self.var_Dcapacity = self.txtDcapacity.value() * 1024 #tamaño en KB + self.var_Dcapacity = self.txtDcapacity.value() @pyqtSignature("") @@ -212,29 +227,18 @@ var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar self.var_n_discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat - functions.make_files_print(self) # Se crean los archivos .print - - #Se deshabilita el Tab Parameters y el boton btnGbkp - self.tabParameters.setEnabled(False) - self.lstDcapacity.setEnabled(False) - self.txtDcapacity.setEnabled(False) - self.btnGbkp.setEnabled(False) - self.btnRestart.setEnabled(True) - self.btnStartburn.setEnabled(True) - + functions2.make_parameters_conf(self) # se crea el archivo parameters.conf + + #Se deshabilitan los parametros de configuracion + functions2.enabled_items1(True, self) @pyqtSignature("") def on_btnRestart_clicked(self): """ Permite que se puedan cambiar los parametros """ - self.tabParameters.setEnabled(True) - self.lstDcapacity.setEnabled(True) - self.txtDcapacity.setEnabled(True) - self.btnGbkp.setEnabled(True) - self.btnRestart.setEnabled(False) - self.btnStartburn.setEnabled(False) + functions2.enabled_items1(False, self) @pyqtSignature("") @@ -264,15 +268,15 @@ var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso self.txtInfo.append(var_cmd) -# -# var_output=commands.getstatusoutput(str(var_cmd))[0] -# self.txtInfo.append(str(var_output)) -# + + var_output=commands.getstatusoutput(str(var_cmd))[0] + self.txtInfo.append(str(var_output)) + #os.system(str(var_cmd)) #p = subprocess.Popen(str('ls /'), shell=True, stdout=self) #os.waitpid(p.pid, 0) ####self.txtInfo.append(str(p.pid)) - + @pyqtSignature("") def on_btnStopburn_clicked(self):