Commit 3a78b610 authored by Andre Hartmann's avatar Andre Hartmann Committed by Orgad Shaneh

VCS: Colorize unmerged files in submit editor

So far, conflicted files were displayed like added ones.

Now they are marked obvious, as they disable the commit button.

Task-number: QTCREATORBUG-16297
Change-Id: Iedf834408a747c4fe5f2133790c5fb81e7fea265
Reviewed-by: default avatarHugues Delorme <delorme.hugues@fougue.pro>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 67f9a262
......@@ -164,6 +164,7 @@ VcsBase_FileAdded_TextColor=ff00ff00
VcsBase_FileModified_TextColor=ff8ee0ff
VcsBase_FileDeleted_TextColor=fffff6c6c
VcsBase_FileRenamed_TextColor=ffffa500
VcsBase_FileUnmerged_TextColor=ffff4040
Bookmarks_TextMarkColor=ff8080ff
......
......@@ -156,8 +156,9 @@ Welcome_LinkColor=ff5caa15
VcsBase_FileStatusUnknown_TextColor=ff000000
VcsBase_FileAdded_TextColor=ff00aa00
VcsBase_FileModified_TextColor=ff0000ee
VcsBase_FileDeleted_TextColor=ffee0000
VcsBase_FileDeleted_TextColor=ff800000
VcsBase_FileRenamed_TextColor=ffd77d00
VcsBase_FileUnmerged_TextColor=ffee0000
Bookmarks_TextMarkColor=ffa0a0ff
......
......@@ -166,8 +166,9 @@ Welcome_LinkColor=ff5caa15
VcsBase_FileStatusUnknown_TextColor=ff000000
VcsBase_FileAdded_TextColor=ff00aa00
VcsBase_FileModified_TextColor=ff0000ee
VcsBase_FileDeleted_TextColor=ffee0000
VcsBase_FileDeleted_TextColor=ff800000
VcsBase_FileRenamed_TextColor=ffd77d00
VcsBase_FileUnmerged_TextColor=ffee0000
Bookmarks_TextMarkColor=ffa0a0ff
......
......@@ -215,6 +215,7 @@ public:
VcsBase_FileModified_TextColor,
VcsBase_FileDeleted_TextColor,
VcsBase_FileRenamed_TextColor,
VcsBase_FileUnmerged_TextColor,
/* Bookmarks Plugin */
Bookmarks_TextMarkColor,
......
......@@ -142,6 +142,8 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
-> SubmitFileModel::FileStatusHint
{
const FileStates state = static_cast<FileStates>(extraData.toInt());
if (state & (UnmergedFile | UnmergedThem | UnmergedUs))
return SubmitFileModel::FileUnmerged;
if (state.testFlag(AddedFile) || state.testFlag(UntrackedFile))
return SubmitFileModel::FileAdded;
if (state.testFlag(ModifiedFile))
......
......@@ -48,6 +48,8 @@ void SubversionSubmitEditor::setStatusList(const QList<StatusFilePair> &statusOu
model->setFileStatusQualifier([](const QString &status, const QVariant &)
-> VcsBase::SubmitFileModel::FileStatusHint
{
if (status == QLatin1String("C"))
return VcsBase::SubmitFileModel::FileUnmerged;
if (status == QLatin1String("A"))
return VcsBase::SubmitFileModel::FileAdded;
if (status == QLatin1String("M"))
......
......@@ -61,6 +61,9 @@ static QBrush fileStatusTextForeground(SubmitFileModel::FileStatusHint statusHin
case SubmitFileModel::FileRenamed:
statusTextColor = Theme::VcsBase_FileRenamed_TextColor;
break;
case VcsBase::SubmitFileModel::FileUnmerged:
statusTextColor = Theme::VcsBase_FileUnmerged_TextColor;
break;
}
return QBrush(Utils::creatorTheme()->color(statusTextColor));
}
......
......@@ -75,7 +75,8 @@ public:
FileAdded,
FileModified,
FileDeleted,
FileRenamed
FileRenamed,
FileUnmerged
};
// Function that converts(qualifies) a QString/QVariant pair to FileStatusHint
......
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