forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.6'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<plugin name=\"Core\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
|
||||
<vendor>Nokia Corporation</vendor>
|
||||
<copyright>(C) 2011 Nokia Corporation</copyright>
|
||||
<copyright>(C) 2012 Nokia Corporation</copyright>
|
||||
<license>
|
||||
Commercial Usage
|
||||
|
||||
@@ -12,7 +12,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
|
||||
</license>
|
||||
<category>Qt Creator</category>
|
||||
<description>The core plugin for the Qt IDE.</description>
|
||||
<url>http://qt.nokia.com</url>
|
||||
<url>http://www.qt-project.org</url>
|
||||
<argumentList>
|
||||
<argument name=\"-color\" parameter=\"color\">Override selected UI color</argument>
|
||||
<argument name=\"-presentationMode\">Enable presentation mode with pop-ups for key combos</argument>
|
||||
|
||||
@@ -216,7 +216,7 @@ RESOURCES += core.qrc \
|
||||
win32 {
|
||||
SOURCES += progressmanager/progressmanager_win.cpp
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private # Uses QPlatformNativeInterface.
|
||||
LIBS += -lole32
|
||||
LIBS += -lole32 -luser32
|
||||
}
|
||||
else:macx {
|
||||
HEADERS += macfullscreen.h
|
||||
|
||||
@@ -30,7 +30,8 @@ QtcPlugin {
|
||||
|
||||
cpp.dynamicLibraries: {
|
||||
if (qbs.targetOS == "windows") return [
|
||||
"ole32"
|
||||
"ole32",
|
||||
"user32"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString &
|
||||
const HICON icon = pix.toWinHICON();
|
||||
#endif
|
||||
pITask->SetOverlayIcon(winId, icon, (wchar_t*)text.utf16());
|
||||
DestroyIcon(icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,17 +326,44 @@ bool VcsManager::promptToDelete(IVersionControl *vc, const QString &fileName)
|
||||
return vc->vcsDelete(fileName);
|
||||
}
|
||||
|
||||
QString VcsManager::msgAddToVcsTitle()
|
||||
{
|
||||
return tr("Add to Version Control");
|
||||
}
|
||||
|
||||
QString VcsManager::msgPromptToAddToVcs(const QStringList &files, const IVersionControl *vc)
|
||||
{
|
||||
return files.size() == 1
|
||||
? tr("Add the file\n%1\nto version control (%2)?")
|
||||
.arg(files.front(), vc->displayName())
|
||||
: tr("Add the files\n%1\nto version control (%2)?")
|
||||
.arg(files.join(QString(QLatin1Char('\n'))), vc->displayName());
|
||||
}
|
||||
|
||||
QString VcsManager::msgAddToVcsFailedTitle()
|
||||
{
|
||||
return tr("Adding to Version Control Failed");
|
||||
}
|
||||
|
||||
QString VcsManager::msgToAddToVcsFailed(const QStringList &files, const IVersionControl *vc)
|
||||
{
|
||||
return files.size() == 1
|
||||
? tr("Could not add the file\n%1\nto version control (%2)\n")
|
||||
.arg(files.front(), vc->displayName())
|
||||
: tr("Could not add the following files to version control (%1)\n%2")
|
||||
.arg(vc->displayName(), files.join(QString(QLatin1Char('\n'))));
|
||||
}
|
||||
|
||||
void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNames)
|
||||
{
|
||||
IVersionControl *vc = findVersionControlForDirectory(directory);
|
||||
if (!vc || !vc->supportsOperation(Core::IVersionControl::AddOperation))
|
||||
return;
|
||||
|
||||
const QString files = fileNames.join(QString(QLatin1Char('\n')));
|
||||
QMessageBox::StandardButton button =
|
||||
QMessageBox::question(Core::ICore::mainWindow(), tr("Add to Version Control"),
|
||||
tr("Add files\n%1\nto version control (%2)?").arg(files, vc->displayName()),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
QMessageBox::question(Core::ICore::mainWindow(), VcsManager::msgAddToVcsTitle(),
|
||||
VcsManager::msgPromptToAddToVcs(fileNames, vc),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (button == QMessageBox::Yes) {
|
||||
QStringList notAddedToVc;
|
||||
foreach (const QString &file, fileNames) {
|
||||
@@ -345,10 +372,8 @@ void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNa
|
||||
}
|
||||
|
||||
if (!notAddedToVc.isEmpty()) {
|
||||
const QString message = tr("Could not add following files to version control (%1)\n").arg(vc->displayName());
|
||||
const QString filesNotAdded = notAddedToVc.join(QString(QLatin1Char('\n')));
|
||||
QMessageBox::warning(Core::ICore::mainWindow(), tr("Adding to Version Control Failed"),
|
||||
message + filesNotAdded);
|
||||
QMessageBox::warning(Core::ICore::mainWindow(), VcsManager::msgAddToVcsFailedTitle(),
|
||||
VcsManager::msgToAddToVcsFailed(notAddedToVc, vc));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,12 @@ public:
|
||||
// added to revision control. Calls vcsAdd for each file.
|
||||
void promptToAdd(const QString &directory, const QStringList &fileNames);
|
||||
|
||||
// Utility messages for adding files
|
||||
static QString msgAddToVcsTitle();
|
||||
static QString msgPromptToAddToVcs(const QStringList &files, const IVersionControl *vc);
|
||||
static QString msgAddToVcsFailedTitle();
|
||||
static QString msgToAddToVcsFailed(const QStringList &files, const IVersionControl *vc);
|
||||
|
||||
signals:
|
||||
void repositoryChanged(const QString &repository);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user