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)
|
- 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: language options in the project wizard don't work
|
||||||
- fix: "ake as default language" option in the project wizard doesn'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
|
Version 0.10.4 For Dev-C++ 7 Beta
|
||||||
- fix: can't correctly undo/redo indent
|
- fix: can't correctly undo/redo indent
|
||||||
|
|
|
@ -1803,18 +1803,26 @@ void MainWindow::updateTools()
|
||||||
QAction* action = new QAction(item->title,ui->menuTools);
|
QAction* action = new QAction(item->title,ui->menuTools);
|
||||||
connect(action, &QAction::triggered,
|
connect(action, &QAction::triggered,
|
||||||
[item] (){
|
[item] (){
|
||||||
if (item->pauseAfterExit
|
QString program = parseMacros(item->program);
|
||||||
&& programHasConsole(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 {
|
||||||
|
if (item->pauseAfterExit) {
|
||||||
executeFile(
|
executeFile(
|
||||||
includeTrailingPathDelimiter(pSettings->dirs().app())+"ConsolePauser.exe",
|
includeTrailingPathDelimiter(pSettings->dirs().app())+"ConsolePauser.exe",
|
||||||
" 0 \""+parseMacros(item->program)+"\" "+parseMacros(item->parameters),
|
" 0 \""+localizePath(program)+"\" "+parseMacros(item->parameters),
|
||||||
parseMacros(item->workingDirectory));
|
workDir);
|
||||||
} else {
|
} else {
|
||||||
executeFile(
|
executeFile(
|
||||||
parseMacros(item->program),
|
program,
|
||||||
parseMacros(item->parameters),
|
parseMacros(item->parameters),
|
||||||
parseMacros(item->workingDirectory));
|
workDir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ui->menuTools->addAction(action);
|
ui->menuTools->addAction(action);
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "compiler/executablerunner.h"
|
||||||
|
|
||||||
const QByteArray GuessTextEncoding(const QByteArray& text){
|
const QByteArray GuessTextEncoding(const QByteArray& text){
|
||||||
bool allAscii;
|
bool allAscii;
|
||||||
|
@ -826,6 +827,30 @@ QString parseMacros(const QString &s)
|
||||||
return result;
|
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)
|
void stringToFile(const QString &str, const QString &fileName)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <QThread>
|
||||||
#include "SimpleIni.h"
|
#include "SimpleIni.h"
|
||||||
|
|
||||||
using SimpleIni = CSimpleIniA;
|
using SimpleIni = CSimpleIniA;
|
||||||
|
@ -121,6 +122,8 @@ QByteArray runAndGetOutput(const QString& cmd, const QString& workingDir, const
|
||||||
const QByteArray& inputContent = QByteArray(),
|
const QByteArray& inputContent = QByteArray(),
|
||||||
bool inheritEnvironment = false);
|
bool inheritEnvironment = false);
|
||||||
|
|
||||||
|
void executeFile(const QString& fileName, const QString& params, const QString& workingDir);
|
||||||
|
|
||||||
bool isNonPrintableAsciiChar(char ch);
|
bool isNonPrintableAsciiChar(char ch);
|
||||||
|
|
||||||
bool fileExists(const QString& file);
|
bool fileExists(const QString& file);
|
||||||
|
|
|
@ -87,7 +87,7 @@ string GetCommand(int argc,char** argv,bool &reInp,bool &pauseAfterExit) {
|
||||||
// result += string(argv[i]);
|
// 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("\"");
|
result += string("\"") + string(argv[i]) + string("\"");
|
||||||
|
|
||||||
// Add a space except for the last argument
|
// Add a space except for the last argument
|
||||||
|
|
Loading…
Reference in New Issue