diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index 29a7afb1..b28ef1f7 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -3450,18 +3450,18 @@ Are you really want to continue?
MainWindow
-
+
小熊猫C++
-
-
-
-
-
+
+
+
+
+
编译器
@@ -3535,7 +3535,7 @@ Are you really want to continue?
-
+
调试主控台
@@ -3611,7 +3611,7 @@ Are you really want to continue?
工具栏2
-
+
新建
@@ -3669,8 +3669,8 @@ Are you really want to continue?
-
-
+
+
编译
@@ -3732,9 +3732,9 @@ Are you really want to continue?
-
-
-
+
+
+
复制
@@ -3745,7 +3745,7 @@ Are you really want to continue?
-
+
粘贴
@@ -3756,8 +3756,8 @@ Are you really want to continue?
-
-
+
+
选择全部
@@ -3877,14 +3877,14 @@ Are you really want to continue?
-
+
试题集
-
+
新建试题集
@@ -3903,14 +3903,14 @@ Are you really want to continue?
-
+
保存试题集
-
+
载入试题集
@@ -3946,7 +3946,7 @@ Are you really want to continue?
-
+
试题
@@ -4249,7 +4249,7 @@ Are you really want to continue?
-
+
删除所有断点
@@ -4350,7 +4350,7 @@ Are you really want to continue?
-
+
重命名符号
@@ -4371,13 +4371,13 @@ Are you really want to continue?
-
+
导出为RTF
-
+
导出为HTML
@@ -4586,7 +4586,7 @@ Are you really want to continue?
-
+
打开文件夹
@@ -4596,42 +4596,42 @@ Are you really want to continue?
运行参数...
-
+
文件编码
-
+
文件历史
-
-
-
-
-
-
+
+
+
+
+
+
正在调试
-
-
-
-
-
-
+
+
+
+
+
+
正在运行
-
-
-
-
-
-
+
+
+
+
+
+
正在编译
@@ -4640,194 +4640,194 @@ Are you really want to continue?
行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5
-
+
Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5
行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5
-
+
只读
-
+
插入
-
+
覆写
-
+
关闭项目
-
+
你确定要关闭'%1'吗?
-
-
+
+
确认
-
-
-
+
+
+
源文件尚未编译。
-
-
+
+
现在编译?
-
-
+
+
源文件比可执行程序新。
-
+
重新编译?
-
+
无编译器设置
-
+
没有配置编译器设置。
-
+
无法启动调试器
-
-
+
+
启用调试参数
-
-
+
+
当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题?
-
+
项目尚未构建
-
+
项目尚未构建。是否构建?
-
+
宿主程序不存在
-
+
动态链接库(DLL)需要一个宿主程序来运行。
-
+
但它不存在。
-
+
宿主程序不存在
-
+
宿主程序'%1'不存在。
-
+
重新编译?
-
-
+
+
保存上次打开信息失败
-
+
无法删除旧上次打开信息文件'%1'
-
+
无法保存上次打开信息文件'%1'
-
+
载入上次打开信息失败
-
+
无法载入上次打开信息文件'%1'
-
+
打开源代码文件
-
+
显示详细调试器日志
-
+
全部复制
-
-
-
+
+
+
清除
-
+
导出
-
+
插入代码段
-
-
+
+
试题集%1
@@ -4848,68 +4848,68 @@ Are you really want to continue?
或者选择使用其他的网络端口。
-
-
+
+
重新构建项目
-
-
+
+
项目已经被修改过,是否需要重新构建?
-
+
自动保存出错
-
+
自动保存"%1"到"%2"失败:%3
-
+
试题属性...
-
+
设置试题集名称
-
+
试题集名称:
-
+
删除
-
+
删除全部书签
-
+
修改描述
-
-
-
+
+
+
书签描述
-
-
-
+
+
+
描述:
@@ -4918,322 +4918,332 @@ Are you really want to continue?
在调试主控台中显示调试器输出
-
+
清除这次搜索
-
+
删除所有搜索
-
+
断点条件...
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
Remove all breakpoints
删除所有断点
-
+
删除当前断点
-
+
重命名文件
-
-
+
+
添加文件夹
-
+
新文件夹
-
+
文件夹:
-
+
重命名
-
+
删除文件夹
-
+
切换为普通视图
-
+
切换为自定义视图
-
+
按类型排序
-
+
按名称排序
-
+
显示继承的成员
-
+
跳转到声明处
-
+
跳转到定义处
-
-
-
+
+
+
新建文件夹
-
-
-
-
+
+
+
+
删除
-
+
在编辑器中打开
-
+
使用外部程序打开
-
+
在终端中打开
-
+
在Windows浏览器中打开
-
+
字符集
-
+
已自动保存%1个文件
-
+
设置答案源代码...
-
+
选择其他文件...
-
+
选择答案源代码文件
-
+
C/C++Source Files (*.c *.cpp *.cc *.cxx
C/C++源代码文件 (*.c *.cpp *.cc *.cxx)
-
+
你真的要删除%1吗?
-
+
你真的要删除%1个文件吗?
-
+
保存项目
-
+
项目'%1'有改动。
-
-
+
+
需要保存吗?
-
-
+
+
文件已发生变化
-
+
新建项目文件?
-
+
您是否要将新建的文件加入项目?
-
-
+
-
+
+
保存失败
-
+
改变项目编译器配置集
-
+
改变项目的编译器配置集会导致所有的自定义编译器选项被重置。
-
+
你真的想要做那些吗?
-
+
您真的要清除该文件的所有断点吗?
-
+
新建项目
-
+
关闭'%1'以打开新项目?
-
+
文件夹不存在
-
+
文件夹'%1'不存在。是否创建?
-
+
无法创建文件夹
-
+
创建文件夹'%1'失败。
-
+
-
+
文件夹%1不是空的。
-
+
你真的要删除它吗?
-
-
+
+
头文件已存在
-
-
+
+
头文件"%1"已存在!
-
+
源文件已存在!
-
+
源文件"%1"已存在!
-
+
+
+ 无法提交!
+
+
+
+
+ 下列文件处于冲突状态,请解决后重新添加和提交:
+
+
+
提交信息
-
+
提交失败
-
+
提交信息不能为空!
@@ -5242,233 +5252,233 @@ Are you really want to continue?
小熊猫Dev-C++项目文件 (*.dev)
-
+
新建项目失败
-
+
无法使用模板创建项目
-
+
删除文件
-
+
同时从硬盘上删除文件?
-
+
无标题
-
+
新的项目文件名
-
+
文件名:
-
+
文件已存在!
-
+
文件'%1'已经存在!
-
+
添加到项目
-
+
小熊猫C++项目文件(*.dev)
-
+
重命名出错
-
+
符号'%1'在系统头文件中定义,无法修改。
-
+
新名称
-
-
+
+
替换出错
-
+
无法打开文件'%1'进行替换!
-
+
内容和上次查找时不一致。
-
+
RTF格式文件 (*.rtf)
-
+
HTML文件 (*.html)
-
+
当前的试题集不是空的。
-
+
试题%1
-
-
+
+
试题集文件 (*.pbs)
-
+
载入失败
-
-
+
+
试题案例%1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
错误
-
+
项目历史
-
+
载入主题失败
-
-
+
+
版本控制
-
+
磁盘文件'%1'已被修改。
-
+
是否重新读取它的内容?
-
+
磁盘文件'%1'已被删除。
-
+
是否保持它在小熊猫C++中打开的编辑窗口?
-
+
打开
-
+
编译失败
-
+
运行失败
-
-
+
+
确认转换
-
-
+
+
当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?
-
+
新监视表达式
-
+
输入监视表达式
-
+
(%1/%2)正在解析文件"%3"
-
-
+
+
完成%1个文件的解析,用时%2秒
-
+
(每秒%1个文件)
@@ -6439,7 +6449,7 @@ Are you really want to continue?
QApplication
-
+
错误
@@ -6493,23 +6503,23 @@ Are you really want to continue?
-
-
+
+
错误
-
+
无法创建配置文件夹"%1"
-
+
无法写入配置文件夹"%1"
-
+
无法载入自动链接设置
@@ -7144,7 +7154,7 @@ Are you really want to continue?
无法解析试题集文件"%1":%2
-
+
<由Git自动生成>
@@ -7603,7 +7613,7 @@ Are you really want to continue?
自动链接
-
+
@@ -7679,15 +7689,15 @@ Are you really want to continue?
杂项
-
-
+
+
程序运行
-
+
试题集
diff --git a/RedPandaIDE/customfileiconprovider.cpp b/RedPandaIDE/customfileiconprovider.cpp
index 4c827c1d..ae109d6d 100644
--- a/RedPandaIDE/customfileiconprovider.cpp
+++ b/RedPandaIDE/customfileiconprovider.cpp
@@ -43,7 +43,9 @@ QIcon CustomFileIconProvider::icon(const QFileInfo &info) const
QIcon icon;
if (info.isDir()) {
if (mVCSRepository->isFileInRepository(info)) {
- if (mVCSRepository->isFileStaged(info))
+ if (mVCSRepository->isFileConflicting(info))
+ icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER_VCS_CONFLICT);
+ else if (mVCSRepository->isFileStaged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER_VCS_STAGED);
else if (mVCSRepository->isFileChanged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER_VCS_CHANGED);
@@ -53,7 +55,9 @@ QIcon CustomFileIconProvider::icon(const QFileInfo &info) const
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FOLDER);
} else if (isHFile(info.fileName())) {
if (mVCSRepository->isFileInRepository(info)) {
- if (mVCSRepository->isFileStaged(info))
+ if (mVCSRepository->isFileConflicting(info))
+ icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE_VCS_CONFLICT);
+ else if (mVCSRepository->isFileStaged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE_VCS_STAGED);
else if (mVCSRepository->isFileChanged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE_VCS_CHANGED);
@@ -63,7 +67,9 @@ QIcon CustomFileIconProvider::icon(const QFileInfo &info) const
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_HFILE);
} else if (isCppFile(info.fileName())) {
if (mVCSRepository->isFileInRepository(info)) {
- if (mVCSRepository->isFileStaged(info))
+ if (mVCSRepository->isFileConflicting(info))
+ icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE_VCS_CONFLICT);
+ else if (mVCSRepository->isFileStaged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE_VCS_STAGED);
else if (mVCSRepository->isFileChanged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE_VCS_CHANGED);
@@ -73,7 +79,9 @@ QIcon CustomFileIconProvider::icon(const QFileInfo &info) const
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CPPFILE);
} else if (isCFile(info.fileName())) {
if (mVCSRepository->isFileInRepository(info)) {
- if (mVCSRepository->isFileStaged(info))
+ if (mVCSRepository->isFileConflicting(info))
+ icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE_VCS_CONFLICT);
+ else if (mVCSRepository->isFileStaged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE_VCS_STAGED);
else if (mVCSRepository->isFileChanged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE_VCS_CHANGED);
@@ -83,7 +91,9 @@ QIcon CustomFileIconProvider::icon(const QFileInfo &info) const
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_CFILE);
} else if (info.suffix()=="dev") {
if (mVCSRepository->isFileInRepository(info)) {
- if (mVCSRepository->isFileStaged(info))
+ if (mVCSRepository->isFileConflicting(info))
+ icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE_VCS_CONFLICT);
+ else if (mVCSRepository->isFileStaged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE_VCS_STAGED);
else if (mVCSRepository->isFileChanged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE_VCS_CHANGED);
@@ -93,7 +103,9 @@ QIcon CustomFileIconProvider::icon(const QFileInfo &info) const
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_PROJECTFILE);
} else {
if (mVCSRepository->isFileInRepository(info)) {
- if (mVCSRepository->isFileStaged(info))
+ if (mVCSRepository->isFileConflicting(info))
+ icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FILE_VCS_CONFLICT);
+ else if (mVCSRepository->isFileStaged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FILE_VCS_STAGED);
else if (mVCSRepository->isFileChanged(info))
icon = pIconsManager->getIcon(IconsManager::FILESYSTEM_FILE_VCS_CHANGED);
diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp
index b4159153..3a1911c7 100644
--- a/RedPandaIDE/iconsmanager.cpp
+++ b/RedPandaIDE/iconsmanager.cpp
@@ -182,26 +182,32 @@ void IconsManager::updateFileSystemIcons(const QString &iconSet, int size)
mIconPixmaps.insert(FILESYSTEM_GIT, createSVGIcon(iconFolder+"git.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FOLDER, createSVGIcon(iconFolder+"folder.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_CHANGED, createSVGIcon(iconFolder+"folder-vcs-changed.svg",size,size));
+ mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_CONFLICT, createSVGIcon(iconFolder+"folder-vcs-conflict.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_NOCHANGE, createSVGIcon(iconFolder+"folder-vcs-nochange.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FOLDER_VCS_STAGED, createSVGIcon(iconFolder+"folder-vcs-staged.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FILE, createSVGIcon(iconFolder+"file.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FILE_VCS_CHANGED, createSVGIcon(iconFolder+"file-vcs-changed.svg",size,size));
+ mIconPixmaps.insert(FILESYSTEM_FILE_VCS_CONFLICT, createSVGIcon(iconFolder+"file-vcs-conflict.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"file-vcs-nochange.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_FILE_VCS_STAGED, createSVGIcon(iconFolder+"file-vcs-staged.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CFILE, createSVGIcon(iconFolder+"cfile.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_CHANGED, createSVGIcon(iconFolder+"cfile-vcs-changed.svg",size,size));
+ mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_CONFLICT, createSVGIcon(iconFolder+"cfile-vcs-conflict.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"cfile-vcs-nochange.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CFILE_VCS_STAGED, createSVGIcon(iconFolder+"cfile-vcs-staged.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_HFILE, createSVGIcon(iconFolder+"hfile.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_CHANGED, createSVGIcon(iconFolder+"hfile-vcs-changed.svg",size,size));
+ mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_CONFLICT, createSVGIcon(iconFolder+"hfile-vcs-conflict.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"hfile-vcs-nochange.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_HFILE_VCS_STAGED, createSVGIcon(iconFolder+"hfile-vcs-staged.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CPPFILE, createSVGIcon(iconFolder+"cppfile.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_CHANGED, createSVGIcon(iconFolder+"cppfile-vcs-changed.svg",size,size));
+ mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_CONFLICT, createSVGIcon(iconFolder+"cppfile-vcs-conflict.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"cppfile-vcs-nochange.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_CPPFILE_VCS_STAGED, createSVGIcon(iconFolder+"cppfile-vcs-staged.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_PROJECTFILE, createSVGIcon(iconFolder+"projectfile.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_CHANGED, createSVGIcon(iconFolder+"projectfile-vcs-changed.svg",size,size));
+ mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_CONFLICT, createSVGIcon(iconFolder+"projectfile-vcs-conflict.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_NOCHANGE, createSVGIcon(iconFolder+"projectfile-vcs-nochange.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_PROJECTFILE_VCS_STAGED, createSVGIcon(iconFolder+"projectfile-vcs-staged.svg",size,size));
mIconPixmaps.insert(FILESYSTEM_HEADERS_FOLDER, createSVGIcon(iconFolder+"headerfolder.svg",size,size));
diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h
index 703230bd..797983da 100644
--- a/RedPandaIDE/iconsmanager.h
+++ b/RedPandaIDE/iconsmanager.h
@@ -78,6 +78,12 @@ public:
FILESYSTEM_HFILE_VCS_CHANGED,
FILESYSTEM_PROJECTFILE_VCS_CHANGED,
FILESYSTEM_CPPFILE_VCS_CHANGED,
+ FILESYSTEM_FOLDER_VCS_CONFLICT,
+ FILESYSTEM_FILE_VCS_CONFLICT,
+ FILESYSTEM_CFILE_VCS_CONFLICT,
+ FILESYSTEM_HFILE_VCS_CONFLICT,
+ FILESYSTEM_PROJECTFILE_VCS_CONFLICT,
+ FILESYSTEM_CPPFILE_VCS_CONFLICT,
FILESYSTEM_FOLDER_VCS_NOCHANGE,
FILESYSTEM_FILE_VCS_NOCHANGE,
FILESYSTEM_CFILE_VCS_NOCHANGE,
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 15af830b..913b7b12 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -43,6 +43,7 @@
#include "vcs/gitrepository.h"
#include "vcs/gitbranchdialog.h"
#include "vcs/gitmergedialog.h"
+#include "widgets/infomessagebox.h"
#include
#include
@@ -3061,6 +3062,7 @@ void MainWindow::onProjectViewContextMenu(const QPoint &pos)
menu.addAction(ui->actionProject_options);
if (pSettings->vcs().gitOk() && hasRepository) {
+ mProject->model()->iconProvider()->update();
vcsMenu.setTitle(tr("Version Control"));
if (ui->projectView->selectionModel()->hasSelection()) {
bool shouldAdd = true;
@@ -3078,7 +3080,11 @@ void MainWindow::onProjectViewContextMenu(const QPoint &pos)
PProjectUnit pUnit=mProject->units()[node->unitIndex];
if (mProject->model()->iconProvider()->VCSRepository()->isFileInRepository(
pUnit->fileName()
- )) {
+ )
+ &&
+ !mProject->model()->iconProvider()->VCSRepository()->isFileConflicting(
+ pUnit->fileName()
+ )) {
shouldAdd=false;
break;
}
@@ -3187,13 +3193,18 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos)
mFilesView_OpenInExplorer->setEnabled(!path.isEmpty());
if (pSettings->vcs().gitOk() && hasRepository) {
+ mFileSystemModelIconProvider.update();
vcsMenu.setTitle(tr("Version Control"));
if (ui->treeFiles->selectionModel()->hasSelection()) {
bool shouldAdd = true;
foreach (const QModelIndex& index, ui->treeFiles->selectionModel()->selectedRows()) {
if (mFileSystemModelIconProvider.VCSRepository()->isFileInRepository(
mFileSystemModel.fileInfo(index)
- )) {
+ ) &&
+ ! mFileSystemModelIconProvider.VCSRepository()->isFileConflicting(
+ mFileSystemModel.fileInfo(index)
+ )
+ ) {
shouldAdd=false;
break;
}
@@ -5710,16 +5721,16 @@ void MainWindow::updateVCSActions()
bool shouldEnable = false;
bool canBranch = false;
if (ui->projectView->isVisible() && mProject) {
- GitManager vcsManager;
+ mProject->model()->iconProvider()->update();
QString branch;
- hasRepository = vcsManager.hasRepository(mProject->folder(),branch);
+ hasRepository = mProject->model()->iconProvider()->VCSRepository()->hasRepository(branch);
shouldEnable = true;
canBranch = !mProject->model()->iconProvider()->VCSRepository()->hasChangedFiles()
&& !mProject->model()->iconProvider()->VCSRepository()->hasStagedFiles();
} else if (ui->treeFiles->isVisible()) {
- GitManager vcsManager;
+ mFileSystemModelIconProvider.update();
QString branch;
- hasRepository = vcsManager.hasRepository(pSettings->environment().currentFolder(),branch);
+ hasRepository = mFileSystemModelIconProvider.VCSRepository()->hasRepository(branch);
shouldEnable = true;
canBranch =!mFileSystemModelIconProvider.VCSRepository()->hasChangedFiles()
&& !mFileSystemModelIconProvider.VCSRepository()->hasStagedFiles();
@@ -6754,6 +6765,18 @@ void MainWindow::on_actionGit_Commit_triggered()
}
if (folder.isEmpty())
return;
+
+ GitManager vcsManager;
+ QStringList conflicts = vcsManager.listConflicts(folder);
+ if (!conflicts.isEmpty()) {
+ InfoMessageBox infoBox;
+ infoBox.setMessage(
+ tr("Can't commit!") + "
"
+ +tr("The following files are in conflicting:")+"
"
+ + linesToText(conflicts));
+ infoBox.exec();
+ return;
+ }
QString message = QInputDialog::getText(this,tr("Commit Message"),"Commit Message:");
if (message.isEmpty()) {
QMessageBox::critical(this,
@@ -6762,7 +6785,6 @@ void MainWindow::on_actionGit_Commit_triggered()
);
return;
}
- GitManager vcsManager;
vcsManager.commit(folder,message,true);
//update project view
diff --git a/RedPandaIDE/resources/iconsets/bluesky/filesystem/cfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/bluesky/filesystem/cfile-vcs-conflict.svg
new file mode 100644
index 00000000..c2b7cb0f
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/filesystem/cfile-vcs-conflict.svg
@@ -0,0 +1,145 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/bluesky/filesystem/cppfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/bluesky/filesystem/cppfile-vcs-conflict.svg
new file mode 100644
index 00000000..59466849
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/filesystem/cppfile-vcs-conflict.svg
@@ -0,0 +1,163 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/bluesky/filesystem/file-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/bluesky/filesystem/file-vcs-conflict.svg
new file mode 100644
index 00000000..64acd7b1
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/filesystem/file-vcs-conflict.svg
@@ -0,0 +1,131 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/bluesky/filesystem/folder-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/bluesky/filesystem/folder-vcs-conflict.svg
new file mode 100644
index 00000000..85c4f34f
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/filesystem/folder-vcs-conflict.svg
@@ -0,0 +1,108 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/bluesky/filesystem/hfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/bluesky/filesystem/hfile-vcs-conflict.svg
new file mode 100644
index 00000000..c3b19b4e
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/filesystem/hfile-vcs-conflict.svg
@@ -0,0 +1,135 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/bluesky/filesystem/projectfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/bluesky/filesystem/projectfile-vcs-conflict.svg
new file mode 100644
index 00000000..cf32579f
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/filesystem/projectfile-vcs-conflict.svg
@@ -0,0 +1,181 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-conflict.svg
new file mode 100644
index 00000000..55d395de
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-conflict.svg
@@ -0,0 +1,105 @@
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/cppfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/cppfile-vcs-conflict.svg
new file mode 100644
index 00000000..05f30bde
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/cppfile-vcs-conflict.svg
@@ -0,0 +1,134 @@
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/file-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/file-vcs-conflict.svg
new file mode 100644
index 00000000..ec3f8626
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/file-vcs-conflict.svg
@@ -0,0 +1,101 @@
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-conflict.svg
new file mode 100644
index 00000000..69f37686
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-conflict.svg
@@ -0,0 +1,77 @@
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-conflict.svg
new file mode 100644
index 00000000..f3c3368a
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-conflict.svg
@@ -0,0 +1,105 @@
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/projectfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/projectfile-vcs-conflict.svg
new file mode 100644
index 00000000..a5f09fd1
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/projectfile-vcs-conflict.svg
@@ -0,0 +1,105 @@
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg
index 10964c61..c2b7cb0f 100644
--- a/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg
+++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg
@@ -25,8 +25,8 @@
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="2.8934905"
- inkscape:cx="160.70556"
- inkscape:cy="10.886505"
+ inkscape:cx="87.092043"
+ inkscape:cy="132.88449"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
@@ -115,17 +115,31 @@
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
x="-8.4125614"
y="18.471058" />
-
-
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/cppfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/cppfile-vcs-conflict.svg
new file mode 100644
index 00000000..59466849
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/cppfile-vcs-conflict.svg
@@ -0,0 +1,163 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/file-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/file-vcs-conflict.svg
new file mode 100644
index 00000000..64acd7b1
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/file-vcs-conflict.svg
@@ -0,0 +1,131 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/folder-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/folder-vcs-conflict.svg
new file mode 100644
index 00000000..85c4f34f
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/folder-vcs-conflict.svg
@@ -0,0 +1,108 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/hfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/hfile-vcs-conflict.svg
new file mode 100644
index 00000000..c3b19b4e
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/hfile-vcs-conflict.svg
@@ -0,0 +1,135 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/projectfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/projectfile-vcs-conflict.svg
new file mode 100644
index 00000000..cf32579f
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/projectfile-vcs-conflict.svg
@@ -0,0 +1,181 @@
+
+
+
+
diff --git a/RedPandaIDE/vcs/gitbranchdialog.cpp b/RedPandaIDE/vcs/gitbranchdialog.cpp
index 6bf4cb38..d08a4aeb 100644
--- a/RedPandaIDE/vcs/gitbranchdialog.cpp
+++ b/RedPandaIDE/vcs/gitbranchdialog.cpp
@@ -41,18 +41,17 @@ void GitBranchDialog::on_btnCancel_clicked()
void GitBranchDialog::on_btnOk_clicked()
{
- QString branch = ui->lstBranches->currentText();
- QString text;
+ QString branch;
if (ui->chkCreate->isChecked())
- text = ui->txtNewBranch->text();
+ branch = ui->txtNewBranch->text();
else
- text = ui->lstBranches->currentText();
+ branch = ui->lstBranches->currentText();
bool result = false;
QString output;
- if (!text.isEmpty()) {
+ if (!branch.isEmpty()) {
result = mManager->switchToBranch(
mFolder,
- ui->txtNewBranch->text(),
+ branch,
ui->chkCreate->isChecked(),
ui->chkForce->isChecked(),
ui->chkMerge->isChecked(),
diff --git a/RedPandaIDE/vcs/gitmanager.cpp b/RedPandaIDE/vcs/gitmanager.cpp
index 39955295..0738a5ed 100644
--- a/RedPandaIDE/vcs/gitmanager.cpp
+++ b/RedPandaIDE/vcs/gitmanager.cpp
@@ -150,6 +150,15 @@ QStringList GitManager::listChangedFiles(const QString &folder)
return textToLines(runGit(folder,args));
}
+QStringList GitManager::listConflicts(const QString &folder)
+{
+ QStringList args;
+ args.append("diff");
+ args.append("--name-only");
+ args.append("--diff-filter=U");
+ return textToLines(runGit(folder,args));
+}
+
QStringList GitManager::listBranches(const QString &folder, int ¤t)
{
QStringList args;
@@ -165,6 +174,8 @@ QStringList GitManager::listBranches(const QString &folder, int ¤t)
temp[i] = s.mid(1).trimmed();
} else if (s.startsWith('+')) {
temp[i] = s.mid(1).trimmed();
+ } else {
+ temp[i] = s.trimmed();
}
}
return temp;
diff --git a/RedPandaIDE/vcs/gitmanager.h b/RedPandaIDE/vcs/gitmanager.h
index 59c93edf..915a87c3 100644
--- a/RedPandaIDE/vcs/gitmanager.h
+++ b/RedPandaIDE/vcs/gitmanager.h
@@ -36,6 +36,8 @@ public:
QStringList listFiles(const QString& folder);
QStringList listStagedFiles(const QString& folder);
QStringList listChangedFiles(const QString& folder);
+ QStringList listConflicts(const QString& folder);
+
QStringList listBranches(const QString& folder, int& current);
bool switchToBranch(const QString& folder, const QString& branch, bool create,
bool force, bool merge, bool track, bool noTrack, bool forceCreation,
diff --git a/RedPandaIDE/vcs/gitmergedialog.cpp b/RedPandaIDE/vcs/gitmergedialog.cpp
index 4bf499dc..c92970e6 100644
--- a/RedPandaIDE/vcs/gitmergedialog.cpp
+++ b/RedPandaIDE/vcs/gitmergedialog.cpp
@@ -56,6 +56,9 @@ void GitMergeDialog::on_btnOk_clicked()
output,
ui->txtMergeMessage->toPlainText()
)) {
+ InfoMessageBox box;
+ box.setMessage(output);
+ box.exec();
accept();
} else {
InfoMessageBox box;
diff --git a/RedPandaIDE/vcs/gitrepository.cpp b/RedPandaIDE/vcs/gitrepository.cpp
index f7e1f574..ecb902eb 100644
--- a/RedPandaIDE/vcs/gitrepository.cpp
+++ b/RedPandaIDE/vcs/gitrepository.cpp
@@ -92,11 +92,13 @@ void GitRepository::update()
mFilesInRepositories.clear();
mChangedFiles.clear();
mStagedFiles.clear();
+ mConflicts.clear();
} else {
mInRepository = mManager->hasRepository(mRealFolder,mBranch);
convertFilesListToSet(mManager->listFiles(mRealFolder),mFilesInRepositories);
convertFilesListToSet(mManager->listChangedFiles(mRealFolder),mChangedFiles);
convertFilesListToSet(mManager->listStagedFiles(mRealFolder),mStagedFiles);
+ convertFilesListToSet(mManager->listConflicts(mRealFolder),mConflicts);
// qDebug()<<"update"< mFilesInRepositories;
QSet mChangedFiles;
QSet mStagedFiles;
+ QSet mConflicts;
private:
void convertFilesListToSet(const QStringList& filesList,QSet& set);
};