feature: astyle reformat option dialog
This commit is contained in:
parent
0f70658d32
commit
2778e9f4bd
|
@ -185,6 +185,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
|
codes.qrc \
|
||||||
colorschemes.qrc \
|
colorschemes.qrc \
|
||||||
themes/dark/dark.qrc \
|
themes/dark/dark.qrc \
|
||||||
themes/light/light.qrc \
|
themes/light/light.qrc \
|
||||||
|
|
|
@ -573,20 +573,20 @@ Are you really want to continue?</source>
|
||||||
<translation>要剪切的内容超过了字符数限制!</translation>
|
<translation>要剪切的内容超过了字符数限制!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="editor.cpp" line="2042"/>
|
<location filename="editor.cpp" line="2045"/>
|
||||||
<location filename="editor.cpp" line="2079"/>
|
<location filename="editor.cpp" line="2082"/>
|
||||||
<location filename="editor.cpp" line="2130"/>
|
<location filename="editor.cpp" line="2133"/>
|
||||||
<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="2148"/>
|
<location filename="editor.cpp" line="2151"/>
|
||||||
<location filename="editor.cpp" line="2178"/>
|
<location filename="editor.cpp" line="2181"/>
|
||||||
<source>Symbol '%1' not found!</source>
|
<source>Symbol '%1' not found!</source>
|
||||||
<translation>未找到符号'%1'!</translation>
|
<translation>未找到符号'%1'!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="editor.cpp" line="2688"/>
|
<location filename="editor.cpp" line="2691"/>
|
||||||
<source>Readonly</source>
|
<source>Readonly</source>
|
||||||
<translation>只读</translation>
|
<translation>只读</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -1319,371 +1319,371 @@ Are you really want to continue?</source>
|
||||||
<translation>预定义排版方案</translation>
|
<translation>预定义排版方案</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="75"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="78"/>
|
||||||
<source>Basic</source>
|
<source>Basic</source>
|
||||||
<translation>基本</translation>
|
<translation>基本</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="81"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="84"/>
|
||||||
<source>Brace modifications</source>
|
<source>Brace modifications</source>
|
||||||
<translation>花括号修改</translation>
|
<translation>花括号修改</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="87"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="90"/>
|
||||||
<source>Attach braces to namespace statements</source>
|
<source>Attach braces to namespace statements</source>
|
||||||
<oldsource>Attach spaces to namespace statements</oldsource>
|
<oldsource>Attach spaces to namespace statements</oldsource>
|
||||||
<translation>添加花括号到命名空间(namespace)定义</translation>
|
<translation>添加花括号到命名空间(namespace)定义</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="94"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="97"/>
|
||||||
<source>Attach braces to classes</source>
|
<source>Attach braces to classes</source>
|
||||||
<oldsource>Attach spaces to classes</oldsource>
|
<oldsource>Attach spaces to classes</oldsource>
|
||||||
<translation>添加花括号到类(class)定义</translation>
|
<translation>添加花括号到类(class)定义</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="101"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="104"/>
|
||||||
<source>Attach braces to class inline function definitions</source>
|
<source>Attach braces to class inline function definitions</source>
|
||||||
<oldsource>Attach spaces to class inline function definitions</oldsource>
|
<oldsource>Attach spaces to class inline function definitions</oldsource>
|
||||||
<translation>添加花括号到类内联函数(inline function)定义</translation>
|
<translation>添加花括号到类内联函数(inline function)定义</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="108"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="111"/>
|
||||||
<source>Attach braces to extern "C" statements</source>
|
<source>Attach braces to extern "C" statements</source>
|
||||||
<oldsource>Attach spaces to extern "C" statements</oldsource>
|
<oldsource>Attach spaces to extern "C" statements</oldsource>
|
||||||
<translation>添加花括号到extern "C"语句</translation>
|
<translation>添加花括号到extern "C"语句</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="115"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="118"/>
|
||||||
<source>Attach the closing while of do-while to the close brace</source>
|
<source>Attach the closing while of do-while to the close brace</source>
|
||||||
<translation>将do-while语句的while部分与结尾花括号合并</translation>
|
<translation>将do-while语句的while部分与结尾花括号合并</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="125"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="128"/>
|
||||||
<source>Convert tabs to the appropriate number of spaces</source>
|
<source>Convert tabs to the appropriate number of spaces</source>
|
||||||
<translation>将制表符(Tab)转换为相应数量的空格</translation>
|
<translation>将制表符(Tab)转换为相应数量的空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="133"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="136"/>
|
||||||
<source>Indentation 1</source>
|
<source>Indentation 1</source>
|
||||||
<translation>缩进1</translation>
|
<translation>缩进1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="139"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="142"/>
|
||||||
<source>Indent with:</source>
|
<source>Indent with:</source>
|
||||||
<translation>使用什么符号缩进:</translation>
|
<translation>使用什么符号缩进:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="154"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="157"/>
|
||||||
<source>Indent using spaces</source>
|
<source>Indent using spaces</source>
|
||||||
<translation>使用空格缩进</translation>
|
<translation>使用空格缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="157"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="160"/>
|
||||||
<source>Spaces</source>
|
<source>Spaces</source>
|
||||||
<translation>空格</translation>
|
<translation>空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="164"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="167"/>
|
||||||
<source>Indent using tabs</source>
|
<source>Indent using tabs</source>
|
||||||
<translation>使用制表符缩进</translation>
|
<translation>使用制表符缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="167"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="170"/>
|
||||||
<source>Tabs</source>
|
<source>Tabs</source>
|
||||||
<translation>制表符</translation>
|
<translation>制表符</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="192"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="195"/>
|
||||||
<source>Tab Size:</source>
|
<source>Tab Size:</source>
|
||||||
<translation>缩进宽度</translation>
|
<translation>缩进宽度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="243"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="246"/>
|
||||||
<source>Indent for continuation lines:</source>
|
<source>Indent for continuation lines:</source>
|
||||||
<translation>连续行的缩进量:</translation>
|
<translation>连续行的缩进量:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="291"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="294"/>
|
||||||
<source>Minimal indent for a continuous conditional beloning to a conditional header:</source>
|
<source>Minimal indent for a continuous conditional beloning to a conditional header:</source>
|
||||||
<translation>属于同一个条件语句('if','while',...)的条件的最小缩进量</translation>
|
<translation>属于同一个条件语句('if','while',...)的条件的最小缩进量</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="332"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="335"/>
|
||||||
<source>Maximal indent spaces for a continuation line</source>
|
<source>Maximal indent spaces for a continuation line</source>
|
||||||
<translation>连续行的最大缩进空格数:</translation>
|
<translation>连续行的最大缩进空格数:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="359"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="362"/>
|
||||||
<source>Indentation 2</source>
|
<source>Indentation 2</source>
|
||||||
<translation>缩进2</translation>
|
<translation>缩进2</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="365"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="368"/>
|
||||||
<source>Indent labels</source>
|
<source>Indent labels</source>
|
||||||
<translation>缩进标签(label)</translation>
|
<translation>缩进标签(label)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="372"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="375"/>
|
||||||
<source>Indent class blocks</source>
|
<source>Indent class blocks</source>
|
||||||
<translation>缩进类定义(class)</translation>
|
<translation>缩进类定义(class)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="379"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="382"/>
|
||||||
<source>Indent namespaces</source>
|
<source>Indent namespaces</source>
|
||||||
<translation>缩进命名空间定义(namespace)</translation>
|
<translation>缩进命名空间定义(namespace)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="386"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="389"/>
|
||||||
<source>Indent class access modifiers</source>
|
<source>Indent class access modifiers</source>
|
||||||
<translation>缩进类访问限制符('public','private'...)</translation>
|
<translation>缩进类访问限制符('public','private'...)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="393"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="396"/>
|
||||||
<source>Indent after parenthesis '(' or assignment '='</source>
|
<source>Indent after parenthesis '(' or assignment '='</source>
|
||||||
<translation>在括号'('或赋值号'='后缩进</translation>
|
<translation>在括号'('或赋值号'='后缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="400"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="403"/>
|
||||||
<source>Indent preprocessor conditional statements</source>
|
<source>Indent preprocessor conditional statements</source>
|
||||||
<translation>缩进预处理条件指令('#if','#else',...)</translation>
|
<translation>缩进预处理条件指令('#if','#else',...)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="407"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="410"/>
|
||||||
<source>Indent multi-line preprocessor #define statements</source>
|
<source>Indent multi-line preprocessor #define statements</source>
|
||||||
<translation>缩进多行#define语句</translation>
|
<translation>缩进多行#define语句</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="414"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="417"/>
|
||||||
<source>Indent line comments that start in column one</source>
|
<source>Indent line comments that start in column one</source>
|
||||||
<translation>缩进在第一列开始的行注释</translation>
|
<translation>缩进在第一列开始的行注释</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="421"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="424"/>
|
||||||
<source>Indent preprocessor blocks</source>
|
<source>Indent preprocessor blocks</source>
|
||||||
<translation>缩进预处理代码段</translation>
|
<translation>缩进预处理代码段</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="428"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="431"/>
|
||||||
<source>Indent switch blocks</source>
|
<source>Indent switch blocks</source>
|
||||||
<translation>缩进switch语句</translation>
|
<translation>缩进switch语句</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="435"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="438"/>
|
||||||
<source>Indent cases</source>
|
<source>Indent cases</source>
|
||||||
<translation>缩进case语句</translation>
|
<translation>缩进case语句</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="443"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="446"/>
|
||||||
<source>Padding 1</source>
|
<source>Padding 1</source>
|
||||||
<translation>填充1</translation>
|
<translation>填充1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="449"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="452"/>
|
||||||
<source>Insert spaces around operators</source>
|
<source>Insert spaces around operators</source>
|
||||||
<translation>在运算符周围插入空格</translation>
|
<translation>在运算符周围插入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="456"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="459"/>
|
||||||
<source>Insert spaces after commas</source>
|
<source>Insert spaces after commas</source>
|
||||||
<translation>在逗号后插入空格</translation>
|
<translation>在逗号后插入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="463"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="466"/>
|
||||||
<source>Insert spaces after parenthesis headers ('if','for',...)</source>
|
<source>Insert spaces after parenthesis headers ('if','for',...)</source>
|
||||||
<translation>在语句和括号间插入空格('if','for'...)</translation>
|
<translation>在语句和括号间插入空格('if','for'...)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="470"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="473"/>
|
||||||
<source>Insert spaces around parenthesis on the outside only</source>
|
<source>Insert spaces around parenthesis on the outside only</source>
|
||||||
<translation>在括号外侧加入空格</translation>
|
<translation>在括号外侧加入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="477"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="480"/>
|
||||||
<source>Insert spaces around parenthesis on the inside only</source>
|
<source>Insert spaces around parenthesis on the inside only</source>
|
||||||
<translation>在括号内侧加入空格</translation>
|
<translation>在括号内侧加入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="484"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="487"/>
|
||||||
<source>Insert empty lines arround unrelated blocks</source>
|
<source>Insert empty lines arround unrelated blocks</source>
|
||||||
<translation>在代码段之间加入空行</translation>
|
<translation>在代码段之间加入空行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="491"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="494"/>
|
||||||
<source>Insert empty lines around all blocks</source>
|
<source>Insert empty lines around all blocks</source>
|
||||||
<oldsource>Insert empy lines around all blocks</oldsource>
|
<oldsource>Insert empy lines around all blocks</oldsource>
|
||||||
<translation>在所有代码段之间加入空格</translation>
|
<translation>在所有代码段之间加入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="498"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="501"/>
|
||||||
<source>Insert spaces around first parenthesis in a series on the out side only</source>
|
<source>Insert spaces around first parenthesis in a series on the out side only</source>
|
||||||
<translation>在多层嵌套括号的最外侧加入空格</translation>
|
<translation>在多层嵌套括号的最外侧加入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="505"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="508"/>
|
||||||
<source>Insert spaces around parenthesis</source>
|
<source>Insert spaces around parenthesis</source>
|
||||||
<translation>在括号两侧加入空格</translation>
|
<translation>在括号两侧加入空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="513"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="516"/>
|
||||||
<source>Padding 2</source>
|
<source>Padding 2</source>
|
||||||
<translation>填充2</translation>
|
<translation>填充2</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="519"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="522"/>
|
||||||
<source>Remove all empty lines. It will NOT delete lines added by the padding options.</source>
|
<source>Remove all empty lines. It will NOT delete lines added by the padding options.</source>
|
||||||
<translation>删除所有空行。不影响填充选项自动插入的空行。</translation>
|
<translation>删除所有空行。不影响填充选项自动插入的空行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="526"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="529"/>
|
||||||
<source>Attach a pointer operator to its :</source>
|
<source>Attach a pointer operator to its :</source>
|
||||||
<translation>将指针运算符('*')放在:</translation>
|
<translation>将指针运算符('*')放在:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="533"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="536"/>
|
||||||
<source>Remove all consecutive empty lines. It will NOT delete lines added by the padding options.</source>
|
<source>Remove all consecutive empty lines. It will NOT delete lines added by the padding options.</source>
|
||||||
<translation>将连续的多个空行合并成一个。不影响填充选项自动插入的空行。</translation>
|
<translation>将连续的多个空行合并成一个。不影响填充选项自动插入的空行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="540"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="543"/>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="550"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="553"/>
|
||||||
<source>type(left)</source>
|
<source>type(left)</source>
|
||||||
<translation>类型侧(左侧)</translation>
|
<translation>类型侧(左侧)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="583"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="586"/>
|
||||||
<source>Fill empty lines with the white space of the previous lines.</source>
|
<source>Fill empty lines with the white space of the previous lines.</source>
|
||||||
<translation>使用前一行的缩进空格填充空行</translation>
|
<translation>使用前一行的缩进空格填充空行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="573"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="576"/>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="600"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="603"/>
|
||||||
<source>middle</source>
|
<source>middle</source>
|
||||||
<translation>中间</translation>
|
<translation>中间</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="61"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="64"/>
|
||||||
<source><html><head/><body><p>Note for the predefined format style</p></body></html></source>
|
<source><html><head/><body><p>Note for the predefined format style</p></body></html></source>
|
||||||
<translation><html><head/><body><p>预定义排版方案说明</p></body></html></translation>
|
<translation><html><head/><body><p>预定义排版方案说明</p></body></html></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="590"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="593"/>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="610"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="613"/>
|
||||||
<source>name(right)</source>
|
<source>name(right)</source>
|
||||||
<translation>名称侧(右侧)</translation>
|
<translation>名称侧(右侧)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="620"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="623"/>
|
||||||
<source>Remove unnecessary space adding around parenthesis</source>
|
<source>Remove unnecessary space adding around parenthesis</source>
|
||||||
<translation>删除括号周围的多余空格</translation>
|
<translation>删除括号周围的多余空格</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="627"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="630"/>
|
||||||
<source>Attach a reference operator to its :</source>
|
<source>Attach a reference operator to its :</source>
|
||||||
<translation>将引用运算符('&')放在:</translation>
|
<translation>将引用运算符('&')放在:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="634"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="637"/>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="644"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="647"/>
|
||||||
<source>none</source>
|
<source>none</source>
|
||||||
<translation>不变</translation>
|
<translation>不变</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="655"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="658"/>
|
||||||
<source>Other 1</source>
|
<source>Other 1</source>
|
||||||
<translation>其它1</translation>
|
<translation>其它1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="661"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="664"/>
|
||||||
<source>Break one line headers ('if','while','else'...) from the statement on the same line</source>
|
<source>Break one line headers ('if','while','else'...) from the statement on the same line</source>
|
||||||
<translation>对单行条件('if','while','else')语句分行</translation>
|
<translation>对单行条件('if','while','else')语句分行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="668"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="671"/>
|
||||||
<source>Add one line braces to unbraced one line conditional statements</source>
|
<source>Add one line braces to unbraced one line conditional statements</source>
|
||||||
<translation>用花括号括起单行条件体</translation>
|
<translation>用花括号括起单行条件体</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="675"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="678"/>
|
||||||
<source>Break braces before close headers ('else','catch"...)</source>
|
<source>Break braces before close headers ('else','catch"...)</source>
|
||||||
<translation>对结束语句('else','catch')和它之前的花括号断行</translation>
|
<translation>对结束语句('else','catch')和它之前的花括号断行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="682"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="685"/>
|
||||||
<source>Remove braces from a braced one line conditional statements</source>
|
<source>Remove braces from a braced one line conditional statements</source>
|
||||||
<translation>删除括起单行条件体语句的花括号</translation>
|
<translation>删除括起单行条件体语句的花括号</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="689"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="692"/>
|
||||||
<source>Break 'else if' statements into two lines</source>
|
<source>Break 'else if' statements into two lines</source>
|
||||||
<translation>将'else if'语句断成两行</translation>
|
<translation>将'else if'语句断成两行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="696"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="699"/>
|
||||||
<source>Add braces to unbraced one line conditional statements</source>
|
<source>Add braces to unbraced one line conditional statements</source>
|
||||||
<translation>对条件和条件体语句在同一行上的,删除括起条件体语句的花括号</translation>
|
<translation>对条件和条件体语句在同一行上的,删除括起条件体语句的花括号</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="704"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="707"/>
|
||||||
<source>Other 2</source>
|
<source>Other 2</source>
|
||||||
<translation>其它2</translation>
|
<translation>其它2</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="745"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="748"/>
|
||||||
<source>Attach return type to the function name in its declaration</source>
|
<source>Attach return type to the function name in its declaration</source>
|
||||||
<translation>将函数声明中的函数名和返回值类型放在同一行</translation>
|
<translation>将函数声明中的函数名和返回值类型放在同一行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="738"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="741"/>
|
||||||
<source>Break return type from the function name in its declaration</source>
|
<source>Break return type from the function name in its declaration</source>
|
||||||
<translation>将函数声明中的函数名和返回值类型断成两行</translation>
|
<translation>将函数声明中的函数名和返回值类型断成两行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="710"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="713"/>
|
||||||
<source>Break return type from the function name in its definition</source>
|
<source>Break return type from the function name in its definition</source>
|
||||||
<translation>将函数定义中的函数名和返回值类型断成两行</translation>
|
<translation>将函数定义中的函数名和返回值类型断成两行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="724"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="727"/>
|
||||||
<source>Attach return type to the function name in its definition</source>
|
<source>Attach return type to the function name in its definition</source>
|
||||||
<translation>将函数定义中的函数名和返回值类型放在同一行</translation>
|
<translation>将函数定义中的函数名和返回值类型放在同一行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="717"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="720"/>
|
||||||
<source>Don't break blocks residing completely on one line</source>
|
<source>Don't break blocks residing completely on one line</source>
|
||||||
<translation>不对同一行上的多个代码段断行</translation>
|
<translation>不对同一行上的多个代码段断行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="731"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="734"/>
|
||||||
<source>Don't break multimple statements residing on one line</source>
|
<source>Don't break multimple statements residing on one line</source>
|
||||||
<translation>不对同一行上的多条语句断行</translation>
|
<translation>不对同一行上的多条语句断行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="753"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="756"/>
|
||||||
<source>Other 3</source>
|
<source>Other 3</source>
|
||||||
<translation>其它3</translation>
|
<translation>其它3</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="840"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="843"/>
|
||||||
<source>Place the logical conditional to the last on the previous line, when break lines</source>
|
<source>Place the logical conditional to the last on the previous line, when break lines</source>
|
||||||
<translation>在断行时,将逻辑条件放在前一行的末尾</translation>
|
<translation>在断行时,将逻辑条件放在前一行的末尾</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="833"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="836"/>
|
||||||
<source>Close ending angle brackets on template definitions</source>
|
<source>Close ending angle brackets on template definitions</source>
|
||||||
<translation>关闭模板定义末尾的尖括号</translation>
|
<translation>关闭模板定义末尾的尖括号</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="826"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="829"/>
|
||||||
<source>Remove the leading '*' prefix on multi-line comments and indent the comment text one line indent.</source>
|
<source>Remove the leading '*' prefix on multi-line comments and indent the comment text one line indent.</source>
|
||||||
<translation>删除多行注释前的'*'并缩进注释内容</translation>
|
<translation>删除多行注释前的'*'并缩进注释内容</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="774"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="777"/>
|
||||||
<source>Break lines exceeds</source>
|
<source>Break lines exceeds</source>
|
||||||
<translation>对超过指定长度的行断行</translation>
|
<translation>对超过指定长度的行断行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.ui" line="781"/>
|
<location filename="settingsdialog/formattergeneralwidget.ui" line="784"/>
|
||||||
<source>characters</source>
|
<source>characters</source>
|
||||||
<translation>字符</translation>
|
<translation>字符</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -1691,179 +1691,187 @@ Are you really want to continue?</source>
|
||||||
<context>
|
<context>
|
||||||
<name>FormatterStyleModel</name>
|
<name>FormatterStyleModel</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="204"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="133"/>
|
||||||
<source>Default</source>
|
<source>Default</source>
|
||||||
<translation>缺省</translation>
|
<translation>缺省</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="205"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="134"/>
|
||||||
<source>The opening braces will not be changed and closing braces will be broken from the preceding line.</source>
|
<source>The opening braces will not be changed and closing braces will be broken from the preceding line.</source>
|
||||||
<translation>左花括号不变,右花括号单独一行。</translation>
|
<translation>左花括号不变,右花括号单独一行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="210"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="139"/>
|
||||||
<source>Allman</source>
|
<source>Allman</source>
|
||||||
<translation>Allman</translation>
|
<translation>Allman</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="211"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="140"/>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="217"/>
|
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="223"/>
|
|
||||||
<source>Broken braces.</source>
|
<source>Broken braces.</source>
|
||||||
<translation>花括号单独一行。</translation>
|
<translation>花括号单独一行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="216"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="145"/>
|
||||||
<source>Java</source>
|
<source>Java</source>
|
||||||
<translation>Java</translation>
|
<translation>Java</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="222"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="146"/>
|
||||||
|
<source>Attached braces.</source>
|
||||||
|
<translation>花括号不断行。</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="151"/>
|
||||||
<source>K&R</source>
|
<source>K&R</source>
|
||||||
<translation>Kernighan & Ritchie</translation>
|
<translation>K&R</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="228"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="152"/>
|
||||||
|
<source>Linux braces.</source>
|
||||||
|
<translation type="unfinished">Linux风格花括号</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="157"/>
|
||||||
<source>Stroustrup</source>
|
<source>Stroustrup</source>
|
||||||
<translation>Kernighan & Ritchie</translation>
|
<translation>Stroustrup</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="229"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="158"/>
|
||||||
<source>Linux braces, with broken closing headers.</source>
|
<source>Linux braces, with broken closing headers.</source>
|
||||||
<translation>Linux风格花括号,对条件结束语句(如do-while的while)断行。</translation>
|
<translation>Linux风格花括号,对条件结束语句(如do-while的while)断行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="234"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="163"/>
|
||||||
<source>Whitesmith</source>
|
<source>Whitesmith</source>
|
||||||
<translation>Whitesmith</translation>
|
<translation>Whitesmith</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="235"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="164"/>
|
||||||
<source>Broken, indented braces.</source>
|
<source>Broken, indented braces.</source>
|
||||||
<translation>花括号独立成行,并且缩进。</translation>
|
<translation>花括号独立成行,并且缩进。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="237"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="166"/>
|
||||||
<source>Indented class blocks and switch blocks.</source>
|
<source>Indented class blocks and switch blocks.</source>
|
||||||
<translation>类代码段和switch代码段缩进。</translation>
|
<translation>类代码段和switch代码段缩进。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="242"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="171"/>
|
||||||
<source>VTK</source>
|
<source>VTK</source>
|
||||||
<translation>VTK</translation>
|
<translation>VTK</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="243"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="172"/>
|
||||||
<source>Broken, indented braces except for the opening braces.</source>
|
<source>Broken, indented braces except for the opening braces.</source>
|
||||||
<translation>除左花括号外,其他花括号独立断行且缩进。</translation>
|
<translation>除左花括号外,其他花括号独立断行且缩进。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="248"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="177"/>
|
||||||
<source>Ratliff</source>
|
<source>Ratliff</source>
|
||||||
<translation>Ratliff</translation>
|
<translation>Ratliff</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="249"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="178"/>
|
||||||
<source>Attached, indented braces.</source>
|
<source>Attached, indented braces.</source>
|
||||||
<translation>花括号不断行,但是缩进</translation>
|
<translation>花括号不断行,但是缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="254"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="183"/>
|
||||||
<source>GNU</source>
|
<source>GNU</source>
|
||||||
<translation>GNU</translation>
|
<translation>GNU</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="255"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="184"/>
|
||||||
<source>Broken braces, indented blocks.</source>
|
<source>Broken braces, indented blocks.</source>
|
||||||
<translation>花括号短号,代码段缩进</translation>
|
<translation>花括号短号,代码段缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="260"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="189"/>
|
||||||
<source>Linux</source>
|
<source>Linux</source>
|
||||||
<translation>Linux</translation>
|
<translation>Linux</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="261"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="190"/>
|
||||||
<source>Linux braces, minimum conditional indent is one-half indent.</source>
|
<source>Linux braces, minimum conditional indent is one-half indent.</source>
|
||||||
<translation>Linux风格花括号,最小条件缩进为1.5单位。</translation>
|
<translation>Linux风格花括号,最小条件缩进为1.5单位。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="266"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="195"/>
|
||||||
<source>Horstmann</source>
|
<source>Horstmann</source>
|
||||||
<translation>Horstmann</translation>
|
<translation>Horstmann</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="267"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="196"/>
|
||||||
<source>Run-in braces, indented switches.</source>
|
<source>Run-in braces, indented switches.</source>
|
||||||
<translation>Run-in花括号,switch语句缩进</translation>
|
<translation>Run-in花括号,switch语句缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="272"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="201"/>
|
||||||
<source>One True Brace</source>
|
<source>One True Brace</source>
|
||||||
<translation>One True Brace</translation>
|
<translation>One True Brace</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="273"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="202"/>
|
||||||
<source>Linux braces, add braces to all conditionals.</source>
|
<source>Linux braces, add braces to all conditionals.</source>
|
||||||
<translation>Linux封号花括号,所有条件语句条件花括号</translation>
|
<translation>Linux封号花括号,所有条件语句条件花括号</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="278"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="207"/>
|
||||||
<source>Google</source>
|
<source>Google</source>
|
||||||
<translation>Google</translation>
|
<translation>Google</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="279"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="208"/>
|
||||||
<source>Attached braces, indented class modifiers.</source>
|
<source>Attached braces, indented class modifiers.</source>
|
||||||
<translation>花括号不断行,类访问限定符缩进</translation>
|
<translation>花括号不断行,类访问限定符缩进</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="284"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="213"/>
|
||||||
<source>Mozilla</source>
|
<source>Mozilla</source>
|
||||||
<translation>Mozilla</translation>
|
<translation>Mozilla</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="285"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="214"/>
|
||||||
<source>Linux braces, with broken braces for structs and enums, and attached braces for namespaces.</source>
|
<source>Linux braces, with broken braces for structs and enums, and attached braces for namespaces.</source>
|
||||||
<translation>Linux风格花括号, 结构和枚举的花括号断行, 命名空间的花括号不断行。</translation>
|
<translation>Linux风格花括号, 结构和枚举的花括号断行, 命名空间的花括号不断行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="290"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="219"/>
|
||||||
<source>Webkit</source>
|
<source>Webkit</source>
|
||||||
<translation>Webkit</translation>
|
<translation>Webkit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="291"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="220"/>
|
||||||
<source>Linux braces, with attached closing headers.</source>
|
<source>Linux braces, with attached closing headers.</source>
|
||||||
<translation>Linux风格花括号, 条件结束语句(如do-while的while)不断行</translation>
|
<translation>Linux风格花括号, 条件结束语句(如do-while的while)不断行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="296"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="225"/>
|
||||||
<source>Pico</source>
|
<source>Pico</source>
|
||||||
<translation>Pico</translation>
|
<translation>Pico</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="297"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="226"/>
|
||||||
<source>Run-in opening braces and attached closing braces.</source>
|
<source>Run-in opening braces and attached closing braces.</source>
|
||||||
<translation>Run-in左花括号,右花括号不断行</translation>
|
<translation>Run-in左花括号,右花括号不断行</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="299"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="228"/>
|
||||||
<source>Uses keep one line blocks and keep one line statements.</source>
|
<source>Uses keep one line blocks and keep one line statements.</source>
|
||||||
<translation>启用保持单行代码段和保持多语句单行选项。</translation>
|
<translation>启用保持单行代码段和保持多语句单行选项。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="304"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="233"/>
|
||||||
<source>Lisp</source>
|
<source>Lisp</source>
|
||||||
<translation>Lisp</translation>
|
<translation>Lisp</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="305"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="234"/>
|
||||||
<source>Attached opening braces and attached closing braces.</source>
|
<source>Attached opening braces and attached closing braces.</source>
|
||||||
<translation>花括号不断行。</translation>
|
<translation>花括号不断行。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="settingsdialog/formattergeneralwidget.cpp" line="307"/>
|
<location filename="settingsdialog/formattergeneralwidget.cpp" line="236"/>
|
||||||
<source>Uses keep one line statements.</source>
|
<source>Uses keep one line statements.</source>
|
||||||
<translation>启用保持多语句单行选项。</translation>
|
<translation>启用保持多语句单行选项。</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -2912,7 +2920,7 @@ Are you really want to continue?</source>
|
||||||
<translation>无标题</translation>
|
<translation>无标题</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="utils.cpp" line="326"/>
|
<location filename="utils.cpp" line="329"/>
|
||||||
<source>Index %1 out of range</source>
|
<source>Index %1 out of range</source>
|
||||||
<translation>下标"%1"越界</translation>
|
<translation>下标"%1"越界</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/codes">
|
||||||
|
<file alias="formatdemo.cpp">resources/formatdemo.cpp</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
|
@ -2704,6 +2704,199 @@ Settings::CodeFormatter::CodeFormatter(Settings *settings):
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList Settings::CodeFormatter::getArguments()
|
||||||
|
{
|
||||||
|
QStringList result;
|
||||||
|
switch(mBraceStyle) {
|
||||||
|
case FormatterBraceStyle::fbsDefault:
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsAllman:
|
||||||
|
result.append("--style=allman");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsJava:
|
||||||
|
result.append("--style=java");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsKR:
|
||||||
|
result.append("--style=kr");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsStroustrup:
|
||||||
|
result.append("--style=stroustrup");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsWitesmith:
|
||||||
|
result.append("--style=whitesmith");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsVtk:
|
||||||
|
result.append("--style=vtk");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsRatliff:
|
||||||
|
result.append("--style=ratliff");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsGNU:
|
||||||
|
result.append("--style=gnu");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsLinux:
|
||||||
|
result.append("--style=linux");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsHorstmann:
|
||||||
|
result.append("--style=horstmann");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbs1TBS:
|
||||||
|
result.append("--style=1tbs");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsGoogle:
|
||||||
|
result.append("--style=google");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsMozilla:
|
||||||
|
result.append("--style=mozilla");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsWebkit:
|
||||||
|
result.append("--style=webkit");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsPico:
|
||||||
|
result.append("--style=pico");
|
||||||
|
break;
|
||||||
|
case FormatterBraceStyle::fbsLisp:
|
||||||
|
result.append("--style=lisp");
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
switch(mIndentStyle) {
|
||||||
|
case FormatterIndentType::fitTab:
|
||||||
|
result.append(QString("--indent=tab=%1").arg(mTabWidth));
|
||||||
|
break;
|
||||||
|
case FormatterIndentType::fitSpace:
|
||||||
|
result.append(QString("--indent=spaces=%1").arg(mTabWidth));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mAttachNamespaces)
|
||||||
|
result.append("--attach-namespaces");
|
||||||
|
if (mAttachClasses)
|
||||||
|
result.append("--attach-classes");
|
||||||
|
if (mAttachInlines)
|
||||||
|
result.append("--attach-inlines");
|
||||||
|
if (mAttachExternC)
|
||||||
|
result.append("--attach-extern-c");
|
||||||
|
if (mAttachClosingWhile)
|
||||||
|
result.append("--attach-closing-while");
|
||||||
|
if (mIndentClasses)
|
||||||
|
result.append("--indent-classes");
|
||||||
|
if (mIndentModifiers)
|
||||||
|
result.append("--indent-modifiers");
|
||||||
|
if (mIndentSwitches)
|
||||||
|
result.append("--indent-switches");
|
||||||
|
if (mIndentCases)
|
||||||
|
result.append("--indent-cases");
|
||||||
|
if (mIndentNamespaces)
|
||||||
|
result.append("--indent-namespaces");
|
||||||
|
if (mIndentAfterParens)
|
||||||
|
result.append("--indent-after-parens");
|
||||||
|
if (mIndentContinuation!=1)
|
||||||
|
result.append(QString("--indent-continuation=%1").arg(mIndentContinuation));
|
||||||
|
if (mIndentLabels)
|
||||||
|
result.append("--indent-labels");
|
||||||
|
if (mIndentPreprocBlock)
|
||||||
|
result.append("--indent-preproc-block");
|
||||||
|
if (mIndentPreprocCond)
|
||||||
|
result.append("--indent-preproc-cond");
|
||||||
|
if (mIndentPreprocDefine)
|
||||||
|
result.append("--indent-preproc-define");
|
||||||
|
if (mIndentCol1Comments)
|
||||||
|
result.append("--indent-col1-comments");
|
||||||
|
if (mMinConditionalIndent!=2)
|
||||||
|
result.append(QString("--min-conditional-indent=%1").arg(mMinConditionalIndent));
|
||||||
|
if (mMaxContinuationIndent!=40)
|
||||||
|
result.append(QString("--max-continuation-indent=%1").arg(mMaxContinuationIndent));
|
||||||
|
if (mBreakBlocks)
|
||||||
|
result.append("--break-blocks");
|
||||||
|
if (mBreakBlocksAll)
|
||||||
|
result.append("--break-blocks=all");
|
||||||
|
if (mPadOper)
|
||||||
|
result.append("--pad-oper");
|
||||||
|
if (mPadComma)
|
||||||
|
result.append("--pad-comma");
|
||||||
|
if (mPadParen)
|
||||||
|
result.append("--pad-paren");
|
||||||
|
if (mPadParenOut)
|
||||||
|
result.append("--pad-paren-out");
|
||||||
|
if (mPadFirstParenOut)
|
||||||
|
result.append("--pad-first-paren-out");
|
||||||
|
if (mPadParenIn)
|
||||||
|
result.append("--pad-paren-in");
|
||||||
|
if (mPadHeader)
|
||||||
|
result.append("--pad-header");
|
||||||
|
if (mUnpadParen)
|
||||||
|
result.append("--unpad-paren");
|
||||||
|
if (mDeleteEmptyLines)
|
||||||
|
result.append("--delete-empty-lines");
|
||||||
|
if (mDeleteMultipleEmptyLines)
|
||||||
|
result.append("--delete-multiple-empty-lines");
|
||||||
|
if (mFillEmptyLines)
|
||||||
|
result.append("--fill-empty-lines");
|
||||||
|
switch(mAlignPointerStyle) {
|
||||||
|
case FormatterOperatorAlign::foaNone:
|
||||||
|
break;
|
||||||
|
case FormatterOperatorAlign::foaType:
|
||||||
|
result.append("--align-pointer=type");
|
||||||
|
break;
|
||||||
|
case FormatterOperatorAlign::foaMiddle:
|
||||||
|
result.append("--align-pointer=middle");
|
||||||
|
break;
|
||||||
|
case FormatterOperatorAlign::foaName:
|
||||||
|
result.append("--align-pointer=name");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch(mAlignReferenceStyle) {
|
||||||
|
case FormatterOperatorAlign::foaNone:
|
||||||
|
break;
|
||||||
|
case FormatterOperatorAlign::foaType:
|
||||||
|
result.append("--align-reference=type");
|
||||||
|
break;
|
||||||
|
case FormatterOperatorAlign::foaMiddle:
|
||||||
|
result.append("--align-reference=middle");
|
||||||
|
break;
|
||||||
|
case FormatterOperatorAlign::foaName:
|
||||||
|
result.append("--align-reference=name");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mBreakClosingBraces)
|
||||||
|
result.append("--break-closing-braces");
|
||||||
|
if (mBreakElseIf)
|
||||||
|
result.append("--break-elseifs");
|
||||||
|
if (mBreakOneLineHeaders)
|
||||||
|
result.append("--break-one-line-headers");
|
||||||
|
if (mAddBraces)
|
||||||
|
result.append("--add-braces");
|
||||||
|
if (mAddOneLineBraces)
|
||||||
|
result.append("--add-one-line-braces");
|
||||||
|
if (mRemoveBraces)
|
||||||
|
result.append("--remove-braces");
|
||||||
|
if (mBreakReturnType)
|
||||||
|
result.append("--break-return-type");
|
||||||
|
if (mBreakReturnTypeDecl)
|
||||||
|
result.append("--break-return-type-decl");
|
||||||
|
if (mAttachReturnType)
|
||||||
|
result.append("--attach-return-type");
|
||||||
|
if (mAttachReturnTypeDecl)
|
||||||
|
result.append("--attach-return-type-decl");
|
||||||
|
if (mKeepOneLineBlocks)
|
||||||
|
result.append("--keep-one-line-blocks");
|
||||||
|
if (mKeepOneLineStatements)
|
||||||
|
result.append("--keep-one-line-statements");
|
||||||
|
if (mConvertTabs)
|
||||||
|
result.append("--convert-tabs");
|
||||||
|
if (mCloseTemplates)
|
||||||
|
result.append("--close-templates");
|
||||||
|
if (mRemoveCommentPrefix)
|
||||||
|
result.append("--remove-comment-prefix");
|
||||||
|
if (mBreakMaxCodeLength) {
|
||||||
|
result.append(QString("--max-code-length=%1").arg(mMaxCodeLength));
|
||||||
|
if (mBreakAfterLogical)
|
||||||
|
result.append("--break-after-logical");
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
int Settings::CodeFormatter::indentStyle() const
|
int Settings::CodeFormatter::indentStyle() const
|
||||||
{
|
{
|
||||||
return mIndentStyle;
|
return mIndentStyle;
|
||||||
|
|
|
@ -468,6 +468,7 @@ public:
|
||||||
class CodeFormatter: public _Base {
|
class CodeFormatter: public _Base {
|
||||||
public:
|
public:
|
||||||
explicit CodeFormatter(Settings* settings);
|
explicit CodeFormatter(Settings* settings);
|
||||||
|
QStringList getArguments();
|
||||||
int braceStyle() const;
|
int braceStyle() const;
|
||||||
void setBraceStyle(int newBraceStyle);
|
void setBraceStyle(int newBraceStyle);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@ FormatterGeneralWidget::FormatterGeneralWidget(const QString& name, const QStrin
|
||||||
connect(ui->cbBraceStyle, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(ui->cbBraceStyle, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||||
this, &FormatterGeneralWidget::onBraceStyleChanged);
|
this, &FormatterGeneralWidget::onBraceStyleChanged);
|
||||||
ui->editDemo->setReadOnly(true);
|
ui->editDemo->setReadOnly(true);
|
||||||
ui->editDemo->lines()->setText("int test;");
|
connect(this, &SettingsWidget::settingsChanged,
|
||||||
|
this, &FormatterGeneralWidget::updateDemo);
|
||||||
}
|
}
|
||||||
|
|
||||||
FormatterGeneralWidget::~FormatterGeneralWidget()
|
FormatterGeneralWidget::~FormatterGeneralWidget()
|
||||||
|
@ -30,7 +31,13 @@ void FormatterGeneralWidget::onBraceStyleChanged()
|
||||||
void FormatterGeneralWidget::doLoad()
|
void FormatterGeneralWidget::doLoad()
|
||||||
{
|
{
|
||||||
Settings::CodeFormatter& format = pSettings->codeFormatter();
|
Settings::CodeFormatter& format = pSettings->codeFormatter();
|
||||||
ui->cbBraceStyle->setCurrentIndex(format.braceStyle());
|
for (int i=0;i<mStylesModel.rowCount(QModelIndex());i++) {
|
||||||
|
PFormatterStyleItem item = mStylesModel.getStyle(i);
|
||||||
|
if (item->style == format.braceStyle()) {
|
||||||
|
ui->cbBraceStyle->setCurrentIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (format.indentStyle() == FormatterIndentType::fitSpace) {
|
if (format.indentStyle() == FormatterIndentType::fitSpace) {
|
||||||
ui->rbIndentSpaces->setChecked(true);
|
ui->rbIndentSpaces->setChecked(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -115,87 +122,13 @@ void FormatterGeneralWidget::doLoad()
|
||||||
ui->chkBreakMaxCodeLength->setChecked(format.breakMaxCodeLength());
|
ui->chkBreakMaxCodeLength->setChecked(format.breakMaxCodeLength());
|
||||||
ui->spinMaxCodeLength->setValue(format.maxCodeLength());
|
ui->spinMaxCodeLength->setValue(format.maxCodeLength());
|
||||||
ui->chkBreakAfterLogical->setChecked(format.breakAfterLogical());
|
ui->chkBreakAfterLogical->setChecked(format.breakAfterLogical());
|
||||||
|
updateDemo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormatterGeneralWidget::doSave()
|
void FormatterGeneralWidget::doSave()
|
||||||
{
|
{
|
||||||
Settings::CodeFormatter& format = pSettings->codeFormatter();
|
Settings::CodeFormatter& format = pSettings->codeFormatter();
|
||||||
if (ui->cbBraceStyle->currentIndex()>0)
|
updateCodeFormatter(format);
|
||||||
format.setBraceStyle(ui->cbBraceStyle->currentIndex());
|
|
||||||
if (ui->rbIndentSpaces) {
|
|
||||||
format.setIndentStyle(FormatterIndentType::fitSpace);
|
|
||||||
} else {
|
|
||||||
format.setIndentStyle(FormatterIndentType::fitTab);
|
|
||||||
}
|
|
||||||
format.setTabWidth(ui->spinTabSize->value());
|
|
||||||
format.setAttachNamespaces(ui->chkAttachNamespaces->isChecked());
|
|
||||||
format.setAttachClasses(ui->chkAttachClasses->isChecked());
|
|
||||||
format.setAttachInlines(ui->chkAttachInline->isChecked());
|
|
||||||
format.setAttachExternC(ui->chkAttachExternC->isChecked());
|
|
||||||
format.setAttachClosingWhile(ui->chkAttachClosingWhile->isChecked());
|
|
||||||
format.setIndentClasses(ui->chkIndentClasses->isChecked());
|
|
||||||
format.setIndentModifiers(ui->chkIndentModifiers->isChecked());
|
|
||||||
format.setIndentSwitches(ui->chkIndentSwiches->isChecked());
|
|
||||||
format.setIndentCases(ui->chkIndentCases->isChecked());
|
|
||||||
format.setIndentNamespaces(ui->chkIndentNamespaces->isChecked());
|
|
||||||
format.setIndentAfterParens(ui->chkIndentAfterParens->isChecked());
|
|
||||||
format.setIndentContinuation(ui->spinIndentContinuation->value());
|
|
||||||
format.setIndentLabels(ui->chkIndentLabels->isChecked());
|
|
||||||
format.setIndentPreprocBlock(ui->chkIndentPreprocBlock->isChecked());
|
|
||||||
format.setIndentPreprocCond(ui->chkIndentPreprocCond->isChecked());
|
|
||||||
format.setIndentPreprocDefine(ui->chkIndentPreprocDefine->isChecked());
|
|
||||||
format.setIndentCol1Comments(ui->chkIndentCol1Comments->isChecked());
|
|
||||||
format.setMinConditionalIndent(ui->spinMinConditionalIndent->value());
|
|
||||||
format.setMaxContinuationIndent(ui->spinMaxContinuationIndent->value());
|
|
||||||
format.setBreakBlocks(ui->chkBreakBlocks->isChecked());
|
|
||||||
format.setBreakBlocksAll(ui->chkBreakBlocksAll->isChecked());
|
|
||||||
format.setPadOper(ui->chkPadOper->isChecked());
|
|
||||||
format.setPadComma(ui->chkPadComma->isChecked());
|
|
||||||
format.setPadParen(ui->chkPadParen->isChecked());
|
|
||||||
format.setPadParenOut(ui->chkPadParenOut->isChecked());
|
|
||||||
format.setPadFirstParenOut(ui->chkPadFirstParenOut->isChecked());
|
|
||||||
format.setPadParenIn(ui->chkPadParenIn->isChecked());
|
|
||||||
format.setPadHeader(ui->chkPadHeader->isChecked());
|
|
||||||
format.setUnpadParen(ui->chkUnpadParen->isChecked());
|
|
||||||
format.setDeleteEmptyLines(ui->chkDeleteEmptyLines->isChecked());
|
|
||||||
format.setDeleteMultipleEmptyLines(ui->chkDeleteMultipleEmptyLines->isChecked());
|
|
||||||
format.setFillEmptyLines(ui->chkFillEmptyLines->isChecked());
|
|
||||||
if (ui->rbAlignPointNone->isChecked()) {
|
|
||||||
format.setAlignPointerStyle(FormatterOperatorAlign::foaNone);
|
|
||||||
} else if (ui->rbAlignPointType->isChecked()) {
|
|
||||||
format.setAlignPointerStyle(FormatterOperatorAlign::foaType);
|
|
||||||
} else if (ui->rbAlignPointerMiddle->isChecked()) {
|
|
||||||
format.setAlignPointerStyle(FormatterOperatorAlign::foaMiddle);
|
|
||||||
} else if (ui->rbAlignPointerName->isChecked()) {
|
|
||||||
format.setAlignPointerStyle(FormatterOperatorAlign::foaName);
|
|
||||||
}
|
|
||||||
if (ui->rbAlignReferenceNone->isChecked()) {
|
|
||||||
format.setAlignReferenceStyle(FormatterOperatorAlign::foaNone);
|
|
||||||
} else if (ui->rbAlignReferenceType->isChecked()) {
|
|
||||||
format.setAlignReferenceStyle(FormatterOperatorAlign::foaType);
|
|
||||||
} else if (ui->rbAlignReferenceMiddle->isChecked()) {
|
|
||||||
format.setAlignReferenceStyle(FormatterOperatorAlign::foaMiddle);
|
|
||||||
} else if (ui->rbAlignReferenceName->isChecked()) {
|
|
||||||
format.setAlignReferenceStyle(FormatterOperatorAlign::foaName);
|
|
||||||
}
|
|
||||||
format.setBreakClosingBraces(ui->chkBreakClosingBraces->isChecked());
|
|
||||||
format.setBreakElseIf(ui->chkBreakElseIf->isChecked());
|
|
||||||
format.setBreakOneLineHeaders(ui->chkBreakOneLineHeaders->isChecked());
|
|
||||||
format.setAddBraces(ui->chkAddBraces->isChecked());
|
|
||||||
format.setAddOneLineBraces(ui->chkAddOneLineBraces->isChecked());
|
|
||||||
format.setRemoveBraces(ui->chkRemoveBraces->isChecked());
|
|
||||||
format.setBreakReturnType(ui->chkBreakReturnType->isChecked());
|
|
||||||
format.setBreakReturnTypeDecl(ui->chkBreakReturnTypeDecl->isChecked());
|
|
||||||
format.setAttachReturnType(ui->chkAttachReturnType->isChecked());
|
|
||||||
format.setAttachReturnTypeDecl(ui->chkAttachReturnTypeDecl->isChecked());
|
|
||||||
format.setKeepOneLineBlocks(ui->chkKeepOneLineBlocks->isChecked());
|
|
||||||
format.setKeepOneLineStatements(ui->chkKeepOneLineStatements->isChecked());
|
|
||||||
format.setConvertTabs(ui->chkConvertTabs->isChecked());
|
|
||||||
format.setCloseTemplates(ui->chkCloseTemplates->isChecked());
|
|
||||||
format.setRemoveCommentPrefix(ui->chkRemoveCommentPrefix->isChecked());
|
|
||||||
format.setBreakMaxCodeLength(ui->chkBreakMaxCodeLength->isChecked());
|
|
||||||
format.setMaxCodeLength(ui->spinMaxCodeLength->value());
|
|
||||||
format.setBreakAfterLogical(ui->chkBreakAfterLogical->isChecked());
|
|
||||||
format.save();
|
format.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,13 +149,13 @@ FormatterStyleModel::FormatterStyleModel(QObject *parent):QAbstractListModel(par
|
||||||
mStyles.append(
|
mStyles.append(
|
||||||
std::make_shared<FormatterStyleItem>(
|
std::make_shared<FormatterStyleItem>(
|
||||||
tr("Java"),
|
tr("Java"),
|
||||||
tr("Broken braces."),
|
tr("Attached braces."),
|
||||||
FormatterBraceStyle::fbsJava)
|
FormatterBraceStyle::fbsJava)
|
||||||
);
|
);
|
||||||
mStyles.append(
|
mStyles.append(
|
||||||
std::make_shared<FormatterStyleItem>(
|
std::make_shared<FormatterStyleItem>(
|
||||||
tr("K&R"),
|
tr("K&R"),
|
||||||
tr("Broken braces."),
|
tr("Linux braces."),
|
||||||
FormatterBraceStyle::fbsKR)
|
FormatterBraceStyle::fbsKR)
|
||||||
);
|
);
|
||||||
mStyles.append(
|
mStyles.append(
|
||||||
|
@ -267,7 +200,7 @@ FormatterStyleModel::FormatterStyleModel(QObject *parent):QAbstractListModel(par
|
||||||
std::make_shared<FormatterStyleItem>(
|
std::make_shared<FormatterStyleItem>(
|
||||||
tr("Horstmann"),
|
tr("Horstmann"),
|
||||||
tr("Run-in braces, indented switches."),
|
tr("Run-in braces, indented switches."),
|
||||||
FormatterBraceStyle::fbsHorstman)
|
FormatterBraceStyle::fbsHorstmann)
|
||||||
);
|
);
|
||||||
mStyles.append(
|
mStyles.append(
|
||||||
std::make_shared<FormatterStyleItem>(
|
std::make_shared<FormatterStyleItem>(
|
||||||
|
@ -362,3 +295,101 @@ void FormatterGeneralWidget::on_chkBreakMaxCodeLength_stateChanged(int)
|
||||||
ui->chkBreakAfterLogical->setEnabled(ui->chkBreakMaxCodeLength->isChecked());
|
ui->chkBreakAfterLogical->setEnabled(ui->chkBreakMaxCodeLength->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FormatterGeneralWidget::updateDemo()
|
||||||
|
{
|
||||||
|
QFile file(":/codes/formatdemo.cpp");
|
||||||
|
if (!file.open(QFile::ReadOnly))
|
||||||
|
return;
|
||||||
|
QByteArray content = file.readAll();
|
||||||
|
|
||||||
|
Settings::CodeFormatter formatter(nullptr);
|
||||||
|
updateCodeFormatter(formatter);
|
||||||
|
|
||||||
|
QByteArray newContent = runAndGetOutput("astyle.exe",
|
||||||
|
pSettings->dirs().app(),
|
||||||
|
formatter.getArguments(),
|
||||||
|
content);
|
||||||
|
ui->editDemo->lines()->setText(newContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FormatterGeneralWidget::updateCodeFormatter(Settings::CodeFormatter &format)
|
||||||
|
{
|
||||||
|
PFormatterStyleItem item = mStylesModel.getStyle(ui->cbBraceStyle->currentIndex());
|
||||||
|
if (item)
|
||||||
|
format.setBraceStyle(item->style);
|
||||||
|
if (ui->rbIndentSpaces) {
|
||||||
|
format.setIndentStyle(FormatterIndentType::fitSpace);
|
||||||
|
} else {
|
||||||
|
format.setIndentStyle(FormatterIndentType::fitTab);
|
||||||
|
}
|
||||||
|
format.setTabWidth(ui->spinTabSize->value());
|
||||||
|
format.setAttachNamespaces(ui->chkAttachNamespaces->isChecked());
|
||||||
|
format.setAttachClasses(ui->chkAttachClasses->isChecked());
|
||||||
|
format.setAttachInlines(ui->chkAttachInline->isChecked());
|
||||||
|
format.setAttachExternC(ui->chkAttachExternC->isChecked());
|
||||||
|
format.setAttachClosingWhile(ui->chkAttachClosingWhile->isChecked());
|
||||||
|
format.setIndentClasses(ui->chkIndentClasses->isChecked());
|
||||||
|
format.setIndentModifiers(ui->chkIndentModifiers->isChecked());
|
||||||
|
format.setIndentSwitches(ui->chkIndentSwiches->isChecked());
|
||||||
|
format.setIndentCases(ui->chkIndentCases->isChecked());
|
||||||
|
format.setIndentNamespaces(ui->chkIndentNamespaces->isChecked());
|
||||||
|
format.setIndentAfterParens(ui->chkIndentAfterParens->isChecked());
|
||||||
|
format.setIndentContinuation(ui->spinIndentContinuation->value());
|
||||||
|
format.setIndentLabels(ui->chkIndentLabels->isChecked());
|
||||||
|
format.setIndentPreprocBlock(ui->chkIndentPreprocBlock->isChecked());
|
||||||
|
format.setIndentPreprocCond(ui->chkIndentPreprocCond->isChecked());
|
||||||
|
format.setIndentPreprocDefine(ui->chkIndentPreprocDefine->isChecked());
|
||||||
|
format.setIndentCol1Comments(ui->chkIndentCol1Comments->isChecked());
|
||||||
|
format.setMinConditionalIndent(ui->spinMinConditionalIndent->value());
|
||||||
|
format.setMaxContinuationIndent(ui->spinMaxContinuationIndent->value());
|
||||||
|
format.setBreakBlocks(ui->chkBreakBlocks->isChecked());
|
||||||
|
format.setBreakBlocksAll(ui->chkBreakBlocksAll->isChecked());
|
||||||
|
format.setPadOper(ui->chkPadOper->isChecked());
|
||||||
|
format.setPadComma(ui->chkPadComma->isChecked());
|
||||||
|
format.setPadParen(ui->chkPadParen->isChecked());
|
||||||
|
format.setPadParenOut(ui->chkPadParenOut->isChecked());
|
||||||
|
format.setPadFirstParenOut(ui->chkPadFirstParenOut->isChecked());
|
||||||
|
format.setPadParenIn(ui->chkPadParenIn->isChecked());
|
||||||
|
format.setPadHeader(ui->chkPadHeader->isChecked());
|
||||||
|
format.setUnpadParen(ui->chkUnpadParen->isChecked());
|
||||||
|
format.setDeleteEmptyLines(ui->chkDeleteEmptyLines->isChecked());
|
||||||
|
format.setDeleteMultipleEmptyLines(ui->chkDeleteMultipleEmptyLines->isChecked());
|
||||||
|
format.setFillEmptyLines(ui->chkFillEmptyLines->isChecked());
|
||||||
|
if (ui->rbAlignPointNone->isChecked()) {
|
||||||
|
format.setAlignPointerStyle(FormatterOperatorAlign::foaNone);
|
||||||
|
} else if (ui->rbAlignPointType->isChecked()) {
|
||||||
|
format.setAlignPointerStyle(FormatterOperatorAlign::foaType);
|
||||||
|
} else if (ui->rbAlignPointerMiddle->isChecked()) {
|
||||||
|
format.setAlignPointerStyle(FormatterOperatorAlign::foaMiddle);
|
||||||
|
} else if (ui->rbAlignPointerName->isChecked()) {
|
||||||
|
format.setAlignPointerStyle(FormatterOperatorAlign::foaName);
|
||||||
|
}
|
||||||
|
if (ui->rbAlignReferenceNone->isChecked()) {
|
||||||
|
format.setAlignReferenceStyle(FormatterOperatorAlign::foaNone);
|
||||||
|
} else if (ui->rbAlignReferenceType->isChecked()) {
|
||||||
|
format.setAlignReferenceStyle(FormatterOperatorAlign::foaType);
|
||||||
|
} else if (ui->rbAlignReferenceMiddle->isChecked()) {
|
||||||
|
format.setAlignReferenceStyle(FormatterOperatorAlign::foaMiddle);
|
||||||
|
} else if (ui->rbAlignReferenceName->isChecked()) {
|
||||||
|
format.setAlignReferenceStyle(FormatterOperatorAlign::foaName);
|
||||||
|
}
|
||||||
|
format.setBreakClosingBraces(ui->chkBreakClosingBraces->isChecked());
|
||||||
|
format.setBreakElseIf(ui->chkBreakElseIf->isChecked());
|
||||||
|
format.setBreakOneLineHeaders(ui->chkBreakOneLineHeaders->isChecked());
|
||||||
|
format.setAddBraces(ui->chkAddBraces->isChecked());
|
||||||
|
format.setAddOneLineBraces(ui->chkAddOneLineBraces->isChecked());
|
||||||
|
format.setRemoveBraces(ui->chkRemoveBraces->isChecked());
|
||||||
|
format.setBreakReturnType(ui->chkBreakReturnType->isChecked());
|
||||||
|
format.setBreakReturnTypeDecl(ui->chkBreakReturnTypeDecl->isChecked());
|
||||||
|
format.setAttachReturnType(ui->chkAttachReturnType->isChecked());
|
||||||
|
format.setAttachReturnTypeDecl(ui->chkAttachReturnTypeDecl->isChecked());
|
||||||
|
format.setKeepOneLineBlocks(ui->chkKeepOneLineBlocks->isChecked());
|
||||||
|
format.setKeepOneLineStatements(ui->chkKeepOneLineStatements->isChecked());
|
||||||
|
format.setConvertTabs(ui->chkConvertTabs->isChecked());
|
||||||
|
format.setCloseTemplates(ui->chkCloseTemplates->isChecked());
|
||||||
|
format.setRemoveCommentPrefix(ui->chkRemoveCommentPrefix->isChecked());
|
||||||
|
format.setBreakMaxCodeLength(ui->chkBreakMaxCodeLength->isChecked());
|
||||||
|
format.setMaxCodeLength(ui->spinMaxCodeLength->value());
|
||||||
|
format.setBreakAfterLogical(ui->chkBreakAfterLogical->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "settingswidget.h"
|
#include "settingswidget.h"
|
||||||
#include "../utils.h"
|
#include "../utils.h"
|
||||||
|
#include "../settings.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class FormatterGeneralWidget;
|
class FormatterGeneralWidget;
|
||||||
|
@ -46,6 +47,10 @@ private slots:
|
||||||
|
|
||||||
void on_chkBreakMaxCodeLength_stateChanged(int arg1);
|
void on_chkBreakMaxCodeLength_stateChanged(int arg1);
|
||||||
|
|
||||||
|
void updateDemo();
|
||||||
|
private:
|
||||||
|
void updateCodeFormatter(Settings::CodeFormatter& format);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FormatterGeneralWidget *ui;
|
Ui::FormatterGeneralWidget *ui;
|
||||||
FormatterStyleModel mStylesModel;
|
FormatterStyleModel mStylesModel;
|
||||||
|
|
|
@ -850,6 +850,12 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Editor" name="editDemo">
|
<widget class="Editor" name="editDemo">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>1</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
|
@ -864,22 +870,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
@ -893,7 +883,7 @@
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="pointerBtnGroup"/>
|
|
||||||
<buttongroup name="referenceBtnGroup"/>
|
<buttongroup name="referenceBtnGroup"/>
|
||||||
|
<buttongroup name="pointerBtnGroup"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -92,7 +92,7 @@ bool isGreenEdition()
|
||||||
return gIsGreenEdition;
|
return gIsGreenEdition;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const QStringList& arguments, bool inheritEnvironment)
|
QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const QStringList& arguments, const QByteArray &inputContent, bool inheritEnvironment)
|
||||||
{
|
{
|
||||||
QProcess process;
|
QProcess process;
|
||||||
QByteArray result;
|
QByteArray result;
|
||||||
|
@ -111,6 +111,9 @@ QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const
|
||||||
result.append(process.readAllStandardOutput());
|
result.append(process.readAllStandardOutput());
|
||||||
});
|
});
|
||||||
process.start(cmd,arguments);
|
process.start(cmd,arguments);
|
||||||
|
if (!inputContent.isEmpty()) {
|
||||||
|
process.write(inputContent);
|
||||||
|
}
|
||||||
process.closeWriteChannel();
|
process.closeWriteChannel();
|
||||||
process.waitForFinished();
|
process.waitForFinished();
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -63,7 +63,7 @@ enum FormatterBraceStyle {
|
||||||
fbsRatliff,
|
fbsRatliff,
|
||||||
fbsGNU,
|
fbsGNU,
|
||||||
fbsLinux,
|
fbsLinux,
|
||||||
fbsHorstman,
|
fbsHorstmann,
|
||||||
fbs1TBS,
|
fbs1TBS,
|
||||||
fbsGoogle,
|
fbsGoogle,
|
||||||
fbsMozilla,
|
fbsMozilla,
|
||||||
|
@ -111,7 +111,9 @@ const QByteArray GuessTextEncoding(const QByteArray& text);
|
||||||
|
|
||||||
bool isTextAllAscii(const QString& text);
|
bool isTextAllAscii(const QString& text);
|
||||||
|
|
||||||
QByteArray runAndGetOutput(const QString& cmd, const QString& workingDir, const QStringList& arguments, bool inheritEnvironment = false);
|
QByteArray runAndGetOutput(const QString& cmd, const QString& workingDir, const QStringList& arguments,
|
||||||
|
const QByteArray& inputContent = QByteArray(),
|
||||||
|
bool inheritEnvironment = false);
|
||||||
|
|
||||||
bool isNonPrintableAsciiChar(char ch);
|
bool isNonPrintableAsciiChar(char ch);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue