diff --git a/doc/addressbook-sdk.qdoc b/doc/addressbook-sdk.qdoc index cfb72d4ea1ba6e440f231e05e44cd83e62a66225..1ad252a8466ab7b2191062d914dce45f0365c4f8 100644 --- a/doc/addressbook-sdk.qdoc +++ b/doc/addressbook-sdk.qdoc @@ -427,7 +427,7 @@ \contentspage {Address Book Tutorial}{Contents} \nextpage {examples/addressbook-sdk/part4}{Chapter 4} \example examples/addressbook-sdk/part3 - \title Address Book 3 - Navigating between Entries} + \title Address Book 3 - Navigating between Entries The address book application is now half complete. We need to add some functions to navigate between contacts. But first, we have to decide what @@ -549,7 +549,7 @@ \contentspage {Address Book Tutorial}{Contents} \nextpage {examples/addressbook-sdk/part5}{Chapter 5} \example examples/addressbook-sdk/part4 - \title Address Book 4 - Editing and Removing Addresses} + \title Address Book 4 - Editing and Removing Addresses In this chapter, we look at ways to modify the contents of contacts stored in the address book application. @@ -710,7 +710,7 @@ \contentspage {Address Book Tutorial}{Contents} \nextpage {examples/addressbook-sdk/part6}{Chapter 6} \example examples/addressbook-sdk/part5 - \title Address Book 5 - Adding a Find Function} + \title Address Book 5 - Adding a Find Function In this chapter, we look at ways to locate contacts and addresses in the address book application. @@ -751,7 +751,7 @@ \contentspage {Address Book Tutorial}{Contents} \nextpage {examples/addressbook-sdk/part7}{Chapter 7} \example examples/addressbook-sdk/part6 - \title Address Book 6 - Loading and Saving} + \title Address Book 6 - Loading and Saving */ @@ -760,6 +760,6 @@ \previouspage Address Book 6 - Loading and Saving \contentspage {Address Book Tutorial}{Contents} \example examples/addressbook-sdk/part7 - \title Address Book 7 - Additional Features} + \title Address Book 7 - Additional Features */ diff --git a/doc/examples/addressbook-sdk/part5/finddialog.cpp b/doc/examples/addressbook-sdk/part5/finddialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..15002d62f322d136ab50e4f7020da7dccc0789a8 --- /dev/null +++ b/doc/examples/addressbook-sdk/part5/finddialog.cpp @@ -0,0 +1,22 @@ +#include "finddialog.h" +#include "ui_finddialog.h" + +FindDialog::FindDialog(QWidget *parent) : + QDialog(parent), + m_ui(new Ui::FindDialog) +{ + m_ui->setupUi(this); +} + +FindDialog::~FindDialog() +{ + delete m_ui; +} + +void FindDialog::findClicked() +{ +} + +QString FindDialog::getFindText() +{ +} diff --git a/doc/examples/addressbook-sdk/part5/finddialog.h b/doc/examples/addressbook-sdk/part5/finddialog.h new file mode 100644 index 0000000000000000000000000000000000000000..8a1b3d47d54c6d6258b78b885fe119936fb3ba95 --- /dev/null +++ b/doc/examples/addressbook-sdk/part5/finddialog.h @@ -0,0 +1,29 @@ +#ifndef FINDDIALOG_H +#define FINDDIALOG_H + +#include <QtGui/QDialog> +#include <QLineEdit> +#include <QPushButton> + +namespace Ui { + class FindDialog; +} + +class FindDialog : public QDialog { + Q_OBJECT +public: + FindDialog(QWidget *parent = 0); + ~FindDialog(); + QString getFindText(); + +public slots: + void findClicked(); + +private: + Ui::FindDialog *m_ui; + QPushButton *findButton; + QLineEdit *lineEdit; + QString findText; +}; + +#endif // FINDDIALOG_H diff --git a/doc/examples/addressbook-sdk/part5/finddialog.ui b/doc/examples/addressbook-sdk/part5/finddialog.ui index 500b70b7c36589c40cab832f47471c55c48589c0..3f39d27d5967577b4eef0157c0cbfb39ff2ae4de 100644 --- a/doc/examples/addressbook-sdk/part5/finddialog.ui +++ b/doc/examples/addressbook-sdk/part5/finddialog.ui @@ -1,18 +1,59 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>FindDialog</class> - <widget class="QDialog" name="FindDialog" > - <property name="geometry" > + <widget class="QDialog" name="FindDialog"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>400</width> - <height>300</height> + <width>486</width> + <height>65</height> </rect> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>Dialog</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Enter the name of a contact:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit"/> + </item> + <item> + <widget class="QPushButton" name="findButton"> + <property name="text"> + <string>Find</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> <resources/> - <connections/> + <connections> + <connection> + <sender>findButton</sender> + <signal>clicked()</signal> + <receiver>FindDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>415</x> + <y>42</y> + </hint> + <hint type="destinationlabel"> + <x>385</x> + <y>50</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index a299fb5e90ddf5e8c96d75a89526a00237c97f11..8287fafde8da83968a0ec495ec8308bf113aab88 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1536,8 +1536,9 @@ \bold{Display Low Level Data} If special debugging of Qt objects fails due to data corruption within the - debugged objects, you can switch the special debugging off in the - \gui{Debug} menu. This will make the low-level structures visible again. + debugged objects, you can switch the debugging helpers off in the + \gui{Debugger -> Debugging Helper} options dialog. + This will make the low-level structures visible again. */ @@ -1640,7 +1641,7 @@ \row \o \raw HTML - System Qt + Auto-detected Qt \endraw \target glossary-system-qt \o The version of Qt installed on your system. This is the Qt @@ -1654,7 +1655,7 @@ \target glossary-default-qt \o The version of Qt configured in \gui{Tools -> Options -> Qt 4 -> Default Qt Version}. This is the Qt version used by your - new projects. It defaults to System Qt. + new projects. It defaults to the Auto-detected Qt. \row \o diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 59a6fc8a7e8a3540bdc93be08dcb360d1ccab8ce..726fe10f24cd4c13ebdcddd15b672f3936a25ce7 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -1359,7 +1359,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+11"/> <source>&Tools</source> - <translation>&Werkzeuge</translation> + <translation>E&xtras</translation> </message> <message> <location line="+5"/> @@ -10283,7 +10283,7 @@ p, li { white-space: pre-wrap; } <font color="#ff0000"><b>No valid Qt version set. Set one in Tools/Options </b></font> </source> <translation> -<font color="#ff0000"><b>Es ist keine gültige Qt-Version gesetzt. Setzen Sie sie unter Werkzeuge/Einstellungen</b></font> +<font color="#ff0000"><b>Es ist keine gültige Qt-Version gesetzt. Setzen Sie sie unter Extras/Einstellungen</b></font> </translation> </message> <message> @@ -11709,7 +11709,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <message> <location/> <source>Never</source> - <translation>NiemalsZahl</translation> + <translation>Niemals</translation> </message> <message> <location/> diff --git a/src/app/main.cpp b/src/app/main.cpp index 5199c7c7e64e8f2f6185ba0525137a85d6fadebe..1cb2b8e8e952a4071b1ac28ad59486ce92ddbcfe 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -217,11 +217,13 @@ int main(int argc, char **argv) QTranslator translator; QTranslator qtTranslator; const QString &locale = QLocale::system().name(); - if (translator.load(QLatin1String("qtcreator_") + locale, - QCoreApplication::applicationDirPath() - + QLatin1String(SHARE_PATH "/translations"))) { - if (qtTranslator.load(QLatin1String("qt_") + locale, - QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { + const QString &creatorTrPath = QCoreApplication::applicationDirPath() + + QLatin1String(SHARE_PATH "/translations"); + if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) { + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString &qtTrFile = QLatin1String("qt_") + locale; + // Binary installer puts Qt tr files into creatorTrPath + if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) { app.installTranslator(&translator); app.installTranslator(&qtTranslator); app.setProperty("qtc_locale", locale); diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp index 307da2ecf11ff74db6cb372dca4c4c4e54b93787..5627cde23dffbe05c1e4ad8e6cecd76f34be3bc7 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp @@ -77,7 +77,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const setStartId(startid); setOption(QWizard::NoCancelButton); - setOption(QWizard::NoBackButtonOnStartPage); + init(); } CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, @@ -93,7 +93,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const else addPage(new CMakeRunPage(this, CMakeRunPage::Update, buildDirectory)); setOption(QWizard::NoCancelButton); - setOption(QWizard::NoBackButtonOnStartPage); + init(); } CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory, @@ -107,7 +107,13 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const m_buildDirectory = oldBuildDirectory; addPage(new ShadowBuildPage(this, true)); addPage(new CMakeRunPage(this, CMakeRunPage::Change)); + init(); +} + +void CMakeOpenProjectWizard::init() +{ setOption(QWizard::NoBackButtonOnStartPage); + setWindowTitle(tr("CMake Wizard")); } CMakeManager *CMakeOpenProjectWizard::cmakeManager() const diff --git a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h index 487037801ebafd032a92af1f6f1ecfd4bf8b980f..485edde663f0708c6f009067360e7340e2e7c9ed 100644 --- a/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h +++ b/src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h @@ -83,6 +83,7 @@ public: void setArguments(const QStringList &args); ProjectExplorer::Environment environment() const; private: + void init(); bool existsUpToDateXmlFile() const; bool hasInSourceBuild() const; CMakeManager *m_cmakeManager; diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 4b84abe8dac3b84081f69d5ffd93cbf886baab90..38377e169f7a3bffd34d85cb679a0dd15c5c9334 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -162,6 +162,8 @@ int EditorModel::findEditor(IEditor *editor) const int EditorModel::findFileName(const QString &filename) const { + if (filename.isEmpty()) + return -1; for (int i = 0; i < m_editors.count(); ++i) { if (m_editors.at(i).fileName() == filename) return i; @@ -300,21 +302,10 @@ QVariant EditorModel::data(const QModelIndex &index, int role) const QModelIndex EditorModel::indexOf(IEditor *editor) const { - int idx = findEditor(editor); - if (idx < 0) - return indexOf(editor->file()->fileName()); + int idx = findEditor(originalForDuplicate(editor)); return createIndex(idx, 0); } -QModelIndex EditorModel::indexOf(const QString &fileName) const -{ - int idx = findFileName(fileName); - if (idx >= 0) - return createIndex(idx, 0); - return QModelIndex(); -} - - void EditorModel::itemChanged() { emitDataChanged(qobject_cast<IEditor*>(sender())); @@ -588,7 +579,7 @@ void EditorView::setCurrentEditor(IEditor *editor) const int idx = m_container->indexOf(editor->widget()); QTC_ASSERT(idx >= 0, return); m_container->setCurrentIndex(idx); - m_editorList->setCurrentIndex(m_model->indexOf(editor->file()->fileName()).row()); + m_editorList->setCurrentIndex(m_model->indexOf(editor).row()); updateEditorStatus(editor); updateToolBar(editor); diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h index 32026d0f413b8f71af7db3251528031eb73443c6..2986d807eca22cec18c4ec09893fabb7e5e223a4 100644 --- a/src/plugins/coreplugin/editormanager/editorview.h +++ b/src/plugins/coreplugin/editormanager/editorview.h @@ -100,8 +100,6 @@ public: IEditor *originalForDuplicate(IEditor *duplicate) const; void makeOriginal(IEditor *duplicate); QModelIndex indexOf(IEditor *editor) const; - QModelIndex indexOf(const QString &filename) const; - private slots: void itemChanged(); diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index c0506a222a87942d4dcf8d26a54a0f5bf936896a..64cf61330026124d4c23c876f5a03778115081e2 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -427,6 +427,9 @@ QStringList WelcomeMode::tipsOfTheDay() tips.append(tr("If you add <a href=\"qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html\"" ">external libraries</a>, Qt Creator will automatically offer syntax highlighting " "and code completion.")); + tips.append(tr("The code completion is CamelCase-aware. For example, to complete <tt>namespaceUri</tt> " + "you can just type <tt>nU</tt> and hit <tt>Ctrl+Space</tt>.")); + tips.append(tr("You can force code completion at any time using <tt>Ctrl+Space</tt>.")); } return tips; } diff --git a/src/plugins/coreplugin/welcomemode.ui b/src/plugins/coreplugin/welcomemode.ui index 29a7f94e44054cc48090e73cf908f2c16a63ef36..c1471f65d7a81e30d1251be14945cb57ae43f7ae 100644 --- a/src/plugins/coreplugin/welcomemode.ui +++ b/src/plugins/coreplugin/welcomemode.ui @@ -976,7 +976,7 @@ QToolButton:pressed { </property> <property name="minimumSize"> <size> - <width>360</width> + <width>340</width> <height>0</height> </size> </property> diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index ffa09ae1c89c010b1417921666a7fee45e419a24..329a8a19bdba09dca2ddeb989eddef7edcddd779 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -1264,17 +1264,12 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio if (c.isUpper() && !first) { keyRegExp += QLatin1String("[a-z0-9_]*"); keyRegExp += c; - } else if (m_caseSensitivity == Qt::CaseInsensitive && c.isLower()) { - keyRegExp += QLatin1Char('['); - keyRegExp += c; - keyRegExp += c.toUpper(); - keyRegExp += QLatin1Char(']'); } else { keyRegExp += QRegExp::escape(c); } first = false; } - const QRegExp regExp(keyRegExp, Qt::CaseSensitive); + const QRegExp regExp(keyRegExp, m_caseSensitivity); foreach (TextEditor::CompletionItem item, m_completions) { if (regExp.indexIn(item.m_text) == 0) { diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index aa4820bc2194c341c1f025901ad2985e4d955bc5..48b5dcaa231f2f1b997108f87195a6a6749cdd7b 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -928,8 +928,8 @@ void GdbEngine::handleAqcuiredInferior() reloadSourceFiles(); // Reverse debugging. FIXME: Should only be used when available. - if (theDebuggerBoolSetting(EnableReverseDebugging)) - postCommand(_("target record")); + //if (theDebuggerBoolSetting(EnableReverseDebugging)) + // postCommand(_("target record")); tryLoadDebuggingHelpers(); diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 8962f2f714abfea35cfd88f86c1afb2609621989..6227c0ff285218fd1e79e0282ef92ef214837707 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -121,9 +121,12 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error) QString locale = qApp->property("qtc_locale").toString(); if (!locale.isEmpty()) { QTranslator *qtr = new QTranslator(this); - qtr->load(QLatin1String("designer_") + locale, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - qApp->installTranslator(qtr); + const QString &creatorTrPath = + Core::ICore::instance()->resourcePath() + QLatin1String("/translations"); + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString &trFile = QLatin1String("designer_") + locale; + if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath)) + qApp->installTranslator(qtr); } error->clear(); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index da61f23b1cf6877e5ef373c74ce04019c3f20554..7eabc65001eabd7bbc14c04833904eba3fb975f6 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -783,7 +783,8 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, const GitSubmitEditorPanelData &data, const QString &messageFile, const QStringList &checkedFiles, - const QStringList &origCommitFiles) + const QStringList &origCommitFiles, + const QStringList &origDeletedFiles) { if (Git::Constants::debug) qDebug() << "GitClient::addAndCommit:" << repositoryDirectory << checkedFiles << origCommitFiles; @@ -795,9 +796,12 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, if (!synchronousReset(repositoryDirectory, resetFiles.toList())) return false; - // Re-add all to make sure we have the latest changes - if (!synchronousAdd(repositoryDirectory, checkedFiles)) - return false; + // Re-add all to make sure we have the latest changes, but only add those that aren't marked + // for deletion + QStringList addFiles = checkedFiles.toSet().subtract(origDeletedFiles.toSet()).toList(); + if (!addFiles.isEmpty()) + if (!synchronousAdd(repositoryDirectory, addFiles)) + return false; // Do the final commit QStringList args; diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 8807218da30f2154e14e0c6175a4f0f45caa83f1..5ac85f41dc77a759dcd31a2a7a96ecd3085c5a56 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -123,7 +123,8 @@ public: const GitSubmitEditorPanelData &data, const QString &messageFile, const QStringList &checkedFiles, - const QStringList &origCommitFiles); + const QStringList &origCommitFiles, + const QStringList &origDeletedFiles); enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed }; StatusResult gitStatus(const QString &workingDirectory, diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index ac3cfb2d2d8ad91b9923ddfde6b38935ee7e623a..ef327da7c34e9506095b1f3177a30c33b652c0cd 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -614,6 +614,7 @@ void GitPlugin::startCommit() // files to be able to unstage files the user unchecks m_submitRepository = data.panelInfo.repository; m_submitOrigCommitFiles = data.stagedFileNames(); + m_submitOrigDeleteFiles = data.stagedFileNames("deleted"); if (Git::Constants::debug) qDebug() << Q_FUNC_INFO << data << commitTemplate; @@ -709,7 +710,8 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor) editor->panelData(), m_changeTmpFile->fileName(), fileList, - m_submitOrigCommitFiles); + m_submitOrigCommitFiles, + m_submitOrigDeleteFiles); } if (closeEditor) cleanChangeTmpFile(); diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index da5af49bb7412ab365cbc7690951b90bd512a76f..a218052c37be8314c7643cf47066c94410dd4a6c 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -173,6 +173,7 @@ private: Core::IVersionControl *m_versionControl; QString m_submitRepository; QStringList m_submitOrigCommitFiles; + QStringList m_submitOrigDeleteFiles; QTemporaryFile *m_changeTmpFile; bool m_submitActionTriggered; }; diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 4de97513fd37ba7a62a28db7cb782d3be4c97cc5..272222cd4e2ad53c2ac73f58fe21bcd98b8f5424 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -63,11 +63,10 @@ GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget() // Utility to add a list of state/file pairs to the model // setting a file type. -static void addStateFileListToModel(const QList<CommitData::StateFilePair> &l, +static void addStateFileListToModel(const QList<CommitData::StateFilePair> &l, bool checked, FileType ft, VCSBase::SubmitFileModel *model) { - typedef QList<CommitData::StateFilePair>::const_iterator ConstIterator; if (!l.empty()) { const ConstIterator cend = l.constEnd(); diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 726d3d47d12bcfeeddac5b1f910a35ae0f02beb3..d318641e4215422c82b4eed506181de37cd91557 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -141,9 +141,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) QString locale = qApp->property("qtc_locale").toString(); if (!locale.isEmpty()) { QTranslator *qtr = new QTranslator(this); - qtr->load(QLatin1String("assistant_") + locale, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - qApp->installTranslator(qtr); + QTranslator *qhelptr = new QTranslator(this); + const QString &creatorTrPath = + Core::ICore::instance()->resourcePath() + QLatin1String("/translations"); + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString &trFile = QLatin1String("assistant_") + locale; + const QString &helpTrFile = QLatin1String("qt_help_") + locale; + if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath)) + qApp->installTranslator(qtr); + if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath)) + qApp->installTranslator(qhelptr); } #ifndef QT_NO_WEBKIT @@ -762,12 +769,19 @@ void HelpPlugin::openHelpPage(const QUrl& url) void HelpPlugin::openHelpPage(const QString& url) { - activateHelpMode(); - if (m_helpEngine->findFile(url).isValid()) + if (m_helpEngine->findFile(url).isValid()) { + activateHelpMode(); m_centralWidget->setSource(url); - else { - QDesktopServices::openUrl(QLatin1String("http://doc.trolltech.com/latest/") - + url.mid(url.lastIndexOf('/') + 1)); + } else { + // local help not installed, resort to external web help + QString urlPrefix; + if (url.startsWith("qthelp://com.nokia.qtcreator")) { + urlPrefix = QString::fromLatin1("http://doc.trolltech.com/qtcreator-%1.%2/") + .arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR); + } else { + urlPrefix = QLatin1String("http://doc.trolltech.com/latest/"); + } + QDesktopServices::openUrl(urlPrefix + url.mid(url.lastIndexOf('/') + 1)); } }