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/editorcodecompletionwidget.cpp \
settingsdialog/editormiscwidget.cpp \ settingsdialog/editormiscwidget.cpp \
settingsdialog/formattergeneralwidget.cpp \ settingsdialog/formattergeneralwidget.cpp \
settingsdialog/formatteridentationwidget.cpp \
widgets/classbrowser.cpp \ widgets/classbrowser.cpp \
widgets/codecompletionlistview.cpp \ widgets/codecompletionlistview.cpp \
widgets/codecompletionpopup.cpp \ widgets/codecompletionpopup.cpp \
@ -106,7 +105,6 @@ HEADERS += \
settingsdialog/editorcodecompletionwidget.h \ settingsdialog/editorcodecompletionwidget.h \
settingsdialog/editormiscwidget.h \ settingsdialog/editormiscwidget.h \
settingsdialog/formattergeneralwidget.h \ settingsdialog/formattergeneralwidget.h \
settingsdialog/formatteridentationwidget.h \
widgets/classbrowser.h \ widgets/classbrowser.h \
widgets/codecompletionlistview.h \ widgets/codecompletionlistview.h \
widgets/codecompletionpopup.h \ widgets/codecompletionpopup.h \
@ -163,7 +161,6 @@ FORMS += \
settingsdialog/editorcodecompletionwidget.ui \ settingsdialog/editorcodecompletionwidget.ui \
settingsdialog/editormiscwidget.ui \ settingsdialog/editormiscwidget.ui \
settingsdialog/formattergeneralwidget.ui \ settingsdialog/formattergeneralwidget.ui \
settingsdialog/formatteridentationwidget.ui \
widgets/cpudialog.ui \ widgets/cpudialog.ui \
mainwindow.ui \ mainwindow.ui \
settingsdialog/compilersetdirectorieswidget.ui \ settingsdialog/compilersetdirectorieswidget.ui \

View File

