Changeset View
Changeset View
Standalone View
Standalone View
plugins/ocr/ocrad/ocrocraddialog.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
53 | #include "ocrocradengine.h" | 53 | #include "ocrocradengine.h" | ||
54 | 54 | | |||
55 | 55 | | |||
56 | OcrOcradDialog::OcrOcradDialog(AbstractOcrEngine *plugin, QWidget *pnt) | 56 | OcrOcradDialog::OcrOcradDialog(AbstractOcrEngine *plugin, QWidget *pnt) | ||
57 | : AbstractOcrDialogue(plugin, pnt), | 57 | : AbstractOcrDialogue(plugin, pnt), | ||
58 | m_setupWidget(nullptr), | 58 | m_setupWidget(nullptr), | ||
59 | m_orfUrlRequester(nullptr), | 59 | m_orfUrlRequester(nullptr), | ||
60 | m_layoutMode(0), | 60 | m_layoutMode(0), | ||
61 | m_ocrCmd(QString::null), | 61 | m_ocrCmd(QString()), | ||
62 | m_versionNum(0), | 62 | m_versionNum(0), | ||
63 | m_versionStr(QString::null) | 63 | m_versionStr(QString()) | ||
64 | { | 64 | { | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | 67 | | |||
68 | bool OcrOcradDialog::setupGui() | 68 | bool OcrOcradDialog::setupGui() | ||
69 | { | 69 | { | ||
70 | AbstractOcrDialogue::setupGui(); // build the standard GUI | 70 | AbstractOcrDialogue::setupGui(); // build the standard GUI | ||
71 | 71 | | |||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | |||||
218 | void OcrOcradDialog::slotWriteConfig() | 218 | void OcrOcradDialog::slotWriteConfig() | ||
219 | { | 219 | { | ||
220 | AbstractOcrDialogue::slotWriteConfig(); | 220 | AbstractOcrDialogue::slotWriteConfig(); | ||
221 | 221 | | |||
222 | KookaSettings::setOcrOcradBinary(getOCRCmd()); | 222 | KookaSettings::setOcrOcradBinary(getOCRCmd()); | ||
223 | KookaSettings::setOcrOcradLayoutDetection(m_layoutMode->currentIndex()); | 223 | KookaSettings::setOcrOcradLayoutDetection(m_layoutMode->currentIndex()); | ||
224 | 224 | | |||
225 | int ix = m_characterSet->currentIndex(); | 225 | int ix = m_characterSet->currentIndex(); | ||
226 | QString value = (m_characterSet->itemData(ix).toBool() ? m_characterSet->currentText() : QString::null); | 226 | QString value = (m_characterSet->itemData(ix).toBool() ? m_characterSet->currentText() : QString()); | ||
227 | KookaSettings::setOcrOcradCharset(value); | 227 | KookaSettings::setOcrOcradCharset(value); | ||
228 | 228 | | |||
229 | ix = m_filter->currentIndex(); | 229 | ix = m_filter->currentIndex(); | ||
230 | value = (m_filter->itemData(ix).toBool() ? m_filter->currentText() : QString::null); | 230 | value = (m_filter->itemData(ix).toBool() ? m_filter->currentText() : QString()); | ||
231 | KookaSettings::setOcrOcradFilter(value); | 231 | KookaSettings::setOcrOcradFilter(value); | ||
232 | 232 | | |||
233 | ix = m_transform->currentIndex(); | 233 | ix = m_transform->currentIndex(); | ||
234 | value = (m_transform->itemData(ix).toBool() ? m_transform->currentText() : QString::null); | 234 | value = (m_transform->itemData(ix).toBool() ? m_transform->currentText() : QString()); | ||
235 | KookaSettings::setOcrOcradTransform(value); | 235 | KookaSettings::setOcrOcradTransform(value); | ||
236 | 236 | | |||
237 | KookaSettings::setOcrOcradInvert(m_invert->isChecked()); | 237 | KookaSettings::setOcrOcradInvert(m_invert->isChecked()); | ||
238 | KookaSettings::setOcrOcradThresholdEnable(m_thresholdEnable->isChecked()); | 238 | KookaSettings::setOcrOcradThresholdEnable(m_thresholdEnable->isChecked()); | ||
239 | KookaSettings::setOcrOcradThresholdValue(m_thresholdSlider->value()); | 239 | KookaSettings::setOcrOcradThresholdValue(m_thresholdSlider->value()); | ||
240 | } | 240 | } | ||
241 | 241 | | |||
242 | 242 | | |||
243 | void OcrOcradDialog::enableFields(bool enable) | 243 | void OcrOcradDialog::enableFields(bool enable) | ||
244 | { | 244 | { | ||
245 | m_setupWidget->setEnabled(enable); | 245 | m_setupWidget->setEnabled(enable); | ||
246 | } | 246 | } | ||
247 | 247 | | |||
248 | 248 | | |||
249 | /* Later: Allow interactive loading of ORF files */ | 249 | /* Later: Allow interactive loading of ORF files */ | ||
250 | QString OcrOcradDialog::orfUrl() const | 250 | QString OcrOcradDialog::orfUrl() const | ||
251 | { | 251 | { | ||
252 | if (m_orfUrlRequester != nullptr) { | 252 | if (m_orfUrlRequester != nullptr) { | ||
253 | return (m_orfUrlRequester->url().url()); | 253 | return (m_orfUrlRequester->url().url()); | ||
254 | } else { | 254 | } else { | ||
255 | return (QString::null); | 255 | return (QString()); | ||
256 | } | 256 | } | ||
257 | } | 257 | } | ||
258 | 258 | | |||
259 | 259 | | |||
260 | void OcrOcradDialog::getVersion(const QString &bin) | 260 | void OcrOcradDialog::getVersion(const QString &bin) | ||
261 | { | 261 | { | ||
262 | //qDebug() << "of" << bin; | 262 | //qDebug() << "of" << bin; | ||
263 | if (bin.isEmpty()) { | 263 | if (bin.isEmpty()) { | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |