Changeset View
Changeset View
Standalone View
Standalone View
src/ksanewidget.cpp
Show First 20 Lines • Show All 712 Lines • ▼ Show 20 Line(s) | 712 | if (optname == InvetColorsOption) { | |||
---|---|---|---|---|---|
713 | value = d->m_invertColors->isChecked() ? QStringLiteral("true") : QStringLiteral("false"); | 713 | value = d->m_invertColors->isChecked() ? QStringLiteral("true") : QStringLiteral("false"); | ||
714 | return true; | 714 | return true; | ||
715 | } | 715 | } | ||
716 | return false; | 716 | return false; | ||
717 | } | 717 | } | ||
718 | 718 | | |||
719 | int KSaneWidget::setOptVals(const QMap <QString, QString> &opts) | 719 | int KSaneWidget::setOptVals(const QMap <QString, QString> &opts) | ||
720 | { | 720 | { | ||
721 | if (d->m_scanThread->isRunning() || | ||||
722 | d->m_previewThread->isRunning()) { | ||||
723 | return -1; | ||||
724 | } | ||||
725 | | ||||
721 | QString tmp; | 726 | QString tmp; | ||
722 | int i; | 727 | int i; | ||
723 | int ret = 0; | 728 | int ret = 0; | ||
724 | 729 | | |||
725 | for (i = 0; i < d->m_optList.size(); i++) { | 730 | for (i = 0; i < d->m_optList.size(); i++) { | ||
726 | if (opts.contains(d->m_optList.at(i)->name())) { | 731 | if (opts.contains(d->m_optList.at(i)->name())) { | ||
727 | tmp = opts[d->m_optList.at(i)->name()]; | 732 | tmp = opts[d->m_optList.at(i)->name()]; | ||
728 | if (d->m_optList.at(i)->setValue(tmp) == false) { | 733 | if (d->m_optList.at(i)->setValue(tmp) == false) { | ||
Show All 32 Lines | 765 | } else { | |||
761 | d->m_invertColors->setChecked(false); | 766 | d->m_invertColors->setChecked(false); | ||
762 | } | 767 | } | ||
763 | } | 768 | } | ||
764 | return ret; | 769 | return ret; | ||
765 | } | 770 | } | ||
766 | 771 | | |||
767 | bool KSaneWidget::setOptVal(const QString &option, const QString &value) | 772 | bool KSaneWidget::setOptVal(const QString &option, const QString &value) | ||
768 | { | 773 | { | ||
774 | if (d->m_scanThread->isRunning() || | ||||
775 | d->m_previewThread->isRunning()) { | ||||
776 | return false; | ||||
777 | } | ||||
778 | | ||||
769 | KSaneOption *opt; | 779 | KSaneOption *opt; | ||
770 | 780 | | |||
771 | if ((opt = d->getOption(option)) != nullptr) { | 781 | if ((opt = d->getOption(option)) != nullptr) { | ||
772 | if (opt->setValue(value)) { | 782 | if (opt->setValue(value)) { | ||
773 | if ((d->m_splitGamChB) && | 783 | if ((d->m_splitGamChB) && | ||
774 | (d->m_optGamR) && | 784 | (d->m_optGamR) && | ||
775 | (d->m_optGamG) && | 785 | (d->m_optGamG) && | ||
776 | (d->m_optGamB) && | 786 | (d->m_optGamB) && | ||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |