src/file.cpp

changeset 321
48e429bfd58c
parent 320
737e466dae72
child 322
5e701c3c3d8e
equal deleted inserted replaced
320:737e466dae72 321:48e429bfd58c
352 } 352 }
353 353
354 ulong numWarnings; 354 ulong numWarnings;
355 bool ok; 355 bool ok;
356 vector<LDObject*> objs = loadFileContents( f, &numWarnings, &ok ); 356 vector<LDObject*> objs = loadFileContents( f, &numWarnings, &ok );
357 print( "ok: %1\n", ok );
358 357
359 if( !ok ) 358 if( !ok )
360 { 359 {
361 if( g_loadingMainFile ) 360 if( g_loadingMainFile )
362 { 361 {
409 408
410 setName( newpath ); 409 setName( newpath );
411 } 410 }
412 411
413 if( !save () ) { 412 if( !save () ) {
414 message = fmt( "Failed to save %1: %2\nDo you still want to close?", 413 message = fmt( QObject::tr( "Failed to save %1: %2\nDo you still want to close?" ),
415 name(), strerror( errno )); 414 name(), strerror( errno ));
416 415
417 if( QMessageBox::critical( g_win, "Save Failure", message, 416 if( QMessageBox::critical( g_win, "Save Failure", message,
418 ( QMessageBox::Yes | QMessageBox::No ), QMessageBox::No ) == QMessageBox::No) 417 ( QMessageBox::Yes | QMessageBox::No ), QMessageBox::No ) == QMessageBox::No)
419 { 418 {
527 526
528 if( !g_aborted ) 527 if( !g_aborted )
529 { 528 {
530 // Tell the user loading failed. 529 // Tell the user loading failed.
531 setlocale( LC_ALL, "C" ); 530 setlocale( LC_ALL, "C" );
532 critical( fmt( "Failed to open %1: %2", path, strerror( errno ))); 531 critical( fmt( QObject::tr( "Failed to open %1: %2" ), path, strerror( errno )));
533 } 532 }
534 533
535 g_loadingMainFile = false; 534 g_loadingMainFile = false;
536 return; 535 return;
537 } 536 }

mercurial