diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-12-03 09:25:33 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-12-03 09:25:33 (GMT) |
commit | 76f27d01adc17ca157c5f6791b21ba4e4cb851eb (patch) | |
tree | 1d469509014c7f9ae46ff3819c50433438deee53 /tools | |
parent | 39609930e066f93197d518f33e320b58ae7f618b (diff) | |
parent | ae2c3a96519ede274bd3a67566f007b1cba24ff8 (diff) | |
download | Qt-76f27d01adc17ca157c5f6791b21ba4e4cb851eb.zip Qt-76f27d01adc17ca157c5f6791b21ba4e4cb851eb.tar.gz Qt-76f27d01adc17ca157c5f6791b21ba4e4cb851eb.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/tools/assistant/centralwidget.cpp | 2 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/doc/assistant.qdocconf | 2 | ||||
-rw-r--r-- | tools/linguist/linguist/mainwindow.cpp | 29 | ||||
-rw-r--r-- | tools/linguist/linguist/mainwindow.h | 1 | ||||
-rw-r--r-- | tools/linguist/linguist/messagemodel.cpp | 7 | ||||
-rw-r--r-- | tools/linguist/linguist/translationsettingsdialog.cpp | 33 | ||||
-rw-r--r-- | tools/linguist/linguist/translationsettingsdialog.h | 2 | ||||
-rw-r--r-- | tools/linguist/shared/qph.cpp | 30 | ||||
-rw-r--r-- | tools/linguist/shared/translator.h | 6 | ||||
-rw-r--r-- | tools/qdoc3/test/assistant.qdocconf | 2 | ||||
-rw-r--r-- | tools/qdoc3/test/designer.qdocconf | 2 | ||||
-rw-r--r-- | tools/qdoc3/test/linguist.qdocconf | 2 | ||||
-rw-r--r-- | tools/qdoc3/test/qmake.qdocconf | 2 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs.qdocconf | 6 | ||||
-rw-r--r-- | tools/qdoc3/test/qt.qdocconf | 6 | ||||
-rw-r--r-- | tools/xmlpatterns/main.cpp | 4 |
16 files changed, 90 insertions, 46 deletions
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 6f6875f..7488662 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -223,6 +223,7 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); vboxLayout->setMargin(0); + tabWidget = new QTabWidget(this); #ifndef Q_OS_MAC resourcePath.append(QLatin1String("win")); #else @@ -230,7 +231,6 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) tabWidget->setDocumentMode(true); #endif - tabWidget = new QTabWidget(this); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentPageChanged(int))); diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index 161d34f..0a7ffe0 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -12,5 +12,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<td width=\"30%\" align=\"left\">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ - "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.0</div></td>\n" \ + "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.1</div></td>\n" \ "</tr></table></div></address>" diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index 5c3aaa1..383f5aa 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -305,8 +305,6 @@ MainWindow::MainWindow() m_contextView->setModel(m_sortedContextsModel); m_contextView->header()->setMovable(false); m_contextView->setColumnHidden(0, true); - m_contextView->header()->setResizeMode(1, QHeaderView::Stretch); - m_contextView->header()->setResizeMode(2, QHeaderView::ResizeToContents); m_contextView->header()->setStretchLastSection(false); m_contextDock->setWidget(m_contextView); @@ -335,8 +333,6 @@ MainWindow::MainWindow() m_messageView->setModel(m_sortedMessagesModel); m_messageView->header()->setMovable(false); m_messageView->setColumnHidden(0, true); - m_messageView->setColumnHidden(2, true); - // last visible column auto-stretches m_messagesDock->setWidget(m_messageView); @@ -443,6 +439,7 @@ MainWindow::MainWindow() statusBar()->addPermanentWidget(m_modifiedLabel); modelCountChanged(); + initViewHeaders(); resetSorting(); connect(m_dataModel, SIGNAL(modifiedChanged(bool)), @@ -509,6 +506,14 @@ MainWindow::~MainWindow() delete m_printer; } +void MainWindow::initViewHeaders() +{ + m_contextView->header()->setResizeMode(1, QHeaderView::Stretch); + m_contextView->header()->setResizeMode(2, QHeaderView::ResizeToContents); + m_messageView->setColumnHidden(2, true); + // last visible column auto-stretches +} + void MainWindow::modelCountChanged() { int mc = m_dataModel->modelCount(); @@ -740,6 +745,7 @@ bool MainWindow::closeAll() m_messageView->setUpdatesEnabled(false); m_dataModel->closeAll(); modelCountChanged(); + initViewHeaders(); recentFiles().closeGroup(); return true; } @@ -2348,6 +2354,17 @@ void MainWindow::updatePhraseDicts() m_phraseView->update(); } +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; + } + return !mnemonic.isEmpty(); +} + void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose) { MultiDataIndex curIdx = index; @@ -2379,10 +2396,10 @@ void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose) } if (m_ui.actionAccelerators->isChecked()) { - bool sk = !QKeySequence::mnemonic(source).isEmpty(); + bool sk = haveMnemonic(source); bool tk = true; for (int i = 0; i < translations.count() && tk; ++i) { - tk &= !QKeySequence::mnemonic(translations[i]).isEmpty(); + tk &= haveMnemonic(translations[i]); } if (!sk && tk) { diff --git a/tools/linguist/linguist/mainwindow.h b/tools/linguist/linguist/mainwindow.h index 8b46893..dc711d8 100644 --- a/tools/linguist/linguist/mainwindow.h +++ b/tools/linguist/linguist/mainwindow.h @@ -179,6 +179,7 @@ private: bool prev(bool checkUnfinished); void updateStatistics(); + void initViewHeaders(); void modelCountChanged(); void setupMenuBar(); void setupToolBars(); diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp index 024fd91..49cd382 100644 --- a/tools/linguist/linguist/messagemodel.cpp +++ b/tools/linguist/linguist/messagemodel.cpp @@ -786,16 +786,9 @@ void MultiDataModel::closeAll() m_numFinished = 0; m_numEditable = 0; m_numMessages = 0; - int delCol = m_dataModels.count(); - m_msgModel->beginRemoveColumns(QModelIndex(), 1, delCol); - for (int i = m_multiContextList.size(); --i >= 0;) { - m_msgModel->beginRemoveColumns(m_msgModel->createIndex(i, 0, 0), 1, delCol); - m_msgModel->endRemoveColumns(); - } qDeleteAll(m_dataModels); m_dataModels.clear(); m_multiContextList.clear(); - m_msgModel->endRemoveColumns(); m_msgModel->reset(); emit allModelsDeleted(); onModifiedChanged(); diff --git a/tools/linguist/linguist/translationsettingsdialog.cpp b/tools/linguist/linguist/translationsettingsdialog.cpp index 0d94c3a..562f14e 100644 --- a/tools/linguist/linguist/translationsettingsdialog.cpp +++ b/tools/linguist/linguist/translationsettingsdialog.cpp @@ -60,15 +60,7 @@ TranslationSettingsDialog::TranslationSettingsDialog(QWidget *parent) m_ui.srcCbLanguageList->model()->sort(0, Qt::AscendingOrder); m_ui.srcCbLanguageList->insertItem(0, QLatin1String("POSIX"), QVariant(QLocale::C)); - for (int i = QLocale::AnyCountry + 1; i < QLocale::LastCountry; ++i) { - QString country = QLocale::countryToString(QLocale::Country(i)); - m_ui.srcCbCountryList->addItem(country, QVariant(i)); - } - m_ui.srcCbCountryList->model()->sort(0, Qt::AscendingOrder); - m_ui.srcCbCountryList->insertItem(0, tr("Any Country"), QVariant(QLocale::AnyCountry)); - m_ui.tgtCbLanguageList->setModel(m_ui.srcCbLanguageList->model()); - m_ui.tgtCbCountryList->setModel(m_ui.srcCbCountryList->model()); } void TranslationSettingsDialog::setDataModel(DataModel *dataModel) @@ -87,6 +79,31 @@ void TranslationSettingsDialog::setPhraseBook(PhraseBook *phraseBook) setWindowTitle(tr("Settings for '%1' - Qt Linguist").arg(fn)); } +static void fillCountryCombo(const QVariant &lng, QComboBox *combo) +{ + combo->clear(); + QLocale::Language lang = QLocale::Language(lng.toInt()); + if (lang != QLocale::C) { + foreach (QLocale::Country cntr, QLocale::countriesForLanguage(lang)) { + QString country = QLocale::countryToString(cntr); + combo->addItem(country, QVariant(cntr)); + } + combo->model()->sort(0, Qt::AscendingOrder); + } + combo->insertItem(0, TranslationSettingsDialog::tr("Any Country"), QVariant(QLocale::AnyCountry)); + combo->setCurrentIndex(0); +} + +void TranslationSettingsDialog::on_srcCbLanguageList_currentIndexChanged(int idx) +{ + fillCountryCombo(m_ui.srcCbLanguageList->itemData(idx), m_ui.srcCbCountryList); +} + +void TranslationSettingsDialog::on_tgtCbLanguageList_currentIndexChanged(int idx) +{ + fillCountryCombo(m_ui.tgtCbLanguageList->itemData(idx), m_ui.tgtCbCountryList); +} + void TranslationSettingsDialog::on_buttonBox_accepted() { int itemindex = m_ui.tgtCbLanguageList->currentIndex(); diff --git a/tools/linguist/linguist/translationsettingsdialog.h b/tools/linguist/linguist/translationsettingsdialog.h index 2408add..7908cd7 100644 --- a/tools/linguist/linguist/translationsettingsdialog.h +++ b/tools/linguist/linguist/translationsettingsdialog.h @@ -66,6 +66,8 @@ private: private slots: void on_buttonBox_accepted(); + void on_srcCbLanguageList_currentIndexChanged(int idx); + void on_tgtCbLanguageList_currentIndexChanged(int idx); private: Ui::TranslationSettingsDialog m_ui; diff --git a/tools/linguist/shared/qph.cpp b/tools/linguist/shared/qph.cpp index 788245c..32bdabb 100644 --- a/tools/linguist/shared/qph.cpp +++ b/tools/linguist/shared/qph.cpp @@ -81,14 +81,20 @@ bool QPHReader::read(Translator &translator) while (!atEnd()) { readNext(); if (isStartElement()) { - if (name() == QLatin1String("source")) + if (name() == QLatin1String("source")) { m_currentField = SourceField; - else if (name() == QLatin1String("target")) + } else if (name() == QLatin1String("target")) { m_currentField = TargetField; - else if (name() == QLatin1String("definition")) + } else if (name() == QLatin1String("definition")) { m_currentField = DefinitionField; - else + } else { m_currentField = NoField; + if (name() == QLatin1String("QPH")) { + QXmlStreamAttributes atts = attributes(); + translator.setLanguageCode(atts.value(QLatin1String("language")).toString()); + translator.setSourceLanguageCode(atts.value(QLatin1String("sourcelanguage")).toString()); + } + } } else if (isWhiteSpace()) { // ignore these } else if (isCharacters()) { @@ -104,7 +110,7 @@ bool QPHReader::read(Translator &translator) TranslatorMessage msg; msg.setSourceText(m_currentSource); msg.setTranslation(m_currentTarget); - msg.setTranslatorComment(m_currentDefinition); + msg.setComment(m_currentDefinition); translator.append(msg); m_currentSource.clear(); m_currentTarget.clear(); @@ -157,7 +163,14 @@ static bool saveQPH(const Translator &translator, QIODevice &dev, ConversionData { QTextStream t(&dev); t.setCodec(QTextCodec::codecForName("UTF-8")); - t << "<!DOCTYPE QPH>\n<QPH>\n"; + t << "<!DOCTYPE QPH>\n<QPH"; + QString languageCode = translator.languageCode(); + if (!languageCode.isEmpty() && languageCode != QLatin1String("C")) + t << " language=\"" << languageCode << "\""; + languageCode = translator.sourceLanguageCode(); + if (!languageCode.isEmpty() && languageCode != QLatin1String("C")) + t << " sourcelanguage=\"" << languageCode << "\""; + t << ">\n"; foreach (const TranslatorMessage &msg, translator.messages()) { t << "<phrase>\n"; t << " <source>" << protect(msg.sourceText()) << "</source>\n"; @@ -166,9 +179,8 @@ static bool saveQPH(const Translator &translator, QIODevice &dev, ConversionData QChar(Translator::TextVariantSeparator)); t << " <target>" << protect(str) << "</target>\n"; - if (!msg.context().isEmpty() || !msg.comment().isEmpty()) - t << " <definition>" << msg.context() << msg.comment() - << "</definition>\n"; + if (!msg.comment().isEmpty()) + t << " <definition>" << protect(msg.comment()) << "</definition>\n"; t << "</phrase>\n"; } t << "</QPH>\n"; diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h index 353cf9d..fa447a3 100644 --- a/tools/linguist/shared/translator.h +++ b/tools/linguist/shared/translator.h @@ -55,10 +55,12 @@ QT_BEGIN_NAMESPACE #ifdef QT_BOOTSTRAPPED -struct QObject { +class QObject { +public: static QString tr(const char *sourceText, const char * = 0, int n = -1); }; -struct QCoreApplication : public QObject { +class QCoreApplication : public QObject { +public: enum Encoding { CodecForTr }; static QString translate(const char *, const char *sourceText, const char * = 0, Encoding = CodecForTr, int n = -1) diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 4ddc94a..adca7b4 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -17,7 +17,7 @@ qhp.Assistant.namespace = com.trolltech.assistant.460 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Assistant.filterAttributes = qt 4.6.0 tools assistant +qhp.Assistant.filterAttributes = qt 4.6.1 tools assistant qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant qhp.Assistant.subprojects = manual examples diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 9d8bd23..d30ade9 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -17,7 +17,7 @@ qhp.Designer.namespace = com.trolltech.designer.460 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Designer.filterAttributes = qt 4.6.0 tools designer +qhp.Designer.filterAttributes = qt 4.6.1 tools designer qhp.Designer.customFilters.Designer.name = Qt Designer Manual qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer qhp.Designer.subprojects = manual examples diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index f433529..f06671b 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -17,7 +17,7 @@ qhp.Linguist.namespace = com.trolltech.linguist.460 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Linguist.filterAttributes = qt 4.6.0 tools linguist +qhp.Linguist.filterAttributes = qt 4.6.1 tools linguist qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist qhp.Linguist.subprojects = manual examples diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index dcb3c9a..ad27d75 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -17,7 +17,7 @@ qhp.qmake.namespace = com.trolltech.qmake.460 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.qmake.filterAttributes = qt 4.6.0 tools qmake +qhp.qmake.filterAttributes = qt 4.6.1 tools qmake qhp.qmake.customFilters.qmake.name = qmake Manual qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake qhp.qmake.subprojects = manual diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index d1733e5..96509a4 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -32,9 +32,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.6.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.6.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.0 +qhp.Qt.filterAttributes = qt 4.6.1 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.6.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.1 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index d70ef58..aa019a7 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -34,9 +34,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.6.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.6.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.0 +qhp.Qt.filterAttributes = qt 4.6.1 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.6.1 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.1 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/xmlpatterns/main.cpp b/tools/xmlpatterns/main.cpp index a930b70..604523b 100644 --- a/tools/xmlpatterns/main.cpp +++ b/tools/xmlpatterns/main.cpp @@ -80,14 +80,14 @@ QT_USE_NAMESPACE Represents the name and value found in "-param name=value". */ typedef QPair<QString, QString> Parameter; -Q_DECLARE_METATYPE(Parameter); +Q_DECLARE_METATYPE(Parameter) /*! \internal \since 4.4 For the -output switch. */ -Q_DECLARE_METATYPE(QIODevice *); +Q_DECLARE_METATYPE(QIODevice *) /*! \class PatternistApplicationParser |