You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

839 lines
23 KiB

* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
* 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.
12 years ago
Modular-Kicad milestone B), major portions: *) Rework the set language support, simplify it by using KIWAY. Now any major frame with a "change language" menu can change the language for all KIWAY_PLAYERs in the whole KIWAY. Multiple KIWAYs are not supported yet. *) Simplify "modal wxFrame" support, and add that support exclusively to KIWAY_PLAYER where it is inherited by all derivatives. The function KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable. *) Remove the requirements and assumptions that the wxFrame hierarchy always had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers and editors. This is no longer the case, nor required. *) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame quickly. It also gives control to the KIWAY as to frame hierarchical relationships. *) Change single_top to use the KIWAY for loading a KIFACE and instantiating the single KIWAY_PLAYER, see bullet immediately above. *) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this gives the KIFACEs a chance to save their final configuration dope to disk. *) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and these modal frames are distinctly different than their non-modal equivalents. KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor, so this is another important reason for having a dedicated FRAME_T for each modal wxFrame. On balance, more lines were deleted than were added to achieve all this.
12 years ago
* 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.
12 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2004-2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
  5. * Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
  6. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. /**
  26. * @file pgm_base.cpp
  27. *
  28. * @brief For the main application: init functions, and language selection
  29. * (locale handling)
  30. */
  31. #include <fctsys.h>
  32. #include <wx/html/htmlwin.h>
  33. #include <wx/fs_zip.h>
  34. #include <wx/dir.h>
  35. #include <wx/filename.h>
  36. #include <wx/snglinst.h>
  37. #include <wx/stdpaths.h>
  38. #include <wx/sysopt.h>
  39. #include <wx/richmsgdlg.h>
  40. #include <pgm_base.h>
  41. #include <wxstruct.h>
  42. #include <macros.h>
  43. #include <config_params.h>
  44. #include <id.h>
  45. #include <build_version.h>
  46. #include <hotkeys_basic.h>
  47. #include <online_help.h>
  48. #include <gestfich.h>
  49. #include <menus_helpers.h>
  50. #include <confirm.h>
  51. #include <dialog_env_var_config.h>
  52. #define KICAD_COMMON wxT( "kicad_common" )
  53. // some key strings used to store parameters in KICAD_COMMON
  54. const wxChar PGM_BASE::workingDirKey[] = wxT( "WorkingDir" ); // public
  55. static const wxChar languageCfgKey[] = wxT( "LanguageID" );
  56. static const wxChar pathEnvVariables[] = wxT( "EnvironmentVariables" );
  57. static const wxChar showEnvVarWarningDialog[] = wxT( "ShowEnvVarWarningDialog" );
  58. static const wxChar traceEnvVars[] = wxT( "KIENVVARS" );
  59. /**
  60. * A small class to handle the list of existing translations.
  61. * The locale translation is automatic.
  62. * The selection of languages is mainly for maintainer's convenience
  63. * To add a support to a new translation:
  64. * create a new icon (flag of the country) (see Lang_Fr.xpm as an example)
  65. * add a new item to s_Languages[].
  66. */
  67. struct LANGUAGE_DESCR
  68. {
  69. /// wxWidgets locale identifier (See wxWidgets doc)
  70. int m_WX_Lang_Identifier;
  71. /// KiCad identifier used in menu selection (See id.h)
  72. int m_KI_Lang_Identifier;
  73. /// The menu language icons
  74. BITMAP_DEF m_Lang_Icon;
  75. /// Labels used in menus
  76. wxString m_Lang_Label;
  77. /// Set to true if the m_Lang_Label must not be translated
  78. bool m_DoNotTranslate;
  79. };
  80. /**
  81. * Variable s_Languages
  82. * Note: because this list is not created on the fly, wxTranslation
  83. * must be called when a language name must be displayed after translation.
  84. * Do not change this behavior, because m_Lang_Label is also used as key in config
  85. */
  86. static LANGUAGE_DESCR s_Languages[] =
  87. {
  88. // Default language
  89. {
  90. wxLANGUAGE_DEFAULT,
  91. ID_LANGUAGE_DEFAULT,
  92. lang_def_xpm,
  93. _( "Default" )
  94. },
  95. // English language
  96. {
  97. wxLANGUAGE_ENGLISH,
  98. ID_LANGUAGE_ENGLISH,
  99. lang_en_xpm,
  100. wxT( "English" ),
  101. true
  102. },
  103. // French language
  104. {
  105. wxLANGUAGE_FRENCH,
  106. ID_LANGUAGE_FRENCH,
  107. lang_fr_xpm,
  108. _( "French" )
  109. },
  110. // Finnish language
  111. {
  112. wxLANGUAGE_FINNISH,
  113. ID_LANGUAGE_FINNISH,
  114. lang_fi_xpm,
  115. _( "Finnish" )
  116. },
  117. // Spanish language
  118. {
  119. wxLANGUAGE_SPANISH,
  120. ID_LANGUAGE_SPANISH,
  121. lang_es_xpm,
  122. _( "Spanish" )
  123. },
  124. // Portuguese language
  125. {
  126. wxLANGUAGE_PORTUGUESE,
  127. ID_LANGUAGE_PORTUGUESE,
  128. lang_pt_xpm,
  129. _( "Portuguese" )
  130. },
  131. // Italian language
  132. {
  133. wxLANGUAGE_ITALIAN,
  134. ID_LANGUAGE_ITALIAN,
  135. lang_it_xpm,
  136. _( "Italian" )
  137. },
  138. // German language
  139. {
  140. wxLANGUAGE_GERMAN,
  141. ID_LANGUAGE_GERMAN,
  142. lang_de_xpm,
  143. _( "German" )
  144. },
  145. // Greek language
  146. {
  147. wxLANGUAGE_GREEK,
  148. ID_LANGUAGE_GREEK,
  149. lang_gr_xpm,
  150. _( "Greek" )
  151. },
  152. // Slovenian language
  153. {
  154. wxLANGUAGE_SLOVENIAN,
  155. ID_LANGUAGE_SLOVENIAN,
  156. lang_sl_xpm,
  157. _( "Slovenian" )
  158. },
  159. // Hungarian language
  160. {
  161. wxLANGUAGE_HUNGARIAN,
  162. ID_LANGUAGE_HUNGARIAN,
  163. lang_hu_xpm,
  164. _( "Hungarian" )
  165. },
  166. // Polish language
  167. {
  168. wxLANGUAGE_POLISH,
  169. ID_LANGUAGE_POLISH,
  170. lang_pl_xpm,
  171. _( "Polish" )
  172. },
  173. // Czech language
  174. {
  175. wxLANGUAGE_CZECH,
  176. ID_LANGUAGE_CZECH,
  177. lang_cs_xpm,
  178. _( "Czech" )
  179. },
  180. // Russian language
  181. {
  182. wxLANGUAGE_RUSSIAN,
  183. ID_LANGUAGE_RUSSIAN,
  184. lang_ru_xpm,
  185. _( "Russian" )
  186. },
  187. // Korean language
  188. {
  189. wxLANGUAGE_KOREAN,
  190. ID_LANGUAGE_KOREAN,
  191. lang_ko_xpm,
  192. _( "Korean" )
  193. },
  194. // Chinese simplified
  195. {
  196. wxLANGUAGE_CHINESE_SIMPLIFIED,
  197. ID_LANGUAGE_CHINESE_SIMPLIFIED,
  198. lang_chinese_xpm,
  199. _( "Chinese simplified" )
  200. },
  201. // Catalan language
  202. {
  203. wxLANGUAGE_CATALAN,
  204. ID_LANGUAGE_CATALAN,
  205. lang_catalan_xpm,
  206. _( "Catalan" )
  207. },
  208. // Dutch language
  209. {
  210. wxLANGUAGE_DUTCH,
  211. ID_LANGUAGE_DUTCH,
  212. lang_nl_xpm,
  213. _( "Dutch" )
  214. },
  215. // Japanese language
  216. {
  217. wxLANGUAGE_JAPANESE,
  218. ID_LANGUAGE_JAPANESE,
  219. lang_jp_xpm,
  220. _( "Japanese" )
  221. },
  222. // Bulgarian language
  223. {
  224. wxLANGUAGE_BULGARIAN,
  225. ID_LANGUAGE_BULGARIAN,
  226. lang_bg_xpm,
  227. _( "Bulgarian" )
  228. }
  229. };
  230. PGM_BASE::PGM_BASE()
  231. {
  232. m_pgm_checker = NULL;
  233. m_locale = NULL;
  234. m_common_settings = NULL;
  235. m_wx_app = NULL;
  236. m_show_env_var_dialog = true;
  237. setLanguageId( wxLANGUAGE_DEFAULT );
  238. ForceSystemPdfBrowser( false );
  239. }
  240. PGM_BASE::~PGM_BASE()
  241. {
  242. destroy();
  243. }
  244. void PGM_BASE::destroy()
  245. {
  246. // unlike a normal destructor, this is designed to be called more than once safely:
  247. delete m_common_settings;
  248. m_common_settings = 0;
  249. delete m_pgm_checker;
  250. m_pgm_checker = 0;
  251. delete m_locale;
  252. m_locale = 0;
  253. }
  254. void PGM_BASE::SetEditorName( const wxString& aFileName )
  255. {
  256. m_editor_name = aFileName;
  257. wxASSERT( m_common_settings );
  258. m_common_settings->Write( wxT( "Editor" ), aFileName );
  259. }
  260. const wxString& PGM_BASE::GetEditorName()
  261. {
  262. wxString editorname = m_editor_name;
  263. if( !editorname )
  264. {
  265. // Get the preferred editor name from environment variable first.
  266. if(!wxGetEnv( wxT( "EDITOR" ), &editorname ))
  267. {
  268. // If there is no EDITOR variable set, try the desktop default
  269. #ifdef __WXMAC__
  270. editorname = "/usr/bin/open";
  271. #elif __WXX11__
  272. editorname = "/usr/bin/xdg-open";
  273. #endif
  274. }
  275. }
  276. if( !editorname ) // We must get a preferred editor name
  277. {
  278. DisplayInfoMessage( NULL,
  279. _( "No default editor found, you must choose it" ) );
  280. wxString mask( wxT( "*" ) );
  281. #ifdef __WINDOWS__
  282. mask += wxT( ".exe" );
  283. #endif
  284. editorname = EDA_FileSelector( _( "Preferred Editor:" ), wxEmptyString,
  285. wxEmptyString, wxEmptyString, mask,
  286. NULL, wxFD_OPEN, true );
  287. }
  288. if( !editorname.IsEmpty() )
  289. {
  290. m_editor_name = editorname;
  291. m_common_settings->Write( wxT( "Editor" ), m_editor_name );
  292. }
  293. return m_editor_name;
  294. }
  295. bool PGM_BASE::initPgm()
  296. {
  297. wxFileName pgm_name( App().argv[0] );
  298. wxConfigBase::DontCreateOnDemand();
  299. wxInitAllImageHandlers();
  300. m_pgm_checker = new wxSingleInstanceChecker( pgm_name.GetName().Lower() + wxT( "-" ) +
  301. wxGetUserId(), GetKicadLockFilePath() );
  302. if( m_pgm_checker->IsAnotherRunning() )
  303. {
  304. wxString quiz = wxString::Format(
  305. _( "%s is already running, Continue?" ),
  306. GetChars( pgm_name.GetName() )
  307. );
  308. if( !IsOK( NULL, quiz ) )
  309. return false;
  310. }
  311. // Init KiCad environment
  312. // the environment variable KICAD (if exists) gives the kicad path:
  313. // something like set KICAD=d:\kicad
  314. bool isDefined = wxGetEnv( wxT( "KICAD" ), &m_kicad_env );
  315. if( isDefined ) // ensure m_kicad_env ends by "/"
  316. {
  317. m_kicad_env.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
  318. if( !m_kicad_env.IsEmpty() && m_kicad_env.Last() != '/' )
  319. m_kicad_env += UNIX_STRING_DIR_SEP;
  320. }
  321. // Init parameters for configuration
  322. App().SetVendorName( wxT( "KiCad" ) );
  323. App().SetAppName( pgm_name.GetName().Lower() );
  324. // Install some image handlers, mainly for help
  325. if( wxImage::FindHandler( wxBITMAP_TYPE_PNG ) == NULL )
  326. wxImage::AddHandler( new wxPNGHandler );
  327. if( wxImage::FindHandler( wxBITMAP_TYPE_GIF ) == NULL )
  328. wxImage::AddHandler( new wxGIFHandler );
  329. if( wxImage::FindHandler( wxBITMAP_TYPE_JPEG ) == NULL )
  330. wxImage::AddHandler( new wxJPEGHandler );
  331. wxFileSystem::AddHandler( new wxZipFSHandler );
  332. // Analyze the command line & initialize the binary path
  333. setExecutablePath();
  334. SetLanguagePath();
  335. // OS specific instantiation of wxConfigBase derivative:
  336. m_common_settings = GetNewConfig( KICAD_COMMON );
  337. // Only define the default environment variable if they haven't been set in the
  338. // .kicad_common configuration file.
  339. if( m_common_settings && !m_common_settings->HasGroup( pathEnvVariables ) )
  340. {
  341. wxString envVarName = wxT( "KIGITHUB" );
  342. ENV_VAR_ITEM envVarItem;
  343. envVarItem.SetValue( wxString( wxT( "https://github.com/KiCad" ) ) );
  344. envVarItem.SetDefinedExternally( wxGetEnv( envVarName, NULL ) );
  345. m_local_env_vars[ envVarName ] = envVarItem;
  346. wxFileName baseSharePath;
  347. baseSharePath.AssignDir( wxString( wxT( DEFAULT_INSTALL_PATH ) ) );
  348. #if !defined( __WXMAC__ )
  349. baseSharePath.AppendDir( wxT( "share" ) );
  350. baseSharePath.AppendDir( wxT( "kicad" ) );
  351. #endif
  352. wxFileName tmpFileName = baseSharePath;
  353. tmpFileName.AppendDir( wxT( "modules" ) );
  354. envVarName = wxT( "KISYSMOD" );
  355. envVarItem.SetValue( tmpFileName.GetPath() );
  356. envVarItem.SetDefinedExternally( wxGetEnv( envVarName, NULL ) );
  357. m_local_env_vars[ envVarName ] = envVarItem;
  358. envVarName = wxT( "KISYS3DMOD" );
  359. tmpFileName.AppendDir( wxT( "packages3d" ) );
  360. envVarItem.SetValue( tmpFileName.GetPath() );
  361. envVarItem.SetDefinedExternally( wxGetEnv( envVarName, NULL ) );
  362. m_local_env_vars[ envVarName ] = envVarItem;
  363. envVarName = wxT( "KICAD_PTEMPLATES" );
  364. tmpFileName = baseSharePath;
  365. tmpFileName.AppendDir( wxT( "template" ) );
  366. envVarItem.SetValue( tmpFileName.GetPath() );
  367. envVarItem.SetDefinedExternally( wxGetEnv( envVarName, NULL ) );
  368. m_local_env_vars[ envVarName ] = envVarItem;
  369. }
  370. ReadPdfBrowserInfos(); // needs m_common_settings
  371. loadCommonSettings();
  372. SetLanguage( true );
  373. // Set locale option for separator used in float numbers
  374. SetLocaleTo_Default();
  375. #ifdef __WXMAC__
  376. // Always show filters on Open dialog to be able to choose plugin
  377. wxSystemOptions::SetOption( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1 );
  378. #endif
  379. return true;
  380. }
  381. bool PGM_BASE::setExecutablePath()
  382. {
  383. m_bin_dir = wxStandardPaths::Get().GetExecutablePath();
  384. #ifdef __WXMAC__
  385. // On OSX Pgm().GetExecutablePath() will always point to main
  386. // bundle directory, e.g., /Applications/kicad.app/
  387. wxFileName fn( m_bin_dir );
  388. if( fn.GetName() == wxT( "kicad" ) )
  389. {
  390. // kicad launcher, so just remove the Contents/MacOS part
  391. fn.RemoveLastDir();
  392. fn.RemoveLastDir();
  393. }
  394. else
  395. {
  396. // standalone binaries live in Contents/Applications/<standalone>.app/Contents/MacOS
  397. fn.RemoveLastDir();
  398. fn.RemoveLastDir();
  399. fn.RemoveLastDir();
  400. fn.RemoveLastDir();
  401. fn.RemoveLastDir();
  402. }
  403. m_bin_dir = fn.GetPath() + wxT( "/" );
  404. #else
  405. // Use unix notation for paths. I am not sure this is a good idea,
  406. // but it simplifies compatibility between Windows and Unices.
  407. // However it is a potential problem in path handling under Windows.
  408. m_bin_dir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
  409. // Remove file name form command line:
  410. while( m_bin_dir.Last() != '/' && !m_bin_dir.IsEmpty() )
  411. m_bin_dir.RemoveLast();
  412. #endif
  413. return true;
  414. }
  415. void PGM_BASE::loadCommonSettings()
  416. {
  417. wxASSERT( m_common_settings );
  418. m_help_size.x = 500;
  419. m_help_size.y = 400;
  420. wxString languageSel;
  421. m_common_settings->Read( languageCfgKey, &languageSel );
  422. setLanguageId( wxLANGUAGE_DEFAULT );
  423. m_common_settings->Read( showEnvVarWarningDialog, &m_show_env_var_dialog );
  424. // Search for the current selection
  425. for( unsigned ii = 0; ii < DIM( s_Languages ); ii++ )
  426. {
  427. if( s_Languages[ii].m_Lang_Label == languageSel )
  428. {
  429. setLanguageId( s_Languages[ii].m_WX_Lang_Identifier );
  430. break;
  431. }
  432. }
  433. m_editor_name = m_common_settings->Read( wxT( "Editor" ) );
  434. wxString entry, oldPath;
  435. wxArrayString entries;
  436. long index = 0L;
  437. oldPath = m_common_settings->GetPath();
  438. m_common_settings->SetPath( pathEnvVariables );
  439. while( m_common_settings->GetNextEntry( entry, index ) )
  440. {
  441. wxLogTrace( traceEnvVars,
  442. wxT( "Enumerating over entry %s, %ld." ), GetChars( entry ), index );
  443. entries.Add( entry );
  444. }
  445. for( unsigned i = 0; i < entries.GetCount(); i++ )
  446. {
  447. wxString val = m_common_settings->Read( entries[i], wxEmptyString );
  448. m_local_env_vars[ entries[i] ] = ENV_VAR_ITEM( val, wxGetEnv( entries[i], NULL ) );
  449. }
  450. for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )
  451. SetLocalEnvVariable( it->first, it->second.GetValue() );
  452. m_common_settings->SetPath( oldPath );
  453. }
  454. void PGM_BASE::saveCommonSettings()
  455. {
  456. // m_common_settings is not initialized until fairly late in the
  457. // process startup: initPgm(), so test before using:
  458. if( m_common_settings )
  459. {
  460. wxString cur_dir = wxGetCwd();
  461. m_common_settings->Write( workingDirKey, cur_dir );
  462. m_common_settings->Write( showEnvVarWarningDialog, m_show_env_var_dialog );
  463. // Save the local environment variables.
  464. m_common_settings->SetPath( pathEnvVariables );
  465. for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )
  466. {
  467. wxLogTrace( traceEnvVars, wxT( "Saving environment varaiable config entry %s as %s" ),
  468. GetChars( it->first ), GetChars( it->second.GetValue() ) );
  469. m_common_settings->Write( it->first, it->second.GetValue() );
  470. }
  471. m_common_settings->SetPath( wxT( ".." ) );
  472. }
  473. }
  474. bool PGM_BASE::SetLanguage( bool first_time )
  475. {
  476. bool retv = true;
  477. // dictionary file name without extend (full name is kicad.mo)
  478. wxString dictionaryName( wxT( "kicad" ) );
  479. delete m_locale;
  480. m_locale = new wxLocale;
  481. #if wxCHECK_VERSION( 2, 9, 0 )
  482. if( !m_locale->Init( m_language_id ) )
  483. #else
  484. if( !m_locale->Init( m_language_id, wxLOCALE_CONV_ENCODING ) )
  485. #endif
  486. {
  487. wxLogDebug( wxT( "This language is not supported by the system." ) );
  488. setLanguageId( wxLANGUAGE_DEFAULT );
  489. delete m_locale;
  490. m_locale = new wxLocale;
  491. m_locale->Init();
  492. retv = false;
  493. }
  494. else if( !first_time )
  495. {
  496. wxLogDebug( wxT( "Search for dictionary %s.mo in %s" ),
  497. GetChars( dictionaryName ), GetChars( m_locale->GetName() ) );
  498. }
  499. // how about a meaningful comment here.
  500. if( !first_time )
  501. {
  502. wxString languageSel;
  503. // Search for the current selection
  504. for( unsigned ii = 0; ii < DIM( s_Languages ); ii++ )
  505. {
  506. if( s_Languages[ii].m_WX_Lang_Identifier == m_language_id )
  507. {
  508. languageSel = s_Languages[ii].m_Lang_Label;
  509. break;
  510. }
  511. }
  512. m_common_settings->Write( languageCfgKey, languageSel );
  513. }
  514. // Test if floating point notation is working (bug in cross compilation, using wine)
  515. // Make a conversion double <=> string
  516. double dtst = 0.5;
  517. wxString msg;
  518. extern bool g_DisableFloatingPointLocalNotation; // See common.cpp
  519. g_DisableFloatingPointLocalNotation = false;
  520. msg << dtst;
  521. double result;
  522. msg.ToDouble( &result );
  523. if( result != dtst ) // string to double encode/decode does not work! Bug detected
  524. {
  525. // Disable floating point localization:
  526. g_DisableFloatingPointLocalNotation = true;
  527. SetLocaleTo_C_standard( );
  528. }
  529. if( !m_locale->IsLoaded( dictionaryName ) )
  530. m_locale->AddCatalog( dictionaryName );
  531. if( !retv )
  532. return retv;
  533. return m_locale->IsOk();
  534. }
  535. void PGM_BASE::SetLanguageIdentifier( int menu_id )
  536. {
  537. wxLogDebug( wxT( "Select language ID %d from %d possible languages." ),
  538. menu_id, DIM( s_Languages ) );
  539. for( unsigned ii = 0; ii < DIM( s_Languages ); ii++ )
  540. {
  541. if( menu_id == s_Languages[ii].m_KI_Lang_Identifier )
  542. {
  543. setLanguageId( s_Languages[ii].m_WX_Lang_Identifier );
  544. break;
  545. }
  546. }
  547. }
  548. void PGM_BASE::SetLanguagePath()
  549. {
  550. SEARCH_STACK guesses;
  551. SystemDirsAppend( &guesses );
  552. // Add our internat dir to the wxLocale catalog of paths
  553. for( unsigned i = 0; i < guesses.GetCount(); i++ )
  554. {
  555. wxFileName fn( guesses[i], wxEmptyString );
  556. // Append path for Windows and unix KiCad package install
  557. fn.AppendDir( wxT( "share" ) );
  558. fn.AppendDir( wxT( "internat" ) );
  559. if( fn.IsDirReadable() )
  560. {
  561. wxLogDebug( wxT( "Adding locale lookup path: " ) + fn.GetPath() );
  562. wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
  563. }
  564. // Append path for unix standard install
  565. fn.RemoveLastDir();
  566. fn.AppendDir( wxT( "kicad" ) );
  567. fn.AppendDir( wxT( "internat" ) );
  568. if( fn.IsDirReadable() )
  569. {
  570. wxLogDebug( wxT( "Adding locale lookup path: " ) + fn.GetPath() );
  571. wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
  572. }
  573. }
  574. }
  575. void PGM_BASE::AddMenuLanguageList( wxMenu* MasterMenu )
  576. {
  577. wxMenu* menu = NULL;
  578. wxMenuItem* item = MasterMenu->FindItem( ID_LANGUAGE_CHOICE );
  579. if( item ) // This menu exists, do nothing
  580. return;
  581. menu = new wxMenu;
  582. for( unsigned ii = 0; ii < DIM( s_Languages ); ii++ )
  583. {
  584. wxString label;
  585. if( s_Languages[ii].m_DoNotTranslate )
  586. label = s_Languages[ii].m_Lang_Label;
  587. else
  588. label = wxGetTranslation( s_Languages[ii].m_Lang_Label );
  589. AddMenuItem( menu, s_Languages[ii].m_KI_Lang_Identifier,
  590. label, KiBitmap(s_Languages[ii].m_Lang_Icon ),
  591. wxITEM_CHECK );
  592. }
  593. AddMenuItem( MasterMenu, menu,
  594. ID_LANGUAGE_CHOICE,
  595. _( "Language" ),
  596. _( "Select application language (only for testing!)" ),
  597. KiBitmap( language_xpm ) );
  598. // Set Check mark on current selected language
  599. for( unsigned ii = 0; ii < DIM( s_Languages ); ii++ )
  600. {
  601. if( m_language_id == s_Languages[ii].m_WX_Lang_Identifier )
  602. menu->Check( s_Languages[ii].m_KI_Lang_Identifier, true );
  603. else
  604. menu->Check( s_Languages[ii].m_KI_Lang_Identifier, false );
  605. }
  606. }
  607. bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValue )
  608. {
  609. wxString env;
  610. // Check to see if the environment variable is already set.
  611. if( wxGetEnv( aName, &env ) )
  612. {
  613. wxLogTrace( traceEnvVars, wxT( "Environment variable %s already set to %s." ),
  614. GetChars( aName ), GetChars( env ) );
  615. return env == aValue;
  616. }
  617. wxLogTrace( traceEnvVars, wxT( "Setting local environment variable %s to %s." ),
  618. GetChars( aName ), GetChars( aValue ) );
  619. return wxSetEnv( aName, aValue );
  620. }
  621. void PGM_BASE::SetLocalEnvVariables( const ENV_VAR_MAP& aEnvVarMap )
  622. {
  623. m_local_env_vars.clear();
  624. m_local_env_vars = aEnvVarMap;
  625. if( m_common_settings )
  626. m_common_settings->DeleteGroup( pathEnvVariables );
  627. saveCommonSettings();
  628. // Overwrites externally defined environment variable until the next time the application
  629. // is run.
  630. for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )
  631. {
  632. wxLogTrace( traceEnvVars, wxT( "Setting local environment variable %s to %s." ),
  633. GetChars( it->first ), GetChars( it->second.GetValue() ) );
  634. wxSetEnv( it->first, it->second.GetValue() );
  635. }
  636. }
  637. void PGM_BASE::ConfigurePaths( wxWindow* aParent )
  638. {
  639. DIALOG_ENV_VAR_CONFIG dlg( aParent, GetLocalEnvVariables() );
  640. if( dlg.ShowModal() == wxID_CANCEL )
  641. return;
  642. ENV_VAR_MAP envVarMap = dlg.GetEnvVarMap();
  643. for( ENV_VAR_MAP_ITER it = envVarMap.begin(); it != envVarMap.end(); ++it )
  644. {
  645. wxLogTrace( traceEnvVars, wxT( "Environment variable %s=%s defined externally = %d" ),
  646. GetChars( it->first ), GetChars( it->second.GetValue() ),
  647. it->second.GetDefinedExternally() );
  648. }
  649. // If any of the environment variables are defined externally, warn the user that the
  650. // next time kicad is run that the externally defined variables will be used instead of
  651. // the user's settings. This is by design.
  652. if( dlg.ExternalDefsChanged() && m_show_env_var_dialog )
  653. {
  654. wxString msg1 = _( "Warning! Some of paths you have configured have been defined \n"
  655. "externally to the running process and will be temporarily overwritten." );
  656. wxString msg2 = _( "The next time KiCad is launched, any paths that have already\n"
  657. "been defined are honored and any settings defined in the path\n"
  658. "configuration dialog are ignored. If you did not intend for this\n"
  659. "behavior, either rename any conflicting entries or remove the\n"
  660. "external environment variable definition(s) from your system." );
  661. wxRichMessageDialog dlg( aParent, msg1, _( "Warning" ), wxOK | wxCENTRE );
  662. dlg.ShowDetailedText( msg2 );
  663. dlg.ShowCheckBox( _( "Do not show this message again." ) );
  664. dlg.ShowModal();
  665. m_show_env_var_dialog = !dlg.IsCheckBoxChecked();
  666. }
  667. SetLocalEnvVariables( dlg.GetEnvVarMap() );
  668. }