- enhancement: create file in files view

This commit is contained in:
Roy Qu 2022-03-17 10:46:24 +08:00
parent 8e00d50d1e
commit 5d6bf0dbb5
4 changed files with 222 additions and 168 deletions

View File

@ -33,6 +33,7 @@ Red Panda C++ Version 1.0.0
- fix: switch disassembly mode doesn't update contents
- fix: if there is a Red Panda C++ process running program, other Red Panda C++ processes can't run program correctly.
- enhancement: ctrl+enter insert a new line at the end of current line
- enhancement: create file in files view
Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong

View File

@ -689,54 +689,54 @@ p, li { white-space: pre-wrap; }
<context>
<name>CompilerManager</name>
<message>
<location filename="compiler/compilermanager.cpp" line="72"/>
<location filename="compiler/compilermanager.cpp" line="113"/>
<location filename="compiler/compilermanager.cpp" line="143"/>
<location filename="compiler/compilermanager.cpp" line="175"/>
<location filename="compiler/compilermanager.cpp" line="194"/>
<location filename="compiler/compilermanager.cpp" line="73"/>
<location filename="compiler/compilermanager.cpp" line="114"/>
<location filename="compiler/compilermanager.cpp" line="144"/>
<location filename="compiler/compilermanager.cpp" line="176"/>
<location filename="compiler/compilermanager.cpp" line="195"/>
<source>No compiler set</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="73"/>
<location filename="compiler/compilermanager.cpp" line="114"/>
<location filename="compiler/compilermanager.cpp" line="144"/>
<location filename="compiler/compilermanager.cpp" line="176"/>
<location filename="compiler/compilermanager.cpp" line="195"/>
<location filename="compiler/compilermanager.cpp" line="74"/>
<location filename="compiler/compilermanager.cpp" line="115"/>
<location filename="compiler/compilermanager.cpp" line="145"/>
<location filename="compiler/compilermanager.cpp" line="177"/>
<location filename="compiler/compilermanager.cpp" line="196"/>
<source>No compiler set is configured.</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="73"/>
<location filename="compiler/compilermanager.cpp" line="114"/>
<location filename="compiler/compilermanager.cpp" line="144"/>
<location filename="compiler/compilermanager.cpp" line="176"/>
<location filename="compiler/compilermanager.cpp" line="195"/>
<location filename="compiler/compilermanager.cpp" line="74"/>
<location filename="compiler/compilermanager.cpp" line="115"/>
<location filename="compiler/compilermanager.cpp" line="145"/>
<location filename="compiler/compilermanager.cpp" line="177"/>
<location filename="compiler/compilermanager.cpp" line="196"/>
<source>Can&apos;t start debugging.</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="83"/>
<location filename="compiler/compilermanager.cpp" line="84"/>
<source>Encoding not support</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="84"/>
<location filename="compiler/compilermanager.cpp" line="85"/>
<source>Clang only support utf-8 encoding.</source>
<translation>Clang只支持UTF-8</translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="86"/>
<location filename="compiler/compilermanager.cpp" line="87"/>
<source>Strings in the program might be wrongly processed.</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="254"/>
<location filename="compiler/compilermanager.cpp" line="258"/>
<source>Can&apos;t find Console Pauser</source>
<translation>Console Pauser程序</translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="255"/>
<location filename="compiler/compilermanager.cpp" line="259"/>
<source>Console Pauser &quot;%1&quot; doesn&apos;t exists!</source>
<translation>Console Pauser程序&quot;%1&quot;</translation>
</message>
@ -2282,7 +2282,7 @@ Are you really want to continue?</oldsource>
<context>
<name>ExecutableRunner</name>
<message>
<location filename="compiler/executablerunner.cpp" line="241"/>
<location filename="compiler/executablerunner.cpp" line="252"/>
<source>The runner process &apos;%1&apos; failed to start.</source>
<oldsource>The runner process failed to start.</oldsource>
<translation>&apos;%1&apos;</translation>
@ -2292,17 +2292,17 @@ Are you really want to continue?</oldsource>
<translation type="vanished"></translation>
</message>
<message>
<location filename="compiler/executablerunner.cpp" line="248"/>
<location filename="compiler/executablerunner.cpp" line="259"/>
<source>The last waitFor...() function timed out.</source>
<translation>waitFor()</translation>
</message>
<message>
<location filename="compiler/executablerunner.cpp" line="251"/>
<location filename="compiler/executablerunner.cpp" line="262"/>
<source>An error occurred when attempting to write to the runner process.</source>
<translation></translation>
</message>
<message>
<location filename="compiler/executablerunner.cpp" line="254"/>
<location filename="compiler/executablerunner.cpp" line="265"/>
<source>An error occurred when attempting to read from the runner process.</source>
<translation></translation>
</message>
@ -3788,11 +3788,11 @@ Are you really want to continue?</oldsource>
<message>
<location filename="mainwindow.ui" line="560"/>
<location filename="mainwindow.ui" line="2640"/>
<location filename="mainwindow.cpp" line="4336"/>
<location filename="mainwindow.cpp" line="4339"/>
<location filename="mainwindow.cpp" line="4343"/>
<location filename="mainwindow.cpp" line="4346"/>
<location filename="mainwindow.cpp" line="5989"/>
<location filename="mainwindow.cpp" line="4374"/>
<location filename="mainwindow.cpp" line="4377"/>
<location filename="mainwindow.cpp" line="4381"/>
<location filename="mainwindow.cpp" line="4384"/>
<location filename="mainwindow.cpp" line="6027"/>
<source>Issues</source>
<translation></translation>
</message>
@ -4065,7 +4065,7 @@ Are you really want to continue?</oldsource>
<location filename="mainwindow.ui" line="1892"/>
<location filename="mainwindow.cpp" line="2373"/>
<location filename="mainwindow.cpp" line="2423"/>
<location filename="mainwindow.cpp" line="2847"/>
<location filename="mainwindow.cpp" line="2854"/>
<source>Copy</source>
<translation></translation>
</message>
@ -4088,7 +4088,7 @@ Are you really want to continue?</oldsource>
<message>
<location filename="mainwindow.ui" line="1913"/>
<location filename="mainwindow.cpp" line="2389"/>
<location filename="mainwindow.cpp" line="2853"/>
<location filename="mainwindow.cpp" line="2860"/>
<source>Select All</source>
<translation></translation>
</message>
@ -4215,7 +4215,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="6324"/>
<location filename="mainwindow.cpp" line="6362"/>
<source>New Problem Set</source>
<translation></translation>
</message>
@ -4234,14 +4234,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="6367"/>
<location filename="mainwindow.cpp" line="6405"/>
<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="6391"/>
<location filename="mainwindow.cpp" line="6429"/>
<source>Load Problem Set</source>
<translation></translation>
</message>
@ -4580,7 +4580,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2315"/>
<location filename="mainwindow.cpp" line="5205"/>
<location filename="mainwindow.cpp" line="5243"/>
<source>Clear all breakpoints</source>
<translation></translation>
</message>
@ -4641,6 +4641,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2405"/>
<location filename="mainwindow.cpp" line="2749"/>
<source>New File</source>
<translation></translation>
</message>
@ -4681,7 +4682,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2469"/>
<location filename="mainwindow.cpp" line="5929"/>
<location filename="mainwindow.cpp" line="5967"/>
<source>Rename Symbol</source>
<translation></translation>
</message>
@ -4702,13 +4703,13 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.ui" line="2489"/>
<location filename="mainwindow.cpp" line="6120"/>
<location filename="mainwindow.cpp" line="6158"/>
<source>Export As RTF</source>
<translation>RTF</translation>
</message>
<message>
<location filename="mainwindow.ui" line="2494"/>
<location filename="mainwindow.cpp" line="6142"/>
<location filename="mainwindow.cpp" line="6180"/>
<source>Export As HTML</source>
<translation>HTML</translation>
</message>
@ -4977,7 +4978,7 @@ Are you really want to continue?</oldsource>
<translation>...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2896"/>
<location filename="mainwindow.cpp" line="2903"/>
<source>File Encoding</source>
<translation></translation>
</message>
@ -5192,7 +5193,7 @@ Are you really want to continue?</oldsource>
<message>
<location filename="mainwindow.cpp" line="2396"/>
<location filename="mainwindow.cpp" line="2449"/>
<location filename="mainwindow.cpp" line="2842"/>
<location filename="mainwindow.cpp" line="2849"/>
<source>Clear</source>
<translation></translation>
</message>
@ -5208,7 +5209,7 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.cpp" line="277"/>
<location filename="mainwindow.cpp" line="6333"/>
<location filename="mainwindow.cpp" line="6371"/>
<source>Problem Set %1</source>
<translation>%1</translation>
</message>
@ -5282,15 +5283,15 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.cpp" line="2350"/>
<location filename="mainwindow.cpp" line="6201"/>
<location filename="mainwindow.cpp" line="6241"/>
<location filename="mainwindow.cpp" line="6239"/>
<location filename="mainwindow.cpp" line="6279"/>
<source>Bookmark Description</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2351"/>
<location filename="mainwindow.cpp" line="6202"/>
<location filename="mainwindow.cpp" line="6242"/>
<location filename="mainwindow.cpp" line="6240"/>
<location filename="mainwindow.cpp" line="6280"/>
<source>Description:</source>
<translation></translation>
</message>
@ -5402,276 +5403,286 @@ Are you really want to continue?</oldsource>
</message>
<message>
<location filename="mainwindow.cpp" line="2743"/>
<location filename="mainwindow.cpp" line="3608"/>
<location filename="mainwindow.cpp" line="3616"/>
<source>New Folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2748"/>
<location filename="mainwindow.cpp" line="3622"/>
<location filename="mainwindow.cpp" line="3628"/>
<location filename="mainwindow.cpp" line="5790"/>
<location filename="mainwindow.cpp" line="2755"/>
<location filename="mainwindow.cpp" line="3660"/>
<location filename="mainwindow.cpp" line="3666"/>
<location filename="mainwindow.cpp" line="5828"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2754"/>
<location filename="mainwindow.cpp" line="2761"/>
<source>Open in Editor</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2766"/>
<location filename="mainwindow.cpp" line="2773"/>
<source>Open in External Program</source>
<translation>使</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2776"/>
<location filename="mainwindow.cpp" line="2783"/>
<source>Open in Terminal</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2792"/>
<location filename="mainwindow.cpp" line="2799"/>
<source>Open in Windows Explorer</source>
<translation>Windows浏览器中打开</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2862"/>
<location filename="mainwindow.cpp" line="2869"/>
<source>Character sets</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2910"/>
<location filename="mainwindow.cpp" line="2917"/>
<source>Convert to %1</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3008"/>
<location filename="mainwindow.cpp" line="3015"/>
<source>%1 files autosaved</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3317"/>
<location filename="mainwindow.cpp" line="3325"/>
<source>Set answer to...</source>
<translation>...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3349"/>
<location filename="mainwindow.cpp" line="3357"/>
<source>select other file...</source>
<translation>...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3355"/>
<location filename="mainwindow.cpp" line="3363"/>
<source>Select Answer Source File</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3357"/>
<location filename="mainwindow.cpp" line="3365"/>
<source>C/C++Source Files (*.c *.cpp *.cc *.cxx)</source>
<oldsource>C/C++Source Files (*.c *.cpp *.cc *.cxx</oldsource>
<translation>C/C++ (*.c *.cpp *.cc *.cxx)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3612"/>
<location filename="mainwindow.cpp" line="3620"/>
<source>New Folder %1</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3623"/>
<location filename="mainwindow.cpp" line="3644"/>
<source>Untitled</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3648"/>
<source>Untitled %1</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3661"/>
<source>Do you really want to delete %1?</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3629"/>
<location filename="mainwindow.cpp" line="3667"/>
<source>Do you really want to delete %1 files?</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3832"/>
<location filename="mainwindow.cpp" line="3870"/>
<source>Save project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3833"/>
<location filename="mainwindow.cpp" line="3871"/>
<source>The project &apos;%1&apos; has modifications.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3835"/>
<location filename="mainwindow.cpp" line="6327"/>
<location filename="mainwindow.cpp" line="3873"/>
<location filename="mainwindow.cpp" line="6365"/>
<source>Do you want to save it?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3922"/>
<location filename="mainwindow.cpp" line="3933"/>
<location filename="mainwindow.cpp" line="3960"/>
<location filename="mainwindow.cpp" line="3971"/>
<source>File Changed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4005"/>
<location filename="mainwindow.cpp" line="4043"/>
<source>New Project File?</source>
<translation>?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4006"/>
<location filename="mainwindow.cpp" line="4044"/>
<source>Do you want to add the new file to the project?</source>
<translation>?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4082"/>
<location filename="mainwindow.cpp" line="4092"/>
<location filename="mainwindow.cpp" line="4104"/>
<location filename="mainwindow.cpp" line="6380"/>
<location filename="mainwindow.cpp" line="4120"/>
<location filename="mainwindow.cpp" line="4130"/>
<location filename="mainwindow.cpp" line="4142"/>
<location filename="mainwindow.cpp" line="6418"/>
<source>Save Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4264"/>
<location filename="mainwindow.cpp" line="4302"/>
<source>Change Project Compiler Set</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4265"/>
<location filename="mainwindow.cpp" line="4303"/>
<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="4267"/>
<location filename="mainwindow.cpp" line="4305"/>
<source>Do you really want to do that?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5206"/>
<location filename="mainwindow.cpp" line="5244"/>
<source>Do you really want to clear all breakpoints in this file?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5404"/>
<location filename="mainwindow.cpp" line="5442"/>
<source>New project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5405"/>
<location filename="mainwindow.cpp" line="5443"/>
<source>Close %1 and start new project?</source>
<translation>&apos;%1&apos;?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5418"/>
<location filename="mainwindow.cpp" line="5456"/>
<source>Folder not exist</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5419"/>
<location filename="mainwindow.cpp" line="5457"/>
<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="5426"/>
<location filename="mainwindow.cpp" line="5464"/>
<source>Can&apos;t create folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5427"/>
<location filename="mainwindow.cpp" line="5465"/>
<source>Failed to create folder &apos;%1&apos;.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5442"/>
<location filename="mainwindow.cpp" line="5480"/>
<source>Save new project as</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5791"/>
<location filename="mainwindow.cpp" line="5829"/>
<source>Folder %1 is not empty.</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5792"/>
<location filename="mainwindow.cpp" line="5830"/>
<source>Do you really want to delete it?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6262"/>
<location filename="mainwindow.cpp" line="6300"/>
<source>Change working folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6263"/>
<location filename="mainwindow.cpp" line="6301"/>
<source>File &apos;%1&apos; is not in the current working folder.</source>
<oldsource>File &apos;%1&apos; is not in the current working folder</oldsource>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6266"/>
<location filename="mainwindow.cpp" line="6304"/>
<source>Do you want to change working folder to &apos;%1&apos;?</source>
<translation>&apos;%1&apos;?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6905"/>
<location filename="mainwindow.cpp" line="6943"/>
<source>Can&apos;t Commit</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6906"/>
<location filename="mainwindow.cpp" line="6944"/>
<source>Git needs user info to commit.</source>
<translation>Git需要用信息进行提交</translation>
</message>
<message>
<location filename="mainwindow.ui" line="2559"/>
<location filename="mainwindow.ui" line="2562"/>
<location filename="mainwindow.cpp" line="6303"/>
<location filename="mainwindow.cpp" line="6341"/>
<source>Choose Working Folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6673"/>
<location filename="mainwindow.cpp" line="6725"/>
<location filename="mainwindow.cpp" line="6711"/>
<location filename="mainwindow.cpp" line="6763"/>
<source>Header Exists</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6674"/>
<location filename="mainwindow.cpp" line="6726"/>
<location filename="mainwindow.cpp" line="6712"/>
<location filename="mainwindow.cpp" line="6764"/>
<source>Header file &quot;%1&quot; already exists!</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6731"/>
<location filename="mainwindow.cpp" line="6769"/>
<source>Source Exists</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6732"/>
<location filename="mainwindow.cpp" line="6770"/>
<source>Source file &quot;%1&quot; already exists!</source>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6884"/>
<location filename="mainwindow.cpp" line="6922"/>
<source>Can&apos;t commit!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6885"/>
<location filename="mainwindow.cpp" line="6923"/>
<source>The following files are in conflicting:</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6890"/>
<location filename="mainwindow.cpp" line="6928"/>
<source>Commit Message</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6890"/>
<location filename="mainwindow.cpp" line="6928"/>
<source>Commit Message:</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6893"/>
<location filename="mainwindow.cpp" line="6931"/>
<source>Commit Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6894"/>
<location filename="mainwindow.cpp" line="6932"/>
<source>Commit message shouldn&apos;t be empty!</source>
<translation></translation>
</message>
@ -5680,125 +5691,125 @@ Are you really want to continue?</oldsource>
<translation type="vanished">Dev-C++ (*.dev)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5455"/>
<location filename="mainwindow.cpp" line="5493"/>
<source>New project fail</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5456"/>
<location filename="mainwindow.cpp" line="5494"/>
<source>Can&apos;t assign project template</source>
<translation>使</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5551"/>
<location filename="mainwindow.cpp" line="5589"/>
<source>Remove file</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5552"/>
<location filename="mainwindow.cpp" line="5590"/>
<source>Remove the file from disk?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5741"/>
<location filename="mainwindow.cpp" line="5779"/>
<source>untitled</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5751"/>
<location filename="mainwindow.cpp" line="5789"/>
<source>New Project File Name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5752"/>
<location filename="mainwindow.cpp" line="5790"/>
<source>File Name:</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5758"/>
<location filename="mainwindow.cpp" line="5796"/>
<source>File Already Exists!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5759"/>
<location filename="mainwindow.cpp" line="5797"/>
<source>File &apos;%1&apos; already exists!</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5500"/>
<location filename="mainwindow.cpp" line="5538"/>
<source>Add to project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5444"/>
<location filename="mainwindow.cpp" line="5482"/>
<source>Red Panda C++ project file (*.dev)</source>
<translation>C++(*.dev)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5915"/>
<location filename="mainwindow.cpp" line="5953"/>
<source>Rename Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5916"/>
<location filename="mainwindow.cpp" line="5954"/>
<source>Symbol &apos;%1&apos; is defined in system header.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="5930"/>
<location filename="mainwindow.cpp" line="5968"/>
<source>New Name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6063"/>
<location filename="mainwindow.cpp" line="6075"/>
<location filename="mainwindow.cpp" line="6101"/>
<location filename="mainwindow.cpp" line="6113"/>
<source>Replace Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6064"/>
<location filename="mainwindow.cpp" line="6102"/>
<source>Can&apos;t open file &apos;%1&apos; for replace!</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6076"/>
<location filename="mainwindow.cpp" line="6114"/>
<source>Contents has changed since last search!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6122"/>
<location filename="mainwindow.cpp" line="6160"/>
<source>Rich Text Format Files (*.rtf)</source>
<translation>RTF格式文件 (*.rtf)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6144"/>
<location filename="mainwindow.cpp" line="6182"/>
<source>HTML Files (*.html)</source>
<translation>HTML文件 (*.html)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6325"/>
<location filename="mainwindow.cpp" line="6363"/>
<source>The current problem set is not empty.</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6343"/>
<location filename="mainwindow.cpp" line="6381"/>
<source>Problem %1</source>
<translation>%1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6369"/>
<location filename="mainwindow.cpp" line="6393"/>
<location filename="mainwindow.cpp" line="6407"/>
<location filename="mainwindow.cpp" line="6431"/>
<source>Problem Set Files (*.pbs)</source>
<translation> (*.pbs)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6399"/>
<location filename="mainwindow.cpp" line="6437"/>
<source>Load Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3509"/>
<location filename="mainwindow.cpp" line="6413"/>
<location filename="mainwindow.cpp" line="3517"/>
<location filename="mainwindow.cpp" line="6451"/>
<source>Problem Case %1</source>
<translation>%1</translation>
</message>
@ -5811,13 +5822,13 @@ Are you really want to continue?</oldsource>
<location filename="mainwindow.cpp" line="257"/>
<location filename="mainwindow.cpp" line="1108"/>
<location filename="mainwindow.cpp" line="2231"/>
<location filename="mainwindow.cpp" line="2887"/>
<location filename="mainwindow.cpp" line="3929"/>
<location filename="mainwindow.cpp" line="4040"/>
<location filename="mainwindow.cpp" line="4233"/>
<location filename="mainwindow.cpp" line="4245"/>
<location filename="mainwindow.cpp" line="4653"/>
<location filename="mainwindow.cpp" line="4665"/>
<location filename="mainwindow.cpp" line="2894"/>
<location filename="mainwindow.cpp" line="3967"/>
<location filename="mainwindow.cpp" line="4078"/>
<location filename="mainwindow.cpp" line="4271"/>
<location filename="mainwindow.cpp" line="4283"/>
<location filename="mainwindow.cpp" line="4691"/>
<location filename="mainwindow.cpp" line="4703"/>
<source>Error</source>
<translation></translation>
</message>
@ -5838,83 +5849,83 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3128"/>
<location filename="mainwindow.cpp" line="3265"/>
<location filename="mainwindow.cpp" line="3135"/>
<location filename="mainwindow.cpp" line="3273"/>
<source>Version Control</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3923"/>
<location filename="mainwindow.cpp" line="3961"/>
<source>File &apos;%1&apos; was changed.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3923"/>
<location filename="mainwindow.cpp" line="3961"/>
<source>Reload its content from disk?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3934"/>
<location filename="mainwindow.cpp" line="3972"/>
<source>File &apos;%1&apos; was removed.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3934"/>
<location filename="mainwindow.cpp" line="3972"/>
<source>Keep it open?</source>
<translation>C++</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4033"/>
<location filename="mainwindow.cpp" line="4071"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4429"/>
<location filename="mainwindow.cpp" line="4467"/>
<source>Compile Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4435"/>
<location filename="mainwindow.cpp" line="4473"/>
<source>Run Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2916"/>
<location filename="mainwindow.cpp" line="4682"/>
<location filename="mainwindow.cpp" line="4696"/>
<location filename="mainwindow.cpp" line="2923"/>
<location filename="mainwindow.cpp" line="4720"/>
<location filename="mainwindow.cpp" line="4734"/>
<source>Confirm Convertion</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="2917"/>
<location filename="mainwindow.cpp" line="4683"/>
<location filename="mainwindow.cpp" line="4697"/>
<location filename="mainwindow.cpp" line="2924"/>
<location filename="mainwindow.cpp" line="4721"/>
<location filename="mainwindow.cpp" line="4735"/>
<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="4847"/>
<location filename="mainwindow.cpp" line="4885"/>
<source>New Watch Expression</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4848"/>
<location filename="mainwindow.cpp" line="4886"/>
<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="4901"/>
<location filename="mainwindow.cpp" line="4939"/>
<source>Parsing file %1 of %2: &quot;%3&quot;</source>
<translation>%1/%2&quot;%3&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4923"/>
<location filename="mainwindow.cpp" line="4929"/>
<location filename="mainwindow.cpp" line="4961"/>
<location filename="mainwindow.cpp" line="4967"/>
<source>Done parsing %1 files in %2 seconds</source>
<translation>%1,%2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4926"/>
<location filename="mainwindow.cpp" line="4964"/>
<source>(%1 files per second)</source>
<translation>(%1</translation>
</message>
@ -7577,12 +7588,12 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="parser/cppparser.cpp" line="991"/>
<location filename="parser/cppparser.cpp" line="1004"/>
<source>constructor</source>
<translation></translation>
</message>
<message>
<location filename="parser/cppparser.cpp" line="998"/>
<location filename="parser/cppparser.cpp" line="1011"/>
<source>destructor</source>
<translation></translation>
</message>
@ -8065,7 +8076,7 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6314"/>
<location filename="mainwindow.cpp" line="6352"/>
<location filename="settingsdialog/settingsdialog.cpp" line="170"/>
<location filename="settingsdialog/settingsdialog.cpp" line="203"/>
<location filename="settingsdialog/settingsdialog.cpp" line="209"/>
@ -8141,15 +8152,15 @@ Are you really want to continue?</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="6315"/>
<location filename="mainwindow.cpp" line="6628"/>
<location filename="mainwindow.cpp" line="6353"/>
<location filename="mainwindow.cpp" line="6666"/>
<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="6627"/>
<location filename="mainwindow.cpp" line="6665"/>
<location filename="settingsdialog/settingsdialog.cpp" line="206"/>
<source>Problem Set</source>
<translation></translation>

View File

@ -2744,6 +2744,13 @@ void MainWindow::buildContextMenus()
ui->treeFiles);
connect(mFilesView_CreateFolder, &QAction::triggered,
this, &MainWindow::onFilesViewCreateFolder);
mFilesView_CreateFile = createActionFor(
tr("New File"),
ui->treeFiles);
connect(mFilesView_CreateFile, &QAction::triggered,
this, &MainWindow::onFilesViewCreateFile);
mFilesView_RemoveFile = createActionFor(
tr("Delete"),
ui->treeFiles);
@ -3236,6 +3243,7 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos)
menu.addAction(ui->actionOpen_Folder);
menu.addSeparator();
menu.addAction(mFilesView_CreateFolder);
menu.addAction(mFilesView_CreateFile);
menu.addSeparator();
if (pSettings->vcs().gitOk()) {
if (hasRepository) {
@ -3614,6 +3622,38 @@ void MainWindow::onFilesViewCreateFolder()
dir.mkdir(dir.filePath(folderName));
}
void MainWindow::onFilesViewCreateFile()
{
QModelIndex index = ui->treeFiles->currentIndex();
QDir dir;
if (index.isValid()
&& ui->treeFiles->selectionModel()->isSelected(index)) {
if (mFileSystemModel.isDir(index))
dir = QDir(mFileSystemModel.fileInfo(index).absoluteFilePath());
else
dir = mFileSystemModel.fileInfo(index).absoluteDir();
ui->treeFiles->expand(index);
} else {
dir = mFileSystemModel.rootDirectory();
}
QString suffix;
if (pSettings->editor().defaultFileCpp())
suffix=".cpp";
else
suffix=".c";
QString fileName = tr("Untitled")+suffix;
int count = 0;
while (dir.exists(fileName)) {
count++;
fileName = tr("Untitled %1").arg(count)+suffix;
}
QFile file(dir.filePath(fileName));
file.open(QFile::NewOnly);
QModelIndex newIndex = mFileSystemModel.index(fileName);
ui->treeFiles->selectionModel()->select(newIndex, QItemSelectionModel::SelectionFlag::Rows);
}
void MainWindow::onFilesViewRemoveFiles()
{
QModelIndexList indexList = ui->treeFiles->selectionModel()->selectedRows();

View File

@ -290,6 +290,7 @@ private slots:
void onShowInsertCodeSnippetMenu();
void onFilesViewCreateFolder();
void onFilesViewCreateFile();
void onFilesViewRemoveFiles();
void on_actionNew_triggered();
@ -716,6 +717,7 @@ private:
QAction * mFilesView_OpenInTerminal;
QAction * mFilesView_OpenInExplorer;
QAction * mFilesView_CreateFolder;
QAction * mFilesView_CreateFile;
QAction * mFilesView_RemoveFile;
//action for debug console