Logo Search packages:      
Sourcecode: qstardict version File versions  Download package

void QStarDict::PopupWindow::showTranslation ( const QString &  text  )  [slot]

Popup with translation of text.

Definition at line 108 of file popupwindow.cpp.

References QStarDict::DictWidget::clearHistory(), QStarDict::Application::instance(), QStarDict::DictCore::isTranslatable(), QStarDict::ResizablePopup::popup(), QStarDict::Application::speaker(), and QStarDict::DictWidget::translate().

Referenced by QStarDict::DBusAdaptor::showPopup().

{
    QString simpl = text.simplified();
    simpl.remove(QRegExp("[&%-/+?\\*#!:\\(\\)\\[\\]]+"));
    if (simpl.isEmpty())
        return;

    bool isFound = m_dict->isTranslatable(simpl);

    if (m_showIfNotFound || isFound)
    {
        translationView->translate(simpl);
        translationView->clearHistory();
        popup();
        if (isFound && m_pronounceWord)
            Application::instance()->speaker()->speak(simpl);
    }
}


Generated by  Doxygen 1.6.0   Back to index