- enhancement: click the encoding info in the statusbar will show encoding menu

This commit is contained in:
royqh1979@gmail.com 2021-10-15 10:23:46 +08:00
parent 0c6f4a10a4
commit b5523aaeda
10 changed files with 168 additions and 98 deletions

View File

@ -3,6 +3,7 @@ Version 0.6.7
- adjust: the max value of the debug console's vertical scrollbar. - adjust: the max value of the debug console's vertical scrollbar.
- fix: shfit+click not correctly set selection's end - fix: shfit+click not correctly set selection's end
- fix: ctrl+home/end not correctly set cursor to start/end of the editor - fix: ctrl+home/end not correctly set cursor to start/end of the editor
- enhancement: click the encoding info in the statusbar will show encoding menu
Version 0.6.6 Version 0.6.6
- fix: crash when create new file - fix: crash when create new file

View File

@ -115,6 +115,7 @@ SOURCES += \
widgets/functiontooltipwidget.cpp \ widgets/functiontooltipwidget.cpp \
widgets/headercompletionpopup.cpp \ widgets/headercompletionpopup.cpp \
widgets/issuestable.cpp \ widgets/issuestable.cpp \
widgets/labelwithmenu.cpp \
widgets/macroinfomodel.cpp \ widgets/macroinfomodel.cpp \
widgets/newprojectdialog.cpp \ widgets/newprojectdialog.cpp \
widgets/qconsole.cpp \ widgets/qconsole.cpp \
@ -226,6 +227,7 @@ HEADERS += \
widgets/functiontooltipwidget.h \ widgets/functiontooltipwidget.h \
widgets/headercompletionpopup.h \ widgets/headercompletionpopup.h \
widgets/issuestable.h \ widgets/issuestable.h \
widgets/labelwithmenu.h \
widgets/macroinfomodel.h \ widgets/macroinfomodel.h \
widgets/newprojectdialog.h \ widgets/newprojectdialog.h \
widgets/qconsole.h \ widgets/qconsole.h \

Binary file not shown.

View File

