diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm
index 9dc4db47..7a8c2151 100644
Binary files a/RedPandaIDE/RedPandaIDE_zh_CN.qm and b/RedPandaIDE/RedPandaIDE_zh_CN.qm differ
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index e47fc441..4aff07aa 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -4,37 +4,37 @@
BacktraceModel
-
+
- 函数
+ 函数
-
+
- 文件名
+ 文件名
-
+
- 行
+ 行
BreakpointModel
-
+
- 文件名
+ 文件名
-
+
- 行
+ 行
-
+
-
+ 条件
@@ -42,22 +42,27 @@
-
+ CPU信息
-
+ 反汇编
-
+ AT&&T
-
+ Intel
+
+
+
+
+ 混合模式
@@ -74,7 +79,7 @@
-
+ 重编译前的清理准备工作失败!
@@ -127,34 +132,34 @@
[说明]
-
+
-
+ 无法启动编译进程。
-
+
-
+ 编译进程启动后崩溃。
-
+
-
+ waitFor()函数等待超时。
-
+
-
+ 在向编译进程输入内容时出错。
-
+
-
+ 在从编译进程读取内容时出错。
-
+
-
+ 发生了未知错误。
@@ -167,19 +172,19 @@
-
+ 无编译器设置
-
+ 没有配置编译器设置。
-
+ 无法启动调试器
@@ -360,13 +365,13 @@ Are you really want to continue?
-
+ 失败
-
+ 找不到编译器
@@ -395,52 +400,66 @@ Are you really want to continue?
- 表单
+ 表单
-
+ 调试主控台
- 字体:
+ 字体:
- 只显示等宽字体
+ 只显示等宽字体
- 大小:
+ 大小:
-
+ 在调试主控台中显示调试器输出
-
+ 在调试主控台中显示gdb输出注解
+
+
+
+ 反汇编代码样式
-
-
+
+ CPU信息窗口
-
+
+
+ 反汇编代码样式
+
+
+
-
+ Intel
-
+
-
+ AT&&T
+
+
+
+
+ 以混合模式显示反汇编代码
@@ -448,53 +467,53 @@ Are you really want to continue?
-
+ 无编译器设置
-
+ 没有配置编译器设置。
-
-
-
-
-
-
+ 无法启动调试器
+
+ 找不到调试器
+
+
+
-
+ 找不到调试器程序"%1"
-
-
+
+
-
+ 执行以求值
-
+
-
+ 不在当前语境中
-
+
- 编译
+ 编译
-
+
-
+ 源文件比程序文件新。
-
+
-
+ 重新编译?
@@ -504,7 +523,7 @@ Are you really want to continue?
无标题
-
+
无标题%1
@@ -513,46 +532,58 @@ Are you really want to continue?
失败
-
-
-
-
-
-
-
+
+
+
+
+
+
+
- 错误
+ 错误
-
+
-
+ 无法写入文件"%1"
-
+
另存为
-
+
要复制的内容超过了行数限制!
-
+
要复制的内容超过了字符数限制!
-
+
要剪切的内容超过了行数限制!
-
+
要剪切的内容超过了字符数限制!
+
+
+
+
+
+ Ctrl+单击以获取更多信息
+
+
+
+
+ 只读
+
EditorClipboardWidget
@@ -861,62 +892,62 @@ Are you really want to continue?
- 表单
+ 表单
-
+ 符号补全
-
+ 详情
-
+ 补全花括号{}
-
+ 补全方括号[]
-
+ 补全括号()
-
+ 补全ANSI C风格注释/*和*/
-
+ 补全单引号''
-
+ 补全双引号""
-
+ 补全#include语句中的<>
-
+ 自动覆写匹配的符号
-
+ 在删除字符时自动删除配对的符号
@@ -924,22 +955,22 @@ Are you really want to continue?
- 表单
+ 表单
-
+ 启用自动语法检查
-
+ 在打开/保存文件时检查
-
+ 在文件函数变化时检查
@@ -974,38 +1005,43 @@ Are you really want to continue?
大小:
+
+
+
+ 简体中文
+
ExecutableRunner
-
+ 无法启动程序运行进程。
-
+ 程序运行进程启动后崩溃。
-
+ waitFor()函数等待超时。
-
+ 在向程序运行进程写入内容时出错。
-
+ 在从程序运行进程读取内容时出错。
-
+ 发生了未知错误。
@@ -1013,17 +1049,17 @@ Are you really want to continue?
- 表单
+ 表单
-
+ 程序返回时暂停
-
+ 在运行程序时自动最小化IDE
@@ -1059,7 +1095,7 @@ Are you really want to continue?
-
+ 编译器程序"%1"不存在!
@@ -1108,642 +1144,662 @@ Are you really want to continue?
小熊猫C++
-
-
+
+
编译器
-
+
编译日志
-
+
文件
-
+
工具
-
-
+
+
运行
-
+
编辑
-
+ 项目
-
+ 监视
-
+ 结构
-
+
-
+ 文件
-
+
-
+ 资源
-
-
-
+
+
+
-
+ 调试
-
+
-
+ 求值
-
+
-
+ 调试主控台
-
+
-
+ 调用栈
-
+
-
+ 断点
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 本地变量
+
-
-
+
+ 查找
-
+
+
+ 历史:
+
+
+
+
+ 重新查找
+
+
+
+
+ 替换为:
+
+
+
+
+ 替换
+
+
+
+
+ 关闭
+
+
+
+
+ 执行
+
+
+
+
+
+
+ 工具栏
+
+
+
+
+ 工具栏2
+
+
+
新建
-
+
Ctrl+N
-
+
打开...
-
+
Ctrl+O
-
+
保存
-
+
Ctrl+S
-
+
另存为...
-
+
另存为
-
+
全部保存
-
+
Ctrl+Shift+S
-
+
选项
-
-
-
-
+
+
+
+
编译
-
+
F9
-
+
F10
-
+
恢复
-
+
Ctrl+Z
-
+
重做
-
+
Ctrl+Y
-
+
剪切
-
+
Ctrl+X
-
+
复制
-
+
Ctrl+C
-
+
粘贴
-
+
Ctrl+V
-
+
选择全部
-
+
Ctrl+A
-
+
缩进
-
+
取消缩进
-
+
切换注释
-
+
Ctrl+/
-
+
全部收起
-
+
全部展开
-
+
使用ANSI编码
-
+
使用UTF-8编码
-
+
自动检测
-
+
转换为ANSI编码
-
+
转换为UTF-8编码
-
-
+
+
-
+ 编译运行
-
+
- F11
+ F11
-
-
+
+
-
+ 全部重编译
-
+
- F12
+ F12
-
+
-
+ 停止执行
-
+
- F6
-
-
-
-
- F5
-
-
-
-
-
-
-
-
-
- F7
-
-
-
-
-
-
-
-
-
- F8
-
-
-
-
-
+ F6
-
-
+
+ F5
-
-
-
+
+
+ 单步跳过
-
-
-
+
+
+ F7
-
-
-
+
+
+ 单步进入
-
-
- F4
-
-
-
-
-
+
+
+ F8
-
-
+
+ 单步跳出
-
-
-
+
+
+ Ctrl+F8
-
-
-
+
+
+ 执行到光标处
-
-
-
+
+
+ Ctrl+F5
-
-
-
+
+
+ 继续执行
-
-
-
+
+
+ F4
-
-
-
+
+
+ 添加监视
-
-
+
+ 打开CPU信息窗口...
+
+ 退出
+
+
+
+
+ 查找...
+
+
+
+
+ Ctrl+F
+
+
+
+
+ 在文件中查找...
+
+
+
+
+ Ctrl+Shift+F
+
+
+
+
+ 替换
+
+
+
+
+ Ctrl+R
+
+
+
-
+ 查找下一个
-
+
- F3
+ F3
-
+
-
+ 查找前一个
-
+
-
+ Shift+F3
-
+
文件编码
-
+
-
+ 文件历史
-
-
+
+
-
+ 正在调试
-
-
+
+
-
+ 正在运行
-
-
+
+
-
+ 正在编译
-
- 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5
+ 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5
-
+
+
+ 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5
+
+
+
只读
-
+
插入
-
+
覆写
-
-
+
+
- 确认
+ 确认
-
-
-
+
+
+
-
+ 源文件尚未编译。
-
-
+
+
-
+ 现在编译?
-
-
+
+
-
+ 源文件比可执行程序新。
-
+
-
+ 重新编译?
-
+
-
+ 无编译器设置
-
+
-
+ 没有配置编译器设置。
-
+
-
+ 无法启动调试器
-
+
-
+ 启用调试参数
-
+
-
+ 当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题?
-
+
-
+ 重新编译?
-
-
-
-
-
-
+
+
+
+
+
+
错误
-
+
打开
-
+
-
+ 编译失败
-
+
-
+ 运行失败
-
-
+
+
确认转换
-
-
+
+
当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?
-
+
-
+ 新监视表达式
-
+
-
+ 输入监视表达式
+
+
+
+
+ (%1/%2)正在解析文件"%3"
+
+
+
+
+
+ 完成1%个文件的解析,用时%2秒
+
+
+
+
+ (每秒%1个文件)
QApplication
-
+
错误
@@ -1751,12 +1807,12 @@ Are you really want to continue?
QObject
-
+
保存
-
+
将修改保存到"%1"?
@@ -1791,73 +1847,83 @@ Are you really want to continue?
-
-
+
+
错误
-
+
无法创建配置文件夹"%1"
-
+
无法写入配置文件夹"%1"
-
-
-
+
+
+
-
+ 下列%1文件夹不存在:
-
-
+
+
-
+ 二进制
-
+
-
+ 未指定%1文件夹
-
-
-
-
-
-
-
-
+
+ C包含
-
+
-
-
-
-
+
+ C++包含
-
+
+
+
+
+
+ 无法找到%1程序"%2"
+
+
+
C语言选项
-
+
代码生成
-
+
-
+ 在验证编译器设置"%1"时遇到了下列问题:
+
+
+
+
+ 未配置编译器设置。
+
+
+
+
+ 您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
@@ -1891,12 +1957,12 @@ Are you really want to continue?
-
+
无标题
-
+
下标"%1"越界
@@ -1908,7 +1974,7 @@ Are you really want to continue?
- JSON文件"%1"在位置"%2"处无法解析!错误码:%3
+ JSON文件"%1"在位置"%2"处无法解析!错误码:%3
@@ -1917,7 +1983,7 @@ Are you really want to continue?
-
+
@@ -1927,14 +1993,14 @@ Are you really want to continue?
-
+ 找不到颜色配置文件%1!
-
+ 删不掉颜色配置文件%1!
@@ -2139,12 +2205,12 @@ Are you really want to continue?
-
+ 将文件'%1'改名为'%2'失败!
-
+ 配置文件'%1'已经存在!
@@ -2156,23 +2222,33 @@ Are you really want to continue?
无标题
+
+
+
+ 构造函数
+
+
+
+
+ 析构函数
+
RegisterModel
-
+
-
+ 寄存器
-
+
-
+ 值(HEX)
-
+
-
+ 值(DEC)
@@ -2180,136 +2256,136 @@ Are you really want to continue?
-
+ 对话框
-
+ 要查找的关键字
-
+ 替换为:
-
+ 选项:
-
+ 区分大小写
-
+ 整个单词
-
+ 正则表达式
-
+ 替换时提示
-
+ 范围:
-
+ 全局
- 选中文字
+ 选中文字
-
+ 起点:
-
+ 从光标处
-
+ 整个范围
-
+ 方向
-
+ 向后
-
+ 向前
-
+ 在哪些文件中查找:
-
+ 当前文件
-
+ 项目中的文件
-
+ 已打开的文件
-
+ 查找
-
+ 取消
-
+ 在文件中查找
-
+ 替换
-
+ 替换这里的"%1"?
@@ -2317,17 +2393,17 @@ Are you really want to continue?
-
+ 当前文件:
-
+ 项目中的文件:
-
+ 打开的文件:
@@ -2335,7 +2411,7 @@ Are you really want to continue?
- 行
+ 行
@@ -2344,163 +2420,164 @@ Are you really want to continue?
- 行
+ 行
Settings::CompilerSet
-
+
支持所有ANSI标准C程序(-ansi)
-
+
不支持将asm、inline和typeof作为关键字(-fno-asm)
-
+
模仿传统C预处理器行为(-traditional-cpp)
-
+
-
+ 生成特定机器的专用指令(-march)
-
+
-
+ 完整兼容特定机器,较少优化(-tune)
-
+
-
+ 启用特定指令集(-mx)
-
+
-
-
-
-
-
-
-
-
-
-
-
+ 优化级别(-Ox)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 使用下列指针大小编译(-mx)
-
-
+
+ 语言标准(-std)
-
-
+
+ 生成调试信息(-g3)
+
+ 生成性能分析信息(-pg)
+
+
+
+
+ 代码警告
+
+
+
+
+ 忽略所有警告信息(-w)
+
+
+
+
+ 启用常见问题警告(-Wall)
+
+
+
+
+ 启用更多问题警告(-Wextra)
+
+
+
+
+ 检查ISO C/C++/C++0x语法一致性(-pedantic)
+
+
+
+
+ 只进行语法检查(不编译)(-fsyntax-only)
+
+
+
+
+ 将警告作为错误处理(-Werror)
+
+
+
+
+ 遇到第一个错误后立即中止编译(-Wfatal-errors)
+
+
+
+
+ 链接器
+
+
+
+
+ 链接Ojbective C程序(-lobjc)
+
+
+
+
+ 不使用标准库和系统启动文件(-nostdlib)
+
+
+
+
+ 不产生控制台窗口(-mwindows)
+
+
+
+
+ 剥除附加信息(-s)
+
+
+
+
+ 静态链接二进制库(-static)
+
+
+
+
+ 输出
+
+
+
+
+
+
+
+
+
+ 编译时使用管道而不是临时文件(-pipe)
+
+
+
-
+ 只生成汇编代码(-S)
Settings::CompilerSets
-
+
+
- 确认
+ 确认
@@ -2585,22 +2662,22 @@ Are you really want to continue?
-
+ 补全符号
-
+ 自动语法检查
-
+ 程序运行
-
+ 调试器
@@ -2618,64 +2695,64 @@ Are you really want to continue?
-
+ 正在检查语法...
- - 文件名: %1
+ - 文件名: %1
- - 编译器配置: %1
+ - 编译器配置: %1
-
+
- 找不到适合文件%1的编译器
+ 找不到适合文件%1的编译器
-
+
-
-
-
-
-
- 正在处理%1源程序文件:
+ 编译器程序'%1'不存在!
-
- %1编译器: %2
+
+ 正在处理%1源程序文件:
-
+
+
+ %1编译器: %2
+
+
+
- 命令: %1 %2
+ 命令: %1 %2
SynEdit
-
-
+
+
-
+ 高亮处理进入了死循环
SynEditStringList
-
+
-
+ 无法读取文件'%1'!
-
+
-
+ 无法写入文件'%2'!
@@ -2683,7 +2760,7 @@ Are you really want to continue?
- 表单
+ 表单
@@ -2748,32 +2825,32 @@ Are you really want to continue?
-
+ 滚动条
-
+ 自动隐藏滚动条
-
+ 可以将每行末尾字符滚动到编辑器最左侧
-
+ 可以将最后一行滚动到编辑器最上方
-
+ 翻页键只滚动半页
-
+ 在滚动页时少滚动一行
diff --git a/RedPandaIDE/compiler/stdincompiler.cpp b/RedPandaIDE/compiler/stdincompiler.cpp
index 5544c800..13b06022 100644
--- a/RedPandaIDE/compiler/stdincompiler.cpp
+++ b/RedPandaIDE/compiler/stdincompiler.cpp
@@ -28,6 +28,7 @@ bool StdinCompiler::prepareForCompile()
QString strFileType;
switch(fileType) {
case FileType::CSource:
+ case FileType::CHeader:
mArguments += " -x c - ";
mArguments += getCCompileArguments(mOnlyCheckSyntax);
mArguments += getCIncludeArguments();
@@ -35,6 +36,7 @@ bool StdinCompiler::prepareForCompile()
mCompiler = compilerSet()->CCompiler();
break;
case FileType::CppSource:
+ case FileType::CppHeader:
mArguments += " -x c++ - ";
mArguments += getCCompileArguments(mOnlyCheckSyntax);
mArguments += getCIncludeArguments();
diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp
index 83485534..aa645b6a 100644
--- a/RedPandaIDE/editor.cpp
+++ b/RedPandaIDE/editor.cpp
@@ -104,6 +104,12 @@ Editor::Editor(QWidget *parent, const QString& filename,
} else {
initParser();
}
+
+ if (mParser->isSystemHeaderFile(filename) || mParser->isProjectHeaderFile(filename)) {
+ this->setModified(false);
+ setReadOnly(true);
+ updateCaption();
+ }
// mCompletionPopup = std::make_shared();
// mHeaderCompletionPopup = std::make_shared();
mCompletionPopup = pMainWindow->completionPopup();
@@ -116,6 +122,8 @@ Editor::Editor(QWidget *parent, const QString& filename,
connect(this,&SynEdit::gutterClicked,this,&Editor::onGutterClicked);
onStatusChanged(SynStatusChange::scOpenFile);
+
+ setAttribute(Qt::WA_Hover,true);
}
Editor::~Editor() {
@@ -557,12 +565,12 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
}
- qDebug()<name()<<" - "<name()<<" - "<name() == SYNS_AttrIdentifier)) {
BufferCoord p{aChar,line};
BufferCoord pBeginPos,pEndPos;
QString s= getWordAtPosition(p, pBeginPos,pEndPos, WordPurpose::wpInformation);
- qDebug()<findStatementOf(mFilename,
s , p.Line);
StatementKind kind = mParser->getKindOfStatement(statement);
@@ -584,8 +592,8 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
bool Editor::event(QEvent *event)
{
- if (event->type() == QEvent::ToolTip) {
- QHelpEvent *helpEvent = static_cast(event);
+ if (event->type() == QEvent::HoverEnter || event->type() == QEvent::HoverMove) {
+ QHoverEvent *helpEvent = static_cast(event);
BufferCoord p;
TipType reason = getTipType(helpEvent->pos(),p);
PSyntaxIssue pError;
@@ -634,12 +642,14 @@ bool Editor::event(QEvent *event)
return true;
}
+// qDebug()<'') then
s = s.trimmed();
if ((s == mCurrentWord) && (mCurrentTipType == reason)) {
- QApplication* app = dynamic_cast(QApplication::instance());
- if (app->keyboardModifiers().testFlag(Qt::ControlModifier)) {
+// QApplication* app = dynamic_cast(QApplication::instance());
+// if (app->keyboardModifiers().testFlag(Qt::ControlModifier)) {
+ if (helpEvent->modifiers() == Qt::ControlModifier) {
setCursor(Qt::PointingHandCursor);
} else {
setCursor(Qt::ArrowCursor);
@@ -680,22 +690,69 @@ bool Editor::event(QEvent *event)
case TipType::Error:
hint = getErrorHint(pError);
}
+// qDebug()<<"hint:"<(QApplication::instance());
- if (app->keyboardModifiers().testFlag(Qt::ControlModifier)) {
+ // QApplication* app = dynamic_cast(QApplication::instance());
+ // if (app->keyboardModifiers().testFlag(Qt::ControlModifier)) {
+ if (helpEvent->modifiers() == Qt::ControlModifier) {
setCursor(Qt::PointingHandCursor);
} else {
setCursor(Qt::ArrowCursor);
}
- QToolTip::showText(helpEvent->globalPos(),hint);
+ QToolTip::showText(mapToGlobal(helpEvent->pos()),hint);
event->ignore();
} else {
event->ignore();
}
+ return true;
+ } else if (event->type() == QEvent::HoverLeave) {
+ cancelHint();
+ return true;
+ } else if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease ) {
+ if (!mCurrentWord.isEmpty()) {
+ QKeyEvent* keyEvent = dynamic_cast(event);
+ if (keyEvent->key() == Qt::Key_Control) {
+ QApplication* app = dynamic_cast(QApplication::instance());
+ QHoverEvent* hoverEvent=new QHoverEvent(QEvent::HoverMove,
+ mapFromGlobal(QCursor::pos()),
+ mapFromGlobal(QCursor::pos()),
+ Qt::ControlModifier
+ );
+ app->postEvent(this,hoverEvent);
+ }
+ }
}
return SynEdit::event(event);
}
+void Editor::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (event->button() | Qt::LeftButton) {
+ mLastIdCharPressed = 0;
+ }
+
+ // if ctrl+clicked
+ if ((event->modifiers() == Qt::ControlModifier)
+ && (event->button() == Qt::LeftButton)) {
+
+ BufferCoord p;
+ if (PointToCharLine(event->pos(),p)) {
+ QString s = lines()->getString(p.Line - 1);
+ if (mParser->isIncludeLine(s)) {
+ QString filename = mParser->getHeaderFileName(mFilename,s);
+ Editor * e = pMainWindow->editorList()->getEditorByFilename(filename);
+ if (e) {
+ e->setCaretPositionAndActivate(1,1);
+ return;
+ }
+ }
+// else
+// MainForm.actGotoImplDeclEditorExecute(self);
+ }
+ }
+ SynEdit::mouseReleaseEvent(event);
+}
+
void Editor::copyToClipboard()
{
if (pSettings->editor().copySizeLimit()) {
@@ -1947,10 +2004,8 @@ QString Editor::getParserHint(const QString &s, int line)
mFilename,line);
} else if (statement->line>0) {
QFileInfo fileInfo(statement->fileName);
- result = mParser->prettyPrintStatement(statement,mFilename, line) + " - " +
- QString(" %1 (%2) ")
- .arg(fileInfo.fileName())
- .arg(statement->line)
+ result = mParser->prettyPrintStatement(statement,mFilename, line) + " - "
+ + QString("%1(%2)").arg(fileInfo.fileName()).arg(line)
+ tr("Ctrl+click for more info");
} else { // hard defines
result = mParser->prettyPrintStatement(statement, mFilename);
@@ -1999,10 +2054,9 @@ QString Editor::getHintForFunction(const PStatement &statement, const PStatement
continue;
if (!result.isEmpty())
result += "
";
- result = mParser->prettyPrintStatement(childStatement,filename,line) + " - " +
- QString(" %1 (%2) ")
- .arg(filename)
- .arg(childStatement->line)
+ QFileInfo fileInfo(filename);
+ result = mParser->prettyPrintStatement(childStatement,filename,line) + " - "
+ + QString("%1(%2)").arg(fileInfo.fileName()).arg(line)
+ tr("Ctrl+click for more info");
}
}
@@ -2505,6 +2559,9 @@ void Editor::updateCaption(const QString& newCaption) {
if (this->modified()) {
caption.append("[*]");
}
+ if (this->readOnly()) {
+ caption.append("["+tr("Readonly")+"]");
+ }
mParentPageControl->setTabText(index,caption);
} else {
mParentPageControl->setTabText(index,newCaption);
diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h
index 4dc18afc..aa03eeb0 100644
--- a/RedPandaIDE/editor.h
+++ b/RedPandaIDE/editor.h
@@ -243,6 +243,10 @@ protected:
// QObject interface
public:
bool event(QEvent *event) override;
+
+ // QWidget interface
+protected:
+ void mouseReleaseEvent(QMouseEvent *event) override;
};
#endif // EDITOR_H
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index 5523d83f..a29a200c 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -349,6 +349,16 @@ void Settings::Editor::setSyntaxCheckWhenLineChanged(bool syntaxCheckWhenLineCha
mSyntaxCheckWhenLineChanged = syntaxCheckWhenLineChanged;
}
+bool Settings::Editor::readOnlySytemHeader() const
+{
+ return mReadOnlySytemHeader;
+}
+
+void Settings::Editor::setReadOnlySytemHeader(bool newReadOnlySytemHeader)
+{
+ mReadOnlySytemHeader = newReadOnlySytemHeader;
+}
+
bool Settings::Editor::syntaxCheckWhenSave() const
{
return mSyntaxCheckWhenSave;
@@ -722,6 +732,7 @@ void Settings::Editor::setAutoHideScrollbar(bool autoHideScrollbar)
void Settings::Editor::doSave()
{
saveValue("default_encoding",mDefaultEncoding);
+ saveValue("readonly_system_header",mReadOnlySytemHeader);
// indents
saveValue("auto_indent", mAutoIndent);
saveValue("add_indent", mAddIndent);
@@ -798,6 +809,7 @@ void Settings::Editor::doSave()
void Settings::Editor::doLoad()
{
mDefaultEncoding = value("default_encoding", ENCODING_SYSTEM_DEFAULT).toByteArray();
+ mReadOnlySytemHeader = boolValue("readonly_system_header",true);
// indents
mAutoIndent = boolValue("auto_indent", true);
mAddIndent = boolValue("add_indent", true);
@@ -1996,7 +2008,6 @@ void Settings::CompilerSets::loadSets()
}
clearSets();
findSets();
- mDefaultIndex = mList.size()-1;
pCurrentSet = defaultSet();
if (!pCurrentSet) {
return;
@@ -2433,3 +2444,155 @@ void Settings::History::doLoad()
mOpenedFiles = stringListValue("opened_files");
mOpenedProjects =stringListValue("opened_projects");
}
+
+Settings::CodeCompletion::CodeCompletion(Settings *settings):_Base(settings, SETTING_CODE_COMPLETION)
+{
+
+}
+
+bool Settings::CodeCompletion::showCodeIns() const
+{
+ return mShowCodeIns;
+}
+
+void Settings::CodeCompletion::setShowCodeIns(bool newShowCodeIns)
+{
+ mShowCodeIns = newShowCodeIns;
+}
+
+bool Settings::CodeCompletion::appendFunc() const
+{
+ return mAppendFunc;
+}
+
+void Settings::CodeCompletion::setAppendFunc(bool newAppendFunc)
+{
+ mAppendFunc = newAppendFunc;
+}
+
+bool Settings::CodeCompletion::ignoreCase() const
+{
+ return mIgnoreCase;
+}
+
+void Settings::CodeCompletion::setIgnoreCase(bool newIgnoreCase)
+{
+ mIgnoreCase = newIgnoreCase;
+}
+
+bool Settings::CodeCompletion::showKeywords() const
+{
+ return mShowKeywords;
+}
+
+void Settings::CodeCompletion::setShowKeywords(bool newShowKeywords)
+{
+ mShowKeywords = newShowKeywords;
+}
+
+bool Settings::CodeCompletion::sortByScope() const
+{
+ return mSortByScope;
+}
+
+void Settings::CodeCompletion::setSortByScope(bool newSortByScope)
+{
+ mSortByScope = newSortByScope;
+}
+
+bool Settings::CodeCompletion::recordUsage() const
+{
+ return mRecordUsage;
+}
+
+void Settings::CodeCompletion::setRecordUsage(bool newRecordUsage)
+{
+ mRecordUsage = newRecordUsage;
+}
+
+bool Settings::CodeCompletion::showCompletionWhileInput() const
+{
+ return mShowCompletionWhileInput;
+}
+
+void Settings::CodeCompletion::setShowCompletionWhileInput(bool newShowCompletionWhileInput)
+{
+ mShowCompletionWhileInput = newShowCompletionWhileInput;
+}
+
+bool Settings::CodeCompletion::parseGlobalHeaders() const
+{
+ return mParseGlobalHeaders;
+}
+
+void Settings::CodeCompletion::setParseGlobalHeaders(bool newParseGlobalHeaders)
+{
+ mParseGlobalHeaders = newParseGlobalHeaders;
+}
+
+bool Settings::CodeCompletion::parseLocalHeaders() const
+{
+ return mParseLocalHeaders;
+}
+
+void Settings::CodeCompletion::setParseLocalHeaders(bool newParseLocalHeaders)
+{
+ mParseLocalHeaders = newParseLocalHeaders;
+}
+
+bool Settings::CodeCompletion::enabled() const
+{
+ return mEnabled;
+}
+
+void Settings::CodeCompletion::setEnabled(bool newEnabled)
+{
+ mEnabled = newEnabled;
+}
+
+int Settings::CodeCompletion::height() const
+{
+ return mHeight;
+}
+
+void Settings::CodeCompletion::setHeight(int newHeight)
+{
+ mHeight = newHeight;
+}
+
+int Settings::CodeCompletion::width() const
+{
+ return mWidth;
+}
+
+void Settings::CodeCompletion::setWidth(int newWidth)
+{
+ mWidth = newWidth;
+}
+
+void Settings::CodeCompletion::doSave()
+{
+ //Appearence
+ saveValue("width",mWidth);
+ saveValue("height",mHeight);
+ saveValue("enabled",mEnabled);
+ saveValue("parse_local_headers",mParseLocalHeaders);
+ saveValue("parse_global_headers",mParseGlobalHeaders);
+ saveValue("show_completion_while_input",mShowCompletionWhileInput);
+ saveValue("record_usage",mRecordUsage);
+ saveValue("sort_by_scope",mSortByScope);
+ saveValue("show_keywords",mShowKeywords);
+ saveValue("ignore_case",mIgnoreCase);
+ saveValue("append_func",mAppendFunc);
+ saveValue("show_code_ins",mShowCodeIns);
+}
+
+
+void Settings::CodeCompletion::doLoad()
+{
+ //Appearence
+ mTheme = stringValue("theme","dark");
+ mInterfaceFont = stringValue("interface font","Segoe UI");
+ mInterfaceFontSize = intValue("interface font size",10);
+ mLanguage = stringValue("language", QLocale::system().name());
+}
diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h
index a2bd3dde..e1aec861 100644
--- a/RedPandaIDE/settings.h
+++ b/RedPandaIDE/settings.h
@@ -17,7 +17,8 @@
#define SETTING_ENVIRONMENT "Environment"
#define SETTING_EXECUTOR "Executor"
#define SETTING_DEBUGGER "Debugger"
-#define SETTING_HISTORY "HISTORY"
+#define SETTING_HISTORY "History"
+#define SETTING_CODE_COMPLETION "CodeCompletion"
#define SETTING_COMPILTER_SETS "CompilerSets"
#define SETTING_COMPILTER_SETS_DEFAULT_INDEX "defaultIndex"
#define SETTING_COMPILTER_SETS_COUNT "count"
@@ -261,9 +262,13 @@ public:
bool syntaxCheckWhenLineChanged() const;
void setSyntaxCheckWhenLineChanged(bool syntaxCheckWhenLineChanged);
+ bool readOnlySytemHeader() const;
+ void setReadOnlySytemHeader(bool newReadOnlySytemHeader);
+
private:
QByteArray mDefaultEncoding;
//General
+ bool mReadOnlySytemHeader;
// indents
bool mAutoIndent;
bool mAddIndent;
@@ -371,6 +376,66 @@ public:
void doLoad() override;
};
+ class CodeCompletion: public _Base {
+ public:
+ explicit CodeCompletion(Settings *settings);
+ int width() const;
+ void setWidth(int newWidth);
+
+ int height() const;
+ void setHeight(int newHeight);
+
+ bool enabled() const;
+ void setEnabled(bool newEnabled);
+
+ bool parseLocalHeaders() const;
+ void setParseLocalHeaders(bool newParseLocalHeaders);
+
+ bool parseGlobalHeaders() const;
+ void setParseGlobalHeaders(bool newParseGlobalHeaders);
+
+ bool showCompletionWhileInput() const;
+ void setShowCompletionWhileInput(bool newShowCompletionWhileInput);
+
+ bool recordUsage() const;
+ void setRecordUsage(bool newRecordUsage);
+
+ bool sortByScope() const;
+ void setSortByScope(bool newSortByScope);
+
+ bool showKeywords() const;
+ void setShowKeywords(bool newShowKeywords);
+
+ bool ignoreCase() const;
+ void setIgnoreCase(bool newIgnoreCase);
+
+ bool appendFunc() const;
+ void setAppendFunc(bool newAppendFunc);
+
+ bool showCodeIns() const;
+ void setShowCodeIns(bool newShowCodeIns);
+
+ private:
+ int mWidth;
+ int mHeight;
+ bool mEnabled;
+ bool mParseLocalHeaders;
+ bool mParseGlobalHeaders;
+ bool mShowCompletionWhileInput;
+ bool mRecordUsage;
+ bool mSortByScope;
+ bool mShowKeywords;
+ bool mIgnoreCase;
+ bool mAppendFunc;
+ bool mShowCodeIns;
+
+ // _Base interface
+ protected:
+ void doSave() override;
+ void doLoad() override;
+
+ };
+
class History: public _Base {
public:
explicit History(Settings *settings);
diff --git a/RedPandaIDE/settingsdialog/debuggeneralwidget.ui b/RedPandaIDE/settingsdialog/debuggeneralwidget.ui
index 5c31b062..5256f55f 100644
--- a/RedPandaIDE/settingsdialog/debuggeneralwidget.ui
+++ b/RedPandaIDE/settingsdialog/debuggeneralwidget.ui
@@ -138,27 +138,6 @@
- -
-
-
- Disassembly Coding Style
-
-
-
- 11
-
-
- 11
-
-
- 11
-
-
- 11
-
-
-
-
-
diff --git a/RedPandaIDE/settingsdialog/editorsymbolcompletionwidget.ui b/RedPandaIDE/settingsdialog/editorsymbolcompletionwidget.ui
index 1cc8a99a..1ab2862c 100644
--- a/RedPandaIDE/settingsdialog/editorsymbolcompletionwidget.ui
+++ b/RedPandaIDE/settingsdialog/editorsymbolcompletionwidget.ui
@@ -14,6 +14,19 @@
Form
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
-
@@ -138,19 +151,6 @@
-
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
Remove symbol pairs when delete chars