diff options
-rw-r--r-- | src/maingui/printergui.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/maingui/printergui.cpp b/src/maingui/printergui.cpp index a54ac7a..615151a 100644 --- a/src/maingui/printergui.cpp +++ b/src/maingui/printergui.cpp @@ -12,6 +12,7 @@ static QStringList knownColorOptions = QStringList() << "ColorModel" << "XRXColo static QStringList knownGrayscaleOptions = QStringList() << "HPColorAsGray"; static QStringList knownDuplexOptions = QStringList() << "Duplex"; static QStringList knownPageSizeOptions = QStringList() << "PageSize"; +//static QStringList knownPageSizeOptions = QStringList() << "PageSize" << "PageRegion" << "ImageableArea" << "PaperDimension"; static int isUtf8(const char *s); static void toLatin1(char *s); @@ -310,7 +311,7 @@ void PrinterGui::on_printerList_currentItemChanged(QTreeWidgetItem *current, QTr } enableOptionSelection(ppd, knownDuplexOptions, ui->comboBoxSides, ui->label_duplex, false); // TODO: Make it so this selection overrides what the document specifies - enableOptionSelection(ppd, knownPageSizeOptions, ui->cboPaperSize, ui->lblPaperSize, true); + enableOptionSelection(ppd, knownPageSizeOptions, ui->cboPaperSize, ui->lblPaperSize, false); handleTrustedPrint(ppd); } else { qDebug() << "ppd is null for "<< dest->name << "; cups last error: " << cupsLastErrorString(); @@ -404,10 +405,12 @@ void PrinterGui::on_buttonPrint_clicked() // Paper size QString paperKey = ui->cboPaperSize->property("key").toString(); if (!paperKey.isEmpty()) { - dest->num_options = cupsAddOption(paperKey.toUtf8().constData(), - ui->cboPaperSize->itemData(ui->cboPaperSize->currentIndex()).toString().toUtf8().constData(), - dest->num_options, - &(dest->options)); + for (QStringList::iterator it = knownPageSizeOptions.begin(); it != knownPageSizeOptions.end(); ++it) { + dest->num_options = cupsAddOption(it->toUtf8().constData(), + ui->cboPaperSize->itemData(ui->cboPaperSize->currentIndex()).toString().toUtf8().constData(), + dest->num_options, + &(dest->options)); + } } // Kopien if (ui->lineEditCopies->isEnabled()) { |