From cf997e90fdf6d0e89273651072dd0eeccfef98cb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 24 Mar 2016 17:44:05 +0100 Subject: [printergui] Interpret --error message as utf8 --- src/maingui/main.cpp | 2 +- src/maingui/printergui.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/maingui/main.cpp b/src/maingui/main.cpp index 58ace07..1e7c2b2 100644 --- a/src/maingui/main.cpp +++ b/src/maingui/main.cpp @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); if (strcmp(argv[1], "--error") == 0) { - QMessageBox::critical(NULL, "Verarbeitungsfehler", argv[2]); + QMessageBox::critical(NULL, "Verarbeitungsfehler", QString::fromUtf8(argv[2])); return 0; } else { // Check if file exists diff --git a/src/maingui/printergui.cpp b/src/maingui/printergui.cpp index e235007..a7f993b 100644 --- a/src/maingui/printergui.cpp +++ b/src/maingui/printergui.cpp @@ -140,7 +140,8 @@ static void enableOptionSelection(ppd_file_t *ppd, QStringList &nameList, QCombo for (ppd_option_t *o = ppdFirstOption(ppd); o != NULL; o = ppdNextOption(ppd)) { QString option(o->keyword); for (QStringList::iterator it = nameList.begin(); it != nameList.end(); ++it) { - if(!option.contains(*it)) + bool exact = (option == *it); + if((!exact && !matchedProperty.isEmpty()) || !option.contains(*it)) continue; // Matches, update combo matchedProperty = option; @@ -160,7 +161,9 @@ static void enableOptionSelection(ppd_file_t *ppd, QStringList &nameList, QCombo } combo->setUpdatesEnabled(true); combo->adjustSize(); - break; + if (exact) { + break; + } } } combo->setProperty("key", matchedProperty); @@ -296,6 +299,8 @@ void PrinterGui::on_buttonPrint_clicked() &(dest->options)); } + dest->num_options = cupsRemoveOption("InputSlot", dest->num_options, &(dest->options)); + cupsSetUser(this->user); char jobtitle[250]; const char *docName; -- cgit v1.2.3-55-g7522