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