@ -82,17 +82,17 @@
<context> <context>
<name>BacktraceModel</name> <name>BacktraceModel</name>
<message> <message>
<location filename="debugger.cpp" line="1896"/> <location filename="debugger.cpp" line="1889"/>
<source>Function</source> <source>Function</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="1898"/> <location filename="debugger.cpp" line="1891"/>
<source>Filename</source> <source>Filename</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="1900"/> <location filename="debugger.cpp" line="1893"/>
<source>Line</source> <source>Line</source>
<translation></translation> <translation></translation>
</message> </message>
@ -100,17 +100,17 @@
<context> <context>
<name>BreakpointModel</name> <name>BreakpointModel</name>
<message> <message>
<location filename="debugger.cpp" line="1765"/> <location filename="debugger.cpp" line="1758"/>
<source>Filename</source> <source>Filename</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="1767"/> <location filename="debugger.cpp" line="1760"/>
<source>Line</source> <source>Line</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="1769"/> <location filename="debugger.cpp" line="1762"/>
<source>Condition</source> <source>Condition</source>
<translation></translation> <translation></translation>
</message> </message>
@ -836,68 +836,68 @@ Are you really want to continue?</source>
<context> <context>
<name>Debugger</name> <name>Debugger</name>
<message> <message>
<location filename="debugger.cpp" line="33"/> <location filename="debugger.cpp" line="34"/>
<source>No compiler set</source> <source>No compiler set</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="34"/> <location filename="debugger.cpp" line="35"/>
<source>No compiler set is configured.</source> <source>No compiler set is configured.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="34"/> <location filename="debugger.cpp" line="35"/>
<source>Can&apos;t start debugging.</source> <source>Can&apos;t start debugging.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="43"/> <location filename="debugger.cpp" line="44"/>
<source>Debugger path error</source> <source>Debugger path error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="44"/> <location filename="debugger.cpp" line="45"/>
<source>Debugger&apos;s path &quot;%1&quot; contains non-ascii characters.</source> <source>Debugger&apos;s path &quot;%1&quot; contains non-ascii characters.</source>
<translation>&quot;%1&quot;ASCII字符</translation> <translation>&quot;%1&quot;ASCII字符</translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="47"/> <location filename="debugger.cpp" line="48"/>
<source>This prevents it from executing.</source> <source>This prevents it from executing.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="53"/> <location filename="debugger.cpp" line="54"/>
<source>Debugger not exists</source> <source>Debugger not exists</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="54"/> <location filename="debugger.cpp" line="55"/>
<source>Can&apos;&apos;t find debugger in : &quot;%1&quot;</source> <source>Can&apos;&apos;t find debugger in : &quot;%1&quot;</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="247"/> <location filename="debugger.cpp" line="248"/>
<location filename="debugger.cpp" line="326"/> <location filename="debugger.cpp" line="327"/>
<source>Execute to evaluate</source> <source>Execute to evaluate</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="324"/> <location filename="debugger.cpp" line="325"/>
<source>Not found in current context</source> <source>Not found in current context</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="436"/> <location filename="debugger.cpp" line="437"/>
<source>Compile</source> <source>Compile</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="437"/> <location filename="debugger.cpp" line="438"/>
<source>Source file is more recent than executable.</source> <source>Source file is more recent than executable.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="437"/> <location filename="debugger.cpp" line="438"/>
<source>Recompile?</source> <source>Recompile?</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2686,7 +2686,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="295"/> <location filename="mainwindow.ui" line="295"/>
<location filename="mainwindow.cpp" line="2777"/> <location filename="mainwindow.cpp" line="2787"/>
<source>Issues</source> <source>Issues</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2889,8 +2889,8 @@ Are you really want to continue?</source>
<location filename="mainwindow.ui" line="1165"/> <location filename="mainwindow.ui" line="1165"/>
<location filename="mainwindow.cpp" line="1174"/> <location filename="mainwindow.cpp" line="1174"/>
<location filename="mainwindow.cpp" line="1185"/> <location filename="mainwindow.cpp" line="1185"/>
<location filename="mainwindow.cpp" line="2473"/> <location filename="mainwindow.cpp" line="2483"/>
<location filename="mainwindow.cpp" line="2484"/> <location filename="mainwindow.cpp" line="2494"/>
<source>Compile</source> <source>Compile</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3334,7 +3334,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="1656"/> <location filename="mainwindow.ui" line="1656"/>
<location filename="mainwindow.cpp" line="3591"/> <location filename="mainwindow.cpp" line="3601"/>
<source>Clear all breakpoints</source> <source>Clear all breakpoints</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3435,7 +3435,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="1807"/> <location filename="mainwindow.ui" line="1807"/>
<location filename="mainwindow.cpp" line="4105"/> <location filename="mainwindow.cpp" line="4115"/>
<source>Rename Symbol</source> <source>Rename Symbol</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3456,13 +3456,13 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="1827"/> <location filename="mainwindow.ui" line="1827"/>
<location filename="mainwindow.cpp" line="4209"/> <location filename="mainwindow.cpp" line="4219"/>
<source>Export As RTF</source> <source>Export As RTF</source>
<translation>RTF</translation> <translation>RTF</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="1832"/> <location filename="mainwindow.ui" line="1832"/>
<location filename="mainwindow.cpp" line="4231"/> <location filename="mainwindow.cpp" line="4241"/>
<source>Export As HTML</source> <source>Export As HTML</source>
<translation>HTML</translation> <translation>HTML</translation>
</message> </message>
@ -3474,10 +3474,10 @@ Are you really want to continue?</source>
<message> <message>
<location filename="mainwindow.ui" line="1840"/> <location filename="mainwindow.ui" line="1840"/>
<source>Ctrl+M</source> <source>Ctrl+M</source>
<translation type="unfinished"></translation> <translation>Ctrl+M</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1972"/> <location filename="mainwindow.cpp" line="1977"/>
<source>File Encoding</source> <source>File Encoding</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3522,8 +3522,9 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="688"/> <location filename="mainwindow.cpp" line="688"/>
<source>Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5</source> <source>Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5</source>
<translation>:%1 :%2 :%3 :%4 :%5</translation> <oldsource>Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5</oldsource>
<translation type="unfinished">: %1 : %2 :%3 : %4 : %5</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="706"/> <location filename="mainwindow.cpp" line="706"/>
@ -3690,6 +3691,11 @@ Are you really want to continue?</source>
<source>Export</source> <source>Export</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="mainwindow.cpp" line="122"/>
<source>Insert Snippet</source>
<translation></translation>
</message>
<message> <message>
<location filename="mainwindow.cpp" line="1613"/> <location filename="mainwindow.cpp" line="1613"/>
<source>Show debug logs in the debug console</source> <source>Show debug logs in the debug console</source>
@ -3782,141 +3788,141 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1938"/> <location filename="mainwindow.cpp" line="1943"/>
<source>Character sets</source> <source>Character sets</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2051"/> <location filename="mainwindow.cpp" line="2056"/>
<source>%1 files autosaved</source> <source>%1 files autosaved</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2393"/> <location filename="mainwindow.cpp" line="2403"/>
<source>Save project</source> <source>Save project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2394"/> <location filename="mainwindow.cpp" line="2404"/>
<source>The project &apos;%1&apos; has modifications.</source> <source>The project &apos;%1&apos; has modifications.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2396"/> <location filename="mainwindow.cpp" line="2406"/>
<source>Do you want to save it?</source> <source>Do you want to save it?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3592"/> <location filename="mainwindow.cpp" line="3602"/>
<source>Do you really want to clear all breakpoints in this file?</source> <source>Do you really want to clear all breakpoints in this file?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3770"/> <location filename="mainwindow.cpp" line="3780"/>
<source>New project</source> <source>New project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3771"/> <location filename="mainwindow.cpp" line="3781"/>
<source>Close %1 and start new project?</source> <source>Close %1 and start new project?</source>
<translation>&apos;%1&apos;?</translation> <translation>&apos;%1&apos;?</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3783"/> <location filename="mainwindow.cpp" line="3793"/>
<source>Folder not exist</source> <source>Folder not exist</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3784"/> <location filename="mainwindow.cpp" line="3794"/>
<source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source> <source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3791"/> <location filename="mainwindow.cpp" line="3801"/>
<source>Can&apos;t create folder</source> <source>Can&apos;t create folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3792"/> <location filename="mainwindow.cpp" line="3802"/>
<source>Failed to create folder &apos;%1&apos;.</source> <source>Failed to create folder &apos;%1&apos;.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3807"/> <location filename="mainwindow.cpp" line="3817"/>
<source>Save new project as</source> <source>Save new project as</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3809"/> <location filename="mainwindow.cpp" line="3819"/>
<source>Red panda Dev-C++ project file (*.dev)</source> <source>Red panda Dev-C++ project file (*.dev)</source>
<translation>Dev-C++ (*.dev)</translation> <translation>Dev-C++ (*.dev)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3820"/> <location filename="mainwindow.cpp" line="3830"/>
<source>New project fail</source> <source>New project fail</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3821"/> <location filename="mainwindow.cpp" line="3831"/>
<source>Can&apos;t assign project template</source> <source>Can&apos;t assign project template</source>
<translation>使</translation> <translation>使</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3878"/> <location filename="mainwindow.cpp" line="3888"/>
<source>Add to project</source> <source>Add to project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4091"/> <location filename="mainwindow.cpp" line="4101"/>
<source>Rename Error</source> <source>Rename Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4092"/> <location filename="mainwindow.cpp" line="4102"/>
<source>Symbol &apos;%1&apos; is defined in system header.</source> <source>Symbol &apos;%1&apos; is defined in system header.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4106"/> <location filename="mainwindow.cpp" line="4116"/>
<source>New Name</source> <source>New Name</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4154"/>
<location filename="mainwindow.cpp" line="4164"/> <location filename="mainwindow.cpp" line="4164"/>
<location filename="mainwindow.cpp" line="4174"/>
<source>Replace Error</source> <source>Replace Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4155"/> <location filename="mainwindow.cpp" line="4165"/>
<source>Can&apos;t open file &apos;%1&apos; for replace!</source> <source>Can&apos;t open file &apos;%1&apos; for replace!</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4165"/> <location filename="mainwindow.cpp" line="4175"/>
<source>Contents has changed since last search!</source> <source>Contents has changed since last search!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4211"/> <location filename="mainwindow.cpp" line="4221"/>
<source>Rich Text Format Files (*.rtf)</source> <source>Rich Text Format Files (*.rtf)</source>
<translation>RTF格式文件 (*.rtf)</translation> <translation>RTF格式文件 (*.rtf)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="4233"/> <location filename="mainwindow.cpp" line="4243"/>
<source>HTML Files (*.html)</source> <source>HTML Files (*.html)</source>
<translation>HTML文件 (*.html)</translation> <translation>HTML文件 (*.html)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="757"/> <location filename="mainwindow.cpp" line="757"/>
<location filename="mainwindow.cpp" line="1595"/> <location filename="mainwindow.cpp" line="1595"/>
<location filename="mainwindow.cpp" line="1963"/> <location filename="mainwindow.cpp" line="1968"/>
<location filename="mainwindow.cpp" line="2480"/> <location filename="mainwindow.cpp" line="2490"/>
<location filename="mainwindow.cpp" line="2565"/> <location filename="mainwindow.cpp" line="2575"/>
<location filename="mainwindow.cpp" line="2672"/> <location filename="mainwindow.cpp" line="2682"/>
<location filename="mainwindow.cpp" line="2684"/> <location filename="mainwindow.cpp" line="2694"/>
<location filename="mainwindow.cpp" line="3019"/> <location filename="mainwindow.cpp" line="3029"/>
<location filename="mainwindow.cpp" line="3031"/> <location filename="mainwindow.cpp" line="3041"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -3926,75 +3932,75 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2474"/> <location filename="mainwindow.cpp" line="2484"/>
<source>File &apos;%1&apos; was changed.</source> <source>File &apos;%1&apos; was changed.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2474"/> <location filename="mainwindow.cpp" line="2484"/>
<source>Reload its content from disk?</source> <source>Reload its content from disk?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2485"/> <location filename="mainwindow.cpp" line="2495"/>
<source>File &apos;%1&apos; was removed.</source> <source>File &apos;%1&apos; was removed.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2485"/> <location filename="mainwindow.cpp" line="2495"/>
<source>Keep it open?</source> <source>Keep it open?</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2561"/> <location filename="mainwindow.cpp" line="2571"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2851"/> <location filename="mainwindow.cpp" line="2861"/>
<source>Compile Failed</source> <source>Compile Failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2856"/> <location filename="mainwindow.cpp" line="2866"/>
<source>Run Failed</source> <source>Run Failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3048"/> <location filename="mainwindow.cpp" line="3058"/>
<location filename="mainwindow.cpp" line="3062"/> <location filename="mainwindow.cpp" line="3072"/>
<source>Confirm Convertion</source> <source>Confirm Convertion</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3049"/> <location filename="mainwindow.cpp" line="3059"/>
<location filename="mainwindow.cpp" line="3063"/> <location filename="mainwindow.cpp" line="3073"/>
<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="3229"/> <location filename="mainwindow.cpp" line="3239"/>
<source>New Watch Expression</source> <source>New Watch Expression</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3230"/> <location filename="mainwindow.cpp" line="3240"/>
<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="3286"/> <location filename="mainwindow.cpp" line="3296"/>
<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="3308"/> <location filename="mainwindow.cpp" line="3318"/>
<location filename="mainwindow.cpp" line="3314"/> <location filename="mainwindow.cpp" line="3324"/>
<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="3311"/> <location filename="mainwindow.cpp" line="3321"/>
<source>(%1 files per second)</source> <source>(%1 files per second)</source>
<translation>(%1</translation> <translation>(%1</translation>
</message> </message>
@ -5400,17 +5406,17 @@ Are you really want to continue?</source>
<context> <context>
<name>RegisterModel</name> <name>RegisterModel</name>
<message> <message>
<location filename="debugger.cpp" line="2202"/> <location filename="debugger.cpp" line="2195"/>
<source>Register</source> <source>Register</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="2204"/> <location filename="debugger.cpp" line="2197"/>
<source>Value(Hex)</source> <source>Value(Hex)</source>
<translation>(HEX)</translation> <translation>(HEX)</translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="2206"/> <location filename="debugger.cpp" line="2199"/>
<source>Value(Dec)</source> <source>Value(Dec)</source>
<translation>(DEC)</translation> <translation>(DEC)</translation>
</message> </message>
@ -6238,12 +6244,12 @@ Are you really want to continue?</source>
<context> <context>
<name>WatchModel</name> <name>WatchModel</name>
<message> <message>
<location filename="debugger.cpp" line="2148"/> <location filename="debugger.cpp" line="2141"/>
<source>Expression</source> <source>Expression</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="debugger.cpp" line="2150"/> <location filename="debugger.cpp" line="2143"/>
<source>Value</source> <source>Value</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -57,7 +57,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this); ui->setupUi(this);
// status bar // status bar
mFileInfoStatus=new QLabel(); mFileInfoStatus=new QLabel();
mFileEncodingStatus = new QLabel(); mFileEncodingStatus = new LabelWithMenu();
mFileModeStatus = new QLabel(); mFileModeStatus = new QLabel();
mFileInfoStatus->setStyleSheet("margin-left:10px; margin-right:10px"); mFileInfoStatus->setStyleSheet("margin-left:10px; margin-right:10px");
mFileEncodingStatus->setStyleSheet("margin-left:10px; margin-right:10px"); mFileEncodingStatus->setStyleSheet("margin-left:10px; margin-right:10px");
@ -119,7 +119,7 @@ MainWindow::MainWindow(QWidget *parent)
rebuildOpenedFileHisotryMenu(); rebuildOpenedFileHisotryMenu();
mMenuInsertCodeSnippet = new QMenu(); mMenuInsertCodeSnippet = new QMenu();
mMenuInsertCodeSnippet->setTitle("Insert Snippet"); mMenuInsertCodeSnippet->setTitle(tr("Insert Snippet"));
ui->menuCode->insertMenu(ui->actionReformat_Code,mMenuInsertCodeSnippet); ui->menuCode->insertMenu(ui->actionReformat_Code,mMenuInsertCodeSnippet);
ui->menuCode->insertSeparator(ui->actionReformat_Code); ui->menuCode->insertSeparator(ui->actionReformat_Code);
connect(mMenuInsertCodeSnippet,&QMenu::aboutToShow, connect(mMenuInsertCodeSnippet,&QMenu::aboutToShow,
@ -686,11 +686,11 @@ void MainWindow::updateStatusbarForLineCol()
if (e!=nullptr) { if (e!=nullptr) {
int col = e->charToColumn(e->caretY(),e->caretX()); int col = e->charToColumn(e->caretY(),e->caretX());
QString msg = tr("Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5") QString msg = tr("Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5")
.arg(e->caretY(),4) .arg(e->caretY())
.arg(col,3) .arg(col)
.arg(e->selText().length(),6) .arg(e->selText().length())
.arg(e->lines()->count(),4) .arg(e->lines()->count())
.arg(e->lines()->getTextLength(),6); .arg(e->lines()->getTextLength());
mFileInfoStatus->setText(msg); mFileInfoStatus->setText(msg);
} else { } else {
mFileInfoStatus->setText(""); mFileInfoStatus->setText("");
@ -1930,6 +1930,11 @@ void MainWindow::buildContextMenus()
toolButton->setDefaultAction(mClassBrowser_Show_Inherited); toolButton->setDefaultAction(mClassBrowser_Show_Inherited);
hlayout->addWidget(toolButton); hlayout->addWidget(toolButton);
hlayout->addStretch(); hlayout->addStretch();
//menu for statusbar
mFileEncodingStatus->setContextMenuPolicy(Qt::CustomContextMenu);
connect(mFileEncodingStatus,&QWidget::customContextMenuRequested,
this, &MainWindow::onFileEncodingContextMenu);
} }
void MainWindow::buildEncodingMenu() void MainWindow::buildEncodingMenu()
@ -2185,6 +2190,11 @@ void MainWindow::onDebugConsoleContextMenu(const QPoint &pos)
menu.exec(ui->debugConsole->mapToGlobal(pos)); menu.exec(ui->debugConsole->mapToGlobal(pos));
} }
void MainWindow::onFileEncodingContextMenu(const QPoint &pos)
{
mMenuEncoding->exec(mFileEncodingStatus->mapToGlobal(pos));
}
void MainWindow::onShowInsertCodeSnippetMenu() void MainWindow::onShowInsertCodeSnippetMenu()
{ {
mMenuInsertCodeSnippet->clear(); mMenuInsertCodeSnippet->clear();

View File

@ -15,6 +15,7 @@
#include "codesnippetsmanager.h" #include "codesnippetsmanager.h"
#include "todoparser.h" #include "todoparser.h"
#include "toolsmanager.h" #include "toolsmanager.h"
#include "widgets/labelwithmenu.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -199,6 +200,7 @@ private slots:
void onProjectViewContextMenu(const QPoint& pos); void onProjectViewContextMenu(const QPoint& pos);
void onClassBrowserContextMenu(const QPoint& pos); void onClassBrowserContextMenu(const QPoint& pos);
void onDebugConsoleContextMenu(const QPoint& pos); void onDebugConsoleContextMenu(const QPoint& pos);
void onFileEncodingContextMenu(const QPoint& pos);
void onShowInsertCodeSnippetMenu(); void onShowInsertCodeSnippetMenu();
@ -405,7 +407,7 @@ private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
EditorList *mEditorList; EditorList *mEditorList;
QLabel *mFileInfoStatus; QLabel *mFileInfoStatus;
QLabel *mFileEncodingStatus; LabelWithMenu *mFileEncodingStatus;
QLabel *mFileModeStatus; QLabel *mFileModeStatus;
QMenu *mMenuEncoding; QMenu *mMenuEncoding;
QMenu *mMenuExport; QMenu *mMenuExport;

View File

@ -283,7 +283,7 @@
<enum>QTabWidget::South</enum> <enum>QTabWidget::South</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tabIssues"> <widget class="QWidget" name="tabIssues">
<attribute name="icon"> <attribute name="icon">
@ -388,16 +388,16 @@
</attribute> </attribute>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>2</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>2</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">

View File

@ -61,5 +61,19 @@
"description": "", "description": "",
"prefix": "function()", "prefix": "function()",
"section": -1 "section": -1
},
{
"caption": "Comment Header",
"code": "/**\r\n * @file %REPL_BEGIN%<SOURCENAME>%REPL_END% \r\n * @brief: %INSERT%\r\n * @version: %INSERT% \r\n * @copyright: %INSERT%\r\n * @author: %INSERT%\r\n * @date: <DATETIME>\r\n * \r\n **/",
"description": "",
"prefix": "",
"section": 0
},
{
"caption": "Date/Time",
"code": "<DATETIME>",
"description": "",
"prefix": "",
"section": 0
} }
] ]

View File

@ -0,0 +1,18 @@
#include "labelwithmenu.h"
#include <QApplication>
#include <QContextMenuEvent>
#include <QMouseEvent>
LabelWithMenu::LabelWithMenu(QWidget* parent):QLabel(parent)
{
}
void LabelWithMenu::mousePressEvent(QMouseEvent *event)
{
QContextMenuEvent *e = new QContextMenuEvent(QContextMenuEvent::Reason::Mouse,
event->pos());
QApplication::instance()->postEvent(this,e);
event->accept();
}

View File

@ -0,0 +1,17 @@
#ifndef LABELWITHMENU_H
#define LABELWITHMENU_H
#include <QLabel>
class LabelWithMenu : public QLabel
{
Q_OBJECT
public:
explicit LabelWithMenu(QWidget* parent = nullptr);
// QWidget interface
protected:
void mousePressEvent(QMouseEvent *event) override;
};
#endif // LABELWITHMENU_H