work save

This commit is contained in:
royqh1979@gmail.com 2021-09-01 00:05:46 +08:00
parent 633f4f73ee
commit 09ef6c8ede
13 changed files with 2098 additions and 330 deletions

View File

@ -34,7 +34,6 @@ SOURCES += \
settingsdialog/editorcodecompletionwidget.cpp \
settingsdialog/editormiscwidget.cpp \
settingsdialog/formattergeneralwidget.cpp \
settingsdialog/formatteridentationwidget.cpp \
widgets/classbrowser.cpp \
widgets/codecompletionlistview.cpp \
widgets/codecompletionpopup.cpp \
@ -106,7 +105,6 @@ HEADERS += \
settingsdialog/editorcodecompletionwidget.h \
settingsdialog/editormiscwidget.h \
settingsdialog/formattergeneralwidget.h \
settingsdialog/formatteridentationwidget.h \
widgets/classbrowser.h \
widgets/codecompletionlistview.h \
widgets/codecompletionpopup.h \
@ -163,7 +161,6 @@ FORMS += \
settingsdialog/editorcodecompletionwidget.ui \
settingsdialog/editormiscwidget.ui \
settingsdialog/formattergeneralwidget.ui \
settingsdialog/formatteridentationwidget.ui \
widgets/cpudialog.ui \
mainwindow.ui \
settingsdialog/compilersetdirectorieswidget.ui \

View File

