Changeset View
Changeset View
Standalone View
Standalone View
src/ksanewidget_p.cpp
Show First 20 Lines • Show All 492 Lines • ▼ Show 20 Line(s) | 486 | { | |||
---|---|---|---|---|---|
493 | 493 | | |||
494 | // Try to set 8 bit color | 494 | // Try to set 8 bit color | ||
495 | if ((option = getOption(QStringLiteral(SANE_NAME_BIT_DEPTH))) != nullptr) { | 495 | if ((option = getOption(QStringLiteral(SANE_NAME_BIT_DEPTH))) != nullptr) { | ||
496 | option->setValue(8); | 496 | option->setValue(8); | ||
497 | } | 497 | } | ||
498 | 498 | | |||
499 | // Try to set Scan resolution to 600 DPI | 499 | // Try to set Scan resolution to 600 DPI | ||
500 | if (m_optRes != nullptr) { | 500 | if (m_optRes != nullptr) { | ||
501 | m_optRes->setValue(600); | 501 | m_optRes->setValue(600); | ||
sars: The other "Try to ..." statements try to change the default "Color mode", 8bits/color and… | |||||
502 | } | 502 | } | ||
503 | } | 503 | } | ||
504 | 504 | | |||
505 | void KSaneWidgetPrivate::scheduleValReload() | 505 | void KSaneWidgetPrivate::scheduleValReload() | ||
506 | { | 506 | { | ||
507 | m_readValsTmr.start(5); | 507 | m_readValsTmr.start(5); | ||
508 | } | 508 | } | ||
509 | 509 | | |||
▲ Show 20 Lines • Show All 449 Lines • ▼ Show 20 Line(s) | 955 | emit(q->imageReady(m_scanData, | |||
959 | (int)getImgFormat(params))); | 959 | (int)getImgFormat(params))); | ||
960 | 960 | | |||
961 | // now check if we should have automatic ADF batch scanning | 961 | // now check if we should have automatic ADF batch scanning | ||
962 | if (m_optSource) { | 962 | if (m_optSource) { | ||
963 | QString source; | 963 | QString source; | ||
964 | m_optSource->getValue(source); | 964 | m_optSource->getValue(source); | ||
965 | 965 | | |||
966 | if (source.contains(QStringLiteral("Automatic Document Feeder")) || | 966 | if (source.contains(QStringLiteral("Automatic Document Feeder")) || | ||
967 | source.contains(QStringLiteral("ADF"))) { | 967 | source.contains(QStringLiteral("ADF")) || | ||
968 | source.contains(QStringLiteral("Duplex"))) { | ||||
968 | // in batch mode only one area can be scanned per page | 969 | // in batch mode only one area can be scanned per page | ||
969 | //qDebug() << "source == " << source; | 970 | //qDebug() << "source == " << source; | ||
970 | m_updProgressTmr.start(); | 971 | m_updProgressTmr.start(); | ||
971 | m_scanThread->start(); | 972 | m_scanThread->start(); | ||
972 | return; | 973 | return; | ||
973 | } | 974 | } | ||
974 | } | 975 | } | ||
975 | 976 | | |||
976 | // Check if we have a "wait for button" batch scanning | 977 | // Check if we have a "wait for button" batch scanning | ||
977 | if (m_optWaitForBtn) { | 978 | if (m_optWaitForBtn) { | ||
978 | qDebug() << m_optWaitForBtn->name(); | 979 | qDebug() << m_optWaitForBtn->name(); | ||
979 | QString wait; | 980 | QString wait; | ||
980 | m_optWaitForBtn->getValue(wait); | 981 | m_optWaitForBtn->getValue(wait); | ||
981 | 982 | | |||
982 | qDebug() << "wait ==" << wait; | 983 | qDebug() << "wait ==" << wait; | ||
983 | if (wait == QStringLiteral("true")) { | 984 | if (wait == QStringLiteral("true")) { | ||
984 | // in batch mode only one area can be scanned per page | 985 | // in batch mode only one area can be scanned per page | ||
sars: Good addition :) | |||||
985 | //qDebug() << "source == \"Automatic Document Feeder\""; | 986 | //qDebug() << "source == \"Automatic Document Feeder\""; | ||
986 | m_updProgressTmr.start(); | 987 | m_updProgressTmr.start(); | ||
987 | m_scanThread->start(); | 988 | m_scanThread->start(); | ||
988 | return; | 989 | return; | ||
989 | } | 990 | } | ||
990 | } | 991 | } | ||
991 | 992 | | |||
992 | // not batch scan, call sane_cancel to be able to change parameters. | 993 | // not batch scan, call sane_cancel to be able to change parameters. | ||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 1158 | if (q->receivers(SIGNAL(userMessage(int,QString))) == 0) { | |||
1158 | switch (type) { | 1159 | switch (type) { | ||
1159 | case KSaneWidget::ErrorGeneral: | 1160 | case KSaneWidget::ErrorGeneral: | ||
1160 | QMessageBox::critical(nullptr, i18nc("@title:window", "General Error"), strStatus); | 1161 | QMessageBox::critical(nullptr, i18nc("@title:window", "General Error"), strStatus); | ||
1161 | break; | 1162 | break; | ||
1162 | default: | 1163 | default: | ||
1163 | QMessageBox::information(nullptr, i18nc("@title:window", "Information"), strStatus); | 1164 | QMessageBox::information(nullptr, i18nc("@title:window", "Information"), strStatus); | ||
1164 | break; | 1165 | break; | ||
1165 | } | 1166 | } | ||
1166 | } else { | 1167 | } else { | ||
sars: signal/slot signature without spaces... | |||||
1167 | emit(q->userMessage(type, strStatus)); | 1168 | emit(q->userMessage(type, strStatus)); | ||
1168 | } | 1169 | } | ||
1169 | } | 1170 | } | ||
1170 | 1171 | | |||
1171 | void KSaneWidgetPrivate::pollPollOptions() | 1172 | void KSaneWidgetPrivate::pollPollOptions() | ||
1172 | { | 1173 | { | ||
1173 | for (int i = 1; i < m_pollList.size(); ++i) { | 1174 | for (int i = 1; i < m_pollList.size(); ++i) { | ||
1174 | m_pollList.at(i)->readValue(); | 1175 | m_pollList.at(i)->readValue(); | ||
1175 | } | 1176 | } | ||
1176 | } | 1177 | } | ||
1177 | 1178 | | |||
1178 | } // NameSpace KSaneIface | 1179 | } // NameSpace KSaneIface |
The other "Try to ..." statements try to change the default "Color mode", 8bits/color and 600DPI.
This reads the source and writes the same value back.... Why? Do you have a buggy back-end that somehow requires this? In that case I think it should be fixed in the back-end.