Merge branch 'master' of github.com:royqh1979/RedPanda-CPP
This commit is contained in:
commit
42029028fc
|
@ -29,6 +29,7 @@ SOURCES += \
|
|||
qsynedit/SearchBase.cpp \
|
||||
qsynedit/SearchRegex.cpp \
|
||||
settingsdialog/debuggeneralwidget.cpp \
|
||||
settingsdialog/editorautosavewidget.cpp \
|
||||
settingsdialog/editorcodecompletionwidget.cpp \
|
||||
settingsdialog/editormiscwidget.cpp \
|
||||
widgets/classbrowser.cpp \
|
||||
|
@ -97,6 +98,7 @@ HEADERS += \
|
|||
qsynedit/SearchBase.h \
|
||||
qsynedit/SearchRegex.h \
|
||||
settingsdialog/debuggeneralwidget.h \
|
||||
settingsdialog/editorautosavewidget.h \
|
||||
settingsdialog/editorcodecompletionwidget.h \
|
||||
settingsdialog/editormiscwidget.h \
|
||||
widgets/classbrowser.h \
|
||||
|
@ -151,6 +153,7 @@ HEADERS += \
|
|||
|
||||
FORMS += \
|
||||
settingsdialog/debuggeneralwidget.ui \
|
||||
settingsdialog/editorautosavewidget.ui \
|
||||
settingsdialog/editorcodecompletionwidget.ui \
|
||||
settingsdialog/editormiscwidget.ui \
|
||||
widgets/cpudialog.ui \
|
||||
|
|
Binary file not shown.
|
@ -532,59 +532,140 @@ Are you really want to continue?</source>
|
|||
<translation type="vanished">失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="170"/>
|
||||
<location filename="editor.cpp" line="182"/>
|
||||
<location filename="editor.cpp" line="210"/>
|
||||
<location filename="editor.cpp" line="767"/>
|
||||
<location filename="editor.cpp" line="772"/>
|
||||
<location filename="editor.cpp" line="790"/>
|
||||
<location filename="editor.cpp" line="795"/>
|
||||
<location filename="editor.cpp" line="180"/>
|
||||
<location filename="editor.cpp" line="192"/>
|
||||
<location filename="editor.cpp" line="224"/>
|
||||
<location filename="editor.cpp" line="792"/>
|
||||
<location filename="editor.cpp" line="797"/>
|
||||
<location filename="editor.cpp" line="815"/>
|
||||
<location filename="editor.cpp" line="820"/>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="171"/>
|
||||
<location filename="editor.cpp" line="181"/>
|
||||
<source>File %1 is not writable!</source>
|
||||
<translation>无法写入文件"%1"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="198"/>
|
||||
<location filename="editor.cpp" line="212"/>
|
||||
<source>Save As</source>
|
||||
<translation>另存为</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="768"/>
|
||||
<location filename="editor.cpp" line="793"/>
|
||||
<source>The text to be copied exceeds count limit!</source>
|
||||
<translation>要复制的内容超过了行数限制!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="773"/>
|
||||
<location filename="editor.cpp" line="798"/>
|
||||
<source>The text to be copied exceeds character limit!</source>
|
||||
<translation>要复制的内容超过了字符数限制!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="791"/>
|
||||
<location filename="editor.cpp" line="816"/>
|
||||
<source>The text to be cut exceeds count limit!</source>
|
||||
<translation>要剪切的内容超过了行数限制!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="796"/>
|
||||
<location filename="editor.cpp" line="821"/>
|
||||
<source>The text to be cut exceeds character limit!</source>
|
||||
<translation>要剪切的内容超过了字符数限制!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="1965"/>
|
||||
<location filename="editor.cpp" line="2002"/>
|
||||
<location filename="editor.cpp" line="2053"/>
|
||||
<location filename="editor.cpp" line="1990"/>
|
||||
<location filename="editor.cpp" line="2027"/>
|
||||
<location filename="editor.cpp" line="2078"/>
|
||||
<source>Ctrl+click for more info</source>
|
||||
<translation>Ctrl+单击以获取更多信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="2556"/>
|
||||
<location filename="editor.cpp" line="2096"/>
|
||||
<location filename="editor.cpp" line="2126"/>
|
||||
<source>Symbol '%1' not found!</source>
|
||||
<translation>未找到符号'%1'!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="editor.cpp" line="2636"/>
|
||||
<source>Readonly</source>
|
||||
<translation>只读</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditorAutoSaveWidget</name>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="14"/>
|
||||
<source>Form</source>
|
||||
<translation>表单</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="20"/>
|
||||
<source>Enable auto save</source>
|
||||
<translation>启用自动保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="44"/>
|
||||
<source>Time interval:</source>
|
||||
<translation>时间间隔</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="51"/>
|
||||
<source>minutes</source>
|
||||
<translation>分钟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="80"/>
|
||||
<source>Objects to save</source>
|
||||
<translation>保存对象</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="86"/>
|
||||
<source>Current File</source>
|
||||
<translation>当前文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="93"/>
|
||||
<source>All files openned</source>
|
||||
<translation>所有打开的文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="100"/>
|
||||
<source>Project files</source>
|
||||
<translation>项目文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="110"/>
|
||||
<source>Save strategy</source>
|
||||
<translation>保存策略</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="116"/>
|
||||
<source>Overwrite</source>
|
||||
<translation>自动覆盖</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="123"/>
|
||||
<source>Append UNIX timestamp</source>
|
||||
<translation>添加Unix时间戳</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="130"/>
|
||||
<source>Append formatted timestamp</source>
|
||||
<translation>添加格式化世时间戳</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.ui" line="140"/>
|
||||
<source>Demo file name:</source>
|
||||
<translation>示例文件名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorautosavewidget.cpp" line="22"/>
|
||||
<location filename="settingsdialog/editorautosavewidget.cpp" line="24"/>
|
||||
<location filename="settingsdialog/editorautosavewidget.cpp" line="28"/>
|
||||
<source>Demo file name: </source>
|
||||
<translation>示例文件名</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditorClipboardWidget</name>
|
||||
<message>
|
||||
|
@ -1256,7 +1337,7 @@ Are you really want to continue?</source>
|
|||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="267"/>
|
||||
<location filename="mainwindow.cpp" line="1100"/>
|
||||
<location filename="mainwindow.cpp" line="1178"/>
|
||||
<source>Issues</source>
|
||||
<translation>编译器</translation>
|
||||
</message>
|
||||
|
@ -1449,8 +1530,8 @@ Are you really want to continue?</source>
|
|||
<message>
|
||||
<location filename="mainwindow.ui" line="994"/>
|
||||
<location filename="mainwindow.ui" line="997"/>
|
||||
<location filename="mainwindow.cpp" line="776"/>
|
||||
<location filename="mainwindow.cpp" line="787"/>
|
||||
<location filename="mainwindow.cpp" line="790"/>
|
||||
<location filename="mainwindow.cpp" line="801"/>
|
||||
<source>Compile</source>
|
||||
<translation>编译</translation>
|
||||
</message>
|
||||
|
@ -1742,20 +1823,20 @@ Are you really want to continue?</source>
|
|||
<translation>文件历史</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="311"/>
|
||||
<location filename="mainwindow.cpp" line="313"/>
|
||||
<location filename="mainwindow.cpp" line="315"/>
|
||||
<location filename="mainwindow.cpp" line="317"/>
|
||||
<source>Debugging</source>
|
||||
<translation>正在调试</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="316"/>
|
||||
<location filename="mainwindow.cpp" line="318"/>
|
||||
<location filename="mainwindow.cpp" line="320"/>
|
||||
<location filename="mainwindow.cpp" line="322"/>
|
||||
<source>Running</source>
|
||||
<translation>正在运行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="321"/>
|
||||
<location filename="mainwindow.cpp" line="323"/>
|
||||
<location filename="mainwindow.cpp" line="325"/>
|
||||
<location filename="mainwindow.cpp" line="327"/>
|
||||
<source>Compiling</source>
|
||||
<translation>正在编译</translation>
|
||||
</message>
|
||||
|
@ -1764,145 +1845,150 @@ Are you really want to continue?</source>
|
|||
<translation type="vanished">行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="439"/>
|
||||
<location filename="mainwindow.cpp" line="453"/>
|
||||
<source>Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5</source>
|
||||
<translation>行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="457"/>
|
||||
<location filename="mainwindow.cpp" line="471"/>
|
||||
<source>Read Only</source>
|
||||
<translation>只读</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="459"/>
|
||||
<location filename="mainwindow.cpp" line="473"/>
|
||||
<source>Insert</source>
|
||||
<translation>插入</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="461"/>
|
||||
<location filename="mainwindow.cpp" line="475"/>
|
||||
<source>Overwrite</source>
|
||||
<translation>覆写</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="586"/>
|
||||
<location filename="mainwindow.cpp" line="601"/>
|
||||
<location filename="mainwindow.cpp" line="600"/>
|
||||
<location filename="mainwindow.cpp" line="615"/>
|
||||
<source>Confirm</source>
|
||||
<translation>确认</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="587"/>
|
||||
<location filename="mainwindow.cpp" line="595"/>
|
||||
<location filename="mainwindow.cpp" line="777"/>
|
||||
<location filename="mainwindow.cpp" line="601"/>
|
||||
<location filename="mainwindow.cpp" line="609"/>
|
||||
<location filename="mainwindow.cpp" line="791"/>
|
||||
<source>Source file is not compiled.</source>
|
||||
<translation>源文件尚未编译。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="588"/>
|
||||
<location filename="mainwindow.cpp" line="777"/>
|
||||
<location filename="mainwindow.cpp" line="602"/>
|
||||
<location filename="mainwindow.cpp" line="791"/>
|
||||
<source>Compile now?</source>
|
||||
<translation>现在编译?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="602"/>
|
||||
<location filename="mainwindow.cpp" line="788"/>
|
||||
<location filename="mainwindow.cpp" line="616"/>
|
||||
<location filename="mainwindow.cpp" line="802"/>
|
||||
<source>Source file is more recent than executable.</source>
|
||||
<translation>源文件比可执行程序新。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="603"/>
|
||||
<location filename="mainwindow.cpp" line="617"/>
|
||||
<source>Recompile now?</source>
|
||||
<translation>重新编译?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="655"/>
|
||||
<location filename="mainwindow.cpp" line="669"/>
|
||||
<source>No compiler set</source>
|
||||
<translation>无编译器设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="656"/>
|
||||
<location filename="mainwindow.cpp" line="670"/>
|
||||
<source>No compiler set is configured.</source>
|
||||
<translation>没有配置编译器设置。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="656"/>
|
||||
<location filename="mainwindow.cpp" line="670"/>
|
||||
<source>Can't start debugging.</source>
|
||||
<translation>无法启动调试器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="745"/>
|
||||
<location filename="mainwindow.cpp" line="759"/>
|
||||
<source>Enable debugging</source>
|
||||
<translation>启用调试参数</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="746"/>
|
||||
<location filename="mainwindow.cpp" line="760"/>
|
||||
<source>You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now?</source>
|
||||
<translation>当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="788"/>
|
||||
<location filename="mainwindow.cpp" line="802"/>
|
||||
<source>Recompile?</source>
|
||||
<translation>重新编译?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="994"/>
|
||||
<location filename="mainwindow.cpp" line="1013"/>
|
||||
<location filename="mainwindow.cpp" line="1035"/>
|
||||
<location filename="mainwindow.cpp" line="1047"/>
|
||||
<location filename="mainwindow.cpp" line="1343"/>
|
||||
<location filename="mainwindow.cpp" line="1355"/>
|
||||
<location filename="mainwindow.cpp" line="1021"/>
|
||||
<source>%1 files autosaved</source>
|
||||
<translation>已自动保存%1个文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1067"/>
|
||||
<location filename="mainwindow.cpp" line="1091"/>
|
||||
<location filename="mainwindow.cpp" line="1113"/>
|
||||
<location filename="mainwindow.cpp" line="1125"/>
|
||||
<location filename="mainwindow.cpp" line="1421"/>
|
||||
<location filename="mainwindow.cpp" line="1433"/>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1009"/>
|
||||
<location filename="mainwindow.cpp" line="1087"/>
|
||||
<source>Open</source>
|
||||
<translation>打开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1191"/>
|
||||
<location filename="mainwindow.cpp" line="1269"/>
|
||||
<source>Compile Failed</source>
|
||||
<translation>编译失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1196"/>
|
||||
<location filename="mainwindow.cpp" line="1274"/>
|
||||
<source>Run Failed</source>
|
||||
<translation>运行失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1372"/>
|
||||
<location filename="mainwindow.cpp" line="1386"/>
|
||||
<location filename="mainwindow.cpp" line="1450"/>
|
||||
<location filename="mainwindow.cpp" line="1464"/>
|
||||
<source>Confirm Convertion</source>
|
||||
<translation>确认转换</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1373"/>
|
||||
<location filename="mainwindow.cpp" line="1387"/>
|
||||
<location filename="mainwindow.cpp" line="1451"/>
|
||||
<location filename="mainwindow.cpp" line="1465"/>
|
||||
<source>The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue?</source>
|
||||
<translation>当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1562"/>
|
||||
<location filename="mainwindow.cpp" line="1640"/>
|
||||
<source>New Watch Expression</source>
|
||||
<translation>新监视表达式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1563"/>
|
||||
<location filename="mainwindow.cpp" line="1641"/>
|
||||
<source>Enter Watch Expression (it is recommended to use 'this->' for class members):</source>
|
||||
<translation>输入监视表达式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1609"/>
|
||||
<location filename="mainwindow.cpp" line="1687"/>
|
||||
<source>Parsing file %1 of %2: "%3"</source>
|
||||
<translation>(%1/%2)正在解析文件"%3"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1631"/>
|
||||
<location filename="mainwindow.cpp" line="1637"/>
|
||||
<location filename="mainwindow.cpp" line="1709"/>
|
||||
<location filename="mainwindow.cpp" line="1715"/>
|
||||
<source>Done parsing %1 files in %2 seconds</source>
|
||||
<translation>完成1%个文件的解析,用时%2秒</translation>
|
||||
<translation>完成%1个文件的解析,用时%2秒</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="1634"/>
|
||||
<location filename="mainwindow.cpp" line="1712"/>
|
||||
<source>(%1 files per second)</source>
|
||||
<translation>(每秒%1个文件)</translation>
|
||||
</message>
|
||||
|
@ -1974,216 +2060,216 @@ Are you really want to continue?</source>
|
|||
<translation>无法写入配置文件夹"%1"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1113"/>
|
||||
<location filename="settings.cpp" line="1132"/>
|
||||
<location filename="settings.cpp" line="1144"/>
|
||||
<location filename="settings.cpp" line="1156"/>
|
||||
<location filename="settings.cpp" line="1197"/>
|
||||
<location filename="settings.cpp" line="1216"/>
|
||||
<location filename="settings.cpp" line="1228"/>
|
||||
<location filename="settings.cpp" line="1240"/>
|
||||
<source>The following %1 directories don't exist:</source>
|
||||
<translation>下列%1文件夹不存在:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1114"/>
|
||||
<location filename="settings.cpp" line="1124"/>
|
||||
<location filename="settings.cpp" line="1198"/>
|
||||
<location filename="settings.cpp" line="1208"/>
|
||||
<source>binary</source>
|
||||
<translation>二进制</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1123"/>
|
||||
<location filename="settings.cpp" line="1207"/>
|
||||
<source>No %1 directories have been specified.</source>
|
||||
<translation>未指定%1文件夹</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1133"/>
|
||||
<location filename="settings.cpp" line="1217"/>
|
||||
<source>C include</source>
|
||||
<translation>C包含</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1145"/>
|
||||
<location filename="settings.cpp" line="1157"/>
|
||||
<location filename="settings.cpp" line="1229"/>
|
||||
<location filename="settings.cpp" line="1241"/>
|
||||
<source>C++ include</source>
|
||||
<translation>C++包含</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1176"/>
|
||||
<location filename="settings.cpp" line="1181"/>
|
||||
<location filename="settings.cpp" line="1186"/>
|
||||
<location filename="settings.cpp" line="1191"/>
|
||||
<location filename="settings.cpp" line="1260"/>
|
||||
<location filename="settings.cpp" line="1265"/>
|
||||
<location filename="settings.cpp" line="1270"/>
|
||||
<location filename="settings.cpp" line="1275"/>
|
||||
<source>Cannot find the %1 "%2"</source>
|
||||
<translation>无法找到%1程序"%2"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1662"/>
|
||||
<location filename="settings.cpp" line="1746"/>
|
||||
<source>C options</source>
|
||||
<translation>C语言选项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1663"/>
|
||||
<location filename="settings.cpp" line="1747"/>
|
||||
<source>Support all ANSI standard C programs (-ansi)</source>
|
||||
<translation>支持所有ANSI标准C程序(-ansi)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1664"/>
|
||||
<location filename="settings.cpp" line="1748"/>
|
||||
<source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source>
|
||||
<translation>不支持将asm、inline和typeof作为关键字(-fno-asm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1665"/>
|
||||
<location filename="settings.cpp" line="1749"/>
|
||||
<source>Imitate traditional C preprocessors (-traditional-cpp)</source>
|
||||
<translation>模仿传统C预处理器行为(-traditional-cpp)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1668"/>
|
||||
<location filename="settings.cpp" line="1752"/>
|
||||
<source>Code Generation</source>
|
||||
<translation>代码生成</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1697"/>
|
||||
<location filename="settings.cpp" line="1781"/>
|
||||
<source>Optimize for the following machine (-march)</source>
|
||||
<translation>生成特定机器的专用指令(-march)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1698"/>
|
||||
<location filename="settings.cpp" line="1782"/>
|
||||
<source>Optimize less, while maintaining full compatibility (-tune)</source>
|
||||
<translation>完整兼容特定机器,较少优化(-tune)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1718"/>
|
||||
<location filename="settings.cpp" line="1802"/>
|
||||
<source>Enable use of specific instructions (-mx)</source>
|
||||
<translation>启用特定指令集(-mx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1729"/>
|
||||
<location filename="settings.cpp" line="1813"/>
|
||||
<source>Optimization level (-Ox)</source>
|
||||
<translation>优化级别(-Ox)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1736"/>
|
||||
<location filename="settings.cpp" line="1820"/>
|
||||
<source>Compile with the following pointer size (-mx)</source>
|
||||
<translation>使用下列指针大小编译(-mx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1759"/>
|
||||
<location filename="settings.cpp" line="1843"/>
|
||||
<source>Language standard (-std)</source>
|
||||
<translation>语言标准(-std)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1760"/>
|
||||
<location filename="settings.cpp" line="1844"/>
|
||||
<source>Generate debugging information (-g3)</source>
|
||||
<translation>生成调试信息(-g3)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1761"/>
|
||||
<location filename="settings.cpp" line="1845"/>
|
||||
<source>Generate profiling info for analysis (-pg)</source>
|
||||
<translation>生成性能分析信息(-pg)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1764"/>
|
||||
<location filename="settings.cpp" line="1848"/>
|
||||
<source>Warnings</source>
|
||||
<translation>代码警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1765"/>
|
||||
<location filename="settings.cpp" line="1849"/>
|
||||
<source>Inhibit all warning messages (-w)</source>
|
||||
<translation>忽略所有警告信息(-w)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1766"/>
|
||||
<location filename="settings.cpp" line="1850"/>
|
||||
<source>Show most warnings (-Wall)</source>
|
||||
<translation>启用常见问题警告(-Wall)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1767"/>
|
||||
<location filename="settings.cpp" line="1851"/>
|
||||
<source>Show some more warnings (-Wextra)</source>
|
||||
<translation>启用更多问题警告(-Wextra)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1768"/>
|
||||
<location filename="settings.cpp" line="1852"/>
|
||||
<source>Check ISO C/C++/C++0x conformance (-pedantic)</source>
|
||||
<translation>检查ISO C/C++/C++0x语法一致性(-pedantic)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1769"/>
|
||||
<location filename="settings.cpp" line="1853"/>
|
||||
<source>Only check the code for syntax errors (-fsyntax-only)</source>
|
||||
<translation>只进行语法检查(不编译)(-fsyntax-only)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1770"/>
|
||||
<location filename="settings.cpp" line="1854"/>
|
||||
<source>Make all warnings into errors (-Werror)</source>
|
||||
<translation>将警告作为错误处理(-Werror)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1771"/>
|
||||
<location filename="settings.cpp" line="1855"/>
|
||||
<source>Abort compilation on first error (-Wfatal-errors)</source>
|
||||
<translation>遇到第一个错误后立即中止编译(-Wfatal-errors)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1774"/>
|
||||
<location filename="settings.cpp" line="1858"/>
|
||||
<source>Linker</source>
|
||||
<translation>链接器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1775"/>
|
||||
<location filename="settings.cpp" line="1859"/>
|
||||
<source>Link an Objective C program (-lobjc)</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1776"/>
|
||||
<location filename="settings.cpp" line="1860"/>
|
||||
<source>Do not use standard system libraries (-nostdlib)</source>
|
||||
<translation>不使用标准库和系统启动文件(-nostdlib)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1777"/>
|
||||
<location filename="settings.cpp" line="1861"/>
|
||||
<source>Do not create a console window (-mwindows)</source>
|
||||
<translation>不产生控制台窗口(-mwindows)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1778"/>
|
||||
<location filename="settings.cpp" line="1862"/>
|
||||
<source>Strip executable (-s)</source>
|
||||
<translation>剥除附加信息(-s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1779"/>
|
||||
<location filename="settings.cpp" line="1863"/>
|
||||
<source>Link libraries statically (-static)</source>
|
||||
<translation>链接Ojbective C程序(-lobjc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1782"/>
|
||||
<location filename="settings.cpp" line="1866"/>
|
||||
<source>Output</source>
|
||||
<translation>输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1783"/>
|
||||
<location filename="settings.cpp" line="1867"/>
|
||||
<source>Put comments in generated assembly code (-fverbose-asm)</source>
|
||||
<translation>在生成的汇编代码中加入注释(-fverbose-asm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1784"/>
|
||||
<location filename="settings.cpp" line="1868"/>
|
||||
<source>Use pipes instead of temporary files during compilation (-pipe)</source>
|
||||
<translation>编译时使用管道而不是临时文件(-pipe)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1785"/>
|
||||
<location filename="settings.cpp" line="1869"/>
|
||||
<source>Do not assemble, compile and generate the assemble code (-S)</source>
|
||||
<translation>只生成汇编代码(-S)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1978"/>
|
||||
<location filename="settings.cpp" line="2003"/>
|
||||
<location filename="settings.cpp" line="2062"/>
|
||||
<location filename="settings.cpp" line="2087"/>
|
||||
<source>Confirm</source>
|
||||
<translation>确认</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1979"/>
|
||||
<location filename="settings.cpp" line="2063"/>
|
||||
<source>The following problems were found during validation of compiler set "%1":</source>
|
||||
<translation>在验证编译器设置"%1"时遇到了下列问题:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="2004"/>
|
||||
<location filename="settings.cpp" line="2088"/>
|
||||
<source>Compiler set not configuared.</source>
|
||||
<translation>未配置编译器设置。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="2006"/>
|
||||
<location filename="settings.cpp" line="2090"/>
|
||||
<source>Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? </source>
|
||||
<translation>您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2</translation>
|
||||
</message>
|
||||
|
@ -2836,90 +2922,102 @@ Are you really want to continue?</source>
|
|||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="31"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="33"/>
|
||||
<source>Appearence</source>
|
||||
<translation>外观</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="31"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="33"/>
|
||||
<source>Environment</source>
|
||||
<translation>环境</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="35"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="37"/>
|
||||
<source>Compiler Set</source>
|
||||
<translation>编译器配置集</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="35"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="37"/>
|
||||
<source>Compiler</source>
|
||||
<translation>编译器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="39"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="68"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="72"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="41"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="78"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="82"/>
|
||||
<source>General</source>
|
||||
<translation>通用</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="39"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="43"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="47"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="51"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="55"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="59"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="63"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="41"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="45"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="49"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="53"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="57"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="61"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="65"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="69"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="73"/>
|
||||
<source>Editor</source>
|
||||
<translation>编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="43"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="45"/>
|
||||
<source>Font</source>
|
||||
<translation>字体</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="47"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="49"/>
|
||||
<source>Copy & Export</source>
|
||||
<translation>复制/导出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="51"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="53"/>
|
||||
<source>Color</source>
|
||||
<translation>配色</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="55"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="57"/>
|
||||
<source>Code Completion</source>
|
||||
<translation>代码补全</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="59"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="61"/>
|
||||
<source>Symbol Completion</source>
|
||||
<translation>符号补全</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="63"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="65"/>
|
||||
<source>Auto Syntax Checking</source>
|
||||
<translation>自动语法检查</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="68"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="69"/>
|
||||
<source>Auto save</source>
|
||||
<translation>自动保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="73"/>
|
||||
<source>Misc</source>
|
||||
<translation>杂项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="78"/>
|
||||
<source>Program Runner</source>
|
||||
<translation>程序运行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="72"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="82"/>
|
||||
<source>Debugger</source>
|
||||
<translation>调试器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="164"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="174"/>
|
||||
<source>Save Changes</source>
|
||||
<translation>保存修改</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="165"/>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="175"/>
|
||||
<source>There are changes in the settings, do you want to save them before swtich to other page?</source>
|
||||
<translation>本页中有尚未保存的设置修改,是否保存后再切换到其他页?</translation>
|
||||
</message>
|
||||
|
|
|
@ -161,16 +161,6 @@ void Editor::saveFile(const QString &filename) {
|
|||
pMainWindow->updateForEncodingInfo();
|
||||
if (pSettings->editor().syntaxCheck() && pSettings->editor().syntaxCheckWhenSave())
|
||||
pMainWindow->checkSyntaxInBack(this);
|
||||
switch(getFileType(mFilename)) {
|
||||
case FileType::CppSource:
|
||||
mUseCppSyntax = true;
|
||||
break;
|
||||
case FileType::CSource:
|
||||
mUseCppSyntax = false;
|
||||
break;
|
||||
default:
|
||||
mUseCppSyntax = pSettings->editor().defaultFileCpp();
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::convertToEncoding(const QByteArray &encoding)
|
||||
|
@ -235,6 +225,16 @@ bool Editor::saveAs(){
|
|||
exception.reason());
|
||||
return false;
|
||||
}
|
||||
switch(getFileType(mFilename)) {
|
||||
case FileType::CppSource:
|
||||
mUseCppSyntax = true;
|
||||
break;
|
||||
case FileType::CSource:
|
||||
mUseCppSyntax = false;
|
||||
break;
|
||||
default:
|
||||
mUseCppSyntax = pSettings->editor().defaultFileCpp();
|
||||
}
|
||||
|
||||
//todo: update (reassign highlighter)
|
||||
//todo: remove old file from parser and reparse file
|
||||
|
@ -2093,7 +2093,7 @@ void Editor::gotoDeclaration(const BufferCoord &pos)
|
|||
mFilename,phrase,pos.Line);
|
||||
|
||||
if (!statement) {
|
||||
pMainWindow->updateStatusBarMessage(tr("Symbol '%1' not found!").arg(phrase));
|
||||
pMainWindow->updateStatusbarMessage(tr("Symbol '%1' not found!").arg(phrase));
|
||||
return;
|
||||
}
|
||||
QString filename;
|
||||
|
@ -2123,7 +2123,7 @@ void Editor::gotoDefinition(const BufferCoord &pos)
|
|||
mFilename,phrase,pos.Line);
|
||||
|
||||
if (!statement) {
|
||||
pMainWindow->updateStatusBarMessage(tr("Symbol '%1' not found!").arg(phrase));
|
||||
pMainWindow->updateStatusbarMessage(tr("Symbol '%1' not found!").arg(phrase));
|
||||
return;
|
||||
}
|
||||
QString filename;
|
||||
|
|
|
@ -126,6 +126,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
mHeaderCompletionPopup = std::make_shared<HeaderCompletionPopup>();
|
||||
|
||||
updateAppTitle();
|
||||
|
||||
connect(&mAutoSaveTimer, &QTimer::timeout,
|
||||
this, &MainWindow::onAutoSaveTimeout);
|
||||
resetAutoSaveTimer();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -426,6 +430,16 @@ void MainWindow::updateClassBrowserForEditor(Editor *editor)
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::resetAutoSaveTimer()
|
||||
{
|
||||
if (pSettings->editor().enableAutoSave()) {
|
||||
//minute to milliseconds
|
||||
mAutoSaveTimer.start(pSettings->editor().autoSaveInterval()*60*1000);
|
||||
} else {
|
||||
mAutoSaveTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
QPlainTextEdit *MainWindow::txtLocals()
|
||||
{
|
||||
return ui->txtLocals;
|
||||
|
@ -466,7 +480,7 @@ void MainWindow::updateForStatusbarModeInfo()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateStatusBarMessage(const QString &s)
|
||||
void MainWindow::updateStatusbarMessage(const QString &s)
|
||||
{
|
||||
ui->statusbar->showMessage(s);
|
||||
}
|
||||
|
@ -948,6 +962,65 @@ void MainWindow::prepareDebugger()
|
|||
// mDebugger->deleteWatchVars(false);
|
||||
}
|
||||
|
||||
void MainWindow::doAutoSave(Editor *e)
|
||||
{
|
||||
if (!e)
|
||||
return;
|
||||
if (!e->modified())
|
||||
return;
|
||||
QString filename = e->filename();
|
||||
QFileInfo fileInfo(filename);
|
||||
QDir parent = fileInfo.absoluteDir();
|
||||
QString baseName = fileInfo.completeBaseName();
|
||||
QString suffix = fileInfo.suffix();
|
||||
switch(pSettings->editor().autoSaveStrategy()) {
|
||||
case assOverwrite:
|
||||
break;
|
||||
case assAppendUnixTimestamp:
|
||||
filename = parent.filePath(
|
||||
QString("%1.%2.%3")
|
||||
.arg(baseName)
|
||||
.arg(QDateTime::currentSecsSinceEpoch())
|
||||
.arg(suffix));
|
||||
break;
|
||||
case assAppendFormatedTimeStamp: {
|
||||
QDateTime time = QDateTime::currentDateTime();
|
||||
filename = parent.filePath(
|
||||
QString("%1.%2.%3")
|
||||
.arg(baseName)
|
||||
.arg(time.toString("yyyy.MM.dd.hh.mm.ss"))
|
||||
.arg(suffix));
|
||||
}
|
||||
}
|
||||
e->saveFile(filename);
|
||||
}
|
||||
|
||||
void MainWindow::onAutoSaveTimeout()
|
||||
{
|
||||
if (!pSettings->editor().enableAutoSave())
|
||||
return;
|
||||
int updateCount = 0;
|
||||
switch (pSettings->editor().autoSaveTarget()) {
|
||||
case astCurrentFile: {
|
||||
Editor *e = mEditorList->getEditor();
|
||||
doAutoSave(e);
|
||||
updateCount++;
|
||||
}
|
||||
break;
|
||||
case astAllOpennedFiles:
|
||||
for (int i=0;i<mEditorList->pageCount();i++) {
|
||||
Editor *e = (*mEditorList)[i];
|
||||
doAutoSave(e);
|
||||
updateCount++;
|
||||
}
|
||||
break;
|
||||
case astAllProjectFiles:
|
||||
//todo: auto save project files
|
||||
break;
|
||||
}
|
||||
updateStatusbarMessage(tr("%1 files autosaved").arg(updateCount));
|
||||
}
|
||||
|
||||
const std::shared_ptr<HeaderCompletionPopup> &MainWindow::headerCompletionPopup() const
|
||||
{
|
||||
return mHeaderCompletionPopup;
|
||||
|
@ -1611,7 +1684,7 @@ void MainWindow::onParserProgress(const QString &fileName, int total, int curren
|
|||
|
||||
// Only show if needed (it's a very slow operation)
|
||||
if (current ==1 || current % showStep==0) {
|
||||
updateStatusBarMessage(tr("Parsing file %1 of %2: \"%3\"")
|
||||
updateStatusbarMessage(tr("Parsing file %1 of %2: \"%3\"")
|
||||
.arg(current).arg(total).arg(fileName));
|
||||
}
|
||||
}
|
||||
|
@ -1633,13 +1706,13 @@ void MainWindow::onEndParsing(int total, int)
|
|||
} else {
|
||||
parsingFrequency = 999;
|
||||
}
|
||||
updateStatusBarMessage(tr("Done parsing %1 files in %2 seconds")
|
||||
updateStatusbarMessage(tr("Done parsing %1 files in %2 seconds")
|
||||
.arg(total).arg(parseTime)
|
||||
+ " "
|
||||
+ tr("(%1 files per second)")
|
||||
.arg(parsingFrequency));
|
||||
} else {
|
||||
updateStatusBarMessage(tr("Done parsing %1 files in %2 seconds")
|
||||
updateStatusbarMessage(tr("Done parsing %1 files in %2 seconds")
|
||||
.arg(total).arg(parseTime));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
#include "common.h"
|
||||
#include "widgets/searchresultview.h"
|
||||
#include "widgets/classbrowser.h"
|
||||
|
@ -52,7 +53,7 @@ public:
|
|||
void updateForEncodingInfo();
|
||||
void updateStatusbarForLineCol();
|
||||
void updateForStatusbarModeInfo();
|
||||
void updateStatusBarMessage(const QString& s);
|
||||
void updateStatusbarMessage(const QString& s);
|
||||
void updateEditorSettings();
|
||||
void updateEditorActions();
|
||||
void updateCompileActions();
|
||||
|
@ -79,6 +80,8 @@ public:
|
|||
|
||||
void updateClassBrowserForEditor(Editor* editor);
|
||||
|
||||
void resetAutoSaveTimer();
|
||||
|
||||
QPlainTextEdit* txtLocals();
|
||||
|
||||
CPUDialog *cpuDialog() const;
|
||||
|
@ -91,16 +94,39 @@ public:
|
|||
|
||||
SearchResultModel* searchResultModel();
|
||||
|
||||
|
||||
|
||||
const std::shared_ptr<CodeCompletionPopup> &completionPopup() const;
|
||||
|
||||
const std::shared_ptr<HeaderCompletionPopup> &headerCompletionPopup() const;
|
||||
public slots:
|
||||
void onCompileLog(const QString& msg);
|
||||
void onCompileIssue(PCompileIssue issue);
|
||||
void onCompileFinished();
|
||||
void onCompileErrorOccured(const QString& reason);
|
||||
void onRunErrorOccured(const QString& reason);
|
||||
void onRunFinished();
|
||||
void cleanUpCPUDialog();
|
||||
void onDebugCommandInput(const QString& command);
|
||||
void onDebugEvaluateInput();
|
||||
void onParserProgress(const QString& fileName, int total, int current);
|
||||
void onStartParsing();
|
||||
void onEndParsing(int total, int updateView);
|
||||
void onEvalValueReady(const QString& value);
|
||||
|
||||
protected:
|
||||
void openFiles(const QStringList& files);
|
||||
void openFile(const QString& filename);
|
||||
|
||||
private:
|
||||
CompileTarget getCompileTarget();
|
||||
bool debugInferiorhasBreakpoint();
|
||||
void setupActions();
|
||||
void openCloseMessageSheet(bool open);
|
||||
void prepareDebugger();
|
||||
void doAutoSave(Editor *e);
|
||||
|
||||
private slots:
|
||||
void onAutoSaveTimeout();
|
||||
|
||||
void on_actionNew_triggered();
|
||||
|
||||
void on_EditorTabsLeft_tabCloseRequested(int index);
|
||||
|
@ -168,9 +194,6 @@ private slots:
|
|||
|
||||
void on_actionDebug_triggered();
|
||||
|
||||
CompileTarget getCompileTarget();
|
||||
bool debugInferiorhasBreakpoint();
|
||||
|
||||
void on_actionStep_Over_triggered();
|
||||
|
||||
void on_actionStep_Into_triggered();
|
||||
|
@ -200,27 +223,6 @@ private slots:
|
|||
void on_cbSearchHistory_currentIndexChanged(int index);
|
||||
|
||||
void on_btnSearchAgin_clicked();
|
||||
|
||||
public slots:
|
||||
void onCompileLog(const QString& msg);
|
||||
void onCompileIssue(PCompileIssue issue);
|
||||
void onCompileFinished();
|
||||
void onCompileErrorOccured(const QString& reason);
|
||||
void onRunErrorOccured(const QString& reason);
|
||||
void onRunFinished();
|
||||
void cleanUpCPUDialog();
|
||||
void onDebugCommandInput(const QString& command);
|
||||
void onDebugEvaluateInput();
|
||||
void onParserProgress(const QString& fileName, int total, int current);
|
||||
void onStartParsing();
|
||||
void onEndParsing(int total, int updateView);
|
||||
void onEvalValueReady(const QString& value);
|
||||
|
||||
private:
|
||||
void setupActions();
|
||||
void openCloseMessageSheet(bool open);
|
||||
void prepareDebugger();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
EditorList *mEditorList;
|
||||
|
@ -254,6 +256,8 @@ private:
|
|||
int mPreviousHeight;
|
||||
PCompileSuccessionTask mCompileSuccessionTask;
|
||||
|
||||
QTimer mAutoSaveTimer;
|
||||
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
|
|
|
@ -376,6 +376,46 @@ void Settings::Editor::setDefaultFileCpp(bool newDefaultFileCpp)
|
|||
mDefaultFileCpp = newDefaultFileCpp;
|
||||
}
|
||||
|
||||
bool Settings::Editor::enableAutoSave() const
|
||||
{
|
||||
return mEnableAutoSave;
|
||||
}
|
||||
|
||||
void Settings::Editor::setEnableAutoSave(bool newEnableAutoSave)
|
||||
{
|
||||
mEnableAutoSave = newEnableAutoSave;
|
||||
}
|
||||
|
||||
int Settings::Editor::autoSaveInterval() const
|
||||
{
|
||||
return mAutoSaveInterval;
|
||||
}
|
||||
|
||||
void Settings::Editor::setAutoSaveInterval(int newInterval)
|
||||
{
|
||||
mAutoSaveInterval = newInterval;
|
||||
}
|
||||
|
||||
AutoSaveStrategy Settings::Editor::autoSaveStrategy() const
|
||||
{
|
||||
return mAutoSaveStrategy;
|
||||
}
|
||||
|
||||
void Settings::Editor::setAutoSaveStrategy(AutoSaveStrategy newAutoSaveStrategy)
|
||||
{
|
||||
mAutoSaveStrategy = newAutoSaveStrategy;
|
||||
}
|
||||
|
||||
AutoSaveTarget Settings::Editor::autoSaveTarget() const
|
||||
{
|
||||
return mAutoSaveTarget;
|
||||
}
|
||||
|
||||
void Settings::Editor::setAutoSaveTarget(AutoSaveTarget newAutoSaveTarget)
|
||||
{
|
||||
mAutoSaveTarget = newAutoSaveTarget;
|
||||
}
|
||||
|
||||
bool Settings::Editor::autoLoadLastFiles() const
|
||||
{
|
||||
return mAutoLoadLastFiles;
|
||||
|
@ -831,6 +871,12 @@ void Settings::Editor::doSave()
|
|||
saveValue("check_syntax_when_save",mSyntaxCheckWhenSave);
|
||||
saveValue("check_syntax_when_line_changed",mSyntaxCheckWhenLineChanged);
|
||||
|
||||
//auto save
|
||||
saveValue("enable_auto_save",mEnableAutoSave);
|
||||
saveValue("auto_save_interal",mAutoSaveInterval);
|
||||
saveValue("auto_save_target",mAutoSaveTarget);
|
||||
saveValue("auto_save_strategy",mAutoSaveStrategy);
|
||||
|
||||
//misc
|
||||
saveValue("default_encoding",mDefaultEncoding);
|
||||
saveValue("readonly_system_header",mReadOnlySytemHeader);
|
||||
|
@ -915,6 +961,14 @@ void Settings::Editor::doLoad()
|
|||
mSyntaxCheckWhenSave = boolValue("check_syntax_when_save",true);
|
||||
mSyntaxCheckWhenLineChanged = boolValue("check_syntax_when_line_changed",true);
|
||||
|
||||
//auto save
|
||||
mEnableAutoSave = boolValue("enable_auto_save",false);
|
||||
mAutoSaveInterval = intValue("auto_save_interal",10);
|
||||
mAutoSaveTarget = static_cast<enum AutoSaveTarget>(
|
||||
intValue("auto_save_target",AutoSaveTarget::astCurrentFile));
|
||||
mAutoSaveStrategy = static_cast<enum AutoSaveStrategy>(
|
||||
intValue("auto_save_strategy",AutoSaveStrategy::assOverwrite));
|
||||
|
||||
//misc
|
||||
mDefaultEncoding = value("default_encoding", ENCODING_SYSTEM_DEFAULT).toByteArray();
|
||||
mReadOnlySytemHeader = boolValue("readonly_system_header",true);
|
||||
|
@ -1602,7 +1656,7 @@ void Settings::CompilerSet::setDefines() {
|
|||
arguments.append("-std=c++17");
|
||||
arguments.append(NULL_FILE);
|
||||
QFileInfo ccompiler(mCCompiler);
|
||||
QByteArray output = getCompilerOutput(ccompiler.absolutePath(),ccompiler.baseName(),arguments);
|
||||
QByteArray output = getCompilerOutput(ccompiler.absolutePath(),ccompiler.fileName(),arguments);
|
||||
// 'cpp.exe -dM -E -x c++ -std=c++17 NUL'
|
||||
|
||||
mDefines.clear();
|
||||
|
|
|
@ -271,6 +271,18 @@ public:
|
|||
bool defaultFileCpp() const;
|
||||
void setDefaultFileCpp(bool newDefaultFileCpp);
|
||||
|
||||
bool enableAutoSave() const;
|
||||
void setEnableAutoSave(bool newEnableAutoSave);
|
||||
|
||||
int autoSaveInterval() const;
|
||||
void setAutoSaveInterval(int newInterval);
|
||||
|
||||
AutoSaveTarget autoSaveTarget() const;
|
||||
void setAutoSaveTarget(AutoSaveTarget newAutoSaveTarget);
|
||||
|
||||
AutoSaveStrategy autoSaveStrategy() const;
|
||||
void setAutoSaveStrategy(AutoSaveStrategy newAutoSaveStrategy);
|
||||
|
||||
private:
|
||||
//General
|
||||
// indents
|
||||
|
@ -346,6 +358,12 @@ public:
|
|||
bool mSyntaxCheckWhenSave;
|
||||
bool mSyntaxCheckWhenLineChanged;
|
||||
|
||||
//auto save
|
||||
bool mEnableAutoSave;
|
||||
int mAutoSaveInterval;
|
||||
enum AutoSaveTarget mAutoSaveTarget;
|
||||
enum AutoSaveStrategy mAutoSaveStrategy;
|
||||
|
||||
//Misc
|
||||
QByteArray mDefaultEncoding;
|
||||
bool mReadOnlySytemHeader;
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
#include "editorautosavewidget.h"
|
||||
#include "ui_editorautosavewidget.h"
|
||||
#include "../settings.h"
|
||||
#include "../mainwindow.h"
|
||||
|
||||
EditorAutoSaveWidget::EditorAutoSaveWidget(const QString& name, const QString& group,
|
||||
QWidget *parent) :
|
||||
SettingsWidget(name,group,parent),
|
||||
ui(new Ui::EditorAutoSaveWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
EditorAutoSaveWidget::~EditorAutoSaveWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EditorAutoSaveWidget::onAutoSaveStrategyChanged()
|
||||
{
|
||||
if (ui->rbOverwrite->isChecked()) {
|
||||
ui->lblFilename->setText(tr("Demo file name: ") + "main.cpp");
|
||||
} else if (ui->rbAppendUNIXTimestamp->isChecked()) {
|
||||
ui->lblFilename->setText(tr("Demo file name: ") +
|
||||
QString("main.%1.cpp").arg(QDateTime::currentSecsSinceEpoch()));
|
||||
} else if (ui->rbAppendFormattedTimestamp->isChecked()) {
|
||||
QDateTime time = QDateTime::currentDateTime();
|
||||
ui->lblFilename->setText(tr("Demo file name: ") +
|
||||
QString("main.%1.cpp").arg(time.toString("yyyy.MM.dd.hh.mm.ss")));
|
||||
}
|
||||
}
|
||||
|
||||
void EditorAutoSaveWidget::doLoad()
|
||||
{
|
||||
//pSettings->editor().load();
|
||||
//font
|
||||
ui->chkEnableAutoSave->setChecked(pSettings->editor().enableAutoSave());
|
||||
ui->spinInterval->setValue(pSettings->editor().autoSaveInterval());
|
||||
switch(pSettings->editor().autoSaveTarget()) {
|
||||
case astCurrentFile:
|
||||
ui->rbCurrentFile->setChecked(true);
|
||||
break;
|
||||
case astAllOpennedFiles:
|
||||
ui->rbAllOpennedFiles->setChecked(true);
|
||||
default:
|
||||
ui->rbProjectFiles->setChecked(true);
|
||||
}
|
||||
switch(pSettings->editor().autoSaveStrategy()) {
|
||||
case assOverwrite:
|
||||
ui->rbOverwrite->setChecked(true);
|
||||
break;
|
||||
case assAppendUnixTimestamp:
|
||||
ui->rbAppendUNIXTimestamp->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
ui->rbAppendFormattedTimestamp->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorAutoSaveWidget::doSave()
|
||||
{
|
||||
pSettings->editor().setEnableAutoSave(ui->chkEnableAutoSave->isChecked());
|
||||
pSettings->editor().setAutoSaveInterval(ui->spinInterval->value());
|
||||
if (ui->rbCurrentFile->isChecked())
|
||||
pSettings->editor().setAutoSaveTarget(astCurrentFile);
|
||||
else if (ui->rbAllOpennedFiles->isChecked())
|
||||
pSettings->editor().setAutoSaveTarget(astAllOpennedFiles);
|
||||
else
|
||||
pSettings->editor().setAutoSaveTarget(astAllProjectFiles);
|
||||
if (ui->rbOverwrite->isChecked())
|
||||
pSettings->editor().setAutoSaveStrategy(assOverwrite);
|
||||
else if (ui->rbAppendUNIXTimestamp->isChecked())
|
||||
pSettings->editor().setAutoSaveStrategy(assAppendUnixTimestamp);
|
||||
else
|
||||
pSettings->editor().setAutoSaveStrategy(assAppendFormatedTimeStamp);
|
||||
}
|
||||
|
||||
void EditorAutoSaveWidget::on_rbOverwrite_toggled(bool)
|
||||
{
|
||||
onAutoSaveStrategyChanged();
|
||||
}
|
||||
|
||||
|
||||
void EditorAutoSaveWidget::on_rbAppendUNIXTimestamp_toggled(bool)
|
||||
{
|
||||
onAutoSaveStrategyChanged();
|
||||
}
|
||||
|
||||
|
||||
void EditorAutoSaveWidget::on_rbAppendFormattedTimestamp_toggled(bool)
|
||||
{
|
||||
onAutoSaveStrategyChanged();
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef EDITORAUTOSAVEWIDGET_H
|
||||
#define EDITORAUTOSAVEWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "settingswidget.h"
|
||||
|
||||
namespace Ui {
|
||||
class EditorAutoSaveWidget;
|
||||
}
|
||||
|
||||
class EditorAutoSaveWidget : public SettingsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditorAutoSaveWidget(const QString& name, const QString& group, QWidget *parent = nullptr);
|
||||
~EditorAutoSaveWidget();
|
||||
|
||||
private:
|
||||
void onAutoSaveStrategyChanged();
|
||||
private:
|
||||
Ui::EditorAutoSaveWidget *ui;
|
||||
|
||||
// SettingsWidget interface
|
||||
protected:
|
||||
void doLoad() override;
|
||||
void doSave() override;
|
||||
private slots:
|
||||
void on_rbOverwrite_toggled(bool checked);
|
||||
void on_rbAppendUNIXTimestamp_toggled(bool checked);
|
||||
void on_rbAppendFormattedTimestamp_toggled(bool checked);
|
||||
};
|
||||
|
||||
#endif // EDITORAUTOSAVEWIDGET_H
|
|
@ -0,0 +1,164 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EditorAutoSaveWidget</class>
|
||||
<widget class="QWidget" name="EditorAutoSaveWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>469</width>
|
||||
<height>459</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="chkEnableAutoSave">
|
||||
<property name="title">
|
||||
<string>Enable auto save</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Time interval:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinInterval">
|
||||
<property name="suffix">
|
||||
<string>minutes</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>60</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Objects to save</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbCurrentFile">
|
||||
<property name="text">
|
||||
<string>Current File</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbAllOpennedFiles">
|
||||
<property name="text">
|
||||
<string>All files openned</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbProjectFiles">
|
||||
<property name="text">
|
||||
<string>Project files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Save strategy</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbOverwrite">
|
||||
<property name="text">
|
||||
<string>Overwrite</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbAppendUNIXTimestamp">
|
||||
<property name="text">
|
||||
<string>Append UNIX timestamp</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="rbAppendFormattedTimestamp">
|
||||
<property name="text">
|
||||
<string>Append formatted timestamp</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblFilename">
|
||||
<property name="text">
|
||||
<string>Demo file name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -9,6 +9,7 @@
|
|||
#include "editorcodecompletionwidget.h"
|
||||
#include "editorsyntaxcheckwidget.h"
|
||||
#include "editorsymbolcompletionwidget.h"
|
||||
#include "editorautosavewidget.h"
|
||||
#include "editormiscwidget.h"
|
||||
#include "environmentappearencewidget.h"
|
||||
#include "executorgeneralwidget.h"
|
||||
|
@ -65,6 +66,10 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
|
|||
pEditorSyntaxCheckWidget->init();
|
||||
addWidget(pEditorSyntaxCheckWidget);
|
||||
|
||||
pEditorAutoSaveWidget = new EditorAutoSaveWidget(tr("Auto save"),tr("Editor"));
|
||||
pEditorAutoSaveWidget->init();
|
||||
addWidget(pEditorAutoSaveWidget);
|
||||
|
||||
pEditorMiscWidget = new EditorMiscWidget(tr("Misc"),tr("Editor"));
|
||||
pEditorMiscWidget->init();
|
||||
addWidget(pEditorMiscWidget);
|
||||
|
|
|
@ -18,6 +18,7 @@ class EditorSymbolCompletionWidget;
|
|||
class EditorColorSchemeWidget;
|
||||
class EditorSyntaxCheckWidget;
|
||||
class EditorCodeCompletionWidget;
|
||||
class EditorAutoSaveWidget;
|
||||
class EditorMiscWidget;
|
||||
class EnvironmentAppearenceWidget;
|
||||
class ExecutorGeneralWidget;
|
||||
|
@ -60,6 +61,7 @@ private:
|
|||
EditorSymbolCompletionWidget *pEditorSymbolCompletionWidget;
|
||||
EditorCodeCompletionWidget *pEditorCodeCompletionWidget;
|
||||
EditorSyntaxCheckWidget *pEditorSyntaxCheckWidget;
|
||||
EditorAutoSaveWidget *pEditorAutoSaveWidget;
|
||||
EditorMiscWidget *pEditorMiscWidget;
|
||||
ExecutorGeneralWidget *pExecutorGeneralWidget;
|
||||
DebugGeneralWidget *pDebugGeneralWidget;
|
||||
|
|
|
@ -40,6 +40,18 @@ enum class SearchFileScope {
|
|||
openedFiles
|
||||
};
|
||||
|
||||
enum AutoSaveTarget {
|
||||
astCurrentFile,
|
||||
astAllOpennedFiles,
|
||||
astAllProjectFiles
|
||||
};
|
||||
|
||||
enum AutoSaveStrategy {
|
||||
assOverwrite,
|
||||
assAppendUnixTimestamp,
|
||||
assAppendFormatedTimeStamp
|
||||
};
|
||||
|
||||
class BaseError{
|
||||
public:
|
||||
explicit BaseError(const QString& reason);
|
||||
|
|
Loading…
Reference in New Issue