- enhancement: save/load default projects folder

- enhancement: add editor general options "highlight current word" and "highlight matching braces"
This commit is contained in:
royqh1979 2021-11-18 21:25:28 +08:00
parent 177cd6e397
commit 1c9bb49799
19 changed files with 341 additions and 191 deletions

View File

@ -3,6 +3,8 @@ Version 0.9.1 For Dev-C++ 7 Beta
- fix: ide failed to start, if there are errors in the compiler set settings - fix: ide failed to start, if there are errors in the compiler set settings
- fix: numpad's enter key doesn't work - fix: numpad's enter key doesn't work
- enhancement: code completion suggestion for phrase after long/short/signed/unsigned - enhancement: code completion suggestion for phrase after long/short/signed/unsigned
- enhancement: save/load default projects folder
- enhancement: add editor general options "highlight current word" and "highlight matching braces"
Version 0.9.0 For Dev-C++ 7 Beta Version 0.9.0 For Dev-C++ 7 Beta
- fix: control keys in the numpad doesn't work in the editor - fix: control keys in the numpad doesn't work in the editor

Binary file not shown.

View File

@ -1031,10 +1031,10 @@ Are you really want to continue?</source>
<message> <message>
<location filename="editor.cpp" line="245"/> <location filename="editor.cpp" line="245"/>
<location filename="editor.cpp" line="322"/> <location filename="editor.cpp" line="322"/>
<location filename="editor.cpp" line="1165"/> <location filename="editor.cpp" line="1176"/>
<location filename="editor.cpp" line="1170"/> <location filename="editor.cpp" line="1181"/>
<location filename="editor.cpp" line="1188"/> <location filename="editor.cpp" line="1199"/>
<location filename="editor.cpp" line="1193"/> <location filename="editor.cpp" line="1204"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1048,55 +1048,55 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1166"/> <location filename="editor.cpp" line="1177"/>
<source>The text to be copied exceeds count limit!</source> <source>The text to be copied exceeds count limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1171"/> <location filename="editor.cpp" line="1182"/>
<source>The text to be copied exceeds character limit!</source> <source>The text to be copied exceeds character limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1189"/> <location filename="editor.cpp" line="1200"/>
<source>The text to be cut exceeds count limit!</source> <source>The text to be cut exceeds count limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="1194"/> <location filename="editor.cpp" line="1205"/>
<source>The text to be cut exceeds character limit!</source> <source>The text to be cut exceeds character limit!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="2180"/> <location filename="editor.cpp" line="2194"/>
<source>Print Document</source> <source>Print Document</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="2726"/> <location filename="editor.cpp" line="2739"/>
<location filename="editor.cpp" line="2763"/> <location filename="editor.cpp" line="2776"/>
<location filename="editor.cpp" line="2814"/> <location filename="editor.cpp" line="2827"/>
<source>Ctrl+click for more info</source> <source>Ctrl+click for more info</source>
<translation>Ctrl+</translation> <translation>Ctrl+</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3201"/> <location filename="editor.cpp" line="3214"/>
<location filename="editor.cpp" line="3231"/> <location filename="editor.cpp" line="3244"/>
<source>Symbol &apos;%1&apos; not found!</source> <source>Symbol &apos;%1&apos; not found!</source>
<translation>&apos;%1&apos;!</translation> <translation>&apos;%1&apos;!</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3651"/> <location filename="editor.cpp" line="3664"/>
<source>Break point condition</source> <source>Break point condition</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3652"/> <location filename="editor.cpp" line="3665"/>
<source>Enter the condition of the breakpoint:</source> <source>Enter the condition of the breakpoint:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="3856"/> <location filename="editor.cpp" line="3869"/>
<source>Readonly</source> <source>Readonly</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2861,7 +2861,7 @@ Are you really want to continue?</source>
<location filename="mainwindow.cpp" line="3524"/> <location filename="mainwindow.cpp" line="3524"/>
<location filename="mainwindow.cpp" line="3528"/> <location filename="mainwindow.cpp" line="3528"/>
<location filename="mainwindow.cpp" line="3531"/> <location filename="mainwindow.cpp" line="3531"/>
<location filename="mainwindow.cpp" line="5119"/> <location filename="mainwindow.cpp" line="5123"/>
<source>Issues</source> <source>Issues</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3072,8 +3072,6 @@ Are you really want to continue?</source>
<location filename="mainwindow.ui" line="1748"/> <location filename="mainwindow.ui" line="1748"/>
<location filename="mainwindow.cpp" line="1356"/> <location filename="mainwindow.cpp" line="1356"/>
<location filename="mainwindow.cpp" line="1367"/> <location filename="mainwindow.cpp" line="1367"/>
<location filename="mainwindow.cpp" line="3146"/>
<location filename="mainwindow.cpp" line="3157"/>
<source>Compile</source> <source>Compile</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3269,7 +3267,7 @@ Are you really want to continue?</source>
<message> <message>
<location filename="mainwindow.ui" line="323"/> <location filename="mainwindow.ui" line="323"/>
<location filename="mainwindow.ui" line="326"/> <location filename="mainwindow.ui" line="326"/>
<location filename="mainwindow.cpp" line="5438"/> <location filename="mainwindow.cpp" line="5442"/>
<source>New Problem Set</source> <source>New Problem Set</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3288,14 +3286,14 @@ Are you really want to continue?</source>
<message> <message>
<location filename="mainwindow.ui" line="365"/> <location filename="mainwindow.ui" line="365"/>
<location filename="mainwindow.ui" line="368"/> <location filename="mainwindow.ui" line="368"/>
<location filename="mainwindow.cpp" line="5481"/> <location filename="mainwindow.cpp" line="5485"/>
<source>Save Problem Set</source> <source>Save Problem Set</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="379"/> <location filename="mainwindow.ui" line="379"/>
<location filename="mainwindow.ui" line="382"/> <location filename="mainwindow.ui" line="382"/>
<location filename="mainwindow.cpp" line="5501"/> <location filename="mainwindow.cpp" line="5505"/>
<source>Load Problem Set</source> <source>Load Problem Set</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3731,7 +3729,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="2390"/> <location filename="mainwindow.ui" line="2390"/>
<location filename="mainwindow.cpp" line="5076"/> <location filename="mainwindow.cpp" line="5080"/>
<source>Rename Symbol</source> <source>Rename Symbol</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3752,13 +3750,13 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="2410"/> <location filename="mainwindow.ui" line="2410"/>
<location filename="mainwindow.cpp" line="5256"/> <location filename="mainwindow.cpp" line="5260"/>
<source>Export As RTF</source> <source>Export As RTF</source>
<translation>RTF</translation> <translation>RTF</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="2415"/> <location filename="mainwindow.ui" line="2415"/>
<location filename="mainwindow.cpp" line="5278"/> <location filename="mainwindow.cpp" line="5282"/>
<source>Export As HTML</source> <source>Export As HTML</source>
<translation>HTML</translation> <translation>HTML</translation>
</message> </message>
@ -3824,7 +3822,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="2477"/> <location filename="mainwindow.ui" line="2477"/>
<location filename="mainwindow.cpp" line="5417"/> <location filename="mainwindow.cpp" line="5421"/>
<source>Open Folder</source> <source>Open Folder</source>
<translation></translation> <translation></translation>
</message> </message>
@ -4055,7 +4053,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="222"/> <location filename="mainwindow.cpp" line="222"/>
<location filename="mainwindow.cpp" line="5447"/> <location filename="mainwindow.cpp" line="5451"/>
<source>Problem Set %1</source> <source>Problem Set %1</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
@ -4122,15 +4120,15 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1894"/> <location filename="mainwindow.cpp" line="1894"/>
<location filename="mainwindow.cpp" line="5336"/> <location filename="mainwindow.cpp" line="5340"/>
<location filename="mainwindow.cpp" line="5376"/> <location filename="mainwindow.cpp" line="5380"/>
<source>Bookmark Description</source> <source>Bookmark Description</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1895"/> <location filename="mainwindow.cpp" line="1895"/>
<location filename="mainwindow.cpp" line="5337"/> <location filename="mainwindow.cpp" line="5341"/>
<location filename="mainwindow.cpp" line="5377"/> <location filename="mainwindow.cpp" line="5381"/>
<source>Description:</source> <source>Description:</source>
<translation></translation> <translation></translation>
</message> </message>
@ -4294,10 +4292,16 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3069"/> <location filename="mainwindow.cpp" line="3069"/>
<location filename="mainwindow.cpp" line="5441"/> <location filename="mainwindow.cpp" line="5445"/>
<source>Do you want to save it?</source> <source>Do you want to save it?</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="mainwindow.cpp" line="3146"/>
<location filename="mainwindow.cpp" line="3157"/>
<source>File Changed</source>
<translation></translation>
</message>
<message> <message>
<location filename="mainwindow.cpp" line="3216"/> <location filename="mainwindow.cpp" line="3216"/>
<source>New Project File?</source> <source>New Project File?</source>
@ -4312,7 +4316,7 @@ Are you really want to continue?</source>
<location filename="mainwindow.cpp" line="3293"/> <location filename="mainwindow.cpp" line="3293"/>
<location filename="mainwindow.cpp" line="3303"/> <location filename="mainwindow.cpp" line="3303"/>
<location filename="mainwindow.cpp" line="3315"/> <location filename="mainwindow.cpp" line="3315"/>
<location filename="mainwindow.cpp" line="5490"/> <location filename="mainwindow.cpp" line="5494"/>
<source>Save Error</source> <source>Save Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -4337,160 +4341,160 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4580"/> <location filename="mainwindow.cpp" line="4584"/>
<source>New project</source> <source>New project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4581"/> <location filename="mainwindow.cpp" line="4585"/>
<source>Close %1 and start new project?</source> <source>Close %1 and start new project?</source>
<translation>&apos;%1&apos;?</translation> <translation>&apos;%1&apos;?</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4593"/> <location filename="mainwindow.cpp" line="4598"/>
<source>Folder not exist</source> <source>Folder not exist</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4594"/> <location filename="mainwindow.cpp" line="4599"/>
<source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source> <source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4601"/> <location filename="mainwindow.cpp" line="4606"/>
<source>Can&apos;t create folder</source> <source>Can&apos;t create folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4602"/> <location filename="mainwindow.cpp" line="4607"/>
<source>Failed to create folder &apos;%1&apos;.</source> <source>Failed to create folder &apos;%1&apos;.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4617"/> <location filename="mainwindow.cpp" line="4622"/>
<source>Save new project as</source> <source>Save new project as</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4619"/> <location filename="mainwindow.cpp" line="4624"/>
<source>Red panda Dev-C++ project file (*.dev)</source> <source>Red panda Dev-C++ project file (*.dev)</source>
<translation>Dev-C++ (*.dev)</translation> <translation>Dev-C++ (*.dev)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4630"/> <location filename="mainwindow.cpp" line="4635"/>
<source>New project fail</source> <source>New project fail</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4631"/> <location filename="mainwindow.cpp" line="4636"/>
<source>Can&apos;t assign project template</source> <source>Can&apos;t assign project template</source>
<translation>使</translation> <translation>使</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4716"/> <location filename="mainwindow.cpp" line="4721"/>
<source>Remove file</source> <source>Remove file</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4717"/> <location filename="mainwindow.cpp" line="4722"/>
<source>Remove the file from disk?</source> <source>Remove the file from disk?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4944"/> <location filename="mainwindow.cpp" line="4948"/>
<source>untitled</source> <source>untitled</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4954"/> <location filename="mainwindow.cpp" line="4958"/>
<source>New Project File Name</source> <source>New Project File Name</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4955"/> <location filename="mainwindow.cpp" line="4959"/>
<source>File Name:</source> <source>File Name:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4961"/> <location filename="mainwindow.cpp" line="4965"/>
<source>File Already Exists!</source> <source>File Already Exists!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4962"/> <location filename="mainwindow.cpp" line="4966"/>
<source>File &apos;%1&apos; already exists!</source> <source>File &apos;%1&apos; already exists!</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4674"/> <location filename="mainwindow.cpp" line="4679"/>
<source>Add to project</source> <source>Add to project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5062"/> <location filename="mainwindow.cpp" line="5066"/>
<source>Rename Error</source> <source>Rename Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5063"/> <location filename="mainwindow.cpp" line="5067"/>
<source>Symbol &apos;%1&apos; is defined in system header.</source> <source>Symbol &apos;%1&apos; is defined in system header.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5077"/> <location filename="mainwindow.cpp" line="5081"/>
<source>New Name</source> <source>New Name</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5201"/> <location filename="mainwindow.cpp" line="5205"/>
<location filename="mainwindow.cpp" line="5211"/> <location filename="mainwindow.cpp" line="5215"/>
<source>Replace Error</source> <source>Replace Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5202"/> <location filename="mainwindow.cpp" line="5206"/>
<source>Can&apos;t open file &apos;%1&apos; for replace!</source> <source>Can&apos;t open file &apos;%1&apos; for replace!</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5212"/> <location filename="mainwindow.cpp" line="5216"/>
<source>Contents has changed since last search!</source> <source>Contents has changed since last search!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5258"/> <location filename="mainwindow.cpp" line="5262"/>
<source>Rich Text Format Files (*.rtf)</source> <source>Rich Text Format Files (*.rtf)</source>
<translation>RTF格式文件 (*.rtf)</translation> <translation>RTF格式文件 (*.rtf)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5280"/> <location filename="mainwindow.cpp" line="5284"/>
<source>HTML Files (*.html)</source> <source>HTML Files (*.html)</source>
<translation>HTML文件 (*.html)</translation> <translation>HTML文件 (*.html)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5439"/> <location filename="mainwindow.cpp" line="5443"/>
<source>The current problem set is not empty.</source> <source>The current problem set is not empty.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5457"/> <location filename="mainwindow.cpp" line="5461"/>
<source>Problem %1</source> <source>Problem %1</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5483"/> <location filename="mainwindow.cpp" line="5487"/>
<location filename="mainwindow.cpp" line="5503"/> <location filename="mainwindow.cpp" line="5507"/>
<source>Problem Set Files (*.pbs)</source> <source>Problem Set Files (*.pbs)</source>
<translation> (*.pbs)</translation> <translation> (*.pbs)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5509"/> <location filename="mainwindow.cpp" line="5513"/>
<source>Load Error</source> <source>Load Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2817"/> <location filename="mainwindow.cpp" line="2817"/>
<location filename="mainwindow.cpp" line="5523"/> <location filename="mainwindow.cpp" line="5527"/>
<source>Problem Case %1</source> <source>Problem Case %1</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
@ -4615,28 +4619,37 @@ Are you really want to continue?</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="widgets/newprojectdialog.ui" line="91"/> <location filename="widgets/newprojectdialog.ui" line="97"/>
<source>Name:</source> <source>Name:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="widgets/newprojectdialog.ui" line="98"/> <location filename="widgets/newprojectdialog.ui" line="116"/>
<source>Location:</source> <source>Create in</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="widgets/newprojectdialog.ui" line="108"/> <location filename="widgets/newprojectdialog.ui" line="123"/>
<source>Use as the default project location</source>
<translation></translation>
</message>
<message>
<source>Location:</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="widgets/newprojectdialog.ui" line="104"/>
<source>...</source> <source>...</source>
<translation>...</translation> <translation>...</translation>
</message> </message>
<message> <message>
<location filename="widgets/newprojectdialog.cpp" line="25"/> <location filename="widgets/newprojectdialog.cpp" line="26"/>
<source>Project%1</source> <source>Project%1</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="widgets/newprojectdialog.cpp" line="117"/> <location filename="widgets/newprojectdialog.cpp" line="123"/>
<location filename="widgets/newprojectdialog.cpp" line="138"/> <location filename="widgets/newprojectdialog.cpp" line="144"/>
<source>Default</source> <source>Default</source>
<translation></translation> <translation></translation>
</message> </message>
@ -5176,24 +5189,24 @@ Are you really want to continue?</source>
<context> <context>
<name>ProjectModel</name> <name>ProjectModel</name>
<message> <message>
<location filename="project.cpp" line="1921"/> <location filename="project.cpp" line="1924"/>
<source>File exists</source> <source>File exists</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="project.cpp" line="1922"/> <location filename="project.cpp" line="1925"/>
<source>File &apos;%1&apos; already exists. Delete it now?</source> <source>File &apos;%1&apos; already exists. Delete it now?</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="project.cpp" line="1940"/> <location filename="project.cpp" line="1943"/>
<location filename="project.cpp" line="1960"/> <location filename="project.cpp" line="1963"/>
<source>Remove failed</source> <source>Remove failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="project.cpp" line="1941"/> <location filename="project.cpp" line="1944"/>
<location filename="project.cpp" line="1961"/> <location filename="project.cpp" line="1964"/>
<source>Failed to remove file &apos;%1&apos;</source> <source>Failed to remove file &apos;%1&apos;</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
@ -5412,7 +5425,7 @@ Are you really want to continue?</source>
<context> <context>
<name>QApplication</name> <name>QApplication</name>
<message> <message>
<location filename="main.cpp" line="159"/> <location filename="main.cpp" line="164"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -5482,180 +5495,180 @@ Are you really want to continue?</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="main.cpp" line="122"/> <location filename="main.cpp" line="127"/>
<source>Can&apos;t load autolink settings</source> <source>Can&apos;t load autolink settings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1430"/> <location filename="settings.cpp" line="1467"/>
<location filename="settings.cpp" line="1449"/> <location filename="settings.cpp" line="1486"/>
<location filename="settings.cpp" line="1461"/> <location filename="settings.cpp" line="1498"/>
<location filename="settings.cpp" line="1473"/> <location filename="settings.cpp" line="1510"/>
<source>The following %1 directories don&apos;t exist:</source> <source>The following %1 directories don&apos;t exist:</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1431"/> <location filename="settings.cpp" line="1468"/>
<location filename="settings.cpp" line="1441"/> <location filename="settings.cpp" line="1478"/>
<source>binary</source> <source>binary</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1440"/> <location filename="settings.cpp" line="1477"/>
<source>No %1 directories have been specified.</source> <source>No %1 directories have been specified.</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1450"/> <location filename="settings.cpp" line="1487"/>
<source>C include</source> <source>C include</source>
<translation>C包含</translation> <translation>C包含</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1462"/> <location filename="settings.cpp" line="1499"/>
<location filename="settings.cpp" line="1474"/> <location filename="settings.cpp" line="1511"/>
<source>C++ include</source> <source>C++ include</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1493"/> <location filename="settings.cpp" line="1530"/>
<location filename="settings.cpp" line="1498"/> <location filename="settings.cpp" line="1535"/>
<location filename="settings.cpp" line="1503"/> <location filename="settings.cpp" line="1540"/>
<location filename="settings.cpp" line="1508"/> <location filename="settings.cpp" line="1545"/>
<source>Cannot find the %1 &quot;%2&quot;</source> <source>Cannot find the %1 &quot;%2&quot;</source>
<translation>%1&quot;%2&quot;</translation> <translation>%1&quot;%2&quot;</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2036"/> <location filename="settings.cpp" line="2073"/>
<source>C options</source> <source>C options</source>
<translation>C语言选项</translation> <translation>C语言选项</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2037"/> <location filename="settings.cpp" line="2074"/>
<source>Support all ANSI standard C programs (-ansi)</source> <source>Support all ANSI standard C programs (-ansi)</source>
<translation>ANSI标准C程序(-ansi)</translation> <translation>ANSI标准C程序(-ansi)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2038"/> <location filename="settings.cpp" line="2075"/>
<source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source> <source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source>
<translation>asminline和typeof作为关键字(-fno-asm)</translation> <translation>asminline和typeof作为关键字(-fno-asm)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2039"/> <location filename="settings.cpp" line="2076"/>
<source>Imitate traditional C preprocessors (-traditional-cpp)</source> <source>Imitate traditional C preprocessors (-traditional-cpp)</source>
<translation>仿C预处理器行为(-traditional-cpp)</translation> <translation>仿C预处理器行为(-traditional-cpp)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2042"/> <location filename="settings.cpp" line="2079"/>
<source>Code Generation</source> <source>Code Generation</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2071"/> <location filename="settings.cpp" line="2108"/>
<source>Optimize for the following machine (-march)</source> <source>Optimize for the following machine (-march)</source>
<translation>(-march)</translation> <translation>(-march)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2072"/> <location filename="settings.cpp" line="2109"/>
<source>Optimize less, while maintaining full compatibility (-tune)</source> <source>Optimize less, while maintaining full compatibility (-tune)</source>
<translation>(-tune)</translation> <translation>(-tune)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2092"/> <location filename="settings.cpp" line="2129"/>
<source>Enable use of specific instructions (-mx)</source> <source>Enable use of specific instructions (-mx)</source>
<translation>(-mx)</translation> <translation>(-mx)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2103"/> <location filename="settings.cpp" line="2140"/>
<source>Optimization level (-Ox)</source> <source>Optimization level (-Ox)</source>
<translation>(-Ox)</translation> <translation>(-Ox)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2110"/> <location filename="settings.cpp" line="2147"/>
<source>Compile with the following pointer size (-mx)</source> <source>Compile with the following pointer size (-mx)</source>
<translation>使(-mx)</translation> <translation>使(-mx)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2133"/> <location filename="settings.cpp" line="2170"/>
<source>Language standard (-std)</source> <source>Language standard (-std)</source>
<translation>(-std)</translation> <translation>(-std)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2146"/> <location filename="settings.cpp" line="2183"/>
<source>Profile</source> <source>Profile</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2155"/> <location filename="settings.cpp" line="2192"/>
<source>Generate debugging information (-g3)</source> <source>Generate debugging information (-g3)</source>
<translation>(-g3)</translation> <translation>(-g3)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2147"/> <location filename="settings.cpp" line="2184"/>
<source>Generate profiling info for analysis (-pg)</source> <source>Generate profiling info for analysis (-pg)</source>
<translation>(-pg)</translation> <translation>(-pg)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2136"/> <location filename="settings.cpp" line="2173"/>
<source>Warnings</source> <source>Warnings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2137"/> <location filename="settings.cpp" line="2174"/>
<source>Inhibit all warning messages (-w)</source> <source>Inhibit all warning messages (-w)</source>
<translation>(-w)</translation> <translation>(-w)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2138"/> <location filename="settings.cpp" line="2175"/>
<source>Show most warnings (-Wall)</source> <source>Show most warnings (-Wall)</source>
<translation>(-Wall)</translation> <translation>(-Wall)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2139"/> <location filename="settings.cpp" line="2176"/>
<source>Show some more warnings (-Wextra)</source> <source>Show some more warnings (-Wextra)</source>
<translation>(-Wextra)</translation> <translation>(-Wextra)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2140"/> <location filename="settings.cpp" line="2177"/>
<source>Check ISO C/C++/C++0x conformance (-pedantic)</source> <source>Check ISO C/C++/C++0x conformance (-pedantic)</source>
<translation>ISO C/C++/C++0x(-pedantic)</translation> <translation>ISO C/C++/C++0x(-pedantic)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2141"/> <location filename="settings.cpp" line="2178"/>
<source>Only check the code for syntax errors (-fsyntax-only)</source> <source>Only check the code for syntax errors (-fsyntax-only)</source>
<translation>(-fsyntax-only)</translation> <translation>(-fsyntax-only)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2142"/> <location filename="settings.cpp" line="2179"/>
<source>Make all warnings into errors (-Werror)</source> <source>Make all warnings into errors (-Werror)</source>
<translation>(-Werror)</translation> <translation>(-Werror)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2143"/> <location filename="settings.cpp" line="2180"/>
<source>Abort compilation on first error (-Wfatal-errors)</source> <source>Abort compilation on first error (-Wfatal-errors)</source>
<translation>(-Wfatal-errors)</translation> <translation>(-Wfatal-errors)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2150"/> <location filename="settings.cpp" line="2187"/>
<source>Linker</source> <source>Linker</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2151"/> <location filename="settings.cpp" line="2188"/>
<source>Link an Objective C program (-lobjc)</source> <source>Link an Objective C program (-lobjc)</source>
<translation>Objective-C程序 (-lobjc)</translation> <translation>Objective-C程序 (-lobjc)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2152"/> <location filename="settings.cpp" line="2189"/>
<source>Do not use standard system libraries (-nostdlib)</source> <source>Do not use standard system libraries (-nostdlib)</source>
<translation>使(-nostdlib)</translation> <translation>使(-nostdlib)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2153"/> <location filename="settings.cpp" line="2190"/>
<source>Do not create a console window (-mwindows)</source> <source>Do not create a console window (-mwindows)</source>
<translation>(-mwindows)</translation> <translation>(-mwindows)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2154"/> <location filename="settings.cpp" line="2191"/>
<source>Strip executable (-s)</source> <source>Strip executable (-s)</source>
<translation>(-s)</translation> <translation>(-s)</translation>
</message> </message>
@ -5664,53 +5677,53 @@ Are you really want to continue?</source>
<translation type="vanished">Ojbective C程序(-lobjc)</translation> <translation type="vanished">Ojbective C程序(-lobjc)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2158"/> <location filename="settings.cpp" line="2195"/>
<source>Output</source> <source>Output</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2159"/> <location filename="settings.cpp" line="2196"/>
<source>Put comments in generated assembly code (-fverbose-asm)</source> <source>Put comments in generated assembly code (-fverbose-asm)</source>
<translation>(-fverbose-asm)</translation> <translation>(-fverbose-asm)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2161"/> <location filename="settings.cpp" line="2198"/>
<source>Use pipes instead of temporary files during compilation (-pipe)</source> <source>Use pipes instead of temporary files during compilation (-pipe)</source>
<translation>使(-pipe)</translation> <translation>使(-pipe)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2160"/> <location filename="settings.cpp" line="2197"/>
<source>Do not assemble, compile and generate the assemble code (-S)</source> <source>Do not assemble, compile and generate the assemble code (-S)</source>
<translation>(-S)</translation> <translation>(-S)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2405"/> <location filename="settings.cpp" line="2450"/>
<location filename="settings.cpp" line="2432"/> <location filename="settings.cpp" line="2480"/>
<source>Confirm</source> <source>Confirm</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2406"/> <location filename="settings.cpp" line="2451"/>
<source>The following problems were found during validation of compiler set &quot;%1&quot;:</source> <source>The following problems were found during validation of compiler set &quot;%1&quot;:</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2410"/> <location filename="settings.cpp" line="2455"/>
<source>Would you like Red Panda C++ to remove them for you and add the default paths to the valid paths?</source> <source>Would you like Red Panda C++ to remove them for you and add the default paths to the valid paths?</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2412"/> <location filename="settings.cpp" line="2457"/>
<source>Leaving those directories will lead to problems during compilation.&lt;br /&gt;&lt;br /&gt;Unless you know exactly what you&apos;re doing, it is recommended that you click Yes.</source> <source>Leaving those directories will lead to problems during compilation.&lt;br /&gt;&lt;br /&gt;Unless you know exactly what you&apos;re doing, it is recommended that you click Yes.</source>
<translation>&lt;br /&gt;&lt;br /&gt;</translation> <translation>&lt;br /&gt;&lt;br /&gt;</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2433"/> <location filename="settings.cpp" line="2481"/>
<source>Compiler set not configuared.</source> <source>Compiler set not configuared.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="2435"/> <location filename="settings.cpp" line="2483"/>
<source>Would you like Red Panda C++ to search for compilers in the following locations: &lt;BR /&gt;&apos;%1&apos;&lt;BR /&gt;&apos;%2&apos;? </source> <source>Would you like Red Panda C++ to search for compilers in the following locations: &lt;BR /&gt;&apos;%1&apos;&lt;BR /&gt;&apos;%2&apos;? </source>
<translation>C++&lt;br /&gt;%1&lt;br /&gt;%2</translation> <translation>C++&lt;br /&gt;%1&lt;br /&gt;%2</translation>
</message> </message>
@ -6503,7 +6516,7 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5428"/> <location filename="mainwindow.cpp" line="5432"/>
<location filename="settingsdialog/settingsdialog.cpp" line="138"/> <location filename="settingsdialog/settingsdialog.cpp" line="138"/>
<location filename="settingsdialog/settingsdialog.cpp" line="182"/> <location filename="settingsdialog/settingsdialog.cpp" line="182"/>
<location filename="settingsdialog/settingsdialog.cpp" line="190"/> <location filename="settingsdialog/settingsdialog.cpp" line="190"/>
@ -6579,7 +6592,7 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="5429"/> <location filename="mainwindow.cpp" line="5433"/>
<location filename="settingsdialog/settingsdialog.cpp" line="182"/> <location filename="settingsdialog/settingsdialog.cpp" line="182"/>
<location filename="settingsdialog/settingsdialog.cpp" line="186"/> <location filename="settingsdialog/settingsdialog.cpp" line="186"/>
<source>Program Runner</source> <source>Program Runner</source>
@ -7087,51 +7100,66 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="234"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="234"/>
<source>Highlight</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="240"/>
<source>Highlight matching braces</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="247"/>
<source>Highlight current word</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="257"/>
<source>Scroll</source> <source>Scroll</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="240"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="263"/>
<source>Auto hide scroll bars</source> <source>Auto hide scroll bars</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="247"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="270"/>
<source>Can scroll the last char to the left edge of the editor</source> <source>Can scroll the last char to the left edge of the editor</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="254"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="277"/>
<source>Can scroll the last line to the top edge of the editor</source> <source>Can scroll the last line to the top edge of the editor</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="261"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="284"/>
<source>Page Up/Down scrolls half a page</source> <source>Page Up/Down scrolls half a page</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="268"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="291"/>
<source>Forces page scroll to be one line less</source> <source>Forces page scroll to be one line less</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="290"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="313"/>
<source>Mouse Wheel Scroll Speed</source> <source>Mouse Wheel Scroll Speed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="326"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="349"/>
<source>Show right edge line</source> <source>Show right edge line</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="338"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="361"/>
<source>Right egde width</source> <source>Right egde width</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/editorgeneralwidget.ui" line="390"/> <location filename="settingsdialog/editorgeneralwidget.ui" line="413"/>
<source>Right edge line color</source> <source>Right edge line color</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -920,7 +920,8 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
foreground = mCurrentHighlighWordForeground; foreground = mCurrentHighlighWordForeground;
if (mCurrentHighlighWordBackground.isValid()) if (mCurrentHighlighWordBackground.isValid())
background = mCurrentHighlighWordBackground; background = mCurrentHighlighWordBackground;
} else if (!selAvail() && attr->name() == SYNS_AttrSymbol) { } else if (!selAvail() && attr->name() == SYNS_AttrSymbol
&& pSettings->editor().highlightMathingBraces()) {
// qDebug()<<line<<":"<<aChar<<" - "<<mHighlightCharPos1.Line<<":"<<mHighlightCharPos1.Char<<" - "<<mHighlightCharPos2.Line<<":"<<mHighlightCharPos2.Char; // qDebug()<<line<<":"<<aChar<<" - "<<mHighlightCharPos1.Line<<":"<<mHighlightCharPos1.Char<<" - "<<mHighlightCharPos2.Line<<":"<<mHighlightCharPos2.Char;
if ( (line == mHighlightCharPos1.Line) if ( (line == mHighlightCharPos1.Line)
&& (aChar == mHighlightCharPos1.Char)) { && (aChar == mHighlightCharPos1.Char)) {
@ -1408,10 +1409,6 @@ void Editor::onStatusChanged(SynStatusChanges changes)
if (changes.testFlag(SynStatusChange::scCaretX) if (changes.testFlag(SynStatusChange::scCaretX)
|| changes.testFlag(SynStatusChange::scCaretY)) { || changes.testFlag(SynStatusChange::scCaretY)) {
invalidateLine(mHighlightCharPos1.Line);
invalidateLine(mHighlightCharPos2.Line);
mHighlightCharPos1 = BufferCoord{0,0};
mHighlightCharPos2 = BufferCoord{0,0};
if (mTabStopBegin >=0) { if (mTabStopBegin >=0) {
if (mTabStopY==caretY()) { if (mTabStopY==caretY()) {
if (mLineAfterTabStop.isEmpty()) { if (mLineAfterTabStop.isEmpty()) {
@ -1437,7 +1434,11 @@ void Editor::onStatusChanged(SynStatusChanges changes)
clearUserCodeInTabStops(); clearUserCodeInTabStops();
} }
} }
} else if (!selAvail() && highlighter()){ } else if (!selAvail() && highlighter() && pSettings->editor().highlightMathingBraces()){
invalidateLine(mHighlightCharPos1.Line);
invalidateLine(mHighlightCharPos2.Line);
mHighlightCharPos1 = BufferCoord{0,0};
mHighlightCharPos2 = BufferCoord{0,0};
// Is there a bracket char before us? // Is there a bracket char before us?
int lineLength = lineText().length(); int lineLength = lineText().length();
int ch = caretX() - 2; int ch = caretX() - 2;
@ -1471,8 +1472,11 @@ void Editor::onStatusChanged(SynStatusChanges changes)
// scSelection includes anything caret related // scSelection includes anything caret related
if (changes.testFlag(SynStatusChange::scSelection)) { if (changes.testFlag(SynStatusChange::scSelection)) {
if (!selAvail()) { if (!selAvail() && pSettings->editor().highlightCurrentWord()) {
mCurrentHighlightedWord = wordAtCursor(); mCurrentHighlightedWord = wordAtCursor();
} else if (selAvail() && blockBegin() == wordStart()
&& blockEnd() == wordEnd()){
mCurrentHighlightedWord = selText();
} else { } else {
mCurrentHighlightedWord = ""; mCurrentHighlightedWord = "";
} }

View File

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv); QApplication app(argc, argv);
//Translation must be loaded first //Translation must be loaded first
QTranslator trans; QTranslator trans,transQt;
QString settingFilename = getSettingFilename(); QString settingFilename = getSettingFilename();
if (!isGreenEdition()) { if (!isGreenEdition()) {
QDir::setCurrent(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]); QDir::setCurrent(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]);
@ -91,8 +91,13 @@ int main(int argc, char *argv[])
QSettings languageSetting(settingFilename,QSettings::IniFormat); QSettings languageSetting(settingFilename,QSettings::IniFormat);
languageSetting.beginGroup(SETTING_ENVIRONMENT); languageSetting.beginGroup(SETTING_ENVIRONMENT);
QString language = languageSetting.value("language",QLocale::system().name()).toString(); QString language = languageSetting.value("language",QLocale::system().name()).toString();
if (trans.load("RedPandaIDE_"+language,":/translations"))
if (trans.load("RedPandaIDE_"+language,":/translations")) {
app.installTranslator(&trans); app.installTranslator(&trans);
}
if (transQt.load("qt_"+language,":/translations")) {
app.installTranslator(&transQt);
}
} }
qRegisterMetaType<PCompileIssue>("PCompileIssue"); qRegisterMetaType<PCompileIssue>("PCompileIssue");

View File

@ -4567,6 +4567,10 @@ void MainWindow::on_actionNew_Project_triggered()
{ {
NewProjectDialog dialog; NewProjectDialog dialog;
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
if (dialog.useAsDefaultProjectDir()) {
pSettings->dirs().setProjectDir(dialog.getLocation());
pSettings->dirs().save();
}
// Take care of the currently opened project // Take care of the currently opened project
QString s; QString s;
if (mProject) { if (mProject) {
@ -4587,19 +4591,20 @@ void MainWindow::on_actionNew_Project_triggered()
} }
//Create the project folder //Create the project folder
QDir dir(dialog.getLocation()); QString location = includeTrailingPathDelimiter(dialog.getLocation())+dialog.getProjectName();
QDir dir(location);
if (!dir.exists()) { if (!dir.exists()) {
if (QMessageBox::question(this, if (QMessageBox::question(this,
tr("Folder not exist"), tr("Folder not exist"),
tr("Folder '%1' doesn't exist. Create it now?").arg(dialog.getLocation()), tr("Folder '%1' doesn't exist. Create it now?").arg(location),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes) != QMessageBox::Yes) { QMessageBox::Yes) != QMessageBox::Yes) {
return; return;
} }
if (!dir.mkpath(dialog.getLocation())) { if (!dir.mkpath(location)) {
QMessageBox::critical(this, QMessageBox::critical(this,
tr("Can't create folder"), tr("Can't create folder"),
tr("Failed to create folder '%1'.").arg(dialog.getLocation()), tr("Failed to create folder '%1'.").arg(location),
QMessageBox::Yes); QMessageBox::Yes);
return; return;
} }
@ -4608,14 +4613,14 @@ void MainWindow::on_actionNew_Project_triggered()
// if cbDefault.Checked then // if cbDefault.Checked then
// devData.DefCpp := rbCpp.Checked; // devData.DefCpp := rbCpp.Checked;
s = includeTrailingPathDelimiter(dialog.getLocation()) s = includeTrailingPathDelimiter(location)
+ dialog.getProjectName() + "." + DEV_PROJECT_EXT; + dialog.getProjectName() + "." + DEV_PROJECT_EXT;
if (fileExists(s)) { if (fileExists(s)) {
QString saveName = QFileDialog::getSaveFileName( QString saveName = QFileDialog::getSaveFileName(
this, this,
tr("Save new project as"), tr("Save new project as"),
dialog.getLocation(), location,
tr("Red panda Dev-C++ project file (*.dev)")); tr("Red panda Dev-C++ project file (*.dev)"));
if (!saveName.isEmpty()) { if (!saveName.isEmpty()) {
s = saveName; s = saveName;

View File

@ -234,3 +234,8 @@ void ContentsCoord::setCh(int newChar)
{ {
mChar = newChar; mChar = newChar;
} }
bool BufferCoord::operator==(const BufferCoord &coord)
{
return coord.Char == Char && coord.Line == Line;
}

View File

@ -10,6 +10,7 @@ enum class SynSelectionMode {smNormal, smLine, smColumn};
struct BufferCoord { struct BufferCoord {
int Char; int Char;
int Line; int Line;
bool operator==(const BufferCoord& coord);
}; };
class SynEdit; class SynEdit;

BIN
RedPandaIDE/qt_zh_CN.qm Normal file

Binary file not shown.

View File

@ -87,6 +87,7 @@ void Settings::load()
mCodeCompletion.load(); mCodeCompletion.load();
mCodeFormatter.load(); mCodeFormatter.load();
mUI.load(); mUI.load();
mDirs.load();
} }
Settings::Dirs &Settings::dirs() Settings::Dirs &Settings::dirs()
@ -161,12 +162,7 @@ QString Settings::Dirs::templateDir() const
QString Settings::Dirs::projectDir() const QString Settings::Dirs::projectDir() const
{ {
if (isGreenEdition()) { return mProjectDir;
return includeTrailingPathDelimiter(app()) + "projects";
} else {
return includeTrailingPathDelimiter(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0])
+ "projects";
}
} }
QString Settings::Dirs::data(Settings::Dirs::DataType dataType) const QString Settings::Dirs::data(Settings::Dirs::DataType dataType) const
@ -205,12 +201,24 @@ QString Settings::Dirs::executable() const
void Settings::Dirs::doSave() void Settings::Dirs::doSave()
{ {
saveValue("projectDir",mProjectDir);
} }
void Settings::Dirs::doLoad() void Settings::Dirs::doLoad()
{ {
QString defaultProjectDir;
if (isGreenEdition()) {
defaultProjectDir = includeTrailingPathDelimiter(app()) + "projects";
} else {
defaultProjectDir = includeTrailingPathDelimiter(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0])
+ "projects";
}
mProjectDir = stringValue("projectDir",defaultProjectDir);
}
void Settings::Dirs::setProjectDir(const QString &newProjectDir)
{
mProjectDir = newProjectDir;
} }
Settings::_Base::_Base(Settings *settings, const QString &groupName): Settings::_Base::_Base(Settings *settings, const QString &groupName):
@ -524,6 +532,26 @@ void Settings::Editor::setUseUTF8ByDefault(bool newUseUTF8ByDefault)
mUseUTF8ByDefault = newUseUTF8ByDefault; mUseUTF8ByDefault = newUseUTF8ByDefault;
} }
bool Settings::Editor::highlightMathingBraces() const
{
return mHighlightMathingBraces;
}
void Settings::Editor::setHighlightMathingBraces(bool newHighlightMathingBraces)
{
mHighlightMathingBraces = newHighlightMathingBraces;
}
bool Settings::Editor::highlightCurrentWord() const
{
return mHighlightCurrentWord;
}
void Settings::Editor::setHighlightCurrentWord(bool newHighlightCurrentWord)
{
mHighlightCurrentWord = newHighlightCurrentWord;
}
bool Settings::Editor::enableTooltips() const bool Settings::Editor::enableTooltips() const
{ {
return mEnableTooltips; return mEnableTooltips;
@ -994,6 +1022,7 @@ void Settings::Editor::doSave()
saveValue("show_indent_lines", mShowIndentLines); saveValue("show_indent_lines", mShowIndentLines);
saveValue("indent_line_color",mIndentLineColor); saveValue("indent_line_color",mIndentLineColor);
saveValue("fill_indents",mfillIndents); saveValue("fill_indents",mfillIndents);
// caret // caret
saveValue("enhance_home_key",mEnhanceHomeKey); saveValue("enhance_home_key",mEnhanceHomeKey);
saveValue("enhance_end_key",mEnhanceEndKey); saveValue("enhance_end_key",mEnhanceEndKey);
@ -1003,6 +1032,10 @@ void Settings::Editor::doSave()
saveValue("caret_use_text_color",mCaretUseTextColor); saveValue("caret_use_text_color",mCaretUseTextColor);
saveValue("caret_color",mCaretColor); saveValue("caret_color",mCaretColor);
//highlight
saveValue("highlight_matching_braces",mHighlightMathingBraces);
saveValue("highlight_current_word",mHighlightCurrentWord);
//scroll //scroll
saveValue("auto_hide_scroll_bar", mAutoHideScrollbar); saveValue("auto_hide_scroll_bar", mAutoHideScrollbar);
saveValue("scroll_past_eof", mScrollPastEof); saveValue("scroll_past_eof", mScrollPastEof);
@ -1112,6 +1145,10 @@ void Settings::Editor::doLoad()
mCaretUseTextColor = boolValue("caret_use_text_color",true); mCaretUseTextColor = boolValue("caret_use_text_color",true);
mCaretColor = colorValue("caret_color",QColorConstants::Svg::yellow); mCaretColor = colorValue("caret_color",QColorConstants::Svg::yellow);
//highlight
mHighlightMathingBraces = boolValue("highlight_matching_braces",true);
mHighlightCurrentWord = boolValue("highlight_current_word",true);
//scroll //scroll
mAutoHideScrollbar = boolValue("auto_hide_scroll_bar", false); mAutoHideScrollbar = boolValue("auto_hide_scroll_bar", false);
mScrollPastEof = boolValue("scroll_past_eof", true); mScrollPastEof = boolValue("scroll_past_eof", true);

View File

@ -96,10 +96,13 @@ public:
QString config(DataType dataType = DataType::None) const; QString config(DataType dataType = DataType::None) const;
QString executable() const; QString executable() const;
// _Base interface void setProjectDir(const QString &newProjectDir);
protected: protected:
void doSave() override; void doSave() override;
void doLoad() override; void doLoad() override;
private:
QString mProjectDir;
}; };
class Editor: public _Base { class Editor: public _Base {
@ -336,6 +339,12 @@ public:
bool useUTF8ByDefault() const; bool useUTF8ByDefault() const;
void setUseUTF8ByDefault(bool newUseUTF8ByDefault); void setUseUTF8ByDefault(bool newUseUTF8ByDefault);
bool highlightCurrentWord() const;
void setHighlightCurrentWord(bool newHighlightCurrentWord);
bool highlightMathingBraces() const;
void setHighlightMathingBraces(bool newHighlightMathingBraces);
private: private:
//General //General
// indents // indents
@ -354,6 +363,10 @@ public:
bool mCaretUseTextColor; bool mCaretUseTextColor;
QColor mCaretColor; QColor mCaretColor;
//highlights
bool mHighlightCurrentWord;
bool mHighlightMathingBraces;
//scroll //scroll
bool mAutoHideScrollbar; bool mAutoHideScrollbar;
bool mScrollPastEof; bool mScrollPastEof;

View File

@ -52,6 +52,9 @@ void EditorGeneralWidget::doLoad()
setCaretTypeIndex(ui->cbCaretForOverwrite,pSettings->editor().caretForOverwrite()); setCaretTypeIndex(ui->cbCaretForOverwrite,pSettings->editor().caretForOverwrite());
ui->chkCaretUseTextColor->setChecked(pSettings->editor().caretUseTextColor()); ui->chkCaretUseTextColor->setChecked(pSettings->editor().caretUseTextColor());
ui->colorCaret->setColor(pSettings->editor().caretColor()); ui->colorCaret->setColor(pSettings->editor().caretColor());
//highlight
ui->chkHighlightCurrentWord->setChecked(pSettings->editor().highlightCurrentWord());
ui->chkHighlightMatchingBraces->setChecked(pSettings->editor().highlightMathingBraces());
//scrolls; //scrolls;
ui->chkAutoHideScrollBars->setChecked(pSettings->editor().autoHideScrollbar()); ui->chkAutoHideScrollBars->setChecked(pSettings->editor().autoHideScrollbar());
ui->chkScrollPastEOF->setChecked(pSettings->editor().scrollPastEof()); ui->chkScrollPastEOF->setChecked(pSettings->editor().scrollPastEof());
@ -84,6 +87,10 @@ void EditorGeneralWidget::doSave()
pSettings->editor().setCaretForOverwrite(getCaretTypeIndex(ui->cbCaretForOverwrite)); pSettings->editor().setCaretForOverwrite(getCaretTypeIndex(ui->cbCaretForOverwrite));
pSettings->editor().setCaretUseTextColor(ui->chkCaretUseTextColor->isChecked()); pSettings->editor().setCaretUseTextColor(ui->chkCaretUseTextColor->isChecked());
pSettings->editor().setCaretColor(ui->colorCaret->color()); pSettings->editor().setCaretColor(ui->colorCaret->color());
//highlight
pSettings->editor().setHighlightCurrentWord(ui->chkHighlightCurrentWord->isChecked());
pSettings->editor().setHighlightMathingBraces(ui->chkHighlightMatchingBraces->isChecked());
//scrolls; //scrolls;
pSettings->editor().setAutoHideScrollbar(ui->chkAutoHideScrollBars->isChecked()); pSettings->editor().setAutoHideScrollbar(ui->chkAutoHideScrollBars->isChecked());
pSettings->editor().setScrollPastEof(ui->chkScrollPastEOF->isChecked()); pSettings->editor().setScrollPastEof(ui->chkScrollPastEOF->isChecked());

View File

@ -228,6 +228,29 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Highlight</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QCheckBox" name="chkHighlightMatchingBraces">
<property name="text">
<string>Highlight matching braces</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkHighlightCurrentWord">
<property name="text">
<string>Highlight current word</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">

View File

@ -1,5 +1,6 @@
<RCC> <RCC>
<qresource prefix="/translations"> <qresource prefix="/translations">
<file>RedPandaIDE_zh_CN.qm</file> <file>RedPandaIDE_zh_CN.qm</file>
<file>qt_zh_CN.qm</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -794,6 +794,11 @@ QIcon DarkFusionStyle::standardIcon(StandardPixmap standardIcon, const QStyleOpt
return QProxyStyle::standardIcon(standardIcon, option, widget); return QProxyStyle::standardIcon(standardIcon, option, widget);
} }
void DarkFusionStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
{
QProxyStyle::drawComplexControl(control,option,painter,widget);
}
void DarkFusionStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, void DarkFusionStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter,
const QWidget *widget) const const QWidget *widget) const
{ {

View File

@ -16,6 +16,11 @@ public:
const QWidget *widget) const override; const QWidget *widget) const override;
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr, QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
const QWidget *widget = nullptr) const override; const QWidget *widget = nullptr) const override;
// QStyle interface
public:
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
QPainter *painter, const QWidget *widget) const override;
}; };
#endif // DARKFUSIONSTYLE_H #endif // DARKFUSIONSTYLE_H

View File

@ -20,11 +20,12 @@ NewProjectDialog::NewProjectDialog(QWidget *parent) :
int i=0; int i=0;
QString projectName; QString projectName;
QString location; QString location;
location = excludeTrailingPathDelimiter(pSettings->dirs().projectDir());
while (true) { while (true) {
i++; i++;
projectName = tr("Project%1").arg(i); projectName = tr("Project%1").arg(i);
location = includeTrailingPathDelimiter(pSettings->dirs().projectDir()) + projectName; QString tempLocation = includeTrailingPathDelimiter(location)+projectName;
if (!QDir(location).exists()) if (!QDir(tempLocation).exists())
break; break;
} }
ui->txtProjectName->setText(projectName); ui->txtProjectName->setText(projectName);
@ -65,6 +66,11 @@ QString NewProjectDialog::getProjectName()
return ui->txtProjectName->text(); return ui->txtProjectName->text();
} }
bool NewProjectDialog::useAsDefaultProjectDir()
{
return ui->chkAsDefaultLocation->isChecked();
}
bool NewProjectDialog::isCProject() bool NewProjectDialog::isCProject()
{ {
return ui->rdCProject->isChecked(); return ui->rdCProject->isChecked();
@ -159,12 +165,7 @@ void NewProjectDialog::updateView()
void NewProjectDialog::updateProjectLocation() void NewProjectDialog::updateProjectLocation()
{ {
ui->txtLocation->setText( QString newLocation = ui->txtLocation->text();
includeTrailingPathDelimiter(
extractFilePath(
ui->txtLocation->text()))
+ ui->txtProjectName->text()
);
QListWidgetItem * current = ui->lstTemplates->currentItem(); QListWidgetItem * current = ui->lstTemplates->currentItem();
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled( ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
@ -210,7 +211,7 @@ void NewProjectDialog::on_btnBrowse_clicked()
} }
QString dir = QFileDialog::getExistingDirectory( QString dir = QFileDialog::getExistingDirectory(
this, this,
"Project directory", "Choose directory",
dirPath dirPath
); );
if (!dir.isEmpty()) { if (!dir.isEmpty()) {

View File

@ -20,6 +20,7 @@ public:
PProjectTemplate getTemplate(); PProjectTemplate getTemplate();
QString getLocation(); QString getLocation();
QString getProjectName(); QString getProjectName();
bool useAsDefaultProjectDir();
bool isCProject(); bool isCProject();
bool isCppProject(); bool isCppProject();
bool makeProjectDefault(); bool makeProjectDefault();

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>670</width> <width>670</width>
<height>528</height> <height>546</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -85,6 +85,12 @@
<item> <item>
<widget class="QWidget" name="widget_3" native="true"> <widget class="QWidget" name="widget_3" native="true">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QLineEdit" name="txtLocation"/>
</item>
<item row="0" column="2" colspan="2">
<widget class="QLineEdit" name="txtProjectName"/>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
@ -92,16 +98,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Location:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="txtLocation"/>
</item>
<item row="1" column="3"> <item row="1" column="3">
<widget class="QToolButton" name="btnBrowse"> <widget class="QToolButton" name="btnBrowse">
<property name="text"> <property name="text">
@ -114,8 +110,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" colspan="2"> <item row="1" column="0">
<widget class="QLineEdit" name="txtProjectName"/> <widget class="QLabel" name="label_3">
<property name="text">
<string>Create in</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<widget class="QCheckBox" name="chkAsDefaultLocation">
<property name="text">
<string>Use as the default project location</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>