diff --git a/NEWS.md b/NEWS.md
index 2eef58ee..a222df3f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -13,6 +13,8 @@ Red Panda C++ Version 0.14.3
- enhancement: git - commit
- enhancement: git - restore
- fix: compiler set index not correctly saved, when remove compiler sets in options dialog
+ - enhancement: when add files to project, auto add it to git (if the project has a git repository)
+
Red Panda C++ Version 0.14.2
- enhancement: file system view mode for project
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index 7a4ba211..62378be9 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -61,24 +61,28 @@ p, li { white-space: pre-wrap; }
<html><head/><body><h1 style=" margin-top:18px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; font-weight:600;">小熊猫C++</span></h1></body></html>
-
+
基于Qt %1 (%2)
-
+
构建时间:%1 %2
-
+
Copyright(C) 2021-2022 瞿华(royqh1979@gmail.com)
-
+
+
+ <html><head/><body><p>官方网站: <a href="Homepage: https://sourceforge.net/projects/dev-cpp-2020/">https://sourceforge.net/projects/dev-cpp-2020/</a></p></body></html>
+
+
- <html><head/><body><p>主页: <a href="Homepage: https://sourceforge.net/projects/dev-cpp-2020/"><span style=" text-decoration: underline; color:#0000ff;">https://sourceforge.net/projects/dev-cpp-2020/</span></a></p></body></html>
+ <html><head/><body><p>主页: <a href="Homepage: https://sourceforge.net/projects/dev-cpp-2020/"><span style=" text-decoration: underline; color:#0000ff;">https://sourceforge.net/projects/dev-cpp-2020/</span></a></p></body></html>
@@ -86,12 +90,12 @@ p, li { white-space: pre-wrap; }
小熊猫Dev-C++ (<=6.7.5):
-
+
GNU通用公共许可
-
+
-
+
版本:
-
+
非GCC编译器
+
+
+
+ 网址:<a href="%1">%1</a>
+
AppTheme
@@ -3279,7 +3288,7 @@ Are you really want to continue?
-
+
@@ -3293,48 +3302,48 @@ Are you really want to continue?
编译日志
-
+
文件
-
+
工具
-
-
+
+
运行
-
+
编辑
-
-
+
+
项目
-
+
监视
-
+
结构
-
+
文件
@@ -3343,85 +3352,85 @@ Are you really want to continue?
资源
-
-
-
-
-
+
+
+
+
+
调试
-
+
求值
-
+
调试主控台
-
+
调用栈
-
+
断点
-
+
局部变量
-
-
-
+
+
+
查找
-
+
历史:
-
+
重新查找
-
+
替换为:
-
+
替换
-
+
关闭
-
+
运行
-
-
+
+
代码
-
+
窗口
@@ -3439,67 +3448,67 @@ Are you really want to continue?
新建
-
+
Ctrl+N
-
+
打开...
-
+
Ctrl+O
-
+
保存
-
+
Ctrl+S
-
+
另存为...
-
+
另存为
-
+
全部保存
-
+
Ctrl+Shift+S
-
+
选项
-
-
-
+
+
+
编译
-
-
+
+
工具输出
@@ -3514,47 +3523,47 @@ Are you really want to continue?
Git
-
+
F9
-
+
F10
-
+
恢复
-
+
Ctrl+Z
-
+
重做
-
+
Ctrl+Y
-
+
剪切
-
+
Ctrl+X
-
+
@@ -3562,144 +3571,144 @@ Are you really want to continue?
复制
-
+
Ctrl+C
-
+
粘贴
-
+
Ctrl+V
-
+
选择全部
-
+
Ctrl+A
-
+
缩进
-
+
取消缩进
-
+
切换注释
-
+
Ctrl+/
-
+
全部收起
-
+
全部展开
-
+
使用ANSI编码
-
+
使用UTF-8编码
-
+
自动检测
-
+
转换为ANSI编码
-
+
转换为UTF-8编码
-
-
+
+
编译运行
-
+
F11
-
-
+
+
全部重编译
-
+
F12
-
+
停止执行
-
+
F6
-
+
F5
-
+
单步跳过
-
+
F7
-
+
单步进入
-
+
试题集
@@ -3707,7 +3716,7 @@ Are you really want to continue?
-
+
新建试题集
@@ -3726,106 +3735,106 @@ Are you really want to continue?
-
+
保存试题集
-
+
载入试题集
-
+
内存
-
+
Address:
地址表达式:
-
+
取消
-
-
+
+
TODO
-
-
+
+
书签
-
-
-
+
+
+
试题
-
-
+
+
添加试题案例
-
-
+
+
Remove Problem Set
删除试题集
-
-
+
+
打开答案源代码文件
-
-
+
+
Run Current Case
运行所有案例
-
+
测试案例验证选项
-
+
%v/%m
-
+
输出
-
+
输入
-
+
期望输出
-
+
帮助
@@ -3844,472 +3853,477 @@ Are you really want to continue?
工具窗口
-
+
主工具栏
-
+
编译器配置集
-
-
+
+
新建源代码文件
-
+
Tab
-
+
Shift+Tab
-
+
F8
-
+
单步跳出
-
+
Ctrl+F8
-
+
执行到光标处
-
+
Ctrl+F5
-
+
继续执行
-
+
F4
-
+
添加监视
-
+
打开CPU信息窗口...
-
+
退出
-
+
查找...
-
+
Ctrl+F
-
+
在文件中查找...
-
+
Ctrl+Shift+F
-
+
替换
-
+
Ctrl+R
-
+
查找下一个
-
+
F3
-
+
查找前一个
-
+
Shift+F3
-
+
删除监视值
-
+
Remove All
删除全部监视值
-
+
修改监视值
-
+
对代码重新排版
-
+
Ctrl+Shift+A
-
+
前一次编辑位置
-
+
Ctrl+Alt+Left
-
+
后一次编辑位置
-
+
Ctrl+Alt+Right
-
+
Ctrl+W
-
+
全部关闭
-
+
Ctrl+Shift+W
-
+
最大化编辑器
-
+
Ctrl+F11
-
+
下一窗口
-
+
Ctrl+Tab
-
+
前一窗口
-
+
Ctrl+Shift+Tab
-
+
切换断点
-
+
Ctrl+F4
-
+
删除所有断点
-
+
设置断点条件...
-
+
跳转到声明处
-
+
跳转到定义处
-
+
查找符号的引用
-
+
打开所在的文件夹
-
+
Ctrl+B
-
+
打开命令行窗口
-
+
文件属性...
-
+
关闭项目
-
+
项目属性
-
+
新建项目...
-
+
新建项目文件
-
+
添加到项目...
-
+
从项目删除
-
+
查看Makefile
-
+
清理构建文件
-
+
在浏览器中打开
-
+
在终端中打开
-
+
关于
-
+
重命名符号
-
+
Shift+F6
-
+
打印...
-
+
Ctrl+P
-
+
导出为RTF
-
+
导出为HTML
-
+
移动到其他视图
-
+
Ctrl+M
-
-
+
+
C++参考手册
-
+
C参考手册
-
+
显示全部工具面板
-
+
Create Repository
创建Git仓库
-
+
提交(Commit)
-
+
撤销(Revert)
-
+
回滚(Reset)
-
+
添加文件
-
+
还原(Restore)
+
+
+
+ 官方网站
+
工具窗口栏
-
+
状态栏
-
+
Ctrl+Backspace
-
+
中断
-
-
+
+
删除到单词开头
-
+
Ctrl+Shift+B
-
+
删除到单词结尾
-
+
Ctrl+Shift+E
-
+
Add Class...
新建类...
-
-
+
+
New Header
新建头文件...
@@ -4319,47 +4333,47 @@ Are you really want to continue?
插入行
-
+
删除当前行
-
+
Ctrl+D
-
+
复制当前行
-
+
Ctrl+E
-
+
删除当前单词
-
+
Ctrl+Shift+D
-
+
删除到行尾
-
+
Ctrl+Del
-
+
删除到行首
@@ -4368,38 +4382,38 @@ Are you really want to continue?
C/C++参考
-
+
EGE图形库手册
-
+
添加书签
-
+
删除书签
-
+
修改书签说明
-
+
在文件视图中定位
-
-
+
+
打开文件夹
-
+
运行参数...
@@ -4635,7 +4649,7 @@ Are you really want to continue?
-
+
试题集%1
@@ -4709,15 +4723,15 @@ Are you really want to continue?
-
-
+
+
书签描述
-
-
+
+
描述:
@@ -4915,7 +4929,7 @@ Are you really want to continue?
-
+
需要保存吗?
@@ -4939,7 +4953,7 @@ Are you really want to continue?
-
+
保存失败
@@ -5009,39 +5023,39 @@ Are you really want to continue?
你真的要删除它吗?
-
-
+
+
头文件已存在
-
-
+
+
头文件"%1"已存在!
-
+
源文件已存在!
-
+
源文件"%1"已存在!
-
+
提交信息
-
+
提交失败
-
+
提交信息不能为空!
@@ -5146,29 +5160,29 @@ Are you really want to continue?
HTML文件 (*.html)
-
+
当前的试题集不是空的。
-
+
试题%1
-
-
+
+
试题集文件 (*.pbs)
-
+
载入失败
-
+
试题案例%1
@@ -6445,7 +6459,7 @@ Are you really want to continue?
生成调试信息(-g3)
-
+
您同意小熊猫C++在PATH路径中寻找gcc编译器吗?
@@ -6545,7 +6559,7 @@ Are you really want to continue?
-
+
确认
@@ -6565,13 +6579,13 @@ Are you really want to continue?
如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果,
-
-
+
+
未配置编译器设置。
-
+
您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
@@ -7405,7 +7419,7 @@ Are you really want to continue?
自动链接
-
+
@@ -7481,15 +7495,15 @@ Are you really want to continue?
杂项
-
-
+
+
程序运行
-
+
试题集
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 9bb93b71..93942c2b 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -748,12 +748,20 @@ void MainWindow::updateDPI()
void MainWindow::onFileSaved(const QString &path, bool inProject)
{
if (pSettings->vcs().gitOk()) {
- if (inProject && mProject) {
+ QString branch;
+ if (inProject && mProject && mProject->model()->iconProvider()->VCSRepository()->hasRepository(branch)) {
mProject->model()->beginUpdate();
mProject->model()->endUpdate();
}
QModelIndex index = mFileSystemModel.index(path);
if (index.isValid()) {
+ if (!inProject) {
+ if ( (isCFile(path) || isHFile(path))
+ && !mFileSystemModelIconProvider.VCSRepository()->isFileInRepository(path)) {
+
+ mFileSystemModelIconProvider.VCSRepository()->add(extractRelativePath(mFileSystemModelIconProvider.VCSRepository()->folder(),path));
+ }
+ }
mFileSystemModelIconProvider.update();
mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider);
ui->treeFiles->update(index);
@@ -5375,6 +5383,12 @@ void MainWindow::on_actionAdd_to_project_triggered()
foreach (const QString& filename, dialog.selectedFiles()) {
mProject->addUnit(filename,folderNode,false);
mProject->cppParser()->addFileToScan(filename);
+ QString branch;
+ if (pSettings->vcs().gitOk() && mProject->model()->iconProvider()->VCSRepository()->hasRepository(branch)) {
+ mProject->model()->iconProvider()->VCSRepository()->add(
+ extractRelativePath(mProject->folder(),filename)
+ );
+ }
}
mProject->rebuildNodes();
mProject->saveUnits();
@@ -5616,14 +5630,21 @@ void MainWindow::newProjectUnitFile()
}
PProjectUnit newUnit = mProject->newUnit(
mProject->pointerToNode(node),newFileName);
- idx = mProject->units().count()-1;
mProject->rebuildNodes();
- mProject->saveUnits();
- updateProjectView();
+ mProject->saveAll();
+ updateProjectView();
+ idx = mProject->units().count()-1;
Editor * editor = mProject->openUnit(idx);
//editor->setUseCppSyntax(mProject->options().useGPP);
//editor->setModified(true);
editor->activate();
+ QString branch;
+ if (pSettings->vcs().gitOk() && mProject->model()->iconProvider()->VCSRepository()->hasRepository(branch)) {
+ mProject->model()->iconProvider()->VCSRepository()->add(newFileName);
+ mProject->model()->beginUpdate();
+ mProject->model()->endUpdate();
+ }
+ updateProjectView();
}
void MainWindow::doFilesViewRemoveFile(const QModelIndex &index)
@@ -5802,6 +5823,7 @@ void MainWindow::showSearchReplacePanel(bool show)
void MainWindow::setFilesViewRoot(const QString &path)
{
mFileSystemModelIconProvider.setRootFolder(path);
+ mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider);
mFileSystemModel.setRootPath(path);
ui->treeFiles->setRootIndex(mFileSystemModel.index(path));
pSettings->environment().setCurrentFolder(path);
@@ -6004,7 +6026,8 @@ void MainWindow::on_actionC_C_Reference_triggered()
if (fileInfo.exists()) {
QDesktopServices::openUrl(QUrl::fromLocalFile(fileInfo.absoluteFilePath()));
} else {
- QDesktopServices::openUrl(QUrl("https://zh.cppreference.com/w/cpp"));
+
+ QDesktopServices::openUrl(QUrl("https://qingcms.gitee.io/cppreference/20210212/zh/cpp.html"));
}
} else {
QDesktopServices::openUrl(QUrl("https://en.cppreference.com/w/cpp"));
@@ -6244,7 +6267,7 @@ void MainWindow::on_btnRunAllProblemCases_clicked()
void MainWindow::on_actionC_Reference_triggered()
{
if (pSettings->environment().language()=="zh_CN") {
- QDesktopServices::openUrl(QUrl("https://zh.cppreference.com/w/c"));
+ QDesktopServices::openUrl(QUrl("https://qingcms.gitee.io/cppreference/20210212/zh/c.html"));
} else {
QDesktopServices::openUrl(QUrl("https://en.cppreference.com/w/c"));
}
@@ -6601,7 +6624,7 @@ void MainWindow::on_actionGit_Create_Repository_triggered()
if (pos>=0) {
ui->cbFilesPath->setItemIcon(pos, pIconsManager->getIcon(IconsManager::FILESYSTEM_GIT));
}
- mFileSystemModelIconProvider.update();
+ mFileSystemModelIconProvider.setRootFolder(pSettings->environment().currentFolder());
mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider);
//update project view
if (mProject && mProject->folder() == mFileSystemModel.rootPath()) {
@@ -6614,6 +6637,7 @@ void MainWindow::on_actionGit_Create_Repository_triggered()
GitManager vcsManager;
vcsManager.createRepository(mProject->folder());
vcsManager.add(mProject->folder(), extractFileName(mProject->filename()));
+ vcsManager.add(mProject->folder(), extractFileName(mProject->options().icon));
foreach (PProjectUnit pUnit, mProject->units()) {
vcsManager.add(mProject->folder(),extractRelativePath(mProject->folder(),pUnit->fileName()));
}
@@ -6729,3 +6753,13 @@ void MainWindow::on_actionGit_Restore_triggered()
mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider);
}
+
+void MainWindow::on_actionWebsite_triggered()
+{
+ if (pSettings->environment().language()=="zh_CN") {
+ QDesktopServices::openUrl(QUrl("https://royqh1979.gitee.io/redpandacpp/"));
+ } else {
+ QDesktopServices::openUrl(QUrl("https://sourceforge.net/projects/redpanda-cpp/"));
+ }
+}
+
diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h
index 12b53b82..d114c32e 100644
--- a/RedPandaIDE/mainwindow.h
+++ b/RedPandaIDE/mainwindow.h
@@ -586,6 +586,8 @@ private slots:
void on_actionGit_Restore_triggered();
+ void on_actionWebsite_triggered();
+
private:
Ui::MainWindow *ui;
EditorList *mEditorList;
diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui
index dd4263cc..7cd73802 100644
--- a/RedPandaIDE/mainwindow.ui
+++ b/RedPandaIDE/mainwindow.ui
@@ -576,7 +576,6 @@
- 50
false
@@ -1422,7 +1421,7 @@
0
0
1114
- 26
+ 25
diff --git a/RedPandaIDE/vcs/gitmanager.cpp b/RedPandaIDE/vcs/gitmanager.cpp
index f109232f..42c9af19 100644
--- a/RedPandaIDE/vcs/gitmanager.cpp
+++ b/RedPandaIDE/vcs/gitmanager.cpp
@@ -218,11 +218,14 @@ QString GitManager::runGit(const QString& workingFolder, const QStringList &args
.arg(workingFolder,
pSettings->vcs().gitPath(),
args.join("\" \"")));
+// qDebug()<<"---------";
+// qDebug()<
AboutDialog::AboutDialog(QWidget *parent) :
@@ -41,6 +42,12 @@ AboutDialog::AboutDialog(QWidget *parent) :
#endif
ui->lblCompileTime->setText(ui->lblCompileTime->text()
.arg(__DATE__, __TIME__));
+
+ QString website="https://sourceforge.net/projects/redpanda-cpp/";
+ if (pSettings->environment().language()=="zh_CN") {
+ website = "https://royqh1979.gitee.io/redpandacpp/";
+ }
+ ui->lblHomepage->setText(tr("Website: %1").arg(website));
}
AboutDialog::~AboutDialog()
diff --git a/RedPandaIDE/widgets/aboutdialog.ui b/RedPandaIDE/widgets/aboutdialog.ui
index 4ad7c1d8..715595b0 100644
--- a/RedPandaIDE/widgets/aboutdialog.ui
+++ b/RedPandaIDE/widgets/aboutdialog.ui
@@ -28,7 +28,6 @@
- 50
false
@@ -41,7 +40,6 @@
- 50
false
@@ -54,7 +52,6 @@
- 50
false
@@ -64,15 +61,17 @@
-
-
+
- 50
false
- <html><head/><body><p>Homepage: <a href="Homepage: https://sourceforge.net/projects/dev-cpp-2020/"><span style=" text-decoration: underline; color:#0000ff;">https://sourceforge.net/projects/dev-cpp-2020/</span></a></p></body></html>
+ <html><head/><body><p>Homepage: <a href="Homepage: https://sourceforge.net/projects/dev-cpp-2020/">https://sourceforge.net/projects/dev-cpp-2020/</a></p></body></html>
+
+
+ true