diff options
author | Simon Rettberg | 2023-02-17 12:29:00 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-02-17 12:29:00 +0100 |
commit | 43f0f7970d300a829045ddd14829b4fc8b83575a (patch) | |
tree | cd473b7ff7b47dacd2a0a54ccb023650869fce32 /src/maingui | |
parent | [maingui] Fallback to latin1 for document name encoding (diff) | |
download | printergui-43f0f7970d300a829045ddd14829b4fc8b83575a.tar.gz printergui-43f0f7970d300a829045ddd14829b4fc8b83575a.tar.xz printergui-43f0f7970d300a829045ddd14829b4fc8b83575a.zip |
Diffstat (limited to 'src/maingui')
-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()) { |