diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5fc1e9a..391eaa7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -329,7 +329,7 @@ void MainWindow::onMenuPrintPreview() subWindow->show(); } catch( const QString &err ) { - QMessageBox::critical( this, tr( "Error" ), err ); + QMessageBox::critical( this, tr( "Error on print preview" ), err ); } } @@ -339,7 +339,12 @@ void MainWindow::onMenuPrint() if( !cdscene ) return; - QDialogProgress::exec( this, cdscene ); + try { + QDialogProgress::exec( this, cdscene ); + } + catch( const QString &err ) { + QMessageBox::critical( this, tr( "Error on print" ), err ); + } } void MainWindow::onMenuAbout() diff --git a/src/qdialogprogress.cpp b/src/qdialogprogress.cpp index b0f843e..4f6e485 100644 --- a/src/qdialogprogress.cpp +++ b/src/qdialogprogress.cpp @@ -68,7 +68,6 @@ bool QDialogProgress::exec( QWidget *parent, QCDScene *scene ) if( !drive ) return false; - QLightScribe *scribe = QLightScribe::instance(); QDialogProgress dialog( parent, drive ); dialog.setWindowTitle( tr( "Printing: " ) + scene->name() ); @@ -111,7 +110,7 @@ void QDialogProgress::onLabelProgress( int current, int final ) if( current && final / double( current ) < 10.0 ) { int elapsed = m_start->elapsed(); - int estimate = double( elapsed ) / current * final; + int estimate = int( double( elapsed ) / current * final ); m_ui->timeEstimated->setTime( QTime().addMSecs( estimate ) ); } } diff --git a/src/qlightscribe.cpp b/src/qlightscribe.cpp index d5b571f..dbd6718 100644 --- a/src/qlightscribe.cpp +++ b/src/qlightscribe.cpp @@ -125,7 +125,7 @@ QPixmap QLightDrive::preview( const PrintParameters ¶ms, QCDScene *scene, co printScene( scene, array ); QDBusReply reply = m_drivePrx->preview( params, array, size ); if( !reply.isValid() ) - throw reply.error().message(); + throw QString( "DBus error: (%1) %2" ).arg( reply.error().name(), reply.error().message() ); QString fname = reply.value(); QPixmap pixmap( fname ); @@ -139,7 +139,7 @@ void QLightDrive::print( const PrintParameters ¶ms, QCDScene *scene ) throw( printScene( scene, array ); QDBusReply reply = m_drivePrx->print( params, array ); if( !reply.isValid() ) - throw reply.error().message(); + throw QString( "DBus error: (%1) %2" ).arg( reply.error().name(), reply.error().message() ); } void QLightDrive::abort()