@ -523,7 +523,7 @@ Are you really want to continue?</source>
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="76"/> <location filename="editor.cpp" line="78"/>
<source>untitled%1</source> <source>untitled%1</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
@ -532,61 +532,61 @@ Are you really want to continue?</source>
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="180"/> <location filename="editor.cpp" line="188"/>
<location filename="editor.cpp" line="192"/> <location filename="editor.cpp" line="202"/>
<location filename="editor.cpp" line="227"/> <location filename="editor.cpp" line="238"/>
<location filename="editor.cpp" line="807"/> <location filename="editor.cpp" line="818"/>
<location filename="editor.cpp" line="812"/> <location filename="editor.cpp" line="823"/>
<location filename="editor.cpp" line="830"/> <location filename="editor.cpp" line="841"/>
<location filename="editor.cpp" line="835"/> <location filename="editor.cpp" line="846"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="181"/> <location filename="editor.cpp" line="189"/>
<source>File %1 is not writable!</source> <source>File %1 is not writable!</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="212"/> <location filename="editor.cpp" line="223"/>
<source>Save As</source> <source>Save As</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="808"/> <location filename="editor.cpp" line="819"/>
<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="813"/> <location filename="editor.cpp" line="824"/>
<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="831"/> <location filename="editor.cpp" line="842"/>
<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="836"/> <location filename="editor.cpp" line="847"/>
<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="2005"/>
<location filename="editor.cpp" line="2042"/> <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> <source>Ctrl+click for more info</source>
<translation>Ctrl+</translation> <translation>Ctrl+</translation>
</message> </message>
<message> <message>
<location filename="editor.cpp" line="2111"/> <location filename="editor.cpp" line="2148"/>
<location filename="editor.cpp" line="2141"/> <location filename="editor.cpp" line="2178"/>
<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="2651"/> <location filename="editor.cpp" line="2688"/>
<source>Readonly</source> <source>Readonly</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1305,6 +1305,388 @@ Are you really want to continue?</source>
<translation>: %1 %2</translation> <translation>: %1 %2</translation>
</message> </message>
</context> </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> <context>
<name>IssuesModel</name> <name>IssuesModel</name>
<message> <message>
@ -1337,7 +1719,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="267"/> <location filename="mainwindow.ui" line="267"/>
<location filename="mainwindow.cpp" line="1228"/> <location filename="mainwindow.cpp" line="1231"/>
<source>Issues</source> <source>Issues</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1949,12 +2331,12 @@ Are you really want to continue?</source>
<message> <message>
<location filename="mainwindow.cpp" line="523"/> <location filename="mainwindow.cpp" line="523"/>
<location filename="mainwindow.cpp" line="1060"/> <location filename="mainwindow.cpp" line="1060"/>
<location filename="mainwindow.cpp" line="1117"/> <location filename="mainwindow.cpp" line="1120"/>
<location filename="mainwindow.cpp" line="1141"/> <location filename="mainwindow.cpp" line="1144"/>
<location filename="mainwindow.cpp" line="1163"/> <location filename="mainwindow.cpp" line="1166"/>
<location filename="mainwindow.cpp" line="1175"/> <location filename="mainwindow.cpp" line="1178"/>
<location filename="mainwindow.cpp" line="1471"/> <location filename="mainwindow.cpp" line="1474"/>
<location filename="mainwindow.cpp" line="1483"/> <location filename="mainwindow.cpp" line="1486"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -1979,55 +2361,55 @@ Are you really want to continue?</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1137"/> <location filename="mainwindow.cpp" line="1140"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1319"/> <location filename="mainwindow.cpp" line="1322"/>
<source>Compile Failed</source> <source>Compile Failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1324"/> <location filename="mainwindow.cpp" line="1327"/>
<source>Run Failed</source> <source>Run Failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1500"/> <location filename="mainwindow.cpp" line="1503"/>
<location filename="mainwindow.cpp" line="1514"/> <location filename="mainwindow.cpp" line="1517"/>
<source>Confirm Convertion</source> <source>Confirm Convertion</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1501"/> <location filename="mainwindow.cpp" line="1504"/>
<location filename="mainwindow.cpp" line="1515"/> <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> <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> <translation>使%1&lt;br /&gt;&lt;br /&gt;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1690"/> <location filename="mainwindow.cpp" line="1693"/>
<source>New Watch Expression</source> <source>New Watch Expression</source>
<translation></translation> <translation></translation>
</message> </message>
<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> <source>Enter Watch Expression (it is recommended to use &apos;this-&gt;&apos; for class members):</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1737"/> <location filename="mainwindow.cpp" line="1740"/>
<source>Parsing file %1 of %2: &quot;%3&quot;</source> <source>Parsing file %1 of %2: &quot;%3&quot;</source>
<translation>%1/%2&quot;%3&quot;</translation> <translation>%1/%2&quot;%3&quot;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1759"/> <location filename="mainwindow.cpp" line="1762"/>
<location filename="mainwindow.cpp" line="1765"/> <location filename="mainwindow.cpp" line="1768"/>
<source>Done parsing %1 files in %2 seconds</source> <source>Done parsing %1 files in %2 seconds</source>
<translation>%1,%2</translation> <translation>%1,%2</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1762"/> <location filename="mainwindow.cpp" line="1765"/>
<source>(%1 files per second)</source> <source>(%1 files per second)</source>
<translation>(%1</translation> <translation>(%1</translation>
</message> </message>
@ -2099,216 +2481,216 @@ Are you really want to continue?</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1197"/> <location filename="settings.cpp" line="1204"/>
<location filename="settings.cpp" line="1216"/> <location filename="settings.cpp" line="1223"/>
<location filename="settings.cpp" line="1228"/> <location filename="settings.cpp" line="1235"/>
<location filename="settings.cpp" line="1240"/> <location filename="settings.cpp" line="1247"/>
<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="1198"/> <location filename="settings.cpp" line="1205"/>
<location filename="settings.cpp" line="1208"/> <location filename="settings.cpp" line="1215"/>
<source>binary</source> <source>binary</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1207"/> <location filename="settings.cpp" line="1214"/>
<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="1217"/> <location filename="settings.cpp" line="1224"/>
<source>C include</source> <source>C include</source>
<translation>C包含</translation> <translation>C包含</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1229"/> <location filename="settings.cpp" line="1236"/>
<location filename="settings.cpp" line="1241"/> <location filename="settings.cpp" line="1248"/>
<source>C++ include</source> <source>C++ include</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1260"/> <location filename="settings.cpp" line="1267"/>
<location filename="settings.cpp" line="1265"/> <location filename="settings.cpp" line="1272"/>
<location filename="settings.cpp" line="1270"/> <location filename="settings.cpp" line="1277"/>
<location filename="settings.cpp" line="1275"/> <location filename="settings.cpp" line="1282"/>
<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="1746"/> <location filename="settings.cpp" line="1753"/>
<source>C options</source> <source>C options</source>
<translation>C语言选项</translation> <translation>C语言选项</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1747"/> <location filename="settings.cpp" line="1754"/>
<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="1748"/> <location filename="settings.cpp" line="1755"/>
<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="1749"/> <location filename="settings.cpp" line="1756"/>
<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="1752"/> <location filename="settings.cpp" line="1759"/>
<source>Code Generation</source> <source>Code Generation</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1781"/> <location filename="settings.cpp" line="1788"/>
<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="1782"/> <location filename="settings.cpp" line="1789"/>
<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="1802"/> <location filename="settings.cpp" line="1809"/>
<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="1813"/> <location filename="settings.cpp" line="1820"/>
<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="1820"/> <location filename="settings.cpp" line="1827"/>
<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="1843"/> <location filename="settings.cpp" line="1850"/>
<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="1844"/> <location filename="settings.cpp" line="1851"/>
<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="1845"/> <location filename="settings.cpp" line="1852"/>
<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="1848"/> <location filename="settings.cpp" line="1855"/>
<source>Warnings</source> <source>Warnings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1849"/> <location filename="settings.cpp" line="1856"/>
<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="1850"/> <location filename="settings.cpp" line="1857"/>
<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="1851"/> <location filename="settings.cpp" line="1858"/>
<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="1852"/> <location filename="settings.cpp" line="1859"/>
<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="1853"/> <location filename="settings.cpp" line="1860"/>
<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="1854"/> <location filename="settings.cpp" line="1861"/>
<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="1855"/> <location filename="settings.cpp" line="1862"/>
<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="1858"/> <location filename="settings.cpp" line="1865"/>
<source>Linker</source> <source>Linker</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1859"/> <location filename="settings.cpp" line="1866"/>
<source>Link an Objective C program (-lobjc)</source> <source>Link an Objective C program (-lobjc)</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1860"/> <location filename="settings.cpp" line="1867"/>
<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="1861"/> <location filename="settings.cpp" line="1868"/>
<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="1862"/> <location filename="settings.cpp" line="1869"/>
<source>Strip executable (-s)</source> <source>Strip executable (-s)</source>
<translation>(-s)</translation> <translation>(-s)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1863"/> <location filename="settings.cpp" line="1870"/>
<source>Link libraries statically (-static)</source> <source>Link libraries statically (-static)</source>
<translation>Ojbective C程序(-lobjc)</translation> <translation>Ojbective C程序(-lobjc)</translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1866"/> <location filename="settings.cpp" line="1873"/>
<source>Output</source> <source>Output</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settings.cpp" line="1867"/> <location filename="settings.cpp" line="1874"/>
<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="1868"/> <location filename="settings.cpp" line="1875"/>
<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="1869"/> <location filename="settings.cpp" line="1876"/>
<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="2062"/> <location filename="settings.cpp" line="2069"/>
<location filename="settings.cpp" line="2087"/> <location filename="settings.cpp" line="2094"/>
<source>Confirm</source> <source>Confirm</source>
<translation></translation> <translation></translation>
</message> </message>
<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> <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="2088"/> <location filename="settings.cpp" line="2095"/>
<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="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> <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>
@ -2961,102 +3343,108 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="33"/> <location filename="settingsdialog/settingsdialog.cpp" line="34"/>
<source>Appearence</source> <source>Appearence</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="33"/> <location filename="settingsdialog/settingsdialog.cpp" line="34"/>
<source>Environment</source> <source>Environment</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="37"/> <location filename="settingsdialog/settingsdialog.cpp" line="38"/>
<source>Compiler Set</source> <source>Compiler Set</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="37"/> <location filename="settingsdialog/settingsdialog.cpp" line="38"/>
<source>Compiler</source> <source>Compiler</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="41"/> <location filename="settingsdialog/settingsdialog.cpp" line="42"/>
<location filename="settingsdialog/settingsdialog.cpp" line="78"/> <location filename="settingsdialog/settingsdialog.cpp" line="79"/>
<location filename="settingsdialog/settingsdialog.cpp" line="82"/> <location filename="settingsdialog/settingsdialog.cpp" line="83"/>
<location filename="settingsdialog/settingsdialog.cpp" line="87"/>
<source>General</source> <source>General</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="41"/> <location filename="settingsdialog/settingsdialog.cpp" line="42"/>
<location filename="settingsdialog/settingsdialog.cpp" line="45"/> <location filename="settingsdialog/settingsdialog.cpp" line="46"/>
<location filename="settingsdialog/settingsdialog.cpp" line="49"/> <location filename="settingsdialog/settingsdialog.cpp" line="50"/>
<location filename="settingsdialog/settingsdialog.cpp" line="53"/> <location filename="settingsdialog/settingsdialog.cpp" line="54"/>
<location filename="settingsdialog/settingsdialog.cpp" line="57"/> <location filename="settingsdialog/settingsdialog.cpp" line="58"/>
<location filename="settingsdialog/settingsdialog.cpp" line="61"/> <location filename="settingsdialog/settingsdialog.cpp" line="62"/>
<location filename="settingsdialog/settingsdialog.cpp" line="65"/> <location filename="settingsdialog/settingsdialog.cpp" line="66"/>
<location filename="settingsdialog/settingsdialog.cpp" line="69"/> <location filename="settingsdialog/settingsdialog.cpp" line="70"/>
<location filename="settingsdialog/settingsdialog.cpp" line="73"/> <location filename="settingsdialog/settingsdialog.cpp" line="74"/>
<source>Editor</source> <source>Editor</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="45"/> <location filename="settingsdialog/settingsdialog.cpp" line="46"/>
<source>Font</source> <source>Font</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="49"/> <location filename="settingsdialog/settingsdialog.cpp" line="50"/>
<source>Copy &amp; Export</source> <source>Copy &amp; Export</source>
<translation>/</translation> <translation>/</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="53"/> <location filename="settingsdialog/settingsdialog.cpp" line="54"/>
<source>Color</source> <source>Color</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="57"/> <location filename="settingsdialog/settingsdialog.cpp" line="58"/>
<source>Code Completion</source> <source>Code Completion</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="61"/> <location filename="settingsdialog/settingsdialog.cpp" line="62"/>
<source>Symbol Completion</source> <source>Symbol Completion</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="65"/> <location filename="settingsdialog/settingsdialog.cpp" line="66"/>
<source>Auto Syntax Checking</source> <source>Auto Syntax Checking</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="69"/> <location filename="settingsdialog/settingsdialog.cpp" line="70"/>
<source>Auto save</source> <source>Auto save</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="73"/> <location filename="settingsdialog/settingsdialog.cpp" line="74"/>
<source>Misc</source> <source>Misc</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="78"/> <location filename="settingsdialog/settingsdialog.cpp" line="79"/>
<source>Program Runner</source> <source>Program Runner</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/settingsdialog.cpp" line="82"/> <location filename="settingsdialog/settingsdialog.cpp" line="83"/>
<source>Debugger</source> <source>Debugger</source>
<translation></translation> <translation></translation>
</message> </message>
<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> <source>Save Changes</source>
<translation></translation> <translation></translation>
</message> </message>
<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> <source>There are changes in the settings, do you want to save them before swtich to other page?</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -24,6 +24,7 @@ Settings::Settings(const QString &filename):
mExecutor(this), mExecutor(this),
mDebugger(this), mDebugger(this),
mCodeCompletion(this), mCodeCompletion(this),
mCodeFormatter(this),
mHistory(this) mHistory(this)
{ {
load(); load();
@ -81,6 +82,7 @@ void Settings::load()
mDebugger.load(); mDebugger.load();
mHistory.load(); mHistory.load();
mCodeCompletion.load(); mCodeCompletion.load();
mCodeFormatter.load();
} }
Settings::Dirs &Settings::dirs() Settings::Dirs &Settings::dirs()
@ -118,6 +120,11 @@ Settings::CodeCompletion& Settings::codeCompletion()
return mCodeCompletion; return mCodeCompletion;
} }
Settings::CodeFormatter &Settings::codeFormatter()
{
return mCodeFormatter;
}
Settings::History& Settings::history() Settings::History& Settings::history()
{ {
return mHistory; 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 { class CodeFormatter: public _Base {
public: public:
explicit CodeFormatter(Settings* settings); 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: private:
int mBraceStyle; int mBraceStyle;
int mIndentStyle; int mIndentStyle;
@ -486,7 +596,7 @@ public:
bool mIndentPreprocBlock; bool mIndentPreprocBlock;
bool mIndentPreprocCond; bool mIndentPreprocCond;
bool mIndentPreprocDefine; bool mIndentPreprocDefine;
bool mIndentCollComments; bool mIndentCol1Comments;
int mMinConditionalIndent; int mMinConditionalIndent;
int mMaxContinuationIndent; int mMaxContinuationIndent;
bool mBreakBlocks; bool mBreakBlocks;
@ -510,7 +620,7 @@ public:
bool mAddBraces; bool mAddBraces;
bool mAddOneLineBraces; bool mAddOneLineBraces;
bool mRemoveBraces; bool mRemoveBraces;
bool mBreakRetureType; bool mBreakReturnType;
bool mBreakReturnTypeDecl; bool mBreakReturnTypeDecl;
bool mAttachReturnType; bool mAttachReturnType;
bool mAttachReturnTypeDecl; bool mAttachReturnTypeDecl;
@ -519,38 +629,13 @@ public:
bool mConvertTabs; bool mConvertTabs;
bool mCloseTemplates; bool mCloseTemplates;
bool mRemoveCommentPrefix; bool mRemoveCommentPrefix;
bool mBreakMaxCodeLength;
int maxCodeLength; int maxCodeLength;
bool mBreakAfterLogical; bool mBreakAfterLogical;
// _Base interface
protected:
void doSave() override;
void doLoad() override;
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;
}; };
class History: public _Base { class History: public _Base {
@ -809,6 +894,7 @@ public:
Debugger& debugger(); Debugger& debugger();
History& history(); History& history();
CodeCompletion &codeCompletion(); CodeCompletion &codeCompletion();
CodeFormatter &codeFormatter();
QString filename() const; QString filename() const;
private: private:
@ -821,6 +907,7 @@ private:
Executor mExecutor; Executor mExecutor;
Debugger mDebugger; Debugger mDebugger;
CodeCompletion mCodeCompletion; CodeCompletion mCodeCompletion;
CodeFormatter mCodeFormatter;
History mHistory; History mHistory;
}; };

View File

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

View File

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

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>881</width>
<height>430</height> <height>598</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -32,12 +32,12 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Default brace style</string> <string>Predefined format style</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboBox"/> <widget class="QComboBox" name="cbBraceStyle"/>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
@ -56,15 +56,25 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="lblBraceStyle">
<property name="text"> <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>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </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> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
@ -72,35 +82,35 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="chkAttachNamespaces">
<property name="text"> <property name="text">
<string>Attach spaces to namespace statements</string> <string>Attach braces to namespace statements</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_2"> <widget class="QCheckBox" name="chkAttachClasses">
<property name="text"> <property name="text">
<string>Attach spaces to classes</string> <string>Attach braces to classes</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_3"> <widget class="QCheckBox" name="chkAttachInline">
<property name="text"> <property name="text">
<string>Attach spaces to class inline function definitions</string> <string>Attach braces to class inline function definitions</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_4"> <widget class="QCheckBox" name="chkAttachExternC">
<property name="text"> <property name="text">
<string>Attach spaces to extern &quot;C&quot; statements</string> <string>Attach braces to extern &quot;C&quot; statements</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_5"> <widget class="QCheckBox" name="chkAttachClosingWhile">
<property name="text"> <property name="text">
<string>Attach the closing while of do-while to the close brace</string> <string>Attach the closing while of do-while to the close brace</string>
</property> </property>
@ -109,14 +119,37 @@
</layout> </layout>
</widget> </widget>
</item> </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> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Indent with:</string> <string>Indent with:</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <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> <item>
<widget class="QRadioButton" name="radioButton_2"> <widget class="QRadioButton" name="rbIndentSpaces">
<property name="toolTip"> <property name="toolTip">
<string>Indent using spaces</string> <string>Indent using spaces</string>
</property> </property>
@ -126,7 +159,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="radioButton"> <widget class="QRadioButton" name="rbIndentTabs">
<property name="toolTip"> <property name="toolTip">
<string>Indent using tabs</string> <string>Indent using tabs</string>
</property> </property>
@ -140,6 +173,57 @@
</item> </item>
<item> <item>
<widget class="QWidget" name="widget_2" native="true"> <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"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@ -154,17 +238,24 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Tab Size:</string> <string>Indent for continuation lines:</string>
</property> </property>
</widget> </widget>
</item> </item>
<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>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -180,6 +271,540 @@
</widget> </widget>
</item> </item>
<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"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -194,6 +819,26 @@
</item> </item>
</layout> </layout>
</widget> </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/> <resources/>
<connections/> <connections/>
</ui> </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 "environmentappearencewidget.h"
#include "executorgeneralwidget.h" #include "executorgeneralwidget.h"
#include "debuggeneralwidget.h" #include "debuggeneralwidget.h"
#include "formattergeneralwidget.h"
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <QModelIndex> #include <QModelIndex>
@ -83,6 +84,11 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
pDebugGeneralWidget->init(); pDebugGeneralWidget->init();
addWidget(pDebugGeneralWidget); addWidget(pDebugGeneralWidget);
pFormatterGeneralWidget = new FormatterGeneralWidget(tr("General"),tr("Code Formatter"));
pFormatterGeneralWidget->init();
addWidget(pFormatterGeneralWidget);
ui->widgetsView->expandAll(); ui->widgetsView->expandAll();
//select the first widget of the first group //select the first widget of the first group
auto groupIndex = ui->widgetsView->model()->index(0,0); auto groupIndex = ui->widgetsView->model()->index(0,0);

View File

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

View File

@ -52,6 +52,38 @@ enum AutoSaveStrategy {
assAppendFormatedTimeStamp 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{ class BaseError{
public: public:
explicit BaseError(const QString& reason); explicit BaseError(const QString& reason);