Commit 7e739985 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Merge remote branch 'origin/2.0'

Conflicts:
	src/plugins/debugger/debuggeruiswitcher.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp
parents 077c9181 9bad0c01
......@@ -6558,7 +6558,7 @@
To move forward in the location history, press \key {Alt+Right}
(\key {Cmd+Opt+Right} on Mac OS). To move backward, press \key {Alt+Left}
(\key {Cmd+Opt+Right} on Mac OS). For example, if you use the \gui Locator
(\key {Cmd+Opt+Left} on Mac OS). For example, if you use the \gui Locator
to jump to a symbol in the same file, you can jump back to your original
location in that file by pressing \key {Alt+Left}.
......
......@@ -36,11 +36,11 @@ leave room for the Qt 4 target page.
-->
<wizard version="1" kind="project"
class="qt4project" firstpage="10"
id="QmlRuntimePlugin" category="F.Projects">
id="QmlExtensionPlugin" category="F.Projects">
<icon>lib.png</icon>
<description>Creates a C++ plugin to extend the funtionality of the QML runtime.</description>
<displayname>QML Runtime Plug-in</displayname>
<displaycategory>QML Runtime Plug-in</displaycategory>
<description>Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QDeclarativeEngine class.</description>
<displayname>Custom QML Extension Plugin</displayname>
<displaycategory>QML Extension Plugin</displaycategory>
<files>
<file source="qmldir" target="qmldir"/>
<file source="plugin.h" target="%ProjectName%.h"/>
......@@ -50,7 +50,7 @@ leave room for the Qt 4 target page.
<file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
</files>
<!-- Create a 2nd wizard page with parameters -->
<fieldpagetitle>QML Runtime Plug-in Parameters</fieldpagetitle>
<fieldpagetitle>Custom QML Extension Plugin Parameters</fieldpagetitle>
<fields>
<field mandatory="false" name="ObjectName">
<fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9_]+$' defaulttext="ExampleObject"/>
......
......@@ -32,7 +32,7 @@ QMAKE_EXTRA_TARGETS += extract
files = $$files($$PWD/*_??.ts) $$PWD/qtcreator_untranslated.ts
for(file, files) {
lang = $$replace(file, .*_(.*)\\.ts, \\1)
lang = $$replace(file, .*_([^/]*)\\.ts, \\1)
v = ts-$${lang}.commands
$$v = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$file
v = ts-$${lang}.depends
......
......@@ -1634,7 +1634,10 @@ void EditorManager::showPopupOrSelectDocument() const
if (QApplication::keyboardModifiers() == Qt::NoModifier) {
windowPopup()->selectAndHide();
} else {
const QPoint p(mapToGlobal(QPoint(0, 0)));
// EditorManager is invisible when invoked from Design Mode.
const QPoint p = isVisible() ?
mapToGlobal(QPoint(0, 0)) :
m_d->m_core->mainWindow()->mapToGlobal(QPoint(0, 0));
windowPopup()->move((width()-m_d->m_windowPopup->width())/2 + p.x(),
(height()-m_d->m_windowPopup->height())/2 + p.y());
windowPopup()->setVisible(true);
......
......@@ -98,7 +98,7 @@
<item row="1" column="0">
<widget class="QCheckBox" name="fastLoadDebuggingHelpersCheckBox">
<property name="text">
<string>fast loading of debugging helpers</string>
<string>Fast loading of debugging helpers</string>
</property>
</widget>
</item>
......
......@@ -144,8 +144,13 @@ DebuggerUISwitcher::~DebuggerUISwitcher()
delete d;
}
void DebuggerUISwitcher::addMenuAction(Core::Command *command,
const QString &langName, const QString &group)
QStringList DebuggerUISwitcher::supportedLanguages() const
{
return d->m_languages;
}
void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName,
const QString &group)
{
d->m_debugMenu->addAction(command, group);
d->m_menuCommands.insert(d->m_languages.indexOf(langName), command);
......
......@@ -78,6 +78,8 @@ public:
void addMenuAction(Core::Command *command, const QString &langName,
const QString &group = QString());
QStringList supportedLanguages() const;
// Changes the active language UI to the one specified by langName.
// Does nothing if automatic switching is toggled off from settings.
void setActiveLanguage(const QString &langName);
......
......@@ -600,18 +600,22 @@ bool GitClient::synchronousInit(const QString &workingDirectory)
bool GitClient::synchronousCheckoutFiles(const QString &workingDirectory,
QStringList files /* = QStringList() */,
QString revision /* = QString() */,
QString *errorMessage /* = 0 */)
QString *errorMessage /* = 0 */,
bool revertStaging /* = true */)
{
if (Git::Constants::debug)
qDebug() << Q_FUNC_INFO << workingDirectory << files;
if (revision.isEmpty())
if (revertStaging && revision.isEmpty())
revision = QLatin1String("HEAD");
if (files.isEmpty())
files = QStringList(QString(QLatin1Char('.')));
QByteArray outputText;
QByteArray errorText;
QStringList arguments;
arguments << QLatin1String("checkout") << revision << QLatin1String("--") << files;
arguments << QLatin1String("checkout");
if (revertStaging)
arguments << revision;
arguments << QLatin1String("--") << files;
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
if (!rc) {
const QString fileArg = files.join(QLatin1String(", "));
......@@ -1479,7 +1483,10 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
* reverting a directory pending a sophisticated selection dialog in the
* VCSBase plugin. */
GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirectory, QString *errorMessage)
GitClient::RevertResult GitClient::revertI(QStringList files,
bool *ptrToIsDirectory,
QString *errorMessage,
bool revertStaging)
{
if (Git::Constants::debug)
qDebug() << Q_FUNC_INFO << files;
......@@ -1541,7 +1548,7 @@ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirec
if (Git::Constants::debug)
qDebug() << Q_FUNC_INFO << data.stagedFiles << data.unstagedFiles << allStagedFiles << allUnstagedFiles << stagedFiles << unstagedFiles;
if (stagedFiles.empty() && unstagedFiles.empty())
if ((!revertStaging || stagedFiles.empty()) && unstagedFiles.empty())
return RevertUnchanged;
// Ask to revert (to do: Handle lists with a selection dialog)
......@@ -1555,19 +1562,22 @@ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirec
return RevertCanceled;
// Unstage the staged files
if (!stagedFiles.empty() && !synchronousReset(repoDirectory, stagedFiles, errorMessage))
if (revertStaging && !stagedFiles.empty() && !synchronousReset(repoDirectory, stagedFiles, errorMessage))
return RevertFailed;
QStringList filesToRevert = unstagedFiles;
if (revertStaging)
filesToRevert += stagedFiles;
// Finally revert!
if (!synchronousCheckoutFiles(repoDirectory, stagedFiles + unstagedFiles, QString(), errorMessage))
if (!synchronousCheckoutFiles(repoDirectory, filesToRevert, QString(), errorMessage, revertStaging))
return RevertFailed;
return RevertOk;
}
void GitClient::revert(const QStringList &files)
void GitClient::revert(const QStringList &files, bool revertStaging)
{
bool isDirectory;
QString errorMessage;
switch (revertI(files, &isDirectory, &errorMessage)) {
switch (revertI(files, &isDirectory, &errorMessage, revertStaging)) {
case RevertOk:
m_plugin->gitVersionControl()->emitFilesChanged(files);
break;
......
......@@ -114,7 +114,8 @@ public:
bool synchronousInit(const QString &workingDirectory);
bool synchronousCheckoutFiles(const QString &workingDirectory,
QStringList files = QStringList(),
QString revision = QString(), QString *errorMessage = 0);
QString revision = QString(), QString *errorMessage = 0,
bool revertStaging = true);
// Checkout branch
bool synchronousCheckoutBranch(const QString &workingDirectory, const QString &branch, QString *errorMessage = 0);
......@@ -164,7 +165,7 @@ public:
void subversionLog(const QString &workingDirectory);
void stashPop(const QString &workingDirectory);
void revert(const QStringList &files);
void revert(const QStringList &files, bool revertStaging);
void branchList(const QString &workingDirectory);
void stashList(const QString &workingDirectory);
bool synchronousStashList(const QString &workingDirectory,
......@@ -259,7 +260,10 @@ private:
unsigned synchronousGitVersion(bool silent, QString *errorMessage = 0);
enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed };
RevertResult revertI(QStringList files, bool *isDirectory, QString *errorMessage);
RevertResult revertI(QStringList files,
bool *isDirectory,
QString *errorMessage,
bool revertStaging);
void connectRepositoryChanged(const QString & repository, GitCommand *cmd);
bool synchronousPull(const QString &workingDirectory, bool rebase);
void syncAbortPullRebase(const QString &workingDir);
......
......@@ -332,9 +332,15 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
globalcontext, true, SLOT(blameFile()));
parameterActionCommand.second->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
parameterActionCommand
= createFileAction(actionManager, gitContainer,
tr("Undo Unstaged Changes"), tr("Undo Unstaged Changes for \"%1\""),
QLatin1String("Git.UndoUnstaged"), globalcontext,
true, SLOT(undoUnstagedFileChanges()));
parameterActionCommand
= createFileAction(actionManager, gitContainer,
tr("Undo Changes"), tr("Undo Changes for \"%1\""),
tr("Undo Uncommitted Changes"), tr("Undo Uncommitted Changes for \"%1\""),
QLatin1String("Git.Undo"), globalcontext,
true, SLOT(undoFileChanges()));
parameterActionCommand.second->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
......@@ -561,12 +567,17 @@ void GitPlugin::logProject()
m_gitClient->log(state.currentProjectTopLevel(), state.relativeCurrentProject());
}
void GitPlugin::undoFileChanges()
void GitPlugin::undoFileChanges(bool revertStaging)
{
const VCSBase::VCSBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
Core::FileChangeBlocker fcb(state.currentFile());
m_gitClient->revert(QStringList(state.currentFile()));
m_gitClient->revert(QStringList(state.currentFile()), revertStaging);
}
void GitPlugin::undoUnstagedFileChanges()
{
undoFileChanges(false);
}
void GitPlugin::undoRepositoryChanges()
......
......@@ -109,7 +109,8 @@ private slots:
void logFile();
void blameFile();
void logProject();
void undoFileChanges();
void undoFileChanges(bool revertStaging = true);
void undoUnstagedFileChanges();
void undoRepositoryChanges();
void stageFile();
void unstageFile();
......
......@@ -942,12 +942,13 @@ void HelpPlugin::highlightSearchTerms()
if (name.isEmpty())
continue;
if (m_oldAttrValue == name) {
if (m_oldAttrValue == name
|| name.startsWith(m_oldAttrValue + QLatin1Char('-'))) {
QWebElement parent = element.parent();
parent.setStyleProperty(property, m_styleProperty);
}
if (attrValue == name) {
if (attrValue == name || name.startsWith(attrValue + QLatin1Char('-'))) {
QWebElement parent = element.parent();
m_styleProperty = parent.styleProperty(property,
QWebElement::InlineStyle);
......@@ -956,7 +957,6 @@ void HelpPlugin::highlightSearchTerms()
}
m_oldAttrValue = attrValue;
#endif
viewer->findText(m_idFromContext, 0, false, true);
}
}
......
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