2010-02-14 14:59:43 +00:00
|
|
|
/**
|
|
|
|
* @file prjconfig.cpp
|
|
|
|
* Load and save project configuration files (*.pro)
|
|
|
|
*/
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2012-02-16 21:03:33 +01:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2012-04-16 14:56:01 +02:00
|
|
|
* Copyright (C) 2004-2012 Jean-Pierre Charras
|
2012-02-16 21:03:33 +01:00
|
|
|
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <fctsys.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
#include <pgm_kicad.h>
|
|
|
|
#include <project.h>
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <confirm.h>
|
|
|
|
#include <gestfich.h>
|
|
|
|
#include <kicad.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
#include <config_params.h>
|
2012-10-14 18:57:11 +02:00
|
|
|
#include <project_template.h>
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <tree_project_frame.h>
|
2012-02-16 21:03:33 +01:00
|
|
|
#include <wildcards_and_files_ext.h>
|
2012-10-14 18:57:11 +02:00
|
|
|
#include <vector>
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <build_version.h>
|
2013-04-09 18:00:46 +02:00
|
|
|
#include <macros.h>
|
2010-01-05 08:48:49 +00:00
|
|
|
|
2013-02-01 08:58:49 +01:00
|
|
|
#include <wx/dir.h>
|
2012-10-14 18:57:11 +02:00
|
|
|
#include <wx/filename.h>
|
|
|
|
#include <wx/stdpaths.h>
|
|
|
|
|
|
|
|
#include "dialogs/dialog_template_selector.h"
|
|
|
|
|
|
|
|
#define SEP() wxFileName::GetPathSeparator()
|
|
|
|
|
2013-03-30 10:28:59 +01:00
|
|
|
// Not really useful, provided to save/restore params in project config file,
|
|
|
|
// (Add them in s_KicadManagerParams if any)
|
|
|
|
// Used also to create new .pro files from the kicad.pro template file
|
|
|
|
// for new projects
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
#define GeneralGroupName wxT( "/general" )
|
2009-02-04 15:25:03 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
PARAM_CFG_ARRAY s_KicadManagerParams;
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
void KICAD_MANAGER_FRAME::CreateNewProject( const wxString& aPrjFullFileName,
|
|
|
|
bool aTemplateSelector = false )
|
2009-02-04 15:25:03 +00:00
|
|
|
{
|
2013-04-10 16:06:49 -05:00
|
|
|
wxString filename;
|
|
|
|
wxFileName newProjectName = aPrjFullFileName;
|
|
|
|
wxChar sep[2] = { SEP(), 0 }; // nul terminated separator wxChar string.
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2010-11-19 19:50:23 +01:00
|
|
|
ClearMsg();
|
2011-08-19 11:08:41 -04:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
// default config filename
|
|
|
|
filename = Pgm().SysSearch().FindValidPath( wxT( "kicad.pro" ) );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2012-10-14 18:57:11 +02:00
|
|
|
// If we are creating a project from a template, make sure the template directory is sane
|
|
|
|
if( aTemplateSelector )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
2012-10-14 18:57:11 +02:00
|
|
|
DIALOG_TEMPLATE_SELECTOR* ps = new DIALOG_TEMPLATE_SELECTOR( this );
|
|
|
|
|
2013-04-10 16:06:49 -05:00
|
|
|
wxFileName templatePath;
|
|
|
|
wxString envStr;
|
|
|
|
|
|
|
|
wxGetEnv( wxT( "KICAD" ), &envStr );
|
2013-03-10 02:35:24 +01:00
|
|
|
|
2012-10-14 18:57:11 +02:00
|
|
|
// Add a new tab for system templates
|
2013-04-10 16:06:49 -05:00
|
|
|
if( !envStr.empty() )
|
2013-03-10 02:35:24 +01:00
|
|
|
{
|
2013-04-10 16:06:49 -05:00
|
|
|
// user may or may not have including terminating separator.
|
|
|
|
if( !envStr.EndsWith( sep ) )
|
|
|
|
envStr += sep;
|
2013-04-10 15:31:40 -05:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
templatePath = envStr + wxT( "template" ) + sep;
|
2013-03-10 02:35:24 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-02-07 18:17:58 +00:00
|
|
|
// The standard path should be in the share directory for kicad. As
|
|
|
|
// it is normal on Windows to only have the share directory and not
|
|
|
|
// the kicad sub-directory we fall back to that if the directory
|
|
|
|
// doesn't exist
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
templatePath = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) +
|
2014-02-07 18:17:58 +00:00
|
|
|
sep + wxT( ".." ) + sep + wxT( "share" ) + sep + wxT( "kicad" ) +
|
|
|
|
sep + wxT( "template" ) + sep;
|
|
|
|
|
|
|
|
if( !wxDirExists( templatePath.GetFullPath() ) )
|
|
|
|
{
|
|
|
|
templatePath = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) +
|
2013-04-10 16:06:49 -05:00
|
|
|
sep + wxT( ".." ) + sep + wxT( "share" ) + sep + wxT( "template" ) + sep;
|
2014-02-07 18:17:58 +00:00
|
|
|
}
|
2013-03-10 02:35:24 +01:00
|
|
|
}
|
2012-10-14 18:57:11 +02:00
|
|
|
|
|
|
|
ps->AddPage( _( "System Templates" ), templatePath );
|
|
|
|
|
|
|
|
// Add a new tab for user templates
|
|
|
|
wxFileName userPath = wxStandardPaths::Get().GetDocumentsDir() +
|
2013-04-10 16:06:49 -05:00
|
|
|
sep + wxT( "kicad" ) + sep + wxT( "template" ) + sep;
|
2012-10-14 18:57:11 +02:00
|
|
|
|
|
|
|
ps->AddPage( _( "User Templates" ), userPath );
|
|
|
|
|
2013-04-10 16:06:49 -05:00
|
|
|
// Check to see if a custom template location is available and setup a
|
|
|
|
// new selection tab if there is.
|
|
|
|
envStr.clear();
|
2013-04-10 15:31:40 -05:00
|
|
|
wxGetEnv( wxT( "KICAD_PTEMPLATES" ), &envStr );
|
2012-10-14 18:57:11 +02:00
|
|
|
|
2013-04-10 16:06:49 -05:00
|
|
|
if( !envStr.empty() )
|
2012-10-14 18:57:11 +02:00
|
|
|
{
|
2013-04-10 16:06:49 -05:00
|
|
|
if( !envStr.EndsWith( sep ) )
|
2013-04-10 15:31:40 -05:00
|
|
|
envStr += sep;
|
|
|
|
|
2012-10-14 18:57:11 +02:00
|
|
|
wxFileName envPath = envStr;
|
2013-04-10 15:31:40 -05:00
|
|
|
|
|
|
|
ps->AddPage( _( "Portable Templates" ), envPath );
|
2012-10-14 18:57:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Show the project template selector dialog
|
|
|
|
int result = ps->ShowModal();
|
|
|
|
|
2013-04-21 15:44:57 -04:00
|
|
|
if( (result != wxID_OK) || (ps->GetWidget() == NULL) )
|
2012-10-14 18:57:11 +02:00
|
|
|
{
|
2013-04-21 15:44:57 -04:00
|
|
|
if( ps->GetWidget() == NULL )
|
|
|
|
{
|
|
|
|
wxMessageBox( _( "No project template was selected. Cannot generate new "
|
|
|
|
"project." ),
|
|
|
|
_( "Error" ),
|
|
|
|
wxOK | wxICON_ERROR,
|
|
|
|
this );
|
|
|
|
}
|
2012-10-14 18:57:11 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// The selected template widget contains the template we're attempting to use to
|
|
|
|
// create a project
|
|
|
|
if( !ps->GetWidget()->GetTemplate()->CreateProject( newProjectName ) )
|
|
|
|
{
|
|
|
|
wxMessageBox( _( "Problem whilst creating new project from template!" ),
|
2013-04-21 15:44:57 -04:00
|
|
|
_( "Template Error" ),
|
2012-10-14 18:57:11 +02:00
|
|
|
wxOK | wxICON_ERROR,
|
|
|
|
this );
|
|
|
|
}
|
|
|
|
}
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-14 18:57:11 +02:00
|
|
|
// Check if file kicad.pro exist in template directory
|
|
|
|
if( wxFileName::FileExists( filename ) )
|
|
|
|
{
|
|
|
|
wxCopyFile( filename, aPrjFullFileName );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DisplayInfoMessage( NULL, _( "Project template file <kicad.pro> not found. " ) );
|
|
|
|
return;
|
|
|
|
}
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2012-10-14 18:57:11 +02:00
|
|
|
// Init project filename
|
2014-07-07 14:49:14 -05:00
|
|
|
SetProjectFileName( newProjectName.GetFullPath() );
|
2010-02-14 14:59:43 +00:00
|
|
|
|
2012-10-14 18:57:11 +02:00
|
|
|
// Write settings to project file
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
// was: wxGetApp().WriteProjectConfig( aPrjFullFileName, GeneralGroupName, s_KicadManagerParams );
|
|
|
|
Prj().ConfigSave( Pgm().SysSearch(), aPrjFullFileName, GeneralGroupName, s_KicadManagerParams );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2014-07-07 14:49:14 -05:00
|
|
|
wxString title;
|
|
|
|
|
|
|
|
// this is still a mess, will work on it tomorrow.
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2010-11-19 19:50:23 +01:00
|
|
|
ClearMsg();
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
if( event.GetId() != wxID_ANY )
|
2008-04-30 12:35:23 +00:00
|
|
|
{
|
2014-07-07 14:49:14 -05:00
|
|
|
int style;
|
|
|
|
|
|
|
|
bool newProject = ( event.GetId() == ID_NEW_PROJECT ) ||
|
|
|
|
( event.GetId() == ID_NEW_PROJECT_FROM_TEMPLATE );
|
|
|
|
|
2012-12-31 09:12:29 +01:00
|
|
|
if( newProject )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
|
|
|
title = _( "Create New Project" );
|
|
|
|
style = wxFD_SAVE | wxFD_OVERWRITE_PROMPT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
title = _( "Open Existing Project" );
|
|
|
|
style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
|
|
|
|
}
|
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
wxString default_dir = wxGetCwd();
|
|
|
|
wxFileDialog dlg( this, title, default_dir, wxEmptyString,
|
|
|
|
ProjectFileWildcard, style );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
|
|
|
return;
|
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
wxFileName pro( dlg.GetPath() );
|
|
|
|
pro.SetExt( ProjectFileExtension );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2012-12-31 09:12:29 +01:00
|
|
|
if( newProject )
|
2010-05-29 20:34:18 +02:00
|
|
|
{
|
2013-02-01 08:58:49 +01:00
|
|
|
// Check if the project directory is empty
|
2014-07-07 14:49:14 -05:00
|
|
|
wxDir directory( pro.GetPath() );
|
2013-04-21 15:44:57 -04:00
|
|
|
|
2013-02-01 08:58:49 +01:00
|
|
|
if( directory.HasFiles() )
|
2010-05-29 20:34:18 +02:00
|
|
|
{
|
2013-04-21 15:44:57 -04:00
|
|
|
wxString msg = _( "The selected directory is not empty. We recommend you "
|
|
|
|
"create projects in their own clean directory.\n\nDo you "
|
|
|
|
"want to create a new empty directory for the project?" );
|
2013-02-01 08:58:49 +01:00
|
|
|
|
|
|
|
if( IsOK( this, msg ) )
|
|
|
|
{
|
|
|
|
// Append a new directory with the same name of the project file
|
|
|
|
// and try to create it
|
2014-07-07 14:49:14 -05:00
|
|
|
pro.AppendDir( pro.GetName() );
|
2013-04-21 15:44:57 -04:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
if( !wxMkdir( pro.GetPath() ) )
|
2013-02-01 08:58:49 +01:00
|
|
|
// There was a problem, undo
|
2014-07-07 14:49:14 -05:00
|
|
|
pro.RemoveLastDir();
|
2013-02-01 08:58:49 +01:00
|
|
|
}
|
2010-05-29 20:34:18 +02:00
|
|
|
}
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2012-10-14 18:57:11 +02:00
|
|
|
if( event.GetId() == ID_NEW_PROJECT )
|
|
|
|
{
|
2014-07-07 14:49:14 -05:00
|
|
|
CreateNewProject( pro.GetFullPath() );
|
2012-10-14 18:57:11 +02:00
|
|
|
}
|
|
|
|
else if( event.GetId() == ID_NEW_PROJECT_FROM_TEMPLATE )
|
|
|
|
{
|
|
|
|
// Launch the template selector dialog
|
2014-07-07 14:49:14 -05:00
|
|
|
CreateNewProject( pro.GetFullPath(), true );
|
2012-10-14 18:57:11 +02:00
|
|
|
}
|
2010-05-29 20:34:18 +02:00
|
|
|
}
|
2014-07-07 14:49:14 -05:00
|
|
|
|
|
|
|
SetProjectFileName( pro.GetFullName() );
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
wxLogDebug( wxT( "Loading KiCad project file: " ) + GetProjectFileName() );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
// Check if project file exists and if it is not noname.pro
|
|
|
|
wxString filename = GetProjectFileName();
|
2010-02-14 14:59:43 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
wxString nameless_prj = NAMELESS_PROJECT wxT( ".pro" );
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
if( !wxFileExists( GetProjectFileName() ) && !filename.IsSameAs( nameless_prj ) )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
wxString msg = wxString::Format(
|
|
|
|
_( "KiCad project file '%s' not found" ),
|
2014-07-07 14:49:14 -05:00
|
|
|
GetChars( GetProjectFileName() ) );
|
2013-04-09 19:49:01 +02:00
|
|
|
|
|
|
|
DisplayError( this, msg );
|
2008-04-30 12:35:23 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
wxSetWorkingDirectory( wxFileName( GetProjectFileName() ).GetPath() );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
// was wxGetApp().ReadProjectConfig( m_ProjectFileName.GetFullPath(),
|
|
|
|
// GeneralGroupName, s_KicadManagerParams, false );
|
2014-07-07 14:49:14 -05:00
|
|
|
Prj().ConfigLoad( Pgm().SysSearch(), GetProjectFileName(),
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
GeneralGroupName, s_KicadManagerParams, false );
|
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
title = wxT( "KiCad " ) + GetBuildVersion() + wxT( ' ' ) + GetProjectFileName();
|
2011-08-19 11:08:41 -04:00
|
|
|
|
2014-07-07 14:49:14 -05:00
|
|
|
if( !wxIsWritable( GetProjectFileName() ) )
|
2011-08-19 11:08:41 -04:00
|
|
|
title += _( " [Read Only]" );
|
|
|
|
|
|
|
|
SetTitle( title );
|
2014-07-07 14:49:14 -05:00
|
|
|
UpdateFileHistory( GetProjectFileName(), &Pgm().GetFileHistory() );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
|
2008-04-30 12:35:23 +00:00
|
|
|
m_LeftWin->ReCreateTreePrj();
|
2013-04-10 15:31:40 -05:00
|
|
|
|
2013-01-01 15:06:49 +01:00
|
|
|
#ifdef KICAD_USE_FILES_WATCHER
|
|
|
|
// Rebuild the list of watched paths.
|
|
|
|
// however this is possible only when the main loop event handler is running,
|
2013-01-13 17:55:07 +01:00
|
|
|
// so we use it to run the rebuild function.
|
2013-01-01 15:06:49 +01:00
|
|
|
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED, ID_INIT_WATCHED_PATHS );
|
2014-07-07 14:49:14 -05:00
|
|
|
|
|
|
|
wxPostEvent( this, cmd );
|
2013-01-01 15:06:49 +01:00
|
|
|
#endif
|
2013-04-10 15:31:40 -05:00
|
|
|
|
2014-02-01 19:27:18 +01:00
|
|
|
PrintPrjInfo();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 15:54:17 +02:00
|
|
|
void KICAD_MANAGER_FRAME::OnSaveProject( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2014-07-07 14:49:14 -05:00
|
|
|
if( !wxIsWritable( GetProjectFileName() ) )
|
2008-04-30 12:35:23 +00:00
|
|
|
return;
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
// was: wxGetApp().WriteProjectConfig( m_ProjectFileName.GetFullPath(),
|
|
|
|
// GeneralGroupName, s_KicadManagerParams );
|
2014-07-07 14:49:14 -05:00
|
|
|
Prj().ConfigSave( Pgm().SysSearch(), GetProjectFileName(),
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
|
|
|
GeneralGroupName, s_KicadManagerParams );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|