@ -523,7 +523,7 @@ Are you really want to continue?</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="editor.cpp" line="76"/>
<location filename="editor.cpp" line="78"/>
<source>untitled%1</source>
<translation>%1</translation>
</message>
@ -532,61 +532,61 @@ Are you really want to continue?</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="editor.cpp" line="180"/>
<location filename="editor.cpp" line="192"/>
<location filename="editor.cpp" line="227"/>
<location filename="editor.cpp" line="807"/>
<location filename="editor.cpp" line="812"/>
<location filename="editor.cpp" line="830"/>
<location filename="editor.cpp" line="835"/>
<location filename="editor.cpp" line="188"/>
<location filename="editor.cpp" line="202"/>
<location filename="editor.cpp" line="238"/>
<location filename="editor.cpp" line="818"/>
<location filename="editor.cpp" line="823"/>
<location filename="editor.cpp" line="841"/>
<location filename="editor.cpp" line="846"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="181"/>
<location filename="editor.cpp" line="189"/>
<source>File %1 is not writable!</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="editor.cpp" line="212"/>
<location filename="editor.cpp" line="223"/>
<source>Save As</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="808"/>
<location filename="editor.cpp" line="819"/>
<source>The text to be copied exceeds count limit!</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="813"/>
<location filename="editor.cpp" line="824"/>
<source>The text to be copied exceeds character limit!</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="831"/>
<location filename="editor.cpp" line="842"/>
<source>The text to be cut exceeds count limit!</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="836"/>
<location filename="editor.cpp" line="847"/>
<source>The text to be cut exceeds character limit!</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="2005"/>
<location filename="editor.cpp" line="2042"/>
<location filename="editor.cpp" line="2093"/>
<location filename="editor.cpp" line="2079"/>
<location filename="editor.cpp" line="2130"/>
<source>Ctrl+click for more info</source>
<translation>Ctrl+</translation>
</message>
<message>
<location filename="editor.cpp" line="2111"/>
<location filename="editor.cpp" line="2141"/>
<location filename="editor.cpp" line="2148"/>
<location filename="editor.cpp" line="2178"/>
<source>Symbol &apos;%1&apos; not found!</source>
<translation>&apos;%1&apos;!</translation>
</message>
<message>
<location filename="editor.cpp" line="2651"/>
<location filename="editor.cpp" line="2688"/>
<source>Readonly</source>
<translation></translation>
</message>
@ -1305,6 +1305,388 @@ Are you really want to continue?</source>
<translation>: %1 %2</translation>
</message>
</context>
<context>
<name>FormatterGeneralWidget</name>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="14"/>
<source>Form</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="35"/>
<source>Predefined format style</source>
<oldsource>Default brace style</oldsource>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="75"/>
<source>Basic</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="81"/>
<source>Brace modifications</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="87"/>
<source>Attach braces to namespace statements</source>
<oldsource>Attach spaces to namespace statements</oldsource>
<translation>(namespace)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="94"/>
<source>Attach braces to classes</source>
<oldsource>Attach spaces to classes</oldsource>
<translation>(class)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="101"/>
<source>Attach braces to class inline function definitions</source>
<oldsource>Attach spaces to class inline function definitions</oldsource>
<translation>(inline function)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="108"/>
<source>Attach braces to extern &quot;C&quot; statements</source>
<oldsource>Attach spaces to extern &quot;C&quot; statements</oldsource>
<translation>extern &quot;C&quot;</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="115"/>
<source>Attach the closing while of do-while to the close brace</source>
<translation>do-while语句的while部分与结尾花括号合并</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="125"/>
<source>Convert tabs to the appropriate number of spaces</source>
<translation>(Tab)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="133"/>
<source>Indentation 1</source>
<translation>1</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="139"/>
<source>Indent with:</source>
<translation>使:</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="154"/>
<source>Indent using spaces</source>
<translation>使</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="157"/>
<source>Spaces</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="164"/>
<source>Indent using tabs</source>
<translation>使</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="167"/>
<source>Tabs</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="192"/>
<source>Tab Size:</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="243"/>
<source>Indent for continuation lines:</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="291"/>
<source>Minimal indent for a continuous conditional beloning to a conditional header:</source>
<translation>(&apos;if&apos;,&apos;while&apos;,...)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="332"/>
<source>Maximal indent spaces for a continuation line</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="359"/>
<source>Indentation 2</source>
<translation>2</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="365"/>
<source>Indent labels</source>
<translation>(label)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="372"/>
<source>Indent class blocks</source>
<translation>(class)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="379"/>
<source>Indent namespaces</source>
<translation>(namespace)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="386"/>
<source>Indent class access modifiers</source>
<translation>访(&apos;public&apos;,&apos;private&apos;...)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="393"/>
<source>Indent after parenthesis &apos;(&apos; or assignment &apos;=&apos;</source>
<translation>&apos;(&apos;&apos;=&apos;</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="400"/>
<source>Indent preprocessor conditional statements</source>
<translation>(&apos;#if&apos;,&apos;#else&apos;,...)</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="407"/>
<source>Indent multi-line preprocessor #define statements</source>
<translation>#define语句</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="414"/>
<source>Indent line comments that start in column one</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="421"/>
<source>Indent preprocessor blocks</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="428"/>
<source>Indent switch blocks</source>
<translation>switch语句</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="435"/>
<source>Indent cases</source>
<translation>case语句</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="443"/>
<source>Padding 1</source>
<translation>1</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="449"/>
<source>Insert spaces around operators</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="456"/>
<source>Insert spaces after commas</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="463"/>
<source>Insert spaces after parenthesis headers (&apos;if&apos;,&apos;for&apos;,...)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="470"/>
<source>Insert spaces around parenthesis on the outside only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="477"/>
<source>Insert spaces around parenthesis on the inside only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="484"/>
<source>Insert empty lines arround unrelated blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="491"/>
<source>Insert empy lines around all blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="498"/>
<source>Insert spaces around first parenthesis in a series on the out side only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="505"/>
<source>Insert spaces around parenthesis</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="513"/>
<source>Padding 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="519"/>
<source>Remove all empty lines. It will NOT delete lines added by the padding options.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="526"/>
<source>Attach a pointer operator to its :</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="533"/>
<source>Remove all consecutive empty lines. It will NOT delete lines added by the padding options.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="540"/>
<location filename="settingsdialog/formattergeneralwidget.ui" line="547"/>
<source>type(left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="574"/>
<source>Fill empty lines with the white space of the previous lines.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="567"/>
<location filename="settingsdialog/formattergeneralwidget.ui" line="588"/>
<source>middle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="61"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Note for the predefined format style&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="581"/>
<location filename="settingsdialog/formattergeneralwidget.ui" line="595"/>
<source>name(right)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="602"/>
<source>Remove unnecessary space adding around parenthesis</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="609"/>
<source>Attach a reference operator to its :</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="616"/>
<location filename="settingsdialog/formattergeneralwidget.ui" line="623"/>
<source>none</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="631"/>
<source>Other 1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="637"/>
<source>Break one line headers (&apos;if&apos;,&apos;while&apos;,&apos;else&apos;...) from the statement on the same line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="644"/>
<source>Add one line braces to unbraced one line conditional statements</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="651"/>
<source>Break braces before close headers (&apos;else&apos;,&apos;catch&quot;...)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="658"/>
<source>Remove braces from a braced one line conditional statements</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="665"/>
<source>Break &apos;else if&apos; statements into two lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="672"/>
<source>Add braces to unbraced one line conditional statements</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="680"/>
<source>Other 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="686"/>
<source>Attach return type to the function name in its declaration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="693"/>
<source>Break return type from the function name in its declaration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="700"/>
<source>Break return type from the function name in its definition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="707"/>
<source>Attach return type to the function name in its definition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="714"/>
<source>Don&apos;t break blocks residing completely on one line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="721"/>
<source>Don&apos;t break multimple statements residing on one line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="729"/>
<source>Other 3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="735"/>
<source>Place the logical conditional to the last on the previous line, when break lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="742"/>
<source>Close ending angle brackets on template definitions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="749"/>
<source>Remove the leading &apos;*&apos; prefix on multi-line comments and indent the comment text one line indent.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="771"/>
<source>Break lines exceeds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.ui" line="778"/>
<source>characters</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IssuesModel</name>
<message>
@ -1337,7 +1719,7 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.ui" line="267"/>
<location filename="mainwindow.cpp" line="1228"/>
<location filename="mainwindow.cpp" line="1231"/>
<source>Issues</source>
<translation></translation>
</message>
@ -1949,12 +2331,12 @@ Are you really want to continue?</source>
<message>
<location filename="mainwindow.cpp" line="523"/>
<location filename="mainwindow.cpp" line="1060"/>
<location filename="mainwindow.cpp" line="1117"/>
<location filename="mainwindow.cpp" line="1141"/>
<location filename="mainwindow.cpp" line="1163"/>
<location filename="mainwindow.cpp" line="1175"/>
<location filename="mainwindow.cpp" line="1471"/>
<location filename="mainwindow.cpp" line="1483"/>
<location filename="mainwindow.cpp" line="1120"/>
<location filename="mainwindow.cpp" line="1144"/>
<location filename="mainwindow.cpp" line="1166"/>
<location filename="mainwindow.cpp" line="1178"/>
<location filename="mainwindow.cpp" line="1474"/>
<location filename="mainwindow.cpp" line="1486"/>
<source>Error</source>
<translation></translation>
</message>
@ -1979,55 +2361,55 @@ Are you really want to continue?</source>
<translation>C++</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1137"/>
<location filename="mainwindow.cpp" line="1140"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1319"/>
<location filename="mainwindow.cpp" line="1322"/>
<source>Compile Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1324"/>
<location filename="mainwindow.cpp" line="1327"/>
<source>Run Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1500"/>
<location filename="mainwindow.cpp" line="1514"/>
<location filename="mainwindow.cpp" line="1503"/>
<location filename="mainwindow.cpp" line="1517"/>
<source>Confirm Convertion</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1501"/>
<location filename="mainwindow.cpp" line="1515"/>
<location filename="mainwindow.cpp" line="1504"/>
<location filename="mainwindow.cpp" line="1518"/>
<source>The editing file will be saved using %1 encoding. &lt;br /&gt;This operation can&apos;t be reverted. &lt;br /&gt;Are you sure to continue?</source>
<translation>使%1&lt;br /&gt;&lt;br /&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1690"/>
<location filename="mainwindow.cpp" line="1693"/>
<source>New Watch Expression</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1691"/>
<location filename="mainwindow.cpp" line="1694"/>
<source>Enter Watch Expression (it is recommended to use &apos;this-&gt;&apos; for class members):</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1737"/>
<location filename="mainwindow.cpp" line="1740"/>
<source>Parsing file %1 of %2: &quot;%3&quot;</source>
<translation>%1/%2&quot;%3&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1759"/>
<location filename="mainwindow.cpp" line="1765"/>
<location filename="mainwindow.cpp" line="1762"/>
<location filename="mainwindow.cpp" line="1768"/>
<source>Done parsing %1 files in %2 seconds</source>
<translation>%1,%2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1762"/>
<location filename="mainwindow.cpp" line="1765"/>
<source>(%1 files per second)</source>
<translation>(%1</translation>
</message>
@ -2099,216 +2481,216 @@ Are you really want to continue?</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="settings.cpp" line="1197"/>
<location filename="settings.cpp" line="1216"/>
<location filename="settings.cpp" line="1228"/>
<location filename="settings.cpp" line="1240"/>
<location filename="settings.cpp" line="1204"/>
<location filename="settings.cpp" line="1223"/>
<location filename="settings.cpp" line="1235"/>
<location filename="settings.cpp" line="1247"/>
<source>The following %1 directories don&apos;t exist:</source>
<translation>%1</translation>
</message>
<message>
<location filename="settings.cpp" line="1198"/>
<location filename="settings.cpp" line="1208"/>
<location filename="settings.cpp" line="1205"/>
<location filename="settings.cpp" line="1215"/>
<source>binary</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="1207"/>
<location filename="settings.cpp" line="1214"/>
<source>No %1 directories have been specified.</source>
<translation>%1</translation>
</message>
<message>
<location filename="settings.cpp" line="1217"/>
<location filename="settings.cpp" line="1224"/>
<source>C include</source>
<translation>C包含</translation>
</message>
<message>
<location filename="settings.cpp" line="1229"/>
<location filename="settings.cpp" line="1241"/>
<location filename="settings.cpp" line="1236"/>
<location filename="settings.cpp" line="1248"/>
<source>C++ include</source>
<translation>C++</translation>
</message>
<message>
<location filename="settings.cpp" line="1260"/>
<location filename="settings.cpp" line="1265"/>
<location filename="settings.cpp" line="1270"/>
<location filename="settings.cpp" line="1275"/>
<location filename="settings.cpp" line="1267"/>
<location filename="settings.cpp" line="1272"/>
<location filename="settings.cpp" line="1277"/>
<location filename="settings.cpp" line="1282"/>
<source>Cannot find the %1 &quot;%2&quot;</source>
<translation>%1&quot;%2&quot;</translation>
</message>
<message>
<location filename="settings.cpp" line="1746"/>
<location filename="settings.cpp" line="1753"/>
<source>C options</source>
<translation>C语言选项</translation>
</message>
<message>
<location filename="settings.cpp" line="1747"/>
<location filename="settings.cpp" line="1754"/>
<source>Support all ANSI standard C programs (-ansi)</source>
<translation>ANSI标准C程序(-ansi)</translation>
</message>
<message>
<location filename="settings.cpp" line="1748"/>
<location filename="settings.cpp" line="1755"/>
<source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source>
<translation>asminline和typeof作为关键字(-fno-asm)</translation>
</message>
<message>
<location filename="settings.cpp" line="1749"/>
<location filename="settings.cpp" line="1756"/>
<source>Imitate traditional C preprocessors (-traditional-cpp)</source>
<translation>仿C预处理器行为(-traditional-cpp)</translation>
</message>
<message>
<location filename="settings.cpp" line="1752"/>
<location filename="settings.cpp" line="1759"/>
<source>Code Generation</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="1781"/>
<location filename="settings.cpp" line="1788"/>
<source>Optimize for the following machine (-march)</source>
<translation>(-march)</translation>
</message>
<message>
<location filename="settings.cpp" line="1782"/>
<location filename="settings.cpp" line="1789"/>
<source>Optimize less, while maintaining full compatibility (-tune)</source>
<translation>(-tune)</translation>
</message>
<message>
<location filename="settings.cpp" line="1802"/>
<location filename="settings.cpp" line="1809"/>
<source>Enable use of specific instructions (-mx)</source>
<translation>(-mx)</translation>
</message>
<message>
<location filename="settings.cpp" line="1813"/>
<location filename="settings.cpp" line="1820"/>
<source>Optimization level (-Ox)</source>
<translation>(-Ox)</translation>
</message>
<message>
<location filename="settings.cpp" line="1820"/>
<location filename="settings.cpp" line="1827"/>
<source>Compile with the following pointer size (-mx)</source>
<translation>使(-mx)</translation>
</message>
<message>
<location filename="settings.cpp" line="1843"/>
<location filename="settings.cpp" line="1850"/>
<source>Language standard (-std)</source>
<translation>(-std)</translation>
</message>
<message>
<location filename="settings.cpp" line="1844"/>
<location filename="settings.cpp" line="1851"/>
<source>Generate debugging information (-g3)</source>
<translation>(-g3)</translation>
</message>
<message>
<location filename="settings.cpp" line="1845"/>
<location filename="settings.cpp" line="1852"/>
<source>Generate profiling info for analysis (-pg)</source>
<translation>(-pg)</translation>
</message>
<message>
<location filename="settings.cpp" line="1848"/>
<location filename="settings.cpp" line="1855"/>
<source>Warnings</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="1849"/>
<location filename="settings.cpp" line="1856"/>
<source>Inhibit all warning messages (-w)</source>
<translation>(-w)</translation>
</message>
<message>
<location filename="settings.cpp" line="1850"/>
<location filename="settings.cpp" line="1857"/>
<source>Show most warnings (-Wall)</source>
<translation>(-Wall)</translation>
</message>
<message>
<location filename="settings.cpp" line="1851"/>
<location filename="settings.cpp" line="1858"/>
<source>Show some more warnings (-Wextra)</source>
<translation>(-Wextra)</translation>
</message>
<message>
<location filename="settings.cpp" line="1852"/>
<location filename="settings.cpp" line="1859"/>
<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="1853"/>
<location filename="settings.cpp" line="1860"/>
<source>Only check the code for syntax errors (-fsyntax-only)</source>
<translation>(-fsyntax-only)</translation>
</message>
<message>
<location filename="settings.cpp" line="1854"/>
<location filename="settings.cpp" line="1861"/>
<source>Make all warnings into errors (-Werror)</source>
<translation>(-Werror)</translation>
</message>
<message>
<location filename="settings.cpp" line="1855"/>
<location filename="settings.cpp" line="1862"/>
<source>Abort compilation on first error (-Wfatal-errors)</source>
<translation>(-Wfatal-errors)</translation>
</message>
<message>
<location filename="settings.cpp" line="1858"/>
<location filename="settings.cpp" line="1865"/>
<source>Linker</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="1859"/>
<location filename="settings.cpp" line="1866"/>
<source>Link an Objective C program (-lobjc)</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="1860"/>
<location filename="settings.cpp" line="1867"/>
<source>Do not use standard system libraries (-nostdlib)</source>
<translation>使(-nostdlib)</translation>
</message>
<message>
<location filename="settings.cpp" line="1861"/>
<location filename="settings.cpp" line="1868"/>
<source>Do not create a console window (-mwindows)</source>
<translation>(-mwindows)</translation>
</message>
<message>
<location filename="settings.cpp" line="1862"/>
<location filename="settings.cpp" line="1869"/>
<source>Strip executable (-s)</source>
<translation>(-s)</translation>
</message>
<message>
<location filename="settings.cpp" line="1863"/>
<location filename="settings.cpp" line="1870"/>
<source>Link libraries statically (-static)</source>
<translation>Ojbective C程序(-lobjc)</translation>
</message>
<message>
<location filename="settings.cpp" line="1866"/>
<location filename="settings.cpp" line="1873"/>
<source>Output</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="1867"/>
<location filename="settings.cpp" line="1874"/>
<source>Put comments in generated assembly code (-fverbose-asm)</source>
<translation>(-fverbose-asm)</translation>
</message>
<message>
<location filename="settings.cpp" line="1868"/>
<location filename="settings.cpp" line="1875"/>
<source>Use pipes instead of temporary files during compilation (-pipe)</source>
<translation>使(-pipe)</translation>
</message>
<message>
<location filename="settings.cpp" line="1869"/>
<location filename="settings.cpp" line="1876"/>
<source>Do not assemble, compile and generate the assemble code (-S)</source>
<translation>(-S)</translation>
</message>
<message>
<location filename="settings.cpp" line="2062"/>
<location filename="settings.cpp" line="2087"/>
<location filename="settings.cpp" line="2069"/>
<location filename="settings.cpp" line="2094"/>
<source>Confirm</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="2063"/>
<location filename="settings.cpp" line="2070"/>
<source>The following problems were found during validation of compiler set &quot;%1&quot;:</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="settings.cpp" line="2088"/>
<location filename="settings.cpp" line="2095"/>
<source>Compiler set not configuared.</source>
<translation></translation>
</message>
<message>
<location filename="settings.cpp" line="2090"/>
<location filename="settings.cpp" line="2097"/>
<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>
</message>
@ -2961,102 +3343,108 @@ Are you really want to continue?</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="33"/>
<location filename="settingsdialog/settingsdialog.cpp" line="34"/>
<source>Appearence</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="33"/>
<location filename="settingsdialog/settingsdialog.cpp" line="34"/>
<source>Environment</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="37"/>
<location filename="settingsdialog/settingsdialog.cpp" line="38"/>
<source>Compiler Set</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="37"/>
<location filename="settingsdialog/settingsdialog.cpp" line="38"/>
<source>Compiler</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="41"/>
<location filename="settingsdialog/settingsdialog.cpp" line="78"/>
<location filename="settingsdialog/settingsdialog.cpp" line="82"/>
<location filename="settingsdialog/settingsdialog.cpp" line="42"/>
<location filename="settingsdialog/settingsdialog.cpp" line="79"/>
<location filename="settingsdialog/settingsdialog.cpp" line="83"/>
<location filename="settingsdialog/settingsdialog.cpp" line="87"/>
<source>General</source>
<translation></translation>
</message>
<message>
<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"/>
<location filename="settingsdialog/settingsdialog.cpp" line="42"/>
<location filename="settingsdialog/settingsdialog.cpp" line="46"/>
<location filename="settingsdialog/settingsdialog.cpp" line="50"/>
<location filename="settingsdialog/settingsdialog.cpp" line="54"/>
<location filename="settingsdialog/settingsdialog.cpp" line="58"/>
<location filename="settingsdialog/settingsdialog.cpp" line="62"/>
<location filename="settingsdialog/settingsdialog.cpp" line="66"/>
<location filename="settingsdialog/settingsdialog.cpp" line="70"/>
<location filename="settingsdialog/settingsdialog.cpp" line="74"/>
<source>Editor</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="45"/>
<location filename="settingsdialog/settingsdialog.cpp" line="46"/>
<source>Font</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="49"/>
<location filename="settingsdialog/settingsdialog.cpp" line="50"/>
<source>Copy &amp; Export</source>
<translation>/</translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="53"/>
<location filename="settingsdialog/settingsdialog.cpp" line="54"/>
<source>Color</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="57"/>
<location filename="settingsdialog/settingsdialog.cpp" line="58"/>
<source>Code Completion</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="61"/>
<location filename="settingsdialog/settingsdialog.cpp" line="62"/>
<source>Symbol Completion</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="65"/>
<location filename="settingsdialog/settingsdialog.cpp" line="66"/>
<source>Auto Syntax Checking</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="69"/>
<location filename="settingsdialog/settingsdialog.cpp" line="70"/>
<source>Auto save</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="73"/>
<location filename="settingsdialog/settingsdialog.cpp" line="74"/>
<source>Misc</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="78"/>
<location filename="settingsdialog/settingsdialog.cpp" line="79"/>
<source>Program Runner</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="82"/>
<location filename="settingsdialog/settingsdialog.cpp" line="83"/>
<source>Debugger</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="178"/>
<location filename="settingsdialog/settingsdialog.cpp" line="87"/>
<source>Code Formatter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="184"/>
<source>Save Changes</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/settingsdialog.cpp" line="179"/>
<location filename="settingsdialog/settingsdialog.cpp" line="185"/>
<source>There are changes in the settings, do you want to save them before swtich to other page?</source>
<translation></translation>
</message>

View File

@ -24,6 +24,7 @@ Settings::Settings(const QString &filename):
mExecutor(this),
mDebugger(this),
mCodeCompletion(this),
mCodeFormatter(this),
mHistory(this)
{
load();
@ -81,6 +82,7 @@ void Settings::load()
mDebugger.load();
mHistory.load();
mCodeCompletion.load();
mCodeFormatter.load();
}
Settings::Dirs &Settings::dirs()
@ -118,6 +120,11 @@ Settings::CodeCompletion& Settings::codeCompletion()
return mCodeCompletion;
}
Settings::CodeFormatter &Settings::codeFormatter()
{
return mCodeFormatter;
}
Settings::History& Settings::history()
{
return mHistory;
@ -2696,3 +2703,647 @@ Settings::CodeFormatter::CodeFormatter(Settings *settings):
{
}
int Settings::CodeFormatter::indentStyle() const
{
return mIndentStyle;
}
void Settings::CodeFormatter::setIndentStyle(int newIndentStyle)
{
mIndentStyle = newIndentStyle;
}
int Settings::CodeFormatter::tabWidth() const
{
return mTabWidth;
}
void Settings::CodeFormatter::setTabWidth(int newTabWidth)
{
mTabWidth = newTabWidth;
}
bool Settings::CodeFormatter::attachNamespaces() const
{
return mAttachNamespaces;
}
void Settings::CodeFormatter::setAttachNamespaces(bool newAttachNamespaces)
{
mAttachNamespaces = newAttachNamespaces;
}
bool Settings::CodeFormatter::attachClasses() const
{
return mAttachClasses;
}
void Settings::CodeFormatter::setAttachClasses(bool newAttachClasses)
{
mAttachClasses = newAttachClasses;
}
bool Settings::CodeFormatter::attachInlines() const
{
return mAttachInlines;
}
void Settings::CodeFormatter::setAttachInlines(bool newAttachInlines)
{
mAttachInlines = newAttachInlines;
}
bool Settings::CodeFormatter::attachExternC() const
{
return mAttachExternC;
}
void Settings::CodeFormatter::setAttachExternC(bool newAttachExternC)
{
mAttachExternC = newAttachExternC;
}
bool Settings::CodeFormatter::attachClosingWhile() const
{
return mAttachClosingWhile;
}
void Settings::CodeFormatter::setAttachClosingWhile(bool newAttachClosingWhile)
{
mAttachClosingWhile = newAttachClosingWhile;
}
bool Settings::CodeFormatter::indentClasses() const
{
return mIndentClasses;
}
void Settings::CodeFormatter::setIndentClasses(bool newIndentClasses)
{
mIndentClasses = newIndentClasses;
}
bool Settings::CodeFormatter::indentModifiers() const
{
return mIndentModifiers;
}
void Settings::CodeFormatter::setIndentModifiers(bool newIndentModifiers)
{
mIndentModifiers = newIndentModifiers;
}
bool Settings::CodeFormatter::indentCases() const
{
return mIndentCases;
}
void Settings::CodeFormatter::setIndentCases(bool newIndentCases)
{
mIndentCases = newIndentCases;
}
bool Settings::CodeFormatter::indentNamespaces() const
{
return mIndentNamespaces;
}
void Settings::CodeFormatter::setIndentNamespaces(bool newIndentNamespaces)
{
mIndentNamespaces = newIndentNamespaces;
}
bool Settings::CodeFormatter::indentContinuation() const
{
return mIndentContinuation;
}
void Settings::CodeFormatter::setIndentContinuation(bool newIndentContinuation)
{
mIndentContinuation = newIndentContinuation;
}
bool Settings::CodeFormatter::indentLabels() const
{
return mIndentLabels;
}
void Settings::CodeFormatter::setIndentLabels(bool newIndentLabels)
{
mIndentLabels = newIndentLabels;
}
bool Settings::CodeFormatter::indentPreprocBlock() const
{
return mIndentPreprocBlock;
}
void Settings::CodeFormatter::setIndentPreprocBlock(bool newIndentPreprocBlock)
{
mIndentPreprocBlock = newIndentPreprocBlock;
}
bool Settings::CodeFormatter::indentPreprocCond() const
{
return mIndentPreprocCond;
}
void Settings::CodeFormatter::setIndentPreprocCond(bool newIndentPreprocCond)
{
mIndentPreprocCond = newIndentPreprocCond;
}
bool Settings::CodeFormatter::indentPreprocDefine() const
{
return mIndentPreprocDefine;
}
void Settings::CodeFormatter::setIndentPreprocDefine(bool newIndentPreprocDefine)
{
mIndentPreprocDefine = newIndentPreprocDefine;
}
bool Settings::CodeFormatter::indentCol1Comments() const
{
return mIndentCol1Comments;
}
void Settings::CodeFormatter::setIndentCol1Comments(bool newIndentCol1Comments)
{
mIndentCol1Comments = newIndentCol1Comments;
}
int Settings::CodeFormatter::minConditionalIndent() const
{
return mMinConditionalIndent;
}
void Settings::CodeFormatter::setMinConditionalIndent(int newMinConditionalIndent)
{
mMinConditionalIndent = newMinConditionalIndent;
}
int Settings::CodeFormatter::maxContinuationIndent() const
{
return mMaxContinuationIndent;
}
void Settings::CodeFormatter::setMaxContinuationIndent(int newMaxContinuationIndent)
{
mMaxContinuationIndent = newMaxContinuationIndent;
}
bool Settings::CodeFormatter::breakBlocks() const
{
return mBreakBlocks;
}
void Settings::CodeFormatter::setBreakBlocks(bool newBreakBlocks)
{
mBreakBlocks = newBreakBlocks;
}
bool Settings::CodeFormatter::breakBlocksAll() const
{
return mBreakBlocksAll;
}
void Settings::CodeFormatter::setBreakBlocksAll(bool newBreakBlocksAll)
{
mBreakBlocksAll = newBreakBlocksAll;
}
bool Settings::CodeFormatter::padOper() const
{
return mPadOper;
}
void Settings::CodeFormatter::setPadOper(bool newPadOper)
{
mPadOper = newPadOper;
}
bool Settings::CodeFormatter::padComma() const
{
return mPadComma;
}
void Settings::CodeFormatter::setPadComma(bool newPadComma)
{
mPadComma = newPadComma;
}
bool Settings::CodeFormatter::padParen() const
{
return mPadParen;
}
void Settings::CodeFormatter::setPadParen(bool newPadParen)
{
mPadParen = newPadParen;
}
bool Settings::CodeFormatter::padParenOut() const
{
return mPadParenOut;
}
void Settings::CodeFormatter::setPadParenOut(bool newPadParenOut)
{
mPadParenOut = newPadParenOut;
}
bool Settings::CodeFormatter::padFirstParenOut() const
{
return mPadFirstParenOut;
}
void Settings::CodeFormatter::setPadFirstParenOut(bool newPadFirstParenOut)
{
mPadFirstParenOut = newPadFirstParenOut;
}
bool Settings::CodeFormatter::padParenIn() const
{
return mPadParenIn;
}
void Settings::CodeFormatter::setPadParenIn(bool newPadParenIn)
{
mPadParenIn = newPadParenIn;
}
bool Settings::CodeFormatter::padHeader() const
{
return mPadHeader;
}
void Settings::CodeFormatter::setPadHeader(bool newPadHeader)
{
mPadHeader = newPadHeader;
}
bool Settings::CodeFormatter::unpadParen() const
{
return mUnpadParen;
}
void Settings::CodeFormatter::setUnpadParen(bool newUnpadParen)
{
mUnpadParen = newUnpadParen;
}
bool Settings::CodeFormatter::deleteEmptyLines() const
{
return mDeleteEmptyLines;
}
void Settings::CodeFormatter::setDeleteEmptyLines(bool newDeleteEmptyLines)
{
mDeleteEmptyLines = newDeleteEmptyLines;
}
bool Settings::CodeFormatter::deleteMultipleEmptyLines() const
{
return mDeleteMultipleEmptyLines;
}
void Settings::CodeFormatter::setDeleteMultipleEmptyLines(bool newDeleteMultipleEmptyLines)
{
mDeleteMultipleEmptyLines = newDeleteMultipleEmptyLines;
}
bool Settings::CodeFormatter::fillEmptyLines() const
{
return mFillEmptyLines;
}
void Settings::CodeFormatter::setFillEmptyLines(bool newFillEmptyLines)
{
mFillEmptyLines = newFillEmptyLines;
}
int Settings::CodeFormatter::alignPointerStyle() const
{
return mAlignPointerStyle;
}
void Settings::CodeFormatter::setAlignPointerStyle(int newAlignPointerStyle)
{
mAlignPointerStyle = newAlignPointerStyle;
}
int Settings::CodeFormatter::alignReferenceStyle() const
{
return mAlignReferenceStyle;
}
void Settings::CodeFormatter::setAlignReferenceStyle(int newAlignReferenceStyle)
{
mAlignReferenceStyle = newAlignReferenceStyle;
}
bool Settings::CodeFormatter::breakClosingBraces() const
{
return mBreakClosingBraces;
}
void Settings::CodeFormatter::setBreakClosingBraces(bool newBreakClosingBraces)
{
mBreakClosingBraces = newBreakClosingBraces;
}
bool Settings::CodeFormatter::breakElseIf() const
{
return mBreakElseIf;
}
void Settings::CodeFormatter::setBreakElseIf(bool newBreakElseIf)
{
mBreakElseIf = newBreakElseIf;
}
bool Settings::CodeFormatter::breakOneLineHeaders() const
{
return mBreakOneLineHeaders;
}
void Settings::CodeFormatter::setBreakOneLineHeaders(bool newBreakOneLineHeaders)
{
mBreakOneLineHeaders = newBreakOneLineHeaders;
}
bool Settings::CodeFormatter::addBraces() const
{
return mAddBraces;
}
void Settings::CodeFormatter::setAddBraces(bool newAddBraces)
{
mAddBraces = newAddBraces;
}
bool Settings::CodeFormatter::addOneLineBraces() const
{
return mAddOneLineBraces;
}
void Settings::CodeFormatter::setAddOneLineBraces(bool newAddOneLineBraces)
{
mAddOneLineBraces = newAddOneLineBraces;
}
bool Settings::CodeFormatter::removeBraces() const
{
return mRemoveBraces;
}
void Settings::CodeFormatter::setRemoveBraces(bool newRemoveBraces)
{
mRemoveBraces = newRemoveBraces;
}
bool Settings::CodeFormatter::breakReturnTypeDecl() const
{
return mBreakReturnTypeDecl;
}
void Settings::CodeFormatter::setBreakReturnTypeDecl(bool newBreakReturnTypeDecl)
{
mBreakReturnTypeDecl = newBreakReturnTypeDecl;
}
bool Settings::CodeFormatter::attachReturnType() const
{
return mAttachReturnType;
}
void Settings::CodeFormatter::setAttachReturnType(bool newAttachReturnType)
{
mAttachReturnType = newAttachReturnType;
}
bool Settings::CodeFormatter::attachReturnTypeDecl() const
{
return mAttachReturnTypeDecl;
}
void Settings::CodeFormatter::setAttachReturnTypeDecl(bool newAttachReturnTypeDecl)
{
mAttachReturnTypeDecl = newAttachReturnTypeDecl;
}
bool Settings::CodeFormatter::keepOneLineBlocks() const
{
return mKeepOneLineBlocks;
}
void Settings::CodeFormatter::setKeepOneLineBlocks(bool newKeepOneLineBlocks)
{
mKeepOneLineBlocks = newKeepOneLineBlocks;
}
bool Settings::CodeFormatter::keepOneLineStatements() const
{
return mKeepOneLineStatements;
}
void Settings::CodeFormatter::setKeepOneLineStatements(bool newKeepOneLineStatements)
{
mKeepOneLineStatements = newKeepOneLineStatements;
}
bool Settings::CodeFormatter::convertTabs() const
{
return mConvertTabs;
}
void Settings::CodeFormatter::setConvertTabs(bool newConvertTabs)
{
mConvertTabs = newConvertTabs;
}
bool Settings::CodeFormatter::closeTemplates() const
{
return mCloseTemplates;
}
void Settings::CodeFormatter::setCloseTemplates(bool newCloseTemplates)
{
mCloseTemplates = newCloseTemplates;
}
bool Settings::CodeFormatter::removeCommentPrefix() const
{
return mRemoveCommentPrefix;
}
void Settings::CodeFormatter::setRemoveCommentPrefix(bool newRemoveCommentPrefix)
{
mRemoveCommentPrefix = newRemoveCommentPrefix;
}
int Settings::CodeFormatter::getMaxCodeLength() const
{
return maxCodeLength;
}
void Settings::CodeFormatter::setMaxCodeLength(int newMaxCodeLength)
{
maxCodeLength = newMaxCodeLength;
}
bool Settings::CodeFormatter::breakAfterLogical() const
{
return mBreakAfterLogical;
}
void Settings::CodeFormatter::setBreakAfterLogical(bool newBreakAfterLogical)
{
mBreakAfterLogical = newBreakAfterLogical;
}
bool Settings::CodeFormatter::breakReturnType() const
{
return mBreakReturnType;
}
void Settings::CodeFormatter::setBreakReturnType(bool newBreakReturnType)
{
mBreakReturnType = newBreakReturnType;
}
bool Settings::CodeFormatter::breakMaxCodeLength() const
{
return mBreakMaxCodeLength;
}
void Settings::CodeFormatter::setBreakMaxCodeLength(bool newBreakMaxCodeLength)
{
mBreakMaxCodeLength = newBreakMaxCodeLength;
}
void Settings::CodeFormatter::doSave()
{
saveValue("brace_style",mBraceStyle);
saveValue("indent_style",mIndentStyle);
saveValue("tab_width",mTabWidth);
saveValue("attach_namespaces",mAttachNamespaces);
saveValue("attach_classes",mAttachClasses);
saveValue("attach_inlines",mAttachInlines);
saveValue("attach_extern_c",mAttachExternC);
saveValue("attach_closing_while",mAttachClosingWhile);
saveValue("indent_classes",mIndentClasses);
saveValue("indent_modifiers",mIndentModifiers);
saveValue("indent_cases",mIndentCases);
saveValue("indent_namespaces",mIndentNamespaces);
saveValue("indent_continuation",mIndentContinuation);
saveValue("indent_labels",mIndentLabels);
saveValue("indent_preproc_block",mIndentPreprocBlock);
saveValue("indent_preproc_cond",mIndentPreprocCond);
saveValue("indent_preproc_define",mIndentPreprocDefine);
saveValue("indent_col1_comments",mIndentCol1Comments);
saveValue("min_conditional_indent",mMinConditionalIndent);
saveValue("max_continuation_indent",mMaxContinuationIndent);
saveValue("break_blocks",mBreakBlocks);
saveValue("break_blocks_all",mBreakBlocksAll);
saveValue("pad_oper",mPadOper);
saveValue("pad_comma",mPadComma);
saveValue("pad_paren",mPadParen);
saveValue("pad_paren_out",mPadParenOut);
saveValue("pad_first_paren_out",mPadFirstParenOut);
saveValue("pad_parent_in",mPadParenIn);
saveValue("pad_header",mPadHeader);
saveValue("unpad_paren",mUnpadParen);
saveValue("delete_empty_lines",mDeleteEmptyLines);
saveValue("delete_multiple_empty_lines",mDeleteMultipleEmptyLines);
saveValue("fill_empty_lines",mFillEmptyLines);
saveValue("align_pointer_style",mAlignPointerStyle);
saveValue("align_reference_style",mAlignReferenceStyle);
saveValue("break_closing_braces",mBreakClosingBraces);
saveValue("break_else_if",mBreakElseIf);
saveValue("break_one_line_headers",mBreakOneLineHeaders);
saveValue("add_braces",mAddBraces);
saveValue("add_one_line_braces",mAddOneLineBraces);
saveValue("remove_braces",mRemoveBraces);
saveValue("break_return_type",mBreakReturnType);
saveValue("break_return_type_decl",mBreakReturnTypeDecl);
saveValue("attach_return_type",mAttachReturnType);
saveValue("attach_return_type_decl",mAttachReturnTypeDecl);
saveValue("keep_one_line_blocks",mKeepOneLineBlocks);
saveValue("keep_one_line_statements",mKeepOneLineStatements);
saveValue("convert_tabs",mConvertTabs);
saveValue("close_templates",mCloseTemplates);
saveValue("remove_comment_prefix",mRemoveCommentPrefix);
saveValue("break_max_code_length",mBreakMaxCodeLength);
saveValue("max_code_length",maxCodeLength);
saveValue("break_after_logical",mBreakAfterLogical);
}
void Settings::CodeFormatter::doLoad()
{
mBraceStyle = intValue("brace_style", FormatterBraceStyle::fbsDefault);
mIndentStyle = intValue("indent_style",FormatterIndentType::fitTab); // 0 isspaces, 1 is tab
mTabWidth = intValue("tab_width",4);
mAttachNamespaces = boolValue("attach_namespaces",false);
mAttachClasses = boolValue("attach_classes",false);
mAttachInlines = boolValue("attach_inlines",false);
mAttachExternC = boolValue("attach_extern_c",false);
mAttachClosingWhile = boolValue("attach_closing_while",false);
mIndentClasses = boolValue("indent_classes",false);
mIndentModifiers = boolValue("indent_modifiers",false);
mIndentCases = boolValue("indent_cases",false);
mIndentNamespaces = boolValue("indent_namespaces",false);
mIndentContinuation = boolValue("indent_continuation",false);
mIndentLabels = boolValue("indent_labels",false);
mIndentPreprocBlock = boolValue("indent_preproc_block",false);
mIndentPreprocCond = boolValue("indent_preproc_cond",false);
mIndentPreprocDefine = boolValue("indent_preproc_define",false);
mIndentCol1Comments = boolValue("indent_col1_comments",false);
mMinConditionalIndent = intValue("min_conditional_indent",1);
mMaxContinuationIndent = intValue("max_continuation_indent",40);
mBreakBlocks = boolValue("break_blocks",false);
mBreakBlocksAll = boolValue("break_blocks_all",false);
mPadOper = boolValue("pad_oper",false);
mPadComma = boolValue("pad_comma",false);
mPadParen = boolValue("pad_paren",false);
mPadParenOut = boolValue("pad_paren_out",false);
mPadFirstParenOut = boolValue("pad_first_paren_out",false);
mPadParenIn = boolValue("pad_parent_in",false);
mPadHeader = boolValue("pad_header",false);
mUnpadParen = boolValue("unpad_paren",false);
mDeleteEmptyLines = boolValue("delete_empty_lines",false);
mDeleteMultipleEmptyLines = boolValue("delete_multiple_empty_lines",false);
mFillEmptyLines = boolValue("fill_empty_lines",false);
mAlignPointerStyle = intValue("align_pointer_style", FormatterOperatorAlign::foaNone);
mAlignReferenceStyle = intValue("align_reference_style", FormatterOperatorAlign::foaNone);
mBreakClosingBraces = boolValue("break_closing_braces",false);
mBreakElseIf = boolValue("break_else_if",false);
mBreakOneLineHeaders = boolValue("break_one_line_headers",false);
mAddBraces = boolValue("add_braces",false);
mAddOneLineBraces = boolValue("add_one_line_braces",false);
mRemoveBraces = boolValue("remove_braces",false);
mBreakReturnType = boolValue("break_return_type",false);
mBreakReturnTypeDecl = boolValue("break_return_type_decl",false);
mAttachReturnType = boolValue("attach_return_type",false);
mAttachReturnTypeDecl = boolValue("attach_return_type_decl",false);
mKeepOneLineBlocks = boolValue("keep_one_line_blocks",false);
mKeepOneLineStatements = boolValue("keep_one_line_statements",false);
mConvertTabs = boolValue("convert_tabs",false);
mCloseTemplates = boolValue("close_templates",false);
mRemoveCommentPrefix = boolValue("remove_comment_prefix",false);
mBreakMaxCodeLength = boolValue("break_max_code_length",false);
maxCodeLength = intValue("max_code_length",200);
mBreakAfterLogical = boolValue("break_after_logical",false);
}
int Settings::CodeFormatter::braceStyle() const
{
return mBraceStyle;
}
void Settings::CodeFormatter::setBraceStyle(int newBraceStyle)
{
mBraceStyle = newBraceStyle;
}

View File

@ -468,6 +468,116 @@ public:
class CodeFormatter: public _Base {
public:
explicit CodeFormatter(Settings* settings);
int braceStyle() const;
void setBraceStyle(int newBraceStyle);
int indentStyle() const;
void setIndentStyle(int newIndentStyle);
int tabWidth() const;
void setTabWidth(int newTabWidth);
bool attachNamespaces() const;
void setAttachNamespaces(bool newAttachNamespaces);
bool attachClasses() const;
void setAttachClasses(bool newAttachClasses);
bool attachInlines() const;
void setAttachInlines(bool newAttachInlines);
bool attachExternC() const;
void setAttachExternC(bool newAttachExternC);
bool attachClosingWhile() const;
void setAttachClosingWhile(bool newAttachClosingWhile);
bool indentClasses() const;
void setIndentClasses(bool newIndentClasses);
bool indentModifiers() const;
void setIndentModifiers(bool newIndentModifiers);
bool indentCases() const;
void setIndentCases(bool newIndentCases);
bool indentNamespaces() const;
void setIndentNamespaces(bool newIndentNamespaces);
bool indentContinuation() const;
void setIndentContinuation(bool newIndentContinuation);
bool indentLabels() const;
void setIndentLabels(bool newIndentLabels);
bool indentPreprocBlock() const;
void setIndentPreprocBlock(bool newIndentPreprocBlock);
bool indentPreprocCond() const;
void setIndentPreprocCond(bool newIndentPreprocCond);
bool indentPreprocDefine() const;
void setIndentPreprocDefine(bool newIndentPreprocDefine);
bool indentCol1Comments() const;
void setIndentCol1Comments(bool newIndentCol1Comments);
int minConditionalIndent() const;
void setMinConditionalIndent(int newMinConditionalIndent);
int maxContinuationIndent() const;
void setMaxContinuationIndent(int newMaxContinuationIndent);
bool breakBlocks() const;
void setBreakBlocks(bool newBreakBlocks);
bool breakBlocksAll() const;
void setBreakBlocksAll(bool newBreakBlocksAll);
bool padOper() const;
void setPadOper(bool newPadOper);
bool padComma() const;
void setPadComma(bool newPadComma);
bool padParen() const;
void setPadParen(bool newPadParen);
bool padParenOut() const;
void setPadParenOut(bool newPadParenOut);
bool padFirstParenOut() const;
void setPadFirstParenOut(bool newPadFirstParenOut);
bool padParenIn() const;
void setPadParenIn(bool newPadParenIn);
bool padHeader() const;
void setPadHeader(bool newPadHeader);
bool unpadParen() const;
void setUnpadParen(bool newUnpadParen);
bool deleteEmptyLines() const;
void setDeleteEmptyLines(bool newDeleteEmptyLines);
bool deleteMultipleEmptyLines() const;
void setDeleteMultipleEmptyLines(bool newDeleteMultipleEmptyLines);
bool fillEmptyLines() const;
void setFillEmptyLines(bool newFillEmptyLines);
int alignPointerStyle() const;
void setAlignPointerStyle(int newAlignPointerStyle);
int alignReferenceStyle() const;
void setAlignReferenceStyle(int newAlignReferenceStyle);
bool breakClosingBraces() const;
void setBreakClosingBraces(bool newBreakClosingBraces);
bool breakElseIf() const;
void setBreakElseIf(bool newBreakElseIf);
bool breakOneLineHeaders() const;
void setBreakOneLineHeaders(bool newBreakOneLineHeaders);
bool addBraces() const;
void setAddBraces(bool newAddBraces);
bool addOneLineBraces() const;
void setAddOneLineBraces(bool newAddOneLineBraces);
bool removeBraces() const;
void setRemoveBraces(bool newRemoveBraces);
bool breakReturnTypeDecl() const;
void setBreakReturnTypeDecl(bool newBreakReturnTypeDecl);
bool attachReturnType() const;
void setAttachReturnType(bool newAttachReturnType);
bool attachReturnTypeDecl() const;
void setAttachReturnTypeDecl(bool newAttachReturnTypeDecl);
bool keepOneLineBlocks() const;
void setKeepOneLineBlocks(bool newKeepOneLineBlocks);
bool keepOneLineStatements() const;
void setKeepOneLineStatements(bool newKeepOneLineStatements);
bool convertTabs() const;
void setConvertTabs(bool newConvertTabs);
bool closeTemplates() const;
void setCloseTemplates(bool newCloseTemplates);
bool removeCommentPrefix() const;
void setRemoveCommentPrefix(bool newRemoveCommentPrefix);
int getMaxCodeLength() const;
void setMaxCodeLength(int newMaxCodeLength);
bool breakAfterLogical() const;
void setBreakAfterLogical(bool newBreakAfterLogical);
bool breakReturnType() const;
void setBreakReturnType(bool newBreakReturnType);
bool breakMaxCodeLength() const;
void setBreakMaxCodeLength(bool newBreakMaxCodeLength);
private:
int mBraceStyle;
int mIndentStyle;
@ -486,7 +596,7 @@ public:
bool mIndentPreprocBlock;
bool mIndentPreprocCond;
bool mIndentPreprocDefine;
bool mIndentCollComments;
bool mIndentCol1Comments;
int mMinConditionalIndent;
int mMaxContinuationIndent;
bool mBreakBlocks;
@ -510,7 +620,7 @@ public:
bool mAddBraces;
bool mAddOneLineBraces;
bool mRemoveBraces;
bool mBreakRetureType;
bool mBreakReturnType;
bool mBreakReturnTypeDecl;
bool mAttachReturnType;
bool mAttachReturnTypeDecl;
@ -519,38 +629,13 @@ public:
bool mConvertTabs;
bool mCloseTemplates;
bool mRemoveCommentPrefix;
bool mBreakMaxCodeLength;
int maxCodeLength;
bool mBreakAfterLogical;
int mBracketStyle;
int mIndentStyle;
int mTabWidth;
int mMaxLineLength;
bool mModifyMaxLineLength;
//Indentation options:
bool mIndentClasses; // --indent-classes
bool mIndentSwitches; //-indent-switches
bool mIndentCases; // --indent-cases
bool mIndentNamespaces; // --indent-namespaces
bool mIndentLabels; // --indent-labels
fIndentPreprocessor: Boolean; // --indent-preprocessor
//Padding options
fPadOper: boolean; // --pad-oper; add spaces around an operator
fPadHeader: boolean; // --pad-header; add spaces after 'if','for',etc.
fPointerAlign: integer; // --align-pointer=none/type/middle/name
fReferenceAlign: integer; // --align-reference=none/type/middle/name
fDeleteEmptyLines: boolean;
fDeleteMultipleEmptyLines: boolean;
fCustomCommand: AnsiString;
fFullCommand: AnsiString; // includes customizations
fAStyleDir: AnsiString;
fAStyleFile: AnsiString;
// _Base interface
protected:
void doSave() override;
void doLoad() override;
};
class History: public _Base {
@ -809,6 +894,7 @@ public:
Debugger& debugger();
History& history();
CodeCompletion &codeCompletion();
CodeFormatter &codeFormatter();
QString filename() const;
private:
@ -821,6 +907,7 @@ private:
Executor mExecutor;
Debugger mDebugger;
CodeCompletion mCodeCompletion;
CodeFormatter mCodeFormatter;
History mHistory;
};

View File

@ -1,8 +1,9 @@
#include "formattergeneralwidget.h"
#include "ui_formattergeneralwidget.h"
#include "../settings.h"
FormatterGeneralWidget::FormatterGeneralWidget(QWidget *parent) :
QWidget(parent),
FormatterGeneralWidget::FormatterGeneralWidget(const QString& name, const QString& group, QWidget *parent):
SettingsWidget(name,group,parent),
ui(new Ui::FormatterGeneralWidget)
{
ui->setupUi(this);
@ -12,3 +13,13 @@ FormatterGeneralWidget::~FormatterGeneralWidget()
{
delete ui;
}
void FormatterGeneralWidget::doLoad()
{
}
void FormatterGeneralWidget::doSave()
{
pSettings->codeFormatter().save();
}

View File

@ -2,21 +2,27 @@
#define FORMATTERGENERALWIDGET_H
#include <QWidget>
#include "settingswidget.h"
namespace Ui {
class FormatterGeneralWidget;
}
class FormatterGeneralWidget : public QWidget
class FormatterGeneralWidget : public SettingsWidget
{
Q_OBJECT
public:
explicit FormatterGeneralWidget(QWidget *parent = nullptr);
explicit FormatterGeneralWidget(const QString& name, const QString& group, QWidget *parent = nullptr);
~FormatterGeneralWidget();
private:
Ui::FormatterGeneralWidget *ui;
// SettingsWidget interface
protected:
void doLoad() override;
void doSave() override;
};
#endif // FORMATTERGENERALWIDGET_H

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>430</height>
<width>881</width>
<height>598</height>
</rect>
</property>
<property name="windowTitle">
@ -32,12 +32,12 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Default brace style</string>
<string>Predefined format style</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox"/>
<widget class="QComboBox" name="cbBraceStyle"/>
</item>
<item>
<spacer name="horizontalSpacer">
@ -56,15 +56,25 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="lblBraceStyle">
<property name="text">
<string>sdafasdf&lt;br/&gt;dsafd</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Note for the predefined format style&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Basic</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
@ -72,35 +82,35 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<widget class="QCheckBox" name="chkAttachNamespaces">
<property name="text">
<string>Attach spaces to namespace statements</string>
<string>Attach braces to namespace statements</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<widget class="QCheckBox" name="chkAttachClasses">
<property name="text">
<string>Attach spaces to classes</string>
<string>Attach braces to classes</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<widget class="QCheckBox" name="chkAttachInline">
<property name="text">
<string>Attach spaces to class inline function definitions</string>
<string>Attach braces to class inline function definitions</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_4">
<widget class="QCheckBox" name="chkAttachExternC">
<property name="text">
<string>Attach spaces to extern &quot;C&quot; statements</string>
<string>Attach braces to extern &quot;C&quot; statements</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_5">
<widget class="QCheckBox" name="chkAttachClosingWhile">
<property name="text">
<string>Attach the closing while of do-while to the close brace</string>
</property>
@ -109,14 +119,37 @@
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkConvertTabs">
<property name="text">
<string>Convert tabs to the appropriate number of spaces</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Indentation 1</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Indent with:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<widget class="QRadioButton" name="radioButton_2">
<widget class="QRadioButton" name="rbIndentSpaces">
<property name="toolTip">
<string>Indent using spaces</string>
</property>
@ -126,7 +159,7 @@
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton">
<widget class="QRadioButton" name="rbIndentTabs">
<property name="toolTip">
<string>Indent using tabs</string>
</property>
@ -140,6 +173,57 @@
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<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 row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Tab Size:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinTabSize">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
@ -154,17 +238,24 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Tab Size:</string>
<string>Indent for continuation lines:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox"/>
<widget class="QSpinBox" name="spinIndentContinuation">
<property name="maximum">
<number>4</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -180,6 +271,540 @@
</widget>
</item>
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<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_4">
<property name="text">
<string>Minimal indent for a continuous conditional beloning to a conditional header:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMinConditionalIndent"/>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>187</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<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_5">
<property name="text">
<string>Maximal indent spaces for a continuation line</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMaxContinuationIndent"/>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>427</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Indentation 2</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="5" column="0">
<widget class="QCheckBox" name="chkIndentLabels">
<property name="text">
<string>Indent labels</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkIndentClasses">
<property name="text">
<string>Indent class blocks</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkIndentNamespaces">
<property name="text">
<string>Indent namespaces</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="chkIndentModifiers">
<property name="text">
<string>Indent class access modifiers</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="chkIdentAfterParens">
<property name="text">
<string>Indent after parenthesis '(' or assignment '='</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="chkIndentPreprocCond">
<property name="text">
<string>Indent preprocessor conditional statements</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="chkIndentPreprocDefine">
<property name="text">
<string>Indent multi-line preprocessor #define statements</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QCheckBox" name="chkIndentCol1Comments">
<property name="text">
<string>Indent line comments that start in column one</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="chkIndentPreprocBlock">
<property name="text">
<string>Indent preprocessor blocks</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkIndentSwiches">
<property name="text">
<string>Indent switch blocks</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="chkIndentCases">
<property name="text">
<string>Indent cases</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Padding 1</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<widget class="QCheckBox" name="chkPadOper">
<property name="text">
<string>Insert spaces around operators</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="chkPadComma">
<property name="text">
<string>Insert spaces after commas</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="QCheckBox" name="chkPadHeader">
<property name="text">
<string>Insert spaces after parenthesis headers ('if','for',...)</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="chkPadParenOut">
<property name="text">
<string>Insert spaces around parenthesis on the outside only</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkPadParenIn">
<property name="text">
<string>Insert spaces around parenthesis on the inside only</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkBreakBlocks">
<property name="text">
<string>Insert empty lines arround unrelated blocks</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkBreadBlocksAll">
<property name="text">
<string>Insert empy lines around all blocks</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="chkPadFirstParenOut">
<property name="text">
<string>Insert spaces around first parenthesis in a series on the out side only</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="chkPadParen">
<property name="text">
<string>Insert spaces around parenthesis</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Padding 2</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0" colspan="6">
<widget class="QCheckBox" name="chkDeleteEmptyLines">
<property name="text">
<string>Remove all empty lines. It will NOT delete lines added by the padding options.</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Attach a pointer operator to its :</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QCheckBox" name="chkDeleteMultipleEmptyLines">
<property name="text">
<string>Remove all consecutive empty lines. It will NOT delete lines added by the padding options.</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QRadioButton" name="rbAlignReferenceType">
<property name="text">
<string>type(left)</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QRadioButton" name="rbAlignPointType">
<property name="text">
<string>type(left)</string>
</property>
</widget>
</item>
<item row="4" column="5">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="3">
<widget class="QRadioButton" name="rbAlignReferenceMiddle">
<property name="text">
<string>middle</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="6">
<widget class="QCheckBox" name="chkFileEmptyLines">
<property name="text">
<string>Fill empty lines with the white space of the previous lines.</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QRadioButton" name="rbAlignReferenceName">
<property name="text">
<string>name(right)</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QRadioButton" name="rbAlignPointerMiddle">
<property name="text">
<string>middle</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QRadioButton" name="rbAlignPointerName">
<property name="text">
<string>name(right)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="6">
<widget class="QCheckBox" name="chkUnpadParen">
<property name="text">
<string>Remove unnecessary space adding around parenthesis</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Attach a reference operator to its :</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QRadioButton" name="rbAlignPointNone">
<property name="text">
<string>none</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QRadioButton" name="rbAlignReferenceNone">
<property name="text">
<string>none</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Other 1</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="0">
<widget class="QCheckBox" name="chkBreakOneLineHeaders">
<property name="text">
<string>Break one line headers ('if','while','else'...) from the statement on the same line</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkAddOneLineBraces">
<property name="text">
<string>Add one line braces to unbraced one line conditional statements</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkBreakClosingBraces">
<property name="text">
<string>Break braces before close headers ('else','catch&quot;...)</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="chkRemoveBraces">
<property name="text">
<string>Remove braces from a braced one line conditional statements</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkBreakElseIf">
<property name="text">
<string>Break 'else if' statements into two lines</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="chkAddBraces">
<property name="text">
<string>Add braces to unbraced one line conditional statements</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_7">
<attribute name="title">
<string>Other 2</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="3" column="0">
<widget class="QCheckBox" name="chkAttachReturnTypeDecl">
<property name="text">
<string>Attach return type to the function name in its declaration</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkBreakReturnTypeDecl">
<property name="text">
<string>Break return type from the function name in its declaration</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkBreakReturnType">
<property name="text">
<string>Break return type from the function name in its definition</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkAttachReturnType">
<property name="text">
<string>Attach return type to the function name in its definition</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkKeepOneLineBlocks">
<property name="text">
<string>Don't break blocks residing completely on one line</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="chkKeepOneLineStatements">
<property name="text">
<string>Don't break multimple statements residing on one line</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_8">
<attribute name="title">
<string>Other 3</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="0">
<widget class="QCheckBox" name="chkBreakAfterLogical">
<property name="text">
<string>Place the logical conditional to the last on the previous line, when break lines</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkCloseTemplates">
<property name="text">
<string>Close ending angle brackets on template definitions</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkRemoveCommentPrefix">
<property name="text">
<string>Remove the leading '*' prefix on multi-line comments and indent the comment text one line indent.</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<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="QCheckBox" name="chkBreakMaxCodeLength">
<property name="text">
<string>Break lines exceeds</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMaxCodeLength">
<property name="suffix">
<string>characters</string>
</property>
<property name="minimum">
<number>50</number>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="value">
<number>200</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<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 row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -194,6 +819,26 @@
</item>
</layout>
</widget>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,14 +0,0 @@
#include "formatteridentationwidget.h"
#include "ui_formatteridentationwidget.h"
FormatterIdentationWidget::FormatterIdentationWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::FormatterIdentationWidget)
{
ui->setupUi(this);
}
FormatterIdentationWidget::~FormatterIdentationWidget()
{
delete ui;
}

View File

@ -1,22 +0,0 @@
#ifndef FORMATTERIDENTATIONWIDGET_H
#define FORMATTERIDENTATIONWIDGET_H
#include <QWidget>
namespace Ui {
class FormatterIdentationWidget;
}
class FormatterIdentationWidget : public QWidget
{
Q_OBJECT
public:
explicit FormatterIdentationWidget(QWidget *parent = nullptr);
~FormatterIdentationWidget();
private:
Ui::FormatterIdentationWidget *ui;
};
#endif // FORMATTERIDENTATIONWIDGET_H

View File

@ -1,21 +0,0 @@
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>FormatterIdentationWidget</class>
<widget name="FormatterIdentationWidget" class="QWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<pixmapfunction/>
<connections/>
</ui>

View File

@ -14,6 +14,7 @@
#include "environmentappearencewidget.h"
#include "executorgeneralwidget.h"
#include "debuggeneralwidget.h"
#include "formattergeneralwidget.h"
#include <QDebug>
#include <QMessageBox>
#include <QModelIndex>
@ -83,6 +84,11 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
pDebugGeneralWidget->init();
addWidget(pDebugGeneralWidget);
pFormatterGeneralWidget = new FormatterGeneralWidget(tr("General"),tr("Code Formatter"));
pFormatterGeneralWidget->init();
addWidget(pFormatterGeneralWidget);
ui->widgetsView->expandAll();
//select the first widget of the first group
auto groupIndex = ui->widgetsView->model()->index(0,0);

View File

@ -23,6 +23,7 @@ class EditorMiscWidget;
class EnvironmentAppearenceWidget;
class ExecutorGeneralWidget;
class DebugGeneralWidget;
class FormatterGeneralWidget;
class SettingsWidget;
class SettingsDialog : public QDialog
{
@ -65,6 +66,7 @@ private:
EditorMiscWidget *pEditorMiscWidget;
ExecutorGeneralWidget *pExecutorGeneralWidget;
DebugGeneralWidget *pDebugGeneralWidget;
FormatterGeneralWidget *pFormatterGeneralWidget;
};
#endif // SETTINGSDIALOG_H

View File

@ -52,6 +52,38 @@ enum AutoSaveStrategy {
assAppendFormatedTimeStamp
};
enum FormatterBraceStyle {
fbsDefault,
fbsAllman,
fbsJava,
fbsKR,
fbsStroustrup,
fbsWitesmith,
fbsVtk,
fbsRatliff,
fbsGNU,
fbsLinux,
fbsHorstman,
fbs1TBS,
fbsGoogle,
fbsMozilla,
fbsWebkit,
fbsPico,
fbsLisp
};
enum FormatterOperatorAlign {
foaNone,
foaType,
foaMiddle,
foaName
};
enum FormatterIndentType {
fitSpace,
fitTab
};
class BaseError{
public:
explicit BaseError(const QString& reason);