@@ -365,29 +365,29 @@ void QgsComposer::on_mActionPrint_activated(void)
365365 s.sprintf ( " %%%%BoundingBox: 0 0 %d %d" , w, h );
366366
367367 if ( s.length () > size ) {
368- QMessageBox::warning (this ," Error in Print" , " Cannot format BoundingBox" );
368+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot format BoundingBox" ) );
369369 } else {
370370 if ( ! f.at (offset) ) {
371- QMessageBox::warning (this ," Error in Print" , " Cannot seek" );
371+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot seek" ) );
372372 } else {
373373 /* Write spaces (for case the size > s.length() ) */
374374 QString es;
375375 es.fill (' ' , size-1 );
376376 f.flush ();
377377 if ( f.writeBlock ( es.toLocal8Bit ().data (), size-1 ) < size-1 ) {
378- QMessageBox::warning (this ," Error in Print" , " Cannot overwrite BoundingBox" );
378+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot overwrite BoundingBox" ) );
379379 }
380380 f.flush ();
381381 f.at (offset);
382382 f.flush ();
383383 if ( f.writeBlock ( s.toLocal8Bit ().data (), s.length () ) < s.length ()-1 ) {
384- QMessageBox::warning (this ," Error in Print" , " Cannot overwrite BoundingBox" );
384+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot overwrite BoundingBox" ) );
385385 }
386386 f.flush ();
387387 }
388388 }
389389 } else {
390- QMessageBox::warning (this ," Error in Print" , " Cannot find BoundingBox" );
390+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot find BoundingBox" ) );
391391 }
392392 f.close ();
393393
@@ -420,35 +420,35 @@ void QgsComposer::on_mActionPrint_activated(void)
420420 s.sprintf ( " 0 %d translate %s scale/defM matrix CM d } d" , trans, (const char *)rx.cap (1 ).toLocal8Bit ().data () );
421421
422422 if ( s.length () > size ) {
423- QMessageBox::warning (this ," Error in Print" , " Cannot format translate" );
423+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot format translate" ) );
424424 } else {
425425 if ( ! f.at (offset) ) {
426- QMessageBox::warning (this ," Error in Print" , " Cannot seek" );
426+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot seek" ) );
427427 } else {
428428 /* Write spaces (for case the size > s.length() ) */
429429 QString es;
430430 es.fill (' ' , size-1 );
431431 f.flush ();
432432 if ( f.writeBlock ( es.toLocal8Bit ().data (), size-1 ) < size-1 ) {
433- QMessageBox::warning (this ," Error in Print" , " Cannot overwrite translate" );
433+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot overwrite translate" ) );
434434 }
435435 f.flush ();
436436 f.at (offset);
437437 f.flush ();
438438 if ( f.writeBlock ( s.toLocal8Bit ().data (), s.length () ) < s.length ()-1 ) {
439- QMessageBox::warning (this ," Error in Print" , " Cannot overwrite translate" );
439+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot overwrite translate" ) );
440440 }
441441 f.flush ();
442442 }
443443 }
444444 } else {
445- QMessageBox::warning (this ," Error in Print" , " Cannot find translate" );
445+ QMessageBox::warning (this , tr ( " Error in Print" ), tr ( " Cannot find translate" ) );
446446 }
447447 f.close ();
448448 }
449449#endif
450450 } catch (QgsIOException e) {
451- QMessageBox::warning (this ," File IO Error" , e.what ());
451+ QMessageBox::warning (this , tr ( " File IO Error" ) , e.what ());
452452 }
453453 } else { // print to printer
454454 bool print = true ;
@@ -458,8 +458,8 @@ void QgsComposer::on_mActionPrint_activated(void)
458458 if ( mComposition ->paperWidth () != mPrinter ->widthMM () ||
459459 mComposition ->paperHeight () != mPrinter ->heightMM () )
460460 {
461- int answer = QMessageBox::warning ( 0 , " Paper does not match" ,
462- " The selected paper size does not match the composition size" ,
461+ int answer = QMessageBox::warning ( 0 , tr ( " Paper does not match" ) ,
462+ tr ( " The selected paper size does not match the composition size" ) ,
463463 QMessageBox::Ok, QMessageBox::Abort );
464464
465465 if ( answer == QMessageBox::Abort )
@@ -502,11 +502,11 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
502502#endif
503503
504504 if ( memuse > 200 ) { // cca 4500 x 4500
505- int answer = QMessageBox::warning ( 0 , " Big image" ,
506- " To create image " + QString::number (width) + " x "
505+ int answer = QMessageBox::warning ( 0 , tr ( " Big image" ) ,
506+ tr ( " To create image " ) + QString::number (width) + " x "
507507 + QString::number (height)
508- + " requires circa "
509- + QString::number (memuse) + " MB of memory" ,
508+ + tr ( " requires circa " )
509+ + QString::number (memuse) + tr ( " MB of memory" ) ,
510510 QMessageBox::Ok, QMessageBox::Abort );
511511
512512 raise ();
@@ -616,13 +616,12 @@ void QgsComposer::on_mActionExportAsSVG_activated(void)
616616 QSettings myQSettings;
617617 QString myLastUsedFile = myQSettings.readEntry (" /UI/lastSaveAsSvgFile" ," qgis.svg" );
618618
619- QFileDialog *myQFileDialog = new QFileDialog ( this , " Save svg file dialog " ,
620- " " , " SVG Format (*.svg *SVG)" );
619+ QFileDialog *myQFileDialog = new QFileDialog ( this , tr ( " Choose a filename to save the map as " ) ,
620+ " . " , " SVG Format (*.svg *SVG)" );
621621
622- myQFileDialog->setCaption (tr (" Choose a filename to save the map as" ));
623-
624622 myQFileDialog->selectFile ( myLastUsedFile );
625623 myQFileDialog->setMode (QFileDialog::AnyFile);
624+ myQFileDialog->setAcceptMode (QFileDialog::AcceptSave);
626625
627626 int result = myQFileDialog->exec ();
628627 raise ();
0 commit comments