diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-09 14:09:34 +0100 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-09 14:09:34 +0100 |
commit | ec0f388dfb14712a144d534296b33df7e6a2df7f (patch) | |
tree | ab4d6b9da547a6439ae6f434a69ee3f202d328d7 /tools/linguist/linguist | |
parent | 6165ab0203fa80d31f3488ead7e7f7c088c8668c (diff) | |
parent | 3b1a0c4877faa9d1d50372f2128c06530ae4b2d4 (diff) | |
download | qt4-tools-ec0f388dfb14712a144d534296b33df7e6a2df7f.tar.gz |
Merge remote branch 'qt/4.6' into qt-master-from-4.6
Conflicts:
src/gui/kernel/qcocoapanel_mac.mm
src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
Diffstat (limited to 'tools/linguist/linguist')
-rw-r--r-- | tools/linguist/linguist/mainwindow.cpp | 29 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditor.cpp | 8 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditorwidgets.cpp | 6 |
3 files changed, 29 insertions, 14 deletions
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index 008ebb16e7..6e5c6566ba 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -94,6 +94,8 @@ #include <QUrl> #include <QWhatsThis> +#include <ctype.h> + QT_BEGIN_NAMESPACE static const int MessageMS = 2500; @@ -2356,13 +2358,28 @@ void MainWindow::updatePhraseDicts() static bool haveMnemonic(const QString &str) { - QString mnemonic = QKeySequence::mnemonic(str); - if (mnemonic == QLatin1String("Alt+Space")) { - // "Nobody" ever really uses these, and they are highly annoying - // because we get a lot of false positives. - return false; + for (const ushort *p = (ushort *)str.constData();; ) { // Assume null-termination + ushort c = *p++; + if (!c) + break; + if (c == '&') { + c = *p++; + if (!c) + return false; + // "Nobody" ever really uses these alt-space, and they are highly annoying + // because we get a lot of false positives. + if (c != '&' && c != ' ' && QChar(c).isPrint()) { + const ushort *pp = p; + for (; ::isalpha(*p); p++) ; + if (pp == p || *p != ';') + return true; + // This looks like a HTML &entity;, so ignore it. As a HTML string + // won't contain accels anyway, we can stop scanning here. + break; + } + } } - return !mnemonic.isEmpty(); + return false; } void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose) diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp index 91c88da9f8..b6c168808c 100644 --- a/tools/linguist/linguist/messageeditor.cpp +++ b/tools/linguist/linguist/messageeditor.cpp @@ -135,14 +135,6 @@ MessageEditor::MessageEditor(MultiDataModel *dataModel, QMainWindow *parent) void MessageEditor::setupEditorPage() { QFrame *editorPage = new QFrame; - editorPage->setObjectName(QLatin1String("editorPage")); - - editorPage->setStyleSheet(QLatin1String( - "QFrame#editorPage { border-image: url(:/images/transbox.png) 12 16 16 12 repeat;" - " border-width: 12px 16px 16px 12px; }" - "QFrame#editorPage { background-color: white; }" - "QLabel { font-weight: bold; }" - )); editorPage->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); m_source = new FormWidget(tr("Source text"), false); diff --git a/tools/linguist/linguist/messageeditorwidgets.cpp b/tools/linguist/linguist/messageeditorwidgets.cpp index 8b4fa6290f..4d31db216e 100644 --- a/tools/linguist/linguist/messageeditorwidgets.cpp +++ b/tools/linguist/linguist/messageeditorwidgets.cpp @@ -171,6 +171,9 @@ FormWidget::FormWidget(const QString &label, bool isEditable, QWidget *parent) layout->setMargin(0); m_label = new QLabel(this); + QFont fnt; + fnt.setBold(true); + m_label->setFont(fnt); m_label->setText(label); layout->addWidget(m_label); @@ -249,6 +252,9 @@ FormMultiWidget::FormMultiWidget(const QString &label, QWidget *parent) m_minusIcon(QIcon(QLatin1String(":/images/minus.png"))) { m_label = new QLabel(this); + QFont fnt; + fnt.setBold(true); + m_label->setFont(fnt); m_label->setText(label); m_plusButtons.append( |