void FindEditor::findOptionChanged() { getFindOption(&m_option,false); m_status->setText(tr("Ready")); if (m_option.useRegexp) { QRegExp reg(m_option.findText); if (!reg.isValid()) { m_status->setText(reg.errorString()); } } updateCurrentEditor(m_liteApp->editorManager()->currentEditor()); }
void FindEditor::setVisible(bool b) { this->m_widget->setVisible(b); if (b) { LiteApi::IEditor *editor = m_liteApp->editorManager()->currentEditor(); if (editor) { QString text; QPlainTextEdit *ed = LiteApi::findExtensionObject<QPlainTextEdit*>(editor,"LiteApi.QPlainTextEdit"); if (ed) { text = ed->textCursor().selectedText(); } if (!text.isEmpty()) { this->m_findEdit->setText(text); } this->m_findEdit->setFocus(); this->m_findEdit->selectAll(); } } updateCurrentEditor(m_liteApp->editorManager()->currentEditor()); }