- enhancement: enable group undo

- enhancement: add option "hide symbols start with underscore" and "hide synbols start with two underscore"
  - fix: can't rename project files that not openned in editor
  - fix: dpi changes in CPU window shouldn't affect main window
This commit is contained in:
Roy Qu 2022-03-01 22:03:54 +08:00
parent 82d812b6eb
commit ee59d80bdb
17 changed files with 391 additions and 230 deletions

View File

@ -5,6 +5,9 @@ Red Panda C++ Version 0.14.5
- fix: can't correctly set break conditions
- fix: crash when copy to non-c files
- fix: fonts in cpu window is not correctly set, when dpi changed
- enhancement: enable group undo
- enhancement: add option "hide symbols start with underscore" and "hide synbols start with two underscore"
- fix: can't rename project files that not openned in editor
Red Panda C++ Version 0.14.4

View File

@ -1314,40 +1314,40 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="3145"/>
<location filename="editor.cpp" line="3184"/>
<location filename="editor.cpp" line="3238"/>
<location filename="editor.cpp" line="3147"/>
<location filename="editor.cpp" line="3186"/>
<location filename="editor.cpp" line="3240"/>
<source>Ctrl+click for more info</source>
<translation>Ctrl+</translation>
</message>
<message>
<location filename="editor.cpp" line="3636"/>
<location filename="editor.cpp" line="3666"/>
<location filename="editor.cpp" line="3638"/>
<location filename="editor.cpp" line="3668"/>
<source>Symbol &apos;%1&apos; not found!</source>
<translation>&apos;%1&apos;!</translation>
</message>
<message>
<location filename="editor.cpp" line="3959"/>
<location filename="editor.cpp" line="3961"/>
<source>astyle not found</source>
<translation>astyle程序</translation>
</message>
<message>
<location filename="editor.cpp" line="3960"/>
<location filename="editor.cpp" line="3962"/>
<source>Can&apos;t find astyle in &quot;%1&quot;.</source>
<translation>astyle程序&quot;%1&quot;.</translation>
</message>
<message>
<location filename="editor.cpp" line="4109"/>
<location filename="editor.cpp" line="4111"/>
<source>Break point condition</source>
<translation></translation>
</message>
<message>
<location filename="editor.cpp" line="4110"/>
<location filename="editor.cpp" line="4112"/>
<source>Enter the condition of the breakpoint:</source>
<translation>:</translation>
</message>
<message>
<location filename="editor.cpp" line="4324"/>
<location filename="editor.cpp" line="4326"/>
<source>Readonly</source>
<translation></translation>
</message>
@ -1558,22 +1558,34 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="167"/>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="152"/>
<source>Hide symbols start with underscore</source>
<oldsource>Hide symbols start with underline</oldsource>
<translation>线</translation>
</message>
<message>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="159"/>
<source>Hide symbols start with two underscores</source>
<oldsource>Hide symbols start with two underline</oldsource>
<translation>线</translation>
</message>
<message>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="181"/>
<source>Prefer symbols mostly used</source>
<translation>使</translation>
</message>
<message>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="187"/>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="201"/>
<source>Clear usage data</source>
<translation>使</translation>
</message>
<message>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="206"/>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="226"/>
<source>Completion suggestion window width:</source>
<translation></translation>
</message>
<message>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="236"/>
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="256"/>
<source>Completion suggestion window height:</source>
<translation></translation>
</message>
@ -3081,7 +3093,7 @@ Are you really want to continue?</oldsource>
<message>
<location filename="settingsdialog/formattergeneralwidget.cpp" line="224"/>
<source>Linux braces, add braces to all conditionals.</source>
<translation>Linux封号花括号</translation>
<translation>Linux花括号</translation>
</message>
<message>
<location filename="settingsdialog/formattergeneralwidget.cpp" line="229"/>
@ -3762,11 +3774,11 @@ Are you really want to continue?</oldsource>
<message>
<location filename="mainwindow.ui" line="560"/>
<location filename="mainwindow.ui" line="2637"/>
<location filename="mainwindow.cpp" line="4299"/>
<location filename="mainwindow.cpp" line="4302"/>
<location filename="mainwindow.cpp" line="4306"/>
<location filename="mainwindow.cpp" line="4305"/>
<location filename="mainwindow.cpp" line="4309"/>
<location filename="mainwindow.cpp" line="5949"/>
<location filename="mainwindow.cpp" line="4312"/>
<location filename="mainwindow.cpp" line="5954"/>
<source>Issues</source>
<translation></translation>
</message>
@ -4189,7 +4201,7 @@ Are you really want to continue?</oldsource>
<message>
<location filename="mainwindow.ui" line="359"/>
<location filename="mainwindow.ui" line="362"/>
<location filename="mainwindow.cpp" line="6263"/>
<location filename="mainwindow.cpp" line="6268"/>
<source>New Problem Set</source>
<translation></translation>
</message>
@ -4208,14 +4220,14 @@ Are you really want to continue?</oldsource>
<message>
<location filename="mainwindow.ui" line="401"/>
<location filename="mainwindow.ui" line="404"/>
<location filename="mainwindow.cpp" line="6306"/>
<location filename="mainwindow.cpp" line="6311"/>
<source>Save Problem Set</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="415"/>
<location filename="mainwindow.ui" line="418"/>
<location filename="mainwindow.cpp" line="6330"/>
<location filename="mainwindow.cpp" line="6335"/>
<source>Load Problem Set</source>
<translation></translation>
</message>
@ -4554,7 +4566,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2312"/>
<location filename="mainwindow.cpp" line="5166"/>
<location filename="mainwindow.cpp" line="5171"/>
<source>Clear all breakpoints</source>
<translation></translation>
</message>
@ -4655,7 +4667,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2466"/>
<location filename="mainwindow.cpp" line="5890"/>
<location filename="mainwindow.cpp" line="5895"/>
<source>Rename Symbol</source>
<translation></translation>
</message>
@ -4676,13 +4688,13 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2486"/>
<location filename="mainwindow.cpp" line="6078"/>
<location filename="mainwindow.cpp" line="6083"/>
<source>Export As RTF</source>
<translation>RTF</translation>
</message>
<message>
<location filename="mainwindow.ui" line="2491"/>
<location filename="mainwindow.cpp" line="6100"/>
<location filename="mainwindow.cpp" line="6105"/>
<source>Export As HTML</source>
<translation>HTML</translation>
</message>
@ -5162,7 +5174,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.cpp" line="277"/>
<location filename="mainwindow.cpp" line="6272"/>
<location filename="mainwindow.cpp" line="6277"/>
<source>Problem Set %1</source>
<translation>%1</translation>
</message>
@ -5236,15 +5248,15 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.cpp" line="2339"/>
<location filename="mainwindow.cpp" line="6159"/>
<location filename="mainwindow.cpp" line="6199"/>
<location filename="mainwindow.cpp" line="6164"/>
<location filename="mainwindow.cpp" line="6204"/>
<source>Bookmark Description</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2340"/>
<location filename="mainwindow.cpp" line="6160"/>
<location filename="mainwindow.cpp" line="6200"/>
<location filename="mainwindow.cpp" line="6165"/>
<location filename="mainwindow.cpp" line="6205"/>
<source>Description:</source>
<translation></translation>
</message>
@ -5365,7 +5377,7 @@ Are you really want to continue?</oldsource>
<location filename="mainwindow.cpp" line="2737"/>
<location filename="mainwindow.cpp" line="3589"/>
<location filename="mainwindow.cpp" line="3595"/>
<location filename="mainwindow.cpp" line="5751"/>
<location filename="mainwindow.cpp" line="5756"/>
<source>Delete</source>
<translation></translation>
</message>
@ -5442,7 +5454,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.cpp" line="3802"/>
<location filename="mainwindow.cpp" line="6266"/>
<location filename="mainwindow.cpp" line="6271"/>
<source>Do you want to save it?</source>
<translation></translation>
</message>
@ -5466,141 +5478,141 @@ Are you really want to continue?</oldsource>
<location filename="mainwindow.cpp" line="4049"/>
<location filename="mainwindow.cpp" line="4059"/>
<location filename="mainwindow.cpp" line="4071"/>
<location filename="mainwindow.cpp" line="6319"/>
<location filename="mainwindow.cpp" line="6324"/>
<source>Save Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4227"/>
<location filename="mainwindow.cpp" line="4230"/>
<source>Change Project Compiler Set</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4228"/>
<location filename="mainwindow.cpp" line="4231"/>
<source>Change the project&apos;s compiler set will lose all custom compiler set options.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4230"/>
<location filename="mainwindow.cpp" line="4233"/>
<source>Do you really want to do that?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5167"/>
<location filename="mainwindow.cpp" line="5172"/>
<source>Do you really want to clear all breakpoints in this file?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5365"/>
<location filename="mainwindow.cpp" line="5370"/>
<source>New project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5366"/>
<location filename="mainwindow.cpp" line="5371"/>
<source>Close %1 and start new project?</source>
<translation>&apos;%1&apos;?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5379"/>
<location filename="mainwindow.cpp" line="5384"/>
<source>Folder not exist</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5380"/>
<location filename="mainwindow.cpp" line="5385"/>
<source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5387"/>
<location filename="mainwindow.cpp" line="5392"/>
<source>Can&apos;t create folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5388"/>
<location filename="mainwindow.cpp" line="5393"/>
<source>Failed to create folder &apos;%1&apos;.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5403"/>
<location filename="mainwindow.cpp" line="5408"/>
<source>Save new project as</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5752"/>
<location filename="mainwindow.cpp" line="5757"/>
<source>Folder %1 is not empty.</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5753"/>
<location filename="mainwindow.cpp" line="5758"/>
<source>Do you really want to delete it?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6844"/>
<location filename="mainwindow.cpp" line="6849"/>
<source>Can&apos;t Commit</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6845"/>
<location filename="mainwindow.cpp" line="6850"/>
<source>Git needs user info to commit.</source>
<translation>Git需要用信息进行提交</translation>
</message>
<message>
<location filename="mainwindow.ui" line="2556"/>
<location filename="mainwindow.ui" line="2559"/>
<location filename="mainwindow.cpp" line="6242"/>
<location filename="mainwindow.cpp" line="6247"/>
<source>Choose Working Folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6612"/>
<location filename="mainwindow.cpp" line="6664"/>
<location filename="mainwindow.cpp" line="6617"/>
<location filename="mainwindow.cpp" line="6669"/>
<source>Header Exists</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6613"/>
<location filename="mainwindow.cpp" line="6665"/>
<location filename="mainwindow.cpp" line="6618"/>
<location filename="mainwindow.cpp" line="6670"/>
<source>Header file &quot;%1&quot; already exists!</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6670"/>
<location filename="mainwindow.cpp" line="6675"/>
<source>Source Exists</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6671"/>
<location filename="mainwindow.cpp" line="6676"/>
<source>Source file &quot;%1&quot; already exists!</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6823"/>
<location filename="mainwindow.cpp" line="6828"/>
<source>Can&apos;t commit!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6824"/>
<location filename="mainwindow.cpp" line="6829"/>
<source>The following files are in conflicting:</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6829"/>
<location filename="mainwindow.cpp" line="6834"/>
<source>Commit Message</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6829"/>
<location filename="mainwindow.cpp" line="6834"/>
<source>Commit Message:</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6832"/>
<location filename="mainwindow.cpp" line="6837"/>
<source>Commit Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6833"/>
<location filename="mainwindow.cpp" line="6838"/>
<source>Commit message shouldn&apos;t be empty!</source>
<translation></translation>
</message>
@ -5609,125 +5621,125 @@ Are you really want to continue?</oldsource>
<translation type="vanished">Dev-C++ (*.dev)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5416"/>
<location filename="mainwindow.cpp" line="5421"/>
<source>New project fail</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5417"/>
<location filename="mainwindow.cpp" line="5422"/>
<source>Can&apos;t assign project template</source>
<translation>使</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5512"/>
<location filename="mainwindow.cpp" line="5517"/>
<source>Remove file</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5513"/>
<location filename="mainwindow.cpp" line="5518"/>
<source>Remove the file from disk?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5702"/>
<location filename="mainwindow.cpp" line="5707"/>
<source>untitled</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5712"/>
<location filename="mainwindow.cpp" line="5717"/>
<source>New Project File Name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5713"/>
<location filename="mainwindow.cpp" line="5718"/>
<source>File Name:</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5719"/>
<location filename="mainwindow.cpp" line="5724"/>
<source>File Already Exists!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5720"/>
<location filename="mainwindow.cpp" line="5725"/>
<source>File &apos;%1&apos; already exists!</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5461"/>
<location filename="mainwindow.cpp" line="5466"/>
<source>Add to project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5405"/>
<location filename="mainwindow.cpp" line="5410"/>
<source>Red Panda C++ project file (*.dev)</source>
<translation>C++(*.dev)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5876"/>
<location filename="mainwindow.cpp" line="5881"/>
<source>Rename Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5877"/>
<location filename="mainwindow.cpp" line="5882"/>
<source>Symbol &apos;%1&apos; is defined in system header.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5891"/>
<location filename="mainwindow.cpp" line="5896"/>
<source>New Name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6023"/>
<location filename="mainwindow.cpp" line="6033"/>
<location filename="mainwindow.cpp" line="6028"/>
<location filename="mainwindow.cpp" line="6038"/>
<source>Replace Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6024"/>
<location filename="mainwindow.cpp" line="6029"/>
<source>Can&apos;t open file &apos;%1&apos; for replace!</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6034"/>
<location filename="mainwindow.cpp" line="6039"/>
<source>Contents has changed since last search!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6080"/>
<location filename="mainwindow.cpp" line="6085"/>
<source>Rich Text Format Files (*.rtf)</source>
<translation>RTF格式文件 (*.rtf)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6102"/>
<location filename="mainwindow.cpp" line="6107"/>
<source>HTML Files (*.html)</source>
<translation>HTML文件 (*.html)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6264"/>
<location filename="mainwindow.cpp" line="6269"/>
<source>The current problem set is not empty.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6282"/>
<location filename="mainwindow.cpp" line="6287"/>
<source>Problem %1</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6308"/>
<location filename="mainwindow.cpp" line="6332"/>
<location filename="mainwindow.cpp" line="6313"/>
<location filename="mainwindow.cpp" line="6337"/>
<source>Problem Set Files (*.pbs)</source>
<translation> (*.pbs)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6338"/>
<location filename="mainwindow.cpp" line="6343"/>
<source>Load Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3478"/>
<location filename="mainwindow.cpp" line="6352"/>
<location filename="mainwindow.cpp" line="6357"/>
<source>Problem Case %1</source>
<translation>%1</translation>
</message>
@ -5743,10 +5755,10 @@ Are you really want to continue?</oldsource>
<location filename="mainwindow.cpp" line="2876"/>
<location filename="mainwindow.cpp" line="3896"/>
<location filename="mainwindow.cpp" line="4007"/>
<location filename="mainwindow.cpp" line="4196"/>
<location filename="mainwindow.cpp" line="4208"/>
<location filename="mainwindow.cpp" line="4614"/>
<location filename="mainwindow.cpp" line="4626"/>
<location filename="mainwindow.cpp" line="4199"/>
<location filename="mainwindow.cpp" line="4211"/>
<location filename="mainwindow.cpp" line="4619"/>
<location filename="mainwindow.cpp" line="4631"/>
<source>Error</source>
<translation></translation>
</message>
@ -5798,50 +5810,50 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4392"/>
<location filename="mainwindow.cpp" line="4395"/>
<source>Compile Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4398"/>
<location filename="mainwindow.cpp" line="4401"/>
<source>Run Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4643"/>
<location filename="mainwindow.cpp" line="4657"/>
<location filename="mainwindow.cpp" line="4648"/>
<location filename="mainwindow.cpp" line="4662"/>
<source>Confirm Convertion</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4644"/>
<location filename="mainwindow.cpp" line="4658"/>
<location filename="mainwindow.cpp" line="4649"/>
<location filename="mainwindow.cpp" line="4663"/>
<source>The editing file will be saved using %1 encoding. &lt;br /&gt;This operation can&apos;t be reverted. &lt;br /&gt;Are you sure to continue?</source>
<translation>使%1&lt;br /&gt;&lt;br /&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4808"/>
<location filename="mainwindow.cpp" line="4813"/>
<source>New Watch Expression</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4809"/>
<location filename="mainwindow.cpp" line="4814"/>
<source>Enter Watch Expression (it is recommended to use &apos;this-&gt;&apos; for class members):</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4862"/>
<location filename="mainwindow.cpp" line="4867"/>
<source>Parsing file %1 of %2: &quot;%3&quot;</source>
<translation>%1/%2&quot;%3&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4884"/>
<location filename="mainwindow.cpp" line="4890"/>
<location filename="mainwindow.cpp" line="4889"/>
<location filename="mainwindow.cpp" line="4895"/>
<source>Done parsing %1 files in %2 seconds</source>
<translation>%1,%2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4887"/>
<location filename="mainwindow.cpp" line="4892"/>
<source>(%1 files per second)</source>
<translation>(%1</translation>
</message>
@ -6582,16 +6594,24 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="project.cpp" line="2106"/>
<location filename="project.cpp" line="2126"/>
<source>Remove failed</source>
<translation></translation>
</message>
<message>
<location filename="project.cpp" line="2107"/>
<location filename="project.cpp" line="2127"/>
<source>Failed to remove file &apos;%1&apos;</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="project.cpp" line="2124"/>
<source>Rename failed</source>
<translation></translation>
</message>
<message>
<location filename="project.cpp" line="2125"/>
<source>Failed to rename file &apos;%1&apos; to &apos;%2&apos;</source>
<translation>&apos;%1&apos;&apos;%2&apos;</translation>
</message>
</context>
<context>
<name>ProjectOutputWidget</name>
@ -6812,7 +6832,7 @@ Are you really want to continue?</oldsource>
<context>
<name>QApplication</name>
<message>
<location filename="main.cpp" line="380"/>
<location filename="main.cpp" line="392"/>
<source>Error</source>
<translation></translation>
</message>
@ -6882,7 +6902,7 @@ Are you really want to continue?</oldsource>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="main.cpp" line="334"/>
<location filename="main.cpp" line="346"/>
<source>Can&apos;t load autolink settings</source>
<translation></translation>
</message>
@ -7976,7 +7996,7 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6253"/>
<location filename="mainwindow.cpp" line="6258"/>
<location filename="settingsdialog/settingsdialog.cpp" line="170"/>
<location filename="settingsdialog/settingsdialog.cpp" line="203"/>
<location filename="settingsdialog/settingsdialog.cpp" line="209"/>
@ -8052,15 +8072,15 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6254"/>
<location filename="mainwindow.cpp" line="6567"/>
<location filename="mainwindow.cpp" line="6259"/>
<location filename="mainwindow.cpp" line="6572"/>
<location filename="settingsdialog/settingsdialog.cpp" line="203"/>
<location filename="settingsdialog/settingsdialog.cpp" line="206"/>
<source>Program Runner</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6566"/>
<location filename="mainwindow.cpp" line="6571"/>
<location filename="settingsdialog/settingsdialog.cpp" line="206"/>
<source>Problem Set</source>
<translation></translation>

View File

@ -2684,6 +2684,8 @@ void Editor::showCompletion(const QString& preWord,bool autoComplete)
mCompletionPopup->setSortByScope(pSettings->codeCompletion().sortByScope());
mCompletionPopup->setShowKeywords(pSettings->codeCompletion().showKeywords());
mCompletionPopup->setShowCodeSnippets(pSettings->codeCompletion().showCodeIns());
mCompletionPopup->setHideSymbolsStartWithUnderline(pSettings->codeCompletion().hideSymbolsStartsWithUnderLine());
mCompletionPopup->setHideSymbolsStartWithTwoUnderline(pSettings->codeCompletion().hideSymbolsStartsWithTwoUnderLine());
if (pSettings->codeCompletion().showCodeIns()) {
mCompletionPopup->setCodeSnippets(pMainWindow->codeSnippetManager()->snippets());
}
@ -4138,7 +4140,7 @@ void Editor::applySettings()
{
SynEditorOptions options = eoAltSetsColumnMode |
eoDragDropEditing | eoDropFiles | eoKeepCaretX | eoTabsToSpaces |
eoRightMouseMovesCursor | eoScrollByOneLess | eoTabIndent | eoHideShowScrollbars;
eoRightMouseMovesCursor | eoScrollByOneLess | eoTabIndent | eoHideShowScrollbars | eoGroupUndo;
//options
options.setFlag(eoAutoIndent,pSettings->editor().autoIndent());

View File

@ -37,12 +37,16 @@
#include "editorlist.h"
#include "widgets/choosethemedialog.h"
#include "thememanager.h"
#ifdef Q_OS_WIN
#include <QTemporaryFile>
#include <windows.h>
#include <psapi.h>
#include <QSharedMemory>
#include <QBuffer>
#include <winuser.h>
#include "widgets/cpudialog.h"
#endif
QString getSettingFilename(const QString& filepath, bool& firstRun);
@ -124,12 +128,18 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/
}
break;
case WM_DPICHANGED:{
int oldDPI = screenDPI();
QEvent * dpiEvent = new QEvent(DPI_CHANGED_EVENT);
qApp->postEvent(pMainWindow,dpiEvent);
setScreenDPI(HIWORD(pMsg->wParam));
int newDPI = screenDPI();
pMainWindow->updateDPI(oldDPI,newDPI);
if (pMsg->hwnd == (HWND)pMainWindow->winId()) {
int oldDPI = screenDPI();
QEvent * dpiEvent = new QEvent(DPI_CHANGED_EVENT);
qApp->postEvent(pMainWindow,dpiEvent);
setScreenDPI(HIWORD(pMsg->wParam));
int newDPI = screenDPI();
pMainWindow->updateDPI(oldDPI,newDPI);
} else if (pMainWindow->cpuDialog() &&
(HWND)pMainWindow->cpuDialog()->winId() == pMsg->hwnd) {
int newDPI = HIWORD(pMsg->wParam);
pMainWindow->cpuDialog()->updateDPI(newDPI);
}
break;
}
case WM_USER_OPEN_FILE: {
@ -243,13 +253,17 @@ int main(int argc, char *argv[])
} else if (!settingFilename.isEmpty() && firstRun)
openInSingleInstance = false;
if (openInSingleInstance) {
int openCount = 0;
while (true) {
if (tempFile.open(QFile::NewOnly))
break;
QThread::msleep(100);
openCount++;
if (openCount>100)
break;
}
if (app.arguments().length()>=2) {
if (app.arguments().length()>=2 && openCount<100) {
#ifdef Q_OS_WIN
if (sendFilesToInstance()) {
tempFile.remove();

View File

@ -625,9 +625,6 @@ void MainWindow::applySettings()
for (QWidget* p:findChildren<QWidget*>()) {
p->setFont(font);
}
if (mCPUDialog!=nullptr) {
mCPUDialog->resetEditorFont();
}
if (pSettings->environment().useCustomIconSet()) {
QString customIconSetFolder = pSettings->dirs().config(Settings::Dirs::DataType::IconSet);
pIconsManager->prepareCustomIconSet(customIconSetFolder);
@ -1844,7 +1841,7 @@ void MainWindow::showSearchPanel(bool showReplace)
void MainWindow::showCPUInfoDialog()
{
if (mCPUDialog==nullptr) {
mCPUDialog = new CPUDialog(this);
mCPUDialog = new CPUDialog();
connect(mCPUDialog, &CPUDialog::closed, this, &MainWindow::cleanUpCPUDialog);
updateCompileActions();
}
@ -4107,6 +4104,9 @@ void MainWindow::closeEvent(QCloseEvent *event) {
mCompilerManager->stopRun();
if (!mShouldRemoveAllSettings)
mSymbolUsageManager->save();
if (mCPUDialog!=nullptr)
cleanUpCPUDialog();
event->accept();
return;
}
@ -4465,6 +4465,8 @@ void MainWindow::onOJProblemCaseNewOutputGetted(const QString &/* id */, const Q
void MainWindow::cleanUpCPUDialog()
{
disconnect(mCPUDialog,&CPUDialog::closed,
this,&MainWindow::cleanUpCPUDialog);
CPUDialog* ptr=mCPUDialog;
mCPUDialog=nullptr;
ptr->deleteLater();

View File

@ -2115,24 +2115,23 @@ bool ProjectModel::setData(const QModelIndex &index, const QVariant &value, int
}
// Target filename does not exist anymore. Do a rename
// change name in project file first (no actual file renaming on disk)
mProject->saveUnitAs(idx,newName);
//save old file, if it is openned;
// remove old file from monitor list
pMainWindow->fileSystemWatcher()->removePath(oldName);
// Finally, we can rename without issues
if (!QFile::remove(oldName)){
if (!QFile::rename(oldName,newName)) {
QMessageBox::critical(pMainWindow,
tr("Remove failed"),
tr("Failed to remove file '%1'")
.arg(oldName),
tr("Rename failed"),
tr("Failed to rename file '%1' to '%2'")
.arg(oldName,newName),
QMessageBox::Ok);
mProject->saveUnitAs(idx,oldName);
return false;
}
mProject->saveUnitAs(idx,newName);
// Add new filename to file minitor
pMainWindow->fileSystemWatcher()->addPath(newName);
//suffix changed
if (mProject && mProject->modelType() == ProjectModelType::FileSystem
&& QFileInfo(oldName).suffix()!=QFileInfo(newName).suffix()) {

View File

@ -2681,78 +2681,81 @@ void SynEdit::doAddChar(QChar AChar)
setSelLength(1);
}
mUndoList->BeginBlock();
doSetSelText(AChar);
int oldCaretX=mCaretX-1;
int oldCaretY=mCaretY;
// auto
if (mOptions.testFlag(eoAutoIndent)
&& mHighlighter
&& mHighlighter->getClass()==SynHighlighterClass::CppHighlighter
&& (oldCaretY<=mLines->count()) ) {
if (isIdentChar(AChar)) {
doSetSelText(AChar);
} else {
mUndoList->BeginBlock();
doSetSelText(AChar);
int oldCaretX=mCaretX-1;
int oldCaretY=mCaretY;
// auto
if (mOptions.testFlag(eoAutoIndent)
&& mHighlighter
&& mHighlighter->getClass()==SynHighlighterClass::CppHighlighter
&& (oldCaretY<=mLines->count()) ) {
//unindent if ':' at end of the line
if (AChar == ':') {
QString line = mLines->getString(oldCaretY-1);
if (line.length() <= oldCaretX) {
int indentSpaces = calcIndentSpaces(oldCaretY,line+":", true);
if (indentSpaces != leftSpaces(line)) {
QString newLine = GetLeftSpacing(indentSpaces,true) + trimLeft(line);
mLines->putString(oldCaretY-1,newLine);
internalSetCaretXY(BufferCoord{newLine.length()+2,oldCaretY});
setBlockBegin(caretXY());
setBlockEnd(caretXY());
mUndoList->AddChange(
SynChangeReason::crDelete,
BufferCoord{1, oldCaretY},
BufferCoord{line.length()+1, oldCaretY},
line,
SynSelectionMode::smNormal
);
mUndoList->AddChange(
SynChangeReason::crInsert,
BufferCoord{1, oldCaretY},
BufferCoord{newLine.length()+1, oldCaretY},
"",
SynSelectionMode::smNormal
);
//unindent if ':' at end of the line
if (AChar == ':') {
QString line = mLines->getString(oldCaretY-1);
if (line.length() <= oldCaretX) {
int indentSpaces = calcIndentSpaces(oldCaretY,line+":", true);
if (indentSpaces != leftSpaces(line)) {
QString newLine = GetLeftSpacing(indentSpaces,true) + trimLeft(line);
mLines->putString(oldCaretY-1,newLine);
internalSetCaretXY(BufferCoord{newLine.length()+2,oldCaretY});
setBlockBegin(caretXY());
setBlockEnd(caretXY());
mUndoList->AddChange(
SynChangeReason::crDelete,
BufferCoord{1, oldCaretY},
BufferCoord{line.length()+1, oldCaretY},
line,
SynSelectionMode::smNormal
);
mUndoList->AddChange(
SynChangeReason::crInsert,
BufferCoord{1, oldCaretY},
BufferCoord{newLine.length()+1, oldCaretY},
"",
SynSelectionMode::smNormal
);
}
}
}
} else if (AChar == '{' || AChar == '}' || AChar == '#') {
//Reindent line when add '{' '}' and '#' at the beginning
QString left = mLines->getString(oldCaretY-1).mid(0,oldCaretX-1);
// and the first nonblank char is this new {
if (left.trimmed().isEmpty()) {
int indentSpaces = calcIndentSpaces(oldCaretY,AChar, true);
if (indentSpaces != leftSpaces(left)) {
QString right = mLines->getString(oldCaretY-1).mid(oldCaretX-1);
QString newLeft = GetLeftSpacing(indentSpaces,true);
mLines->putString(oldCaretY-1,newLeft+right);
BufferCoord newCaretPos = BufferCoord{newLeft.length()+2,oldCaretY};
internalSetCaretXY(newCaretPos);
setBlockBegin(caretXY());
setBlockEnd(caretXY());
mUndoList->AddChange(
SynChangeReason::crDelete,
BufferCoord{1, oldCaretY},
BufferCoord{left.length()+1, oldCaretY},
left,
SynSelectionMode::smNormal
);
mUndoList->AddChange(
SynChangeReason::crInsert,
BufferCoord{1, oldCaretY},
BufferCoord{newLeft.length()+1, oldCaretY},
"",
SynSelectionMode::smNormal
);
} else if (AChar == '{' || AChar == '}' || AChar == '#') {
//Reindent line when add '{' '}' and '#' at the beginning
QString left = mLines->getString(oldCaretY-1).mid(0,oldCaretX-1);
// and the first nonblank char is this new {
if (left.trimmed().isEmpty()) {
int indentSpaces = calcIndentSpaces(oldCaretY,AChar, true);
if (indentSpaces != leftSpaces(left)) {
QString right = mLines->getString(oldCaretY-1).mid(oldCaretX-1);
QString newLeft = GetLeftSpacing(indentSpaces,true);
mLines->putString(oldCaretY-1,newLeft+right);
BufferCoord newCaretPos = BufferCoord{newLeft.length()+2,oldCaretY};
internalSetCaretXY(newCaretPos);
setBlockBegin(caretXY());
setBlockEnd(caretXY());
mUndoList->AddChange(
SynChangeReason::crDelete,
BufferCoord{1, oldCaretY},
BufferCoord{left.length()+1, oldCaretY},
left,
SynSelectionMode::smNormal
);
mUndoList->AddChange(
SynChangeReason::crInsert,
BufferCoord{1, oldCaretY},
BufferCoord{newLeft.length()+1, oldCaretY},
"",
SynSelectionMode::smNormal
);
}
}
}
}
mUndoList->EndBlock();
}
mUndoList->EndBlock();
//DoOnPaintTransient(ttAfter);
}
@ -4779,11 +4782,13 @@ void SynEdit::setSelTextPrimitiveEx(SynSelectionMode PasteMode, const QString &V
void SynEdit::doSetSelText(const QString &Value)
{
mUndoList->BeginBlock();
auto action = finally([this]{
mUndoList->EndBlock();
bool blockBeginned = false;
auto action = finally([this, &blockBeginned]{
if (blockBeginned)
mUndoList->EndBlock();
});
if (selAvail()) {
mUndoList->BeginBlock();
mUndoList->AddChange(
SynChangeReason::crDelete, mBlockBegin, mBlockEnd,
selText(), mActiveSelectionMode);

View File

@ -3606,6 +3606,26 @@ void Settings::CodeCompletion::setMinCharRequired(int newMinCharRequired)
mMinCharRequired = newMinCharRequired;
}
bool Settings::CodeCompletion::hideSymbolsStartsWithTwoUnderLine() const
{
return mHideSymbolsStartsWithTwoUnderLine;
}
void Settings::CodeCompletion::setHideSymbolsStartsWithTwoUnderLine(bool newHideSymbolsStartsWithTwoUnderLine)
{
mHideSymbolsStartsWithTwoUnderLine = newHideSymbolsStartsWithTwoUnderLine;
}
bool Settings::CodeCompletion::hideSymbolsStartsWithUnderLine() const
{
return mHideSymbolsStartsWithUnderLine;
}
void Settings::CodeCompletion::setHideSymbolsStartsWithUnderLine(bool newHideSymbolsStartsWithOneUnderLine)
{
mHideSymbolsStartsWithUnderLine = newHideSymbolsStartsWithOneUnderLine;
}
bool Settings::CodeCompletion::appendFunc() const
{
return mAppendFunc;
@ -3732,6 +3752,8 @@ void Settings::CodeCompletion::doSave()
saveValue("show_code_ins",mShowCodeIns);
saveValue("clear_when_editor_hidden",mClearWhenEditorHidden);
saveValue("min_char_required",mMinCharRequired);
saveValue("hide_symbols_start_with_two_underline", mHideSymbolsStartsWithTwoUnderLine);
saveValue("hide_symbols_start_with_underline", mHideSymbolsStartsWithUnderLine);
}
@ -3751,6 +3773,8 @@ void Settings::CodeCompletion::doLoad()
mAppendFunc = boolValue("append_func",true);
mShowCodeIns = boolValue("show_code_ins",true);
mMinCharRequired = intValue("min_char_required",1);
mHideSymbolsStartsWithTwoUnderLine = boolValue("hide_symbols_start_with_two_underline", true);
mHideSymbolsStartsWithUnderLine = boolValue("hide_symbols_start_with_underline", false);
bool doClear = true;

View File

@ -602,6 +602,12 @@ public:
int minCharRequired() const;
void setMinCharRequired(int newMinCharRequired);
bool hideSymbolsStartsWithUnderLine() const;
void setHideSymbolsStartsWithUnderLine(bool newHideSymbolsStartsWithOneUnderLine);
bool hideSymbolsStartsWithTwoUnderLine() const;
void setHideSymbolsStartsWithTwoUnderLine(bool newHideSymbolsStartsWithTwoUnderLine);
private:
int mWidth;
int mHeight;
@ -617,6 +623,8 @@ public:
bool mShowCodeIns;
bool mClearWhenEditorHidden;
int mMinCharRequired;
bool mHideSymbolsStartsWithTwoUnderLine;
bool mHideSymbolsStartsWithUnderLine;
// _Base interface
protected:

View File

@ -51,6 +51,8 @@ void EditorCodeCompletionWidget::doLoad()
ui->chkAppendFunc->setChecked(pSettings->codeCompletion().appendFunc());
ui->chkShowCodeIns->setChecked(pSettings->codeCompletion().showCodeIns());
ui->chkClearWhenEditorHidden->setChecked(pSettings->codeCompletion().clearWhenEditorHidden());
ui->chkHideSymbolsStartWithTwoUnderline->setChecked(pSettings->codeCompletion().hideSymbolsStartsWithTwoUnderLine());
ui->chkHideSymbolsStartWithUnderline->setChecked(pSettings->codeCompletion().hideSymbolsStartsWithUnderLine());
ui->spinMinCharRequired->setValue(pSettings->codeCompletion().minCharRequired());
}
@ -77,6 +79,9 @@ void EditorCodeCompletionWidget::doSave()
pSettings->codeCompletion().setClearWhenEditorHidden(ui->chkClearWhenEditorHidden->isChecked());
pSettings->codeCompletion().setHideSymbolsStartsWithTwoUnderLine(ui->chkHideSymbolsStartWithTwoUnderline->isChecked());
pSettings->codeCompletion().setHideSymbolsStartsWithUnderLine(ui->chkHideSymbolsStartWithUnderline->isChecked());
pSettings->codeCompletion().save();
}

View File

@ -146,6 +146,20 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkHideSymbolsStartWithUnderline">
<property name="text">
<string>Hide symbols start with underscore</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkHideSymbolsStartWithTwoUnderline">
<property name="text">
<string>Hide symbols start with two underscores</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
@ -195,10 +209,16 @@
<widget class="QWidget" name="widget_2" native="true">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>11</number>
<number>0</number>
</property>
<property name="topMargin">
<number>11</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">

View File

@ -1142,3 +1142,8 @@ void copyFolder(const QString &fromDir, const QString &toDir)
}
float pointToPixel(float point, float dpi)
{
return point * dpi / 72;
}

View File

@ -234,6 +234,7 @@ void resetCppParser(std::shared_ptr<CppParser> parser, int compilerSetIndex=-1);
int screenDPI();
void setScreenDPI(int dpi);
float pointToPixel(float point);
float pointToPixel(float point, float dpi);
float pixelToPoint(float pixel);
void copyFolder(const QString &fromDir, const QString& toDir);

View File

@ -53,6 +53,9 @@ CodeCompletionPopup::CodeCompletionPopup(QWidget *parent) :
mShowCodeSnippets = true;
mIgnoreCase = false;
mHideSymbolsStartWithTwoUnderline = false;
mHideSymbolsStartWithUnderline = false;
}
CodeCompletionPopup::~CodeCompletionPopup()
@ -382,6 +385,9 @@ void CodeCompletionPopup::filterList(const QString &member)
mCompletionStatementList.clear();
mCompletionStatementList.reserve(mFullCompletionStatementList.size());
bool hideSymbolsTwoUnderline = mHideSymbolsStartWithTwoUnderline && !member.startsWith("__") ;
bool hideSymbolsUnderline = mHideSymbolsStartWithUnderline && !member.startsWith("_") ;
int len = member.length();
foreach (const PStatement& statement, mFullCompletionStatementList) {
int matched = 0;
@ -391,31 +397,37 @@ void CodeCompletionPopup::filterList(const QString &member)
int lastPos = -10;
int totalPos = 0;
statement->matchPositions.clear();
foreach (const QChar& ch, member) {
if (mIgnoreCase)
pos = command.indexOf(ch,pos,Qt::CaseInsensitive);
else
pos = command.indexOf(ch,pos,Qt::CaseSensitive);
if (pos<0) {
break;
if (hideSymbolsTwoUnderline && statement->command.startsWith("__")) {
} else if (hideSymbolsUnderline && statement->command.startsWith("_")) {
} else {
foreach (const QChar& ch, member) {
if (mIgnoreCase)
pos = command.indexOf(ch,pos,Qt::CaseInsensitive);
else
pos = command.indexOf(ch,pos,Qt::CaseSensitive);
if (pos<0) {
break;
}
if (pos == lastPos+1) {
statement->matchPositions.last()->end++;
} else {
PStatementMathPosition matchPosition=std::make_shared<StatementMatchPosition>();
matchPosition->start = pos;
matchPosition->end = pos+1;
statement->matchPositions.append(matchPosition);
}
if (ch==command[pos])
caseMatched++;
matched++;
totalPos += pos;
lastPos = pos;
pos+=1;
}
if (pos == lastPos+1) {
statement->matchPositions.last()->end++;
} else {
PStatementMathPosition matchPosition=std::make_shared<StatementMatchPosition>();
matchPosition->start = pos;
matchPosition->end = pos+1;
statement->matchPositions.append(matchPosition);
}
if (ch==command[pos])
caseMatched++;
matched++;
totalPos += pos;
lastPos = pos;
pos+=1;
}
if (mIgnoreCase && matched==member.length()) {
if (mIgnoreCase && matched== len) {
statement->caseMatched = caseMatched;
statement->matchPosTotal = totalPos;
if (member.length()>0) {
@ -424,7 +436,7 @@ void CodeCompletionPopup::filterList(const QString &member)
} else
statement->firstMatchLength = 0;
mCompletionStatementList.append(statement);
} else if (caseMatched == member.length()) {
} else if (caseMatched == len) {
statement->caseMatched = caseMatched;
statement->matchPosTotal = totalPos;
if (member.length()>0) {
@ -799,6 +811,26 @@ bool CodeCompletionPopup::isIncluded(const QString &fileName)
return mIncludedFiles.contains(fileName);
}
void CodeCompletionPopup::setHideSymbolsStartWithTwoUnderline(bool newHideSymbolsStartWithTwoUnderline)
{
mHideSymbolsStartWithTwoUnderline = newHideSymbolsStartWithTwoUnderline;
}
bool CodeCompletionPopup::hideSymbolsStartWithTwoUnderline() const
{
return mHideSymbolsStartWithTwoUnderline;
}
bool CodeCompletionPopup::hideSymbolsStartWithUnderline() const
{
return mHideSymbolsStartWithUnderline;
}
void CodeCompletionPopup::setHideSymbolsStartWithUnderline(bool newHideSymbolsStartWithUnderline)
{
mHideSymbolsStartWithUnderline = newHideSymbolsStartWithUnderline;
}
const QString &CodeCompletionPopup::memberOperator() const
{
return mMemberOperator;

View File

@ -112,6 +112,11 @@ public:
bool useCppKeyword() const;
void setUseCppKeyword(bool newUseCppKeyword);
bool hideSymbolsStartWithUnderline() const;
void setHideSymbolsStartWithUnderline(bool newHideSymbolsStartWithUnderline);
bool hideSymbolsStartWithTwoUnderline() const;
void setHideSymbolsStartWithTwoUnderline(bool newHideSymbolsStartWithTwoUnderline);
const PStatement &currentStatement() const;
void setCurrentStatement(const PStatement &newCurrentStatement);
const std::shared_ptr<QHash<StatementKind, std::shared_ptr<ColorSchemeItem> > >& colors() const;
@ -160,6 +165,8 @@ private:
bool mIgnoreCase;
bool mSortByScope;
bool mUseCppKeyword;
bool mHideSymbolsStartWithUnderline;
bool mHideSymbolsStartWithTwoUnderline;
// QWidget interface
protected:
@ -170,6 +177,7 @@ protected:
public:
bool event(QEvent *event) override;
const QString &memberOperator() const;
};
#endif // CODECOMPLETIONPOPUP_H

View File

@ -54,8 +54,7 @@ CPUDialog::CPUDialog(QWidget *parent) :
ui->txtCode->setForegroundColor(palette().color(QPalette::Text));
ui->txtCode->setBackgroundColor(palette().color(QPalette::Base));
}
resetEditorFont();
resetEditorFont(screenDPI());
ui->lstRegister->setModel(pMainWindow->debugger()->registerModel());
ui->rdIntel->setChecked(pSettings->debugger().useIntelStyle());
@ -98,6 +97,19 @@ void CPUDialog::updateButtonStates(bool enable)
ui->btnStepOverInstruction->setEnabled(enable);
}
void CPUDialog::updateDPI(float dpi)
{
QFont font(pSettings->environment().interfaceFont());
font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize(),dpi));
font.setStyleStrategy(QFont::PreferAntialias);
setFont(font);
for (QWidget* p:findChildren<QWidget*>()) {
if (p!=ui->txtCode)
p->setFont(font);
}
resetEditorFont(dpi);
}
void CPUDialog::setDisassembly(const QString& file, const QString& funcName,const QStringList& lines)
{
ui->txtFunctionName->setText(QString("%1:%2").arg(file, funcName));
@ -114,14 +126,14 @@ void CPUDialog::setDisassembly(const QString& file, const QString& funcName,cons
ui->txtCode->setCaretXYEx(true,BufferCoord{1,activeLine+1});
}
void CPUDialog::resetEditorFont()
void CPUDialog::resetEditorFont(float dpi)
{
QFont f=QFont(pSettings->editor().fontName());
f.setPixelSize(pointToPixel(pSettings->editor().fontSize()));
f.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi));
f.setStyleStrategy(QFont::PreferAntialias);
ui->txtCode->setFont(f);
QFont f2=QFont(pSettings->editor().nonAsciiFontName());
f2.setPixelSize(pointToPixel(pSettings->editor().fontSize()));
f2.setPixelSize(pointToPixel(pSettings->editor().fontSize(),dpi));
f2.setStyleStrategy(QFont::PreferAntialias);
ui->txtCode->setFontForNonAscii(f2);
}

View File

@ -33,8 +33,9 @@ public:
void updateInfo();
void updateButtonStates(bool enable);
public slots:
void updateDPI(float dpi);
void setDisassembly(const QString& file, const QString& funcName,const QStringList& lines);
void resetEditorFont();
void resetEditorFont(float dpi);
signals:
void closed();
private: