Changeset View
Changeset View
Standalone View
Standalone View
kaddressbook/mainwidget.cpp
Show First 20 Lines • Show All 690 Lines • ▼ Show 20 Lines | void MainWidget::print() | ||||
QPrinter printer; | QPrinter printer; | ||||
printer.setDocName( i18n( "Address Book" ) ); | printer.setDocName( i18n( "Address Book" ) ); | ||||
printer.setOutputFileName( Settings::self()->defaultFileName() ); | printer.setOutputFileName( Settings::self()->defaultFileName() ); | ||||
printer.setOutputFormat( QPrinter::PdfFormat ); | printer.setOutputFormat( QPrinter::PdfFormat ); | ||||
printer.setCollateCopies( true ); | printer.setCollateCopies( true ); | ||||
QPrintDialog printDialog(KdePrint::createPrintDialog(&printer)); | QPrintDialog printDialog(KdePrint::createPrintDialog(&printer)); | ||||
printDialog.setWindowTitle( i18n( "Print Contacts" ) ); | printDialog.setWindowTitle( i18n( "Print Contacts" ) ); | ||||
if ( !printDialog.exec() ) { //krazy:exclude=crashy | if (printDialog.exec() != QDialog::Accepted) { | ||||
return; | return; | ||||
} | } | ||||
KABPrinting::PrintingWizard wizard( &printer, mItemView->selectionModel(), this ); | KABPrinting::PrintingWizard wizard( printDialog.printer(), mItemView->selectionModel(), this ); | ||||
wizard.setDefaultAddressBook( currentAddressBook() ); | wizard.setDefaultAddressBook( currentAddressBook() ); | ||||
wizard.exec(); //krazy:exclude=crashy | wizard.exec(); //krazy:exclude=crashy | ||||
Settings::self()->setDefaultFileName( printer.outputFileName() ); | Settings::self()->setDefaultFileName( printDialog.printer()->outputFileName() ); | ||||
Settings::self()->setPrintingStyle( wizard.printingStyle() ); | Settings::self()->setPrintingStyle( wizard.printingStyle() ); | ||||
Settings::self()->setSortOrder( wizard.sortOrder() ); | Settings::self()->setSortOrder( wizard.sortOrder() ); | ||||
} | } | ||||
void MainWidget::newContact() | void MainWidget::newContact() | ||||
{ | { | ||||
mActionManager->action( Akonadi::StandardContactActionManager::CreateContact )->trigger(); | mActionManager->action( Akonadi::StandardContactActionManager::CreateContact )->trigger(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |