void FindToolBar::openFindToolBar(OpenFlags flags) { installEventFilters(); FindToolBarPlaceHolder *holder = findToolBarPlaceHolder(); if (!holder) return; FindToolBarPlaceHolder *previousHolder = FindToolBarPlaceHolder::getCurrent(); if (previousHolder != holder) { if (previousHolder) previousHolder->setWidget(0); holder->setWidget(this); FindToolBarPlaceHolder::setCurrent(holder); } m_currentDocumentFind->acceptCandidate(); holder->setVisible(true); setVisible(true); // We do not want to change the text when we currently have the focus and user presses the // find shortcut // if (!focus || !toolBarHasFocus()) { if (flags & UpdateFindText) { QString text = m_currentDocumentFind->currentFindString(); if (!text.isEmpty()) setFindText(text); } if (flags & UpdateFocusAndSelect) setFocus(); if (flags & UpdateFindScope) m_currentDocumentFind->defineFindScope(); if (flags & UpdateHighlight) m_currentDocumentFind->highlightAll(getFindText(), effectiveFindFlags()); if (flags & UpdateFocusAndSelect) selectFindText(); }
void FindToolBar::updateFromFindClipboard() { if (QApplication::clipboard()->supportsFindBuffer()) { QSignalBlocker blocker(m_ui.findEdit); setFindText(QApplication::clipboard()->text(QClipboard::FindBuffer)); } }
void MainWindow::showFindToolBar() { m_findToolBar->setVisible(true); m_findLineEdit->setFocus(Qt::OtherFocusReason); m_findLineEdit->selectAll(); setFindText(m_findLineEdit->text()); }
void FindToolBar::updateFromFindClipboard() { if (QApplication::clipboard()->supportsFindBuffer()) { const bool blocks = m_ui.findEdit->blockSignals(true); setFindText(QApplication::clipboard()->text(QClipboard::FindBuffer)); m_ui.findEdit->blockSignals(blocks); } }
ICQSearch::ICQSearch(ICQClient *client) { m_client = client; m_result = NULL; m_wizard = NULL; m_bRandomSearch = false; m_randomUin = 0; initCombo(cmbGender, 0, p_genders); initCombo(cmbAge, 0, ages); initCombo(cmbCountry, 0, getCountries()); initCombo(cmbLang, 0, p_languages); connect(tabSearch, SIGNAL(currentChanged(QWidget*)), this, SLOT(currentChanged(QWidget*))); connect(edtEmail, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(cmbAge, SIGNAL(activated(const QString&)), this, SLOT(textChanged(const QString&))); connect(cmbGender, SIGNAL(activated(const QString&)), this, SLOT(textChanged(const QString&))); connect(cmbCountry, SIGNAL(activated(const QString&)), this, SLOT(textChanged(const QString&))); connect(cmbLang, SIGNAL(activated(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtCity, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtState, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtCompany, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtDepartment, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtInterests, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtFirst, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtLast, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtNick, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtUin, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtScreen, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&))); connect(edtEmail, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtFirst, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtLast, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtNick, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtUin, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtCity, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtState, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtCompany, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtDepartment, SIGNAL(returnPressed()), this, SLOT(search())); connect(edtInterests, SIGNAL(returnPressed()), this, SLOT(search())); edtUin->setValidator(new QIntValidator(10000, 0x7FFFFFFF, edtUin)); initCombo(cmbGroup, m_client->getRandomChatGroup(), p_chat_groups, false); connect(btnFind, SIGNAL(clicked()), this, SLOT(randomFind())); setFindText(); edtStatus->setReadOnly(true); edtInfo->setReadOnly(true); edtInfo->setTextFormat(QTextEdit::RichText); btnAdd->setEnabled(false); btnMsg->setEnabled(false); connect(btnAdd, SIGNAL(clicked()), this, SLOT(addContact())); connect(btnMsg, SIGNAL(clicked()), this, SLOT(sendMessage())); edtScreen->setValidator(new AIMValidator(edtScreen)); fillGroup(); }
void ICQSearch::randomFind() { if (m_bRandomSearch){ m_bRandomSearch = false; edtStatus->setText("Canceled"); }else{ unsigned short grp = getComboValue(cmbGroup, p_chat_groups); m_client->searchChat(grp); edtStatus->setText(i18n("Request UIN")); edtInfo->setText(""); m_name = ""; btnAdd->setEnabled(false); btnMsg->setEnabled(false); } setFindText(); }
void MainWindow::findNext() { setFindText(m_findLineEdit->text()); }