##// END OF EJS Templates
#Parece todo ok...
ralonso -
r79:80
parent child
Show More
@@ -1,616 +1,634
1 1 # -*- coding: utf-8 -*-
2 2
3 3 """
4 4 Module implementing MainWindow.
5 5 """
6 6
7 7 from PyQt4.QtGui import QMainWindow
8 8 from PyQt4.QtCore import pyqtSignature
9 9 from PyQt4 import QtCore
10 10 from Ui_MainWindow import Ui_MainWindow
11 11 from Ui_Parameters import Ui_Parameters
12 12 from Ui_About import Ui_About
13 13 from PyQt4 import QtGui
14 14 from subprocess import *
15 15 import sys
16 16 import os
17 17 #import subprocess
18 18 import time
19 19 import commands
20 20 from functions import functions
21 21 from functions import functions2
22 22
23 23 class MainWindow(QMainWindow, Ui_MainWindow):
24 24 """
25 25 Class documentation goes here.
26 26 """
27 27
28 28 def __init__(self, parent = None):
29 29 QMainWindow.__init__(self, parent)
30 30 self.setupUi(self)
31 31 self.setupUi2()
32 32
33 33 def setupUi2(self):
34 34
35
36 self.var_real_principal = False
37
38 self.var_real_detect_devices = False
39
35 40 self.var_real_iso = True
36 41 self.var_real_burn = False
37 42 self.var_real_check = False
38 43 self.var_real_eject = False
39 # Reconocimiento de los dispositivos de grabacion
40 # functions2.detect_devices(self) #busca los dispositivos de grabacion
41 ####################################
42 functions2.set_devices_test(self) ############
43 ####################################
44
45 self.var_real_show_cmd = True
46
47 if self.var_real_detect_devices == True:
48 # Reconocimiento de los dispositivos de grabacion
49 functions2.detect_devices(self)
50 else:
51 functions2.set_devices_test(self)
44 52
45 53 #Inicialiazacion de variables
46 54 self.var_Discs = 0 #Numero de discos del proyecto
47 55 self.var_Copys = 0 #Numero de copias
48 56 self.var_disc_n = 0 # disco actual
49 57 self.var_copy_n = 0 # copia actual
50 58 self.var_burned_discs = 0 #numero de discos ya grabados
51 59
52 60 self.bool_first_iso = False
53 61 self.var_step = 0 # numero de paso en el proceso
54 62 self.bool_state_burning = False #si es True se puede grabar
55 63 self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco
56 64
57 65 self.var_list=[] # Lista de DOYs
58 66 self.var_sublist=[] # Sub-lista de DOYs seleccionados
59 67 self.var_devices=[] #Lista de dispositivos seleccionados
60 68
61 69 #Revisa si existe el archivo de confirguracion y lo carga
62 70 if os.path.isfile("parameters.conf"):
63 71 functions2.get_parameters_conf(self)
64 72 self.bool_first_iso = True
65 73 self.txtInfo.append("Parameters were loaded from configuration file")
66 74 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
67 75
68 else:
76 elif self.var_real_principal == False:
69 77 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas
70 78
71 79 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados
72 80
73 81 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
74 82 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
75 83 functions.load_days(self)
76 84
77 85 if os.path.isfile("parameters.conf"):
78 86 functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion
79 87
80 88 if os.path.isfile("burning.conf"):
81 89 functions2.get_burning_conf(self)
82 90 self.txtInfo.append("Current disc: "+str(self.var_disc_n))
83 91 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
84 92 self.txtInfo.append("Burned discs: "+str(self.var_burned_discs))
85 93 self.btnStartburn.setText("Continue")
86 94 self.actionChange_Parameters.setEnabled(False)
87 95
88 96 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters)
89 97 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about)
90 98
91 99 self.process_iso = QtCore.QProcess()
92 100 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_iso)
93 101 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardError()'), self.readError_iso)
94 102 self.connect(self.process_iso, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_iso)
95 103
96 104 self.process_burn = QtCore.QProcess()
97 105 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_burn)
98 106 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardError()'), self.readError_burn)
99 107 self.connect(self.process_burn, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_burn)
100 108
101 109 self.process_check = QtCore.QProcess()
102 110 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check)
103 111 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check)
104 112 self.connect(self.process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check)
105 113
106 114
107 115 def changeParameters(self):
108 116 dlg=QtGui.QDialog()
109 117 dlgui=Ui_Parameters()
110 118 dlgui.setupUi(dlg)
111 119 if (dlg.exec_() == QtGui.QDialog.Accepted):
112 120 if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value():
113 121 self.txtInfo.append("Wrong parameters")
114 122 else:
115 123 self.var_Copys = dlgui.txtNcopys.value()
116 124 self.var_disc_n = dlgui.txtDisc.value()
117 125 self.var_copy_n = dlgui.txtCopy.value()
118 126 self.txtInfo.append("Changed parameters")
119 127 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
120 128 self.bool_first_iso = True
121 129 self.txtInfo.append("Current disc: "+str(self.var_disc_n))
122 130 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
123 131 self.txtInfo.append("Nro Copys: "+str(self.var_Copys))
124 132 functions2.make_parameters_conf(self)
125 133 self.txtCopys.setValue(self.var_Copys) #Actualizo mananualmente el valor Copys
126 134
127 135
128 136
129 137 def about(self):
130 138 dlg_about=QtGui.QDialog()
131 139 dlgui_about=Ui_About()
132 140 dlgui_about.setupUi(dlg_about)
133 141 dlg_about.exec_()
134 142
135 143
136 144 #==============================================================================
137 145 # Manejo de los eventos
138 146 #==============================================================================
139 147
140 148 #----------------------------------------------------- Obtencion de la ruta de los datos ---------------------------------------------------------------
141 149
142 150 @pyqtSignature("")
143 151 def on_btnDpath_clicked(self):
144 152 """
145 153 Permite seleccionar graficamente el direcorio de los datos a grabar
146 154 """
147 155 self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
148 156 self.txtDpath.setText(self.var_Dpath)
149 157 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
150 158 functions.load_days(self)
151 159
152 160
153 161 @pyqtSignature("")
154 162 def on_txtDpath_editingFinished(self):
155 163 """
156 164 Carga la ruta editada y verifica que sea correcta y carga la lista de dias
157 165 """
158 166 self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada
159 167 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
160 168 functions.load_days(self)
161 169
162 170
163 171 #----------------------------------------------------- Obtencion de las ruta del proyecto ---------------------------------------------------------------
164 172
165 173 @pyqtSignature("")
166 174 def on_btnRpath_clicked(self):
167 175 """
168 176 Permite seleccionar graficamente el direcorio del proyecto
169 177 """
170 178 self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
171 179 self.txtRpath.setText(self.var_Rpath)
172 180 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
173 181
174 182
175 183 @pyqtSignature("")
176 184 def on_txtRpath_editingFinished(self):
177 185 """
178 186 Valida la ruta del proyecto
179 187 """
180 188 self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada
181 189 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
182 190
183 191
184 192 #----------------------------------------------------- Tipo de datos ---------------------------------------------------------------
185 193
186 194 @pyqtSignature("int")
187 195 def on_lstDtype_activated(self, index):
188 196 """
189 197 Permite elegir entre los tipos de archivos
190 198 """
191 199 self.txtDtype.setReadOnly(True)
192 200 if index == 0:
193 201 self.var_Dtype ='r'
194 202 elif index == 1:
195 203 self.var_Dtype ='pdata'
196 204 elif index == 2:
197 205 self.var_Dtype ='sswma'
198 206 else :
199 207 self.var_Dtype =''
200 208 self.txtDtype.setReadOnly(False)
201 209
202 210 self.txtDtype.setText(self.var_Dtype)
203 211 functions.load_days(self) #llamada a funcion
204 212
205 213 @pyqtSignature("")
206 214 def on_txtDtype_editingFinished(self):
207 215 self.var_Dtype=str(self.txtDtype.text())
208 216 functions.load_days(self) #llamada a funcion
209 217
210 218
211 219 #----------------------------------------------------- Etiqueta ---------------------------------------------------------------
212 220
213 221 @pyqtSignature("")
214 222 def on_txtElabel_editingFinished(self):
215 223 self.var_Elabel = str(self.txtElabel.text())
216 224
217 225 #----------------------------------------------------- Numero de copias ---------------------------------------------------------------
218 226 @pyqtSignature("")
219 227 def on_txtCopys_editingFinished(self):
220 228 self.var_Copys = self.txtCopys.value()
221 229
222 230 #----------------------------------------------------- Seleccion del rango de fechas ---------------------------------------------------------------
223 231
224 232 @pyqtSignature("int") #CLOSED
225 233 def on_lstStartDay_activated(self, index):
226 234 """
227 235 Cambia la lista de opciones en lstStopDay
228 236 """
229 237 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex()
230 238 self.lstStopDay.clear()
231 239
232 240 for i in self.var_list[index:]:
233 241 self.lstStopDay.addItem(i)
234 242
235 243 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index)
236 244
237 245 functions.get_sub_list(self)
238 246
239 247
240 248 @pyqtSignature("int") #CLOSED
241 249 def on_lstStopDay_activated(self, index):
242 250 """
243 251 Cambia la lista de opciones en lstStartDay
244 252 """
245 253 var_StartDay_index=self.lstStartDay.currentIndex()
246 254 var_end_index = self.lstStopDay.count() - index
247 255 self.lstStartDay.clear()
248 256
249 257 for i in self.var_list[:len(self.var_list) - var_end_index + 1]:
250 258 self.lstStartDay.addItem(i)
251 259
252 260 self.lstStartDay.setCurrentIndex(var_StartDay_index)
253 261
254 262 functions.get_sub_list(self)
255 263
256 264
257 265 #----------------------------------------------------- Capacidad del dispositivo de grabacion ---------------------------------------------------------------
258 266
259 267 @pyqtSignature("")
260 268 def on_txtDcapacity_editingFinished(self):
261 269 self.var_Dcapacity = self.txtDcapacity.value()
262 270
263 271
264 272 @pyqtSignature("int") #CLOSED
265 273 def on_lstDcapacity_activated(self, index):
266 274 """
267 275 Permite elegir el tamaΓ±o del disco
268 276 """
269 277 if index == 0:
270 278 var_size=25.0
271 279 elif index == 1:
272 280 var_size=8.5
273 281 elif index == 2:
274 282 var_size=4.7
275 283 elif index == 3:
276 284 var_size=0.7
277 285
278 286 if index != 4:
279 287 self.txtDcapacity.setValue(var_size*10**9/1024**2)
280 288 self.txtDcapacity.setReadOnly(True)
281 289 else:
282 290 self.txtDcapacity.setValue(100.0)
283 291 self.txtDcapacity.setReadOnly(False)
284 292
285 293 self.var_lstDcapacity = self.lstDcapacity.currentIndex()
286 294 self.var_Dcapacity = self.txtDcapacity.value()
287 295
288 296 #----------------------------------------------------- Testeo de las unidades de grabacion ---------------------------------------------------------------
289 297
290 298 @pyqtSignature("")
291 299 def on_btnTdevA_clicked(self):
292 300 var_dev = str(self.txtDeviceA.text())
293 301 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
294 302 commands.getstatusoutput(var_cmd)
295 303
296 304 @pyqtSignature("")
297 305 def on_btnTdevB_clicked(self):
298 306 var_dev = str(self.txtDeviceB.text())
299 307 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
300 308 commands.getstatusoutput(var_cmd)
301 309
302 310 @pyqtSignature("")
303 311 def on_btnTdevC_clicked(self):
304 312 var_dev = str(self.txtDeviceC.text())
305 313 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
306 314 commands.getstatusoutput(var_cmd)
307 315
308 316 @pyqtSignature("")
309 317 def on_btnTdevD_clicked(self):
310 318 var_dev = str(self.txtDeviceD.text())
311 319 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
312 320 commands.getstatusoutput(var_cmd)
313 321
314 322
315 323 #==============================================================================
316 324 # Botones para la generacion de los archivos de configuracion
317 325 #==============================================================================
318 326
319 327 #----------------------------------------------------- Generacion de la configuracion usando los parametros ---------------------------------------------------------------
320 328
321 329 @pyqtSignature("")
322 330 def on_btnGbkp_clicked(self):
323 331 """
324 332 Generacion de archivos de configuracion usando los parametros
325 333 """
326 334
327 335 if functions.validate_parameters(self) == False:
328 336 return
329 337
330 338 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente
331 339 list_dirs=['gpath','iso','ppath', 'tmpdata']
332 340 bool_make_dirs = functions.make_dirs(list_dirs, self)
333 341 if bool_make_dirs == False:
334 342 return
335 343
336 344 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar
337 345
338 346 self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat
339 347
340 348 functions.make_files_print(self) # Se crean los archivos .print
341 349
342 350 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf
343 351
344 352 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
345 353
346 354 #Se bloquean los parametros de configuracion
347 355 functions2.enabled_items1(True, self)
348 356 self.var_disc_n = 1
349 357 self.var_copy_n = 1
350 358 self.bool_first_iso = True
351 359 self.var_burned_discs = 0 #numero de discos grabados
352 360
353 361
354 362 #----------------------------------------------------- Permite reiniciar la configuracion ---------------------------------------------------------------
355 363
356 364 @pyqtSignature("")
357 365 def on_btnRestart_clicked(self):
358 366 """
359 367 Permite que se puedan cambiar los parametros
360 368 """
361 369 if os.path.isfile("parameters.conf"):
362 370 os.remove("parameters.conf")
363 371 if os.path.isfile("burning.conf"):
364 372 os.remove("burning.conf")
365 373
366 374 functions2.enabled_items1(False, self)
367 375 self.btnStartburn.setText("Start Burn")
376 self.txtInfo.clear()
368 377
369 378
370 379
371 380 #==============================================================================
372 381 # Acciones de los procesos
373 382 #==============================================================================
374 383
375 384 #------------------------------------------------ Funciones del proceso de creacion del iso ------------------------------------------------------
376 385
377 386 def readOuput_iso(self):
378 387 self.txtProgress.setText("stdout iso: " + QtCore.QString(self.process_iso.readAllStandardOutput()))
379 388
380 389 def readError_iso(self):
381 390 self.txtProgress.setText("stderr iso: " + QtCore.QString(self.process_iso.readAllStandardError()))
382 391
383 392 def finished_iso(self):
384 393 self.txtProgress.clear()
385 394
386 395 if not(self.bool_state_burning):
387 396 return
388 397
389 398 if self.process_iso.exitCode() == 0:
390 399 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully\n")
391 400 self.var_step = 1
392 401 self.function_burn()
393 402
394 403 else:
395 404 self.txtInfo.append("#####Error creating iso file "+function.i2s(self.var_disc_n)
396 405 +" , code "+QtCore.QString(self.process_iso.exitCode()))
397 406 self.txtInfo.append("Please check the data")
398 407 self.txtInfo.append("FATAL ERROR")
399 408
400 409 #----------------------------------------------------- Funciones del proceso de grabado ---------------------------------------------------------------
401 410
402 411 def readOuput_burn(self):
403 412 self.txtProgress.setText("stdout burn: " + QtCore.QString(self.process_burn.readAllStandardOutput()))
404 413
405 414 def readError_burn(self):
406 415 self.txtProgress.setText("stderr burn: " + QtCore.QString(self.process_burn.readAllStandardError()))
407 416
408 417 def finished_burn(self):
409 418 self.txtProgress.clear()
410 419
411 420 #Si se paro el proceso manualmente se termina
412 421 if not(self.bool_state_burning):
413 422 return
414 423
415 424 if self.process_burn.exitCode() == 0:
416 425 self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
417 426 functions2.update_message(1, "COMPLETED", self)
418 427 self.var_step = 2
419 428 self.function_check()
420 429
421 430 else:
422 431 self.txtInfo.append("#######Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: "
423 432 +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode()))
424 433 functions2.update_message(1, "ERROR", self)
425 434
426 435 functions.is_last_disc_and_copy(self)
427 436
428 437
429 438 #----------------------------------------------------- Funciones del proceso de verificacion ---------------------------------------------------------------
430 439
431 440 def readOuput_check(self):
432 441 self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_check.readAllStandardOutput()))
433 442
434 443 def readError_check(self):
435 444 self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_check.readAllStandardError()))
436 445
437 446 def finished_check(self):
438 447 self.txtProgress.clear()
439 448
440 449 if not(self.bool_state_burning):
441 450 return
442 451
443 452 if self.process_check.exitCode() == 0:
444 453 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
445 454 functions2.update_message(2, "CHECKED", self)
446 455
447 456 else:
448 457 self.txtInfo.append("#######Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: "
449 458 +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode()))
450 459 functions2.update_message(2, "ERROR", self)
451 460
452 461 functions.is_last_disc_and_copy(self)
453 462
454 463
455 464
456 465 #==============================================================================
457 466 # Botones para el proceso de grabacion
458 467 #==============================================================================
459 468
460 469 #----------------------------------------------------- Iniciar proceso de grabacion ---------------------------------------------------------------
461 470
462 471 @pyqtSignature("")
463 472 def on_btnStartburn_clicked(self):
464 473 """
465 474 Se inicia el proceso de grabacion
466 475 """
467 476 #Verifica que exista algun dispositivo de grabacion seleccionado
468 477 if not(functions2.selected_devices(self)):
469 478 self.txtInfo.append("There is no recording device selected")
470 479 return
471 480
472 481 # #Lista los dispositivos de grabacion a usar
473 482 # for dev in self.var_devices:
474 483 # self.txtInfo.append("recording device :"+dev)
475 484
476 485 self.bool_state_burning = True
477 486 functions2.enabled_items2(True, self)
478 487
479 488 if self.bool_first_iso == True:
480 489 self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
481 490 self.var_step = 4
482 491 self.function_eject()
483 492 return
484 493
485 494 if self.var_step == 0:
486 495 self.function_iso()
487 496 return
488 497
489 498 if self.var_step == 1:
490 499 self.function_burn()
491 500 return
492 501
493 502 #----------------------------------------------------- Funcion para el grabado ---------------------------------------------------------------
494 503
495 504 def function_iso(self):
496 505 #Creacion del archivo.iso para la grabacion
497 506 if self.var_step == 0:
498 507 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
499 508 self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n))
500 509
501 if self.var_real_iso == True:
502 var_cmd = functions.cmd_iso(self)
503 else:
510 var_cmd = functions.cmd_iso(self)
511
512 if self.var_real_show_cmd == True:
513 self.txtInfo.append("CMD: "+var_cmd)
514
515 if self.var_real_iso == False:
504 516 self.txtInfo.append('**function_iso')
505 517 var_cmd="echo 'function_iso'"
506 518
507 519 self.process_iso.start(var_cmd)
508 520
509 521 def function_burn(self):
510 522 #Grabacion de los DVDs
511 523
512 524 if self.var_step == 1:
513 525 self.txtInfo.append("------Recording disc: "+str(self.var_disc_n)+", copy:"+str(self.var_copy_n))
514 526 functions2.update_message(1, "BURNING", self)
515 527
516 if self.var_real_burn == True:
517 var_cmd = functions.cmd_burn(self)
518 #########################################
519 return######################################
520 ########################################
521
522 else:
528 var_cmd = functions.cmd_burn(self)
529
530 if self.var_real_show_cmd == True:
531 self.txtInfo.append("CMD: "+var_cmd)
532
533 if self.var_real_burn == False:
523 534 self.txtInfo.append('**function_burn')
524 535 var_cmd="echo 'function_burn'"
525 536
526 537 self.process_burn.start(var_cmd)
527 538
528 539 def function_check(self):
529 540 #Verificacion de los discos
530 541 if self.var_step == 2:
531 542 self.txtInfo.append("-----------checking disc:"+str(self.var_disc_n)+", copy:"+str(self.var_copy_n))
532 543 functions2.update_message(2, "CHECKING", self)
533 544
534 if self.var_real_check == True:
535 var_cmd = functions.cmd_check(self)
536 else:
545 var_cmd = functions.cmd_check(self)
546
547 if self.var_real_show_cmd == True:
548 self.txtInfo.append("CMD: "+var_cmd)
549
550 if self.var_real_check == False:
537 551 self.txtInfo.append('**function_check')
538 552 var_cmd="echo 'function_check'"
539 553
540 554 self.process_check.start(var_cmd)
541 555
542 556 #OK
543 557 def function_eject(self):
544 558 self.txtInfo.append("Ejecting recording devices")
545 559 self.txtInfo.append("Please insert blank discs")
546 560
547 561 if self.var_real_eject == True:
548 562 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
549 563 else:
550 564 self.txtInfo.append("**functions2.eject_devices")
551 565
552 566 self.btnStartburn.setText("Continue")
553 567 self.btnStartburn.setEnabled(True)
554 568
555 569 if self.bool_first_iso == True:
556 570 self.bool_first_iso = False
557 571 self.var_step = 0
558 572
559 573 elif self.var_copy_n == 1:
560 574 self.var_step = 0
561 575
562 576 else:
563 577 self.var_step = 1
564 578
565 579 def function_final(self):
566 580 self.txtInfo.append("Recording process is complete")
581 if os.path.isfile("parameters.conf"):
582 os.remove("parameters.conf")
583 if os.path.isfile("burning.conf"):
584 os.remove("burning.conf")
567 585
568 586
569 587
570 588 #----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
571 589
572 590 @pyqtSignature("")
573 591 def on_btnStopburn_clicked(self):
574 592 """
575 593 Slot documentation goes here.
576 594 """
577 595 self.bool_state_burning = False
578 596
579 597 if self.var_step == 0:
580 598 self.process_iso.terminate() #Termina el proceso, si puede
581 599 # self.process_iso.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona
582 600 elif self.var_step == 1:
583 601 self.process_burn.terminate()
584 602 elif self.var_step == 2:
585 603 self.process_check.terminate()
586 604
587 605 self.txtInfo.append("Stopped recording")
588 606 functions2.enabled_items2(False, self)
589 607 self.bool_first_iso = True
590 608
591 609
592 610
593 611 #==============================================================================
594 612 # Proceso verificacion manual
595 613 #==============================================================================
596 614
597 615
598 616 #----------------------------------------------------- Proceso de verificaion manual ---------------------------------------------------------------
599 617
600 618
601 619 @pyqtSignature("")
602 620 def on_btnTDpath_clicked(self):
603 621 """
604 622 Slot documentation goes here.
605 623 """
606 624 self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
607 625 self.txtTDpath.setText(self.var_TDpath)
608 626 self.statusTDpath = functions.dir_exists(self.var_TDpath, self)
609 627
610 628
611 629 @pyqtSignature("")
612 630 def on_btnCHstart_clicked(self):
613 631 """
614 632 Slot documentation goes here.
615 633 """
616 634 pass
General Comments 0
You need to be logged in to leave comments. Login now