Commit ba92f94f authored by dickelbeck's avatar dickelbeck

ProcessExecute instead of wxExecute

parent 080746ac
......@@ -12,7 +12,7 @@
#include "common.h"
#include "macros.h"
#include "build_version.h"
#include <wx/process.h>
/*****************************/
wxString GetBuildVersion()
......@@ -30,7 +30,9 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS
/*********************************************************************************************/
{
// All sizes are in 1/1000 inch
m_Size = size; m_Offset = offset, m_Name = name;
m_Size = size;
m_Offset = offset;
m_Name = name;
// Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
m_LeftMargin = m_RightMargin = m_TopMargin = m_BottomMargin = 400;
......@@ -205,6 +207,7 @@ wxString GenDate()
wxT( "jan" ), wxT( "feb" ), wxT( "mar" ), wxT( "apr" ), wxT( "may" ), wxT( "jun" ),
wxT( "jul" ), wxT( "aug" ), wxT( "sep" ), wxT( "oct" ), wxT( "nov" ), wxT( "dec" )
};
time_t buftime;
struct tm* Date;
wxString string_date;
......@@ -241,6 +244,14 @@ void* MyMalloc( size_t nb_octets )
}
bool ProcessExecute( const wxString& aCommandLine, int aFlags )
{
wxProcess* process = wxProcess::Open( aCommandLine, aFlags );
return process != NULL;
}
/************************************/
void* MyZMalloc( size_t nb_octets )
/************************************/
......
This diff is collapsed.
......@@ -533,7 +533,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para
{
if( !param.IsEmpty() )
FullFileName += wxT( " " ) + param;
wxExecute( FullFileName );
ProcessExecute( FullFileName );
return 0;
}
......@@ -748,7 +748,7 @@ void OpenPDF( const wxString& file )
}
if( !command.IsEmpty() )
wxExecute( command );
ProcessExecute( command );
}
......@@ -771,5 +771,5 @@ void OpenFile( const wxString& file )
delete filetype;
if( success && !command.IsEmpty() )
wxExecute( command );
ProcessExecute( command );
}
......@@ -342,7 +342,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
CommandFile += wxT( " " ) + TmpFullFileName;
CommandFile += wxT( " " ) + FullFileName;
wxExecute( CommandFile, wxEXEC_SYNC );
ProcessExecute( CommandFile, wxEXEC_SYNC );
}
......
......@@ -354,6 +354,18 @@ class WinEDA_DrawPanel;
/* COMMON.CPP */
/**
* Function ProcessExecute
* runs a child process.
* @param aCommandLine The process and any arguments to it all in a single string.
* @param aFlags The same args as allowed for wxExecute()
* @return bool - true if success, else false
*/
bool ProcessExecute( const wxString& aCommandLine, int aFlags = wxEXEC_ASYNC );
wxString ReturnPcbLayerName( int layer_number, bool is_filename = FALSE );
/* Return the name of the layer number "layer_number".
......@@ -431,10 +443,10 @@ wxString MakeFileName( const wxString& dir,
* dir = prefixe (chemin)
* shortname = nom avec ou sans chemin ou extension
* ext = extension
*
*
* si la chaine name possede deja un chemin ou une extension, elles
* ne seront pas modifiees
*
*
* retourne la chaine calculee */
wxString MakeReducedFileName( const wxString& fullfilename,
......@@ -445,12 +457,12 @@ wxString MakeReducedFileName( const wxString& fullfilename,
* fullfilename = nom complet
* default_path = prefixe (chemin) par defaut
* default_ext = extension par defaut
*
*
* retourne le nom reduit, c'est a dire:
* sans le chemin si le chemin est default_path
* avec ./ si si le chemin est le chemin courant
* sans l'extension si l'extension est default_ext
*
*
* Renvoie un chemin en notation unix ('/' en separateur de repertoire)
*/
......
......@@ -305,7 +305,7 @@ void dialog_freeroute_exchange::OnButton5Click( wxCommandEvent& event )
if( wxFileExists( FullFileName ) )
{
command << wxT("javaws") << wxT( " " ) + FullFileName;
wxExecute( command );
ProcessExecute( command );
return;
}
......
......@@ -134,7 +134,7 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC )
Affiche_Message( ExecFileName );
wxExecute( ExecFileName );
ProcessExecute( ExecFileName );
#else
wxMessageBox( wxT( "TODO, currently not available" ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment