SVN commit 891015 by skelly: Disable the ignored page range option of QPrintDialog and enable the Selection option. BUG: 158888 M +17 -5 kjotscomponent.cpp --- trunk/KDE/kdepim/kjots/kjotscomponent.cpp #891014:891015 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -1285,13 +1286,24 @@ //are before I setup the printer? QPrintDialog printDialog(printer, this); + + QAbstractPrintDialog::PrintDialogOptions options = printDialog.enabledOptions(); + options &= ~QAbstractPrintDialog::PrintPageRange; + if (activeEditor()->textCursor().hasSelection()) + options |= QAbstractPrintDialog::PrintSelection; + printDialog.setEnabledOptions(options); + printDialog.setWindowTitle(i18n("Send To Printer")); - if (printDialog.exec()) { + if (printDialog.exec() == QDialog::Accepted) { QTextDocument printDocument; - QTextCursor printCursor ( &printDocument ); - - foreach ( KJotsEntry *entry, bookshelf->selected() ) { - entry->generatePrintData ( &printCursor ); + if ( printer->printRange() == QPrinter::Selection ) + { + printDocument.setHtml( activeEditor()->textCursor().selection().toHtml() ); + } else { + QTextCursor printCursor ( &printDocument ); + foreach ( KJotsEntry *entry, bookshelf->selected() ) { + entry->generatePrintData ( &printCursor ); + } } QPainter p(printer);