From af76296378f6fc398f0f6f516506d19019ff8287 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Mar 2013 17:52:31 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation - Fixed: text editor blocks CreaDevManager - Fixed: launching bbEditor blocks CreaDevManager - Fixed: launching miniTools blocks CreaDevManager - Fixed: launching files with a specific command blocks CreaDevManager --- lib/creaDevManagerLib/CDMUtilities.cpp | 35 +++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/lib/creaDevManagerLib/CDMUtilities.cpp b/lib/creaDevManagerLib/CDMUtilities.cpp index 64a6987..b4696b1 100644 --- a/lib/creaDevManagerLib/CDMUtilities.cpp +++ b/lib/creaDevManagerLib/CDMUtilities.cpp @@ -81,7 +81,7 @@ namespace CDMUtilities { std::string pathFixed = ""; -#if(_WIN32) +#ifdef _WIN32 // ------ Windows std::vector pathSplit; @@ -112,48 +112,71 @@ namespace CDMUtilities int openTextEditor(const std::string& file) { +#ifdef _WIN32 + wxConfigBase* pConfig = wxConfigBase::Get(); + std::string command = "start " + crea::wx2std(pConfig->Read(wxT("TEXT_EDITOR"), crea::std2wx(CDMUtilities::TEXT_EDITOR))); + + if(file != "") + command += " \"" + file + "\""; +#else wxConfigBase* pConfig = wxConfigBase::Get(); std::string command = crea::wx2std(pConfig->Read(wxT("TEXT_EDITOR"), crea::std2wx(CDMUtilities::TEXT_EDITOR))); if(file != "") command += " \"" + file + "\""; command += " &"; - +#endif return system(command.c_str()); } int openFileExplorer(const std::string& file) { +#ifdef _WIN32 + wxConfigBase* pConfig = wxConfigBase::Get(); + std::string command = "start " + crea::wx2std(pConfig->Read(wxT("FILE_EXPLORER"), crea::std2wx(CDMUtilities::FILE_EXPLORER))); + + if(file != "") + command += " \"" + file + "\""; +#else wxConfigBase* pConfig = wxConfigBase::Get(); std::string command = crea::wx2std(pConfig->Read(wxT("FILE_EXPLORER"), crea::std2wx(CDMUtilities::FILE_EXPLORER))); if(file != "") command += " \"" + file + "\""; command += " &"; - +#endif return system(command.c_str()); } int openFileWithCommand(const std::string& file, const std::string& command) { +#ifdef _WIN32 + std::string comm = "start " + command; + if(file != "") + comm += " \"" + file + "\""; +#else std::string comm = command; if(file != "") comm += " \"" + file + "\""; comm += " &"; - +#endif return system(comm.c_str()); } int openBBEditor() { - std::string comm = "bbEditor &"; +#ifdef _WIN32 + std::string comm = "start bbEditor"; +#else + std::string comm = "bbEditor &"; +#endif return system(comm.c_str()); } int openCreaToolsTools() { #ifdef _WIN32 - std::string comm = "creaTools &"; + std::string comm = "start creaTools"; #else std::string comm = "creaTools.sh &"; #endif -- 2.45.0