Commit caafffd7 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Code cleaning: move class PAGE_INFO from common.h to class_page_info.h;

Fix issue when using a page layout file in project folder: eeschema and Pcbnew did not use it, unless using an absolute path.
Now, if the file path is not absolute, it is seen as relative to the project (which is the expected behavior)
fp lib wizard: when pcbnew id compiled with USE_GITHUB_PLUGIN=OFF, the github plugin option is no more accessible (and the web viewer no more used).
parents ef098324 9ba847c8
Loading
Loading
Loading
Loading
+9 −8
Original line number Original line Diff line number Diff line
@@ -36,16 +36,17 @@ option( KICAD_KEEPCASE
    ON
    ON
    )
    )


# The footprint library wizard uses wxWEBVIEW, which needs a system webkit to be built
# The footprint library wizard uses wxWebview, which needs a system webkit to be built
# The default build option in wxWidgets is to build wxWEBVIEW, but it colud be not built
# The default build option in wxWidgets is to build wxWebview, but it could be not built
# if web kit devel tools are missing
# if web kit devel tools are missing
# So this option disable use of wxWEBVIEW, if building wxWEBVIEW creates issues
# So this option disable use of wxWebview, if building wxWebview creates issues
# see:
# see:
# http://docs.wxwidgets.org/3.0/classwx_web_view.html
# http://docs.wxwidgets.org/3.0/classwx_web_view.html
# No issues on Windows, needs webkitgtk-devel package installed on Linux.
# * No issues on Windows.
# (I don't know the OSX status)
# * needs webkitgtk-devel package installed on Linux, and wxWidgets rebuilt with this package.
# However the default option is on
# * Seems also OK on OSX.
# This option could be removed soon, if no serious issue happens on Linux or OSX
# However the default option is on and has effect only if BUILD_GITHUB_PLUGIN is ON
# This option could be removed soon, if no serious issue happens on Linux
option( KICAD_USE_WEBKIT
option( KICAD_USE_WEBKIT
    "Use system web kit to build a web viewer in footprint library wizard to easily select github libraries (default ON)."
    "Use system web kit to build a web viewer in footprint library wizard to easily select github libraries (default ON)."
    ON
    ON
@@ -418,7 +419,7 @@ add_definitions( -DWX_COMPATIBILITY )
# See line 41 of CMakeModules/FindwxWidgets.cmake
# See line 41 of CMakeModules/FindwxWidgets.cmake
set( wxWidgets_CONFIG_OPTIONS --static=no )
set( wxWidgets_CONFIG_OPTIONS --static=no )


if( KICAD_USE_WEBKIT )
if( KICAD_USE_WEBKIT AND BUILD_GITHUB_PLUGIN )
    set( webkitlib "webview" )
    set( webkitlib "webview" )
else()
else()
    set( webkitlib "" )
    set( webkitlib "" )
+1 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@




#include <common.h>
#include <common.h>
#include <class_page_info.h>
#include <macros.h>
#include <macros.h>




+13 −0
Original line number Original line Diff line number Diff line
@@ -346,6 +346,19 @@ wxString GetKicadConfigPath()
}
}




#include <ki_mutex.h>
const wxString ExpandEnvVarSubstitutions( const wxString& aString )
{
    // wxGetenv( wchar_t* ) is not re-entrant on linux.
    // Put a lock on multithreaded use of wxGetenv( wchar_t* ), called from wxEpandEnvVars(),
    static MUTEX    getenv_mutex;

    MUTLOCK lock( getenv_mutex );

    // We reserve the right to do this another way, by providing our own member
    // function.
    return wxExpandEnvVars( aString );
}


bool EnsureFileDirectoryExists( wxFileName*     aTargetFullFileName,
bool EnsureFileDirectoryExists( wxFileName*     aTargetFullFileName,
                                const wxString& aBaseFilename,
                                const wxString& aBaseFilename,
+6 −0
Original line number Original line Diff line number Diff line
@@ -639,6 +639,9 @@ const FP_LIB_TABLE::ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname )


const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
{
{
// Duplicate code: the same is now in common.cpp, due to the fact it is used
// in many other places than FP_LIB_TABLE
#if 0
    static MUTEX    getenv_mutex;
    static MUTEX    getenv_mutex;


    MUTLOCK lock( getenv_mutex );
    MUTLOCK lock( getenv_mutex );
@@ -646,6 +649,9 @@ const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
    // We reserve the right to do this another way, by providing our own member
    // We reserve the right to do this another way, by providing our own member
    // function.
    // function.
    return wxExpandEnvVars( aString );
    return wxExpandEnvVars( aString );
#else
    return ExpandEnvVarSubstitutions( aString );
#endif
}
}




+1 −0
Original line number Original line Diff line number Diff line
@@ -56,6 +56,7 @@


#include <fctsys.h>
#include <fctsys.h>
#include <drawtxt.h>
#include <drawtxt.h>
#include <class_page_info.h>
#include <worksheet.h>
#include <worksheet.h>
#include <class_title_block.h>
#include <class_title_block.h>
#include <worksheet_shape_builder.h>
#include <worksheet_shape_builder.h>
Loading