forked from qt-creator/qt-creator
VCS: Improve dialog when files cannot be added
Avoid making the dialog larger than the screen. Also remove the special handling for single files. Fixes: QTCREATORBUG-31161 Change-Id: I5a85834505351493c51ee708c81527147d1a1270 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
9b7016f519
commit
078f6df4d6
@@ -370,11 +370,15 @@ QString VcsManager::msgAddToVcsFailedTitle()
|
|||||||
|
|
||||||
QString VcsManager::msgToAddToVcsFailed(const QStringList &files, const IVersionControl *vc)
|
QString VcsManager::msgToAddToVcsFailed(const QStringList &files, const IVersionControl *vc)
|
||||||
{
|
{
|
||||||
return files.size() == 1
|
QStringList fileList = files;
|
||||||
? Tr::tr("Could not add the file\n%1\nto version control (%2)\n")
|
const qsizetype size = files.size();
|
||||||
.arg(files.front(), vc->displayName())
|
const qsizetype maxSize = 10;
|
||||||
: Tr::tr("Could not add the following files to version control (%1)\n%2")
|
if (size > maxSize) {
|
||||||
.arg(vc->displayName(), files.join(QString(QLatin1Char('\n'))));
|
fileList = files.first(maxSize);
|
||||||
|
fileList.append(Tr::tr("... and %1 more.").arg(size - maxSize));
|
||||||
|
}
|
||||||
|
return Tr::tr("Could not add the following files to version control (%1)\n%2")
|
||||||
|
.arg(vc->displayName(), fileList.join(QString(QLatin1Char('\n'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePaths VcsManager::additionalToolsPath()
|
FilePaths VcsManager::additionalToolsPath()
|
||||||
|
|||||||
Reference in New Issue
Block a user