work save
This commit is contained in:
parent
319c26902c
commit
1a3df76068
3
NEWS.md
3
NEWS.md
|
@ -2,6 +2,9 @@ Version 0.11.0 For Dev-C++ 7 Beta
|
|||
- enhancement: use token list instead of single string to do code completion ( intial version)
|
||||
- fix: language options in the project wizard don't work
|
||||
- fix: "ake as default language" option in the project wizard doesn't work
|
||||
- fix: typo errors in settings dialog
|
||||
- enhancement: console pauser clears STDIN buffer before show "press any key to continue..."
|
||||
- fix: path in macros should use system's path separator
|
||||
|
||||
Version 0.10.4 For Dev-C++ 7 Beta
|
||||
- fix: can't correctly undo/redo indent
|
||||
|
|
|
@ -1803,18 +1803,26 @@ void MainWindow::updateTools()
|
|||
QAction* action = new QAction(item->title,ui->menuTools);
|
||||
connect(action, &QAction::triggered,
|
||||
[item] (){
|
||||
if (item->pauseAfterExit
|
||||
&& programHasConsole(parseMacros(item->program))) {
|
||||
executeFile(
|
||||
includeTrailingPathDelimiter(pSettings->dirs().app())+"ConsolePauser.exe",
|
||||
" 0 \""+parseMacros(item->program)+"\" "+parseMacros(item->parameters),
|
||||
parseMacros(item->workingDirectory));
|
||||
QString program = parseMacros(item->program);
|
||||
QString workDir = parseMacros(item->workingDirectory);
|
||||
if (program == "del") {
|
||||
QString current = QDir::currentPath();
|
||||
QDir::setCurrent(workDir);
|
||||
qDebug()<<(program+" "+parseMacros(item->parameters));
|
||||
system((program+" "+parseMacros(item->parameters)).toLocal8Bit());
|
||||
QDir::setCurrent(current);
|
||||
} else {
|
||||
executeFile(
|
||||
parseMacros(item->program),
|
||||
parseMacros(item->parameters),
|
||||
parseMacros(item->workingDirectory));
|
||||
|
||||
if (item->pauseAfterExit) {
|
||||
executeFile(
|
||||
includeTrailingPathDelimiter(pSettings->dirs().app())+"ConsolePauser.exe",
|
||||
" 0 \""+localizePath(program)+"\" "+parseMacros(item->parameters),
|
||||
workDir);
|
||||
} else {
|
||||
executeFile(
|
||||
program,
|
||||
parseMacros(item->parameters),
|
||||
workDir);
|
||||
}
|
||||
}
|
||||
});
|
||||
ui->menuTools->addAction(action);
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "editor.h"
|
||||
#include "project.h"
|
||||
#include "version.h"
|
||||
#include "compiler/executablerunner.h"
|
||||
|
||||
const QByteArray GuessTextEncoding(const QByteArray& text){
|
||||
bool allAscii;
|
||||
|
@ -826,6 +827,30 @@ QString parseMacros(const QString &s)
|
|||
return result;
|
||||
}
|
||||
|
||||
void executeFile(const QString &fileName, const QString ¶ms, const QString &workingDir)
|
||||
{
|
||||
qDebug()<<fileName;
|
||||
qDebug()<<params;
|
||||
qDebug()<<workingDir;
|
||||
ExecutableRunner* runner=new ExecutableRunner(
|
||||
fileName,
|
||||
params,
|
||||
workingDir);
|
||||
runner->connect(runner, &QThread::finished,
|
||||
[runner](){
|
||||
qDebug()<<"finished";
|
||||
runner->deleteLater();
|
||||
});
|
||||
runner->connect(runner, &Runner::runErrorOccurred,
|
||||
[](const QString& s){
|
||||
qDebug()<<"error occured";
|
||||
qDebug()<<s;
|
||||
});
|
||||
qDebug()<<"running";
|
||||
runner->setStartConsole(true);
|
||||
runner->start();
|
||||
}
|
||||
|
||||
void stringToFile(const QString &str, const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <QRect>
|
||||
#include <QStringList>
|
||||
#include <memory>
|
||||
#include <QThread>
|
||||
#include "SimpleIni.h"
|
||||
|
||||
using SimpleIni = CSimpleIniA;
|
||||
|
@ -121,6 +122,8 @@ QByteArray runAndGetOutput(const QString& cmd, const QString& workingDir, const
|
|||
const QByteArray& inputContent = QByteArray(),
|
||||
bool inheritEnvironment = false);
|
||||
|
||||
void executeFile(const QString& fileName, const QString& params, const QString& workingDir);
|
||||
|
||||
bool isNonPrintableAsciiChar(char ch);
|
||||
|
||||
bool fileExists(const QString& file);
|
||||
|
|
|
@ -87,7 +87,7 @@ string GetCommand(int argc,char** argv,bool &reInp,bool &pauseAfterExit) {
|
|||
// result += string(argv[i]);
|
||||
// }
|
||||
*/
|
||||
// Quote the first argument in case the path name contains spaces
|
||||
// Quote the argument in case the path name contains spaces
|
||||
result += string("\"") + string(argv[i]) + string("\"");
|
||||
|
||||
// Add a space except for the last argument
|
||||
|
|
Loading…
Reference in New Issue