5
6
7
8
19 statusFilter->addItem(tr(
"All"), -1);
20 statusFilter->addItem(tr(
"Finished"), TranslatorMessage::Finished);
21 statusFilter->addItem(tr(
"Unfinished"), TranslatorMessage::Unfinished);
23 findNxt->setEnabled(
false);
25 connect(findNxt, &QAbstractButton::clicked,
26 this, &FindDialog::emitFindNext);
27 connect(useRegExp, &QCheckBox::checkStateChanged,
28 this, &FindDialog::verify);
29 connect(led, &QLineEdit::textChanged,
30 this, &FindDialog::verify);
31 connect(statusFilter, &QComboBox::currentIndexChanged,
32 this, &FindDialog::statusFilterChanged);
39 bool validRegExp =
true;
40 if (useRegExp->isChecked() && !led->text().isEmpty()) {
41 m_regExp.setPattern(led->text());
42 validRegExp = m_regExp.isValid();
44 if (validRegExp && m_redText)
45 led->setStyleSheet(QStringLiteral(
"color: auto;"));
46 else if (!validRegExp && !m_redText)
47 led->setStyleSheet(QStringLiteral(
"color: red;"));
48 m_redText = !validRegExp;
49 findNxt->setEnabled(!led->text().isEmpty() && validRegExp);
54 int newStateFilter = statusFilter->currentData().toInt();
55 if (newStateFilter != -1) {
56 if (m_lastStateFilter == -1)
57 m_storedSkipObsolete = skipObsolete->isChecked();
58 skipObsolete->setEnabled(
false);
59 skipObsolete->setChecked(
true);
61 skipObsolete->setEnabled(
true);
62 skipObsolete->setChecked(m_storedSkipObsolete);
64 m_lastStateFilter = newStateFilter;
72 DataModel::FindLocation(
73 (sourceText->isChecked() ? DataModel::SourceText : 0) |
74 (translations->isChecked() ? DataModel::Translations : 0) |
75 (comments->isChecked() ? DataModel::Comments : 0));
79 FindOptions options((matchCase->isChecked() ? FindOption::MatchCase : 0) |
80 (ignoreAccelerators->isChecked() ? FindDialog::IgnoreAccelerators : 0) |
81 (skipObsolete->isChecked() ? FindDialog::SkipObsolete : 0) |
82 (useRegExp->isChecked() ? FindDialog::UseRegExp : 0));
83 emit findNext(led->text(), where, options, statusFilter->currentData().toInt());
Combined button and popup list for selecting options.