diff --git a/RedPandaIDE/compiler/compilermanager.cpp b/RedPandaIDE/compiler/compilermanager.cpp index 2abe81fc..16d239d6 100644 --- a/RedPandaIDE/compiler/compilermanager.cpp +++ b/RedPandaIDE/compiler/compilermanager.cpp @@ -21,6 +21,7 @@ #include "executablerunner.h" #include "ojproblemcasesrunner.h" #include "utils.h" +#include "../systemconsts.h" #include "../settings.h" #include #include @@ -250,7 +251,7 @@ void CompilerManager::run( .arg(sharedMemoryId,localizePath(filename)).arg(arguments); //delete when thread finished - execRunner = new ExecutableRunner(includeTrailingPathDelimiter(pSettings->dirs().appDir())+"ConsolePauser.exe",newArguments,workDir); + execRunner = new ExecutableRunner(includeTrailingPathDelimiter(pSettings->dirs().appDir())+CONSOLE_PAUSER,newArguments,workDir); execRunner->setShareMemoryId(sharedMemoryId); } else { //delete when thread finished diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 8ad38c54..ac4e54d9 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -3124,7 +3124,7 @@ void MainWindow::updateTools() file.close(); if (item->pauseAfterExit) { executeFile( - includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"ConsolePauser.exe", + includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+CONSOLE_PAUSER, " 1 \""+localizePath(file.fileName())+"\" ", workDir, file.fileName()); } else { @@ -3137,7 +3137,7 @@ void MainWindow::updateTools() } else { if (item->pauseAfterExit) { executeFile( - includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"ConsolePauser.exe", + includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+CONSOLE_PAUSER, " 1 \""+program+"\" "+params, workDir, ""); } else { diff --git a/RedPandaIDE/settingsdialog/formattergeneralwidget.cpp b/RedPandaIDE/settingsdialog/formattergeneralwidget.cpp index 5088803c..b2958556 100644 --- a/RedPandaIDE/settingsdialog/formattergeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/formattergeneralwidget.cpp @@ -321,10 +321,17 @@ void FormatterGeneralWidget::updateDemo() Settings::CodeFormatter formatter(nullptr); updateCodeFormatter(formatter); +#ifdef Q_OS_WIN QByteArray newContent = runAndGetOutput("astyle.exe", pSettings->dirs().appDir(), formatter.getArguments(), content); +#else + QByteArray newContent = runAndGetOutput(pSettings->environment().AStylePath(), + extractFileDir(pSettings->environment().AStylePath()), + formatter.getArguments(), + content); +#endif ui->editDemo->document()->setText(newContent); } diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 4a642487..aec8dc5d 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -21,6 +21,7 @@ #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #ifdef Q_OS_WIN +#define CONSOLE_PAUSER "consolepauser.exe" #define GCC_PROGRAM "gcc.exe" #define GPP_PROGRAM "g++.exe" #define GDB_PROGRAM "gdb.exe" @@ -36,6 +37,7 @@ #define CLANG_CPP_PROGRAM "clang++.exe" #define LLDB_MI_PROGRAM "lldb-mi.exe" #elif defined(Q_OS_LINUX) +#define CONSOLE_PAUSER "consolepauser" #define GCC_PROGRAM "gcc" #define GPP_PROGRAM "g++" #define GDB_PROGRAM "gdb" diff --git a/tools/consolepauser/main.unix.cpp b/tools/consolepauser/main.unix.cpp index 597e5d26..d52fdf01 100644 --- a/tools/consolepauser/main.unix.cpp +++ b/tools/consolepauser/main.unix.cpp @@ -157,7 +157,7 @@ int main(int argc, char** argv) { // First make sure we aren't going to read nonexistent arrays if(argc < 4) { printf("\n--------------------------------"); - printf("\nUsage: ConsolePauser.exe <0|1> \n"); + printf("\nUsage: consolepauser <0|1> \n"); printf("\n 1 means the STDIN is redirected by Red Panda C++; 0 means not\n"); PauseExit(EXIT_SUCCESS,false); } diff --git a/tools/consolepauser/main.windows.cpp b/tools/consolepauser/main.windows.cpp index fcaf6fc2..88d93753 100644 --- a/tools/consolepauser/main.windows.cpp +++ b/tools/consolepauser/main.windows.cpp @@ -158,7 +158,7 @@ int main(int argc, char** argv) { // First make sure we aren't going to read nonexistent arrays if(argc < 4) { printf("\n--------------------------------"); - printf("\nUsage: ConsolePauser.exe <0|1> \n"); + printf("\nUsage: consolepauser.exe <0|1> \n"); printf("\n 1 means the STDIN is redirected by Red Panda C++; 0 means not\n"); PauseExit(EXIT_SUCCESS,false); }