Commit 1cdd2c27 authored by con's avatar con
Browse files

Merge commit 'origin/1.2'

parents 3ddb7b02 a778626e
How To add translations to Qt Creator
- Coordinate over the mailing list to avoid duplicate work.
- Add your language to the LANGUAGES line in
Don't qualify it with a country unless it is reasonable to expect
country-specific variants.
Skip this step if updating an existing translation, obviously.
- Run "make ts". This will complain if you are not building against
Qt 4.6 (or the master branch which will become it).
If your Qt version is too old, you may create a template by running
lconvert --drop-translations qtcreator_de.ts -o qtcreator_<yours>.ts
and adjusting the language attribute in the new .ts file. The downside
of this method is obviously that you will not be translating the newest
Creator sources (unless qtcreator_de.ts was completely up-to-date).
Of course, this method is not applicable if you are updating an existing
You may also request an up-to-date template from us.
The remaining steps do *not* require Qt 4.6 in any case.
- Fire up linguist and do the translation.
- Check in the modified .pro file and _only_ your .ts file.
- Make a merge request on gitorious.
- .qm files are generated as part of the regular build.
......@@ -109,6 +109,7 @@ public:
virtual void openFiles(const QStringList &fileNames) = 0;
void coreAboutToOpen();
void coreOpened();
void saveSettingsRequested();
void optionsDialogRequested();
......@@ -348,8 +348,9 @@ void MainWindow::extensionsInitialized()
emit m_coreImpl->coreAboutToOpen();
emit m_coreImpl->coreOpened();
......@@ -414,16 +414,17 @@ QStringList WelcomeMode::tipsOfTheDay()
static QStringList tips;
if (tips.isEmpty()) {
QString sideBarShortcut =
QString altShortcut =
#ifdef Q_WS_MAC
tr("Cmd", "Shortcut key");
tr("Alt", "Shortcut key");
tips.append(tr("You can switch between Qt Creator's modes using <tt>Ctrl+number</tt>:"
"<ol><li> - Welcome</li><li> - Edit</li><li>- Debug</li><li>- Projects</li><li>- Help</li>"
"<li></li><li>- Output</li></ol>"));
tips.append(tr("You can show and hide the side bar using <tt>%1<tt>.").arg(sideBarShortcut));
tips.append(tr("You can switch between Qt Creator's modes using <tt>Ctrl+number</tt>:<ul>"
"<li>1 - Welcome</li><li>2 - Edit</li><li>3 - Debug</li><li>4 - Projects</li><li>5 - Help</li>"
"<li></li><li>6 - Output</li></ul>"));
//:%1 gets replaced by Alt (Win/Unix) or Cmd (Mac)
tips.append(tr("You can show and hide the side bar using <tt>%1+0<tt>.").arg(altShortcut));
tips.append(tr("You can fine tune the <tt>Find</tt> function by selecting &quot;Whole Words&quot; "
"or &quot;Case Sensitive&quot;. Simply click on the icons on the right end of the line edit."));
tips.append(tr("If you add <a href=\"qthelp://\""
......@@ -432,6 +433,26 @@ QStringList WelcomeMode::tipsOfTheDay()
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>."));
tips.append(tr("You can start Qt Creator with a session by calling <tt>qtcreator &lt;sessionname&gt;</tt>."));
tips.append(tr("You can return to edit mode from any other mode at any time by hitting <tt>Escape</tt>."));
//:%1 gets replaced by Alt (Win/Unix) or Cmd (Mac)
tips.append(tr("You can switch between the output pane by hitting <tt>%1+n</tt> where n is the number denoted "
"on the buttons at the window bottom:"
"<ul><li>1 - Build Issues</li><li>2 - Search Results</li><li>3 - Application Output</li>"
"<li>4 - Compile Output</li></ul>").arg(altShortcut));
tips.append(tr("You can quickly search methods, classes, help and more using the "
"<a href=\"qthelp://\">Locator bar</a> (<tt>Ctrl+K</tt>)."));
tips.append(tr("You can add custom build steps in the "
"<a href=\"qthelp://\">build settings</a>."));
tips.append(tr("Within a session, you can add "
"<a href=\"qthelp://\">dependencies</a> between projects."));
tips.append(tr("You can set the preferred editor encoding for every project in <tt>Projects -> Editor Settings -> Default Encoding</tt>."));
tips.append(tr("You can modify the binary that is being executed when you press the <tt>Run</tt> button: Add a <tt>Custom Executable</tt> "
"by clicking the <tt>+</tt> button in <tt>Projects -> Run Settings -> Run Configuration</tt> and then select the new "
"target in the combo box."));
tips.append(tr("You can use Qt Creator with a number of <a href=\"qthelp://\">"
"revision control systems</a> such as Subversion, Perforce and Git."));
tips.append(tr("In the editor, <tt>F2</tt> toggles declaration and definition while <tt>F4</tt> toggles header file and source file."));
return tips;
......@@ -205,14 +205,17 @@ void GdbEngine::initializeVariables()
void GdbEngine::gdbProcError(QProcess::ProcessError error)
QString msg;
bool kill = true;
switch (error) {
case QProcess::FailedToStart:
kill = false;
msg = tr("The Gdb process failed to start. Either the "
"invoked program '%1' is missing, or you may have insufficient "
"permissions to invoke the program.")
case QProcess::Crashed:
kill = false;
msg = tr("The Gdb process crashed some time after starting "
......@@ -238,7 +241,8 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error)
QMessageBox::critical(q->mainWindow(), tr("Error"), msg);
// act as if it was closed by the core
if (kill)
void GdbEngine::uploadProcError(QProcess::ProcessError error)
......@@ -1332,8 +1336,7 @@ void GdbEngine::exitDebugger()
postCommand(_("-gdb-exit"), CB(handleExit));
// 20s can easily happen when loading webkit debug information
if (m_gdbProc.state() != QProcess::Running) {
if (!m_gdbProc.waitForFinished(20000)) {
debugMessage(_("FORCING TERMINATION: %1")
......@@ -703,6 +703,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(Core::ICore::instance(), SIGNAL(coreAboutToOpen()),
this, SLOT(determineSessionToRestoreAtStartup()));
connect(Core::ICore::instance(), SIGNAL(coreOpened()), this, SLOT(restoreSession()));
return true;
......@@ -1041,6 +1043,24 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
void ProjectExplorerPlugin::determineSessionToRestoreAtStartup()
QStringList sessions = m_session->sessions();
// We have command line arguments, try to find a session in them
QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments();
// Default to no session loading
m_sessionToRestoreAtStartup = QString::null;
foreach (const QString &arg, arguments) {
if (sessions.contains(arg)) {
// Session argument
m_sessionToRestoreAtStartup = arg;
if (!m_sessionToRestoreAtStartup.isNull())
\fn void ProjectExplorerPlugin::restoreSession()
......@@ -1049,37 +1069,20 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
default session and puts the list of recent projects and sessions
onto the welcome page.
void ProjectExplorerPlugin::restoreSession()
if (debug)
qDebug() << "ProjectExplorerPlugin::restoreSession";
QStringList sessions = m_session->sessions();
// We have command line arguments, try to find a session in them
QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments();
// Default to no session loading
QString sessionToLoad = QString::null;
if (!arguments.isEmpty()) {
foreach (const QString &arg, arguments) {
if (sessions.contains(arg)) {
// Session argument
sessionToLoad = arg;
if (debug)
qDebug() << "Found session argument, restoring session" << sessionToLoad;
// Restore latest session or what was passed on the command line
if (sessionToLoad == QString::null) {
if (m_sessionToRestoreAtStartup == QString::null) {
} else {
// update welcome page
......@@ -161,6 +161,7 @@ private slots:
void updateSessionMenu();
void setSession(QAction *action);
void determineSessionToRestoreAtStartup();
void restoreSession();
void loadSession(const QString &session);
void runProject();
......@@ -260,6 +261,7 @@ private:
Internal::ProjectWindow *m_proWindow;
SessionManager *m_session;
QString m_sessionToRestoreAtStartup;
Project *m_currentProject;
Node *m_currentNode;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment