From 8518cc400489733be1e3490b3d601d4fe446b403 Mon Sep 17 00:00:00 2001 From: nicolas-f Date: Fri, 2 Sep 2016 11:04:19 +0200 Subject: [PATCH 1/2] Various fix Copy python dll on install isimpa Fix application folder for language selection Fix toolbar drawing issue by forcing slider to 16 pixel height --- src/isimpa/CMakeLists.txt | 13 +++++++++++++ src/isimpa/IHM/languageSelection.cpp | 3 +-- src/isimpa/data_manager/appconfig.cpp | 2 +- src/isimpa/main/i_simpa_main.cpp | 21 ++++++--------------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/isimpa/CMakeLists.txt b/src/isimpa/CMakeLists.txt index ea98b1c9..10151010 100644 --- a/src/isimpa/CMakeLists.txt +++ b/src/isimpa/CMakeLists.txt @@ -474,11 +474,24 @@ DESTINATION .) # Copy python ressources required by boost python runtime if(WIN32) # Check if we are on Windows + SET(CMAKE_FIND_LIBRARY_PREFIXES "") + SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll") + + find_library( + PYTHON_DLL + NAMES Python27.dll + ) + + MESSAGE(STATUS "Python dll ${PYTHON_DLL}") get_filename_component(PYTHON_ROOT_FOLDER ${PYTHON_EXECUTABLE} PATH) set(PYTHON_LIB_FOLDER ${PYTHON_ROOT_FOLDER}/Lib) install(DIRECTORY ${PYTHON_ROOT_FOLDER}/Lib DESTINATION .) + + install (FILES + ${PYTHON_DLL} + DESTINATION .) endif() # Package creation instructions, NSIS under windows diff --git a/src/isimpa/IHM/languageSelection.cpp b/src/isimpa/IHM/languageSelection.cpp index 7ef8c4eb..98d8333b 100644 --- a/src/isimpa/IHM/languageSelection.cpp +++ b/src/isimpa/IHM/languageSelection.cpp @@ -112,12 +112,11 @@ LanguageSelector::LanguageSelector(wxWindow *parent, Canonical_lng = langInfo.CanonicalName; ISO3166_lng=Canonical_lng.Mid(Canonical_lng.rfind("_")+1).Lower(); ISO639_lng=Canonical_lng.Left(Canonical_lng.rfind("_")).Lower(); - if(lngFolders.Index(ressourceFolder+Canonical_lng)>=0)//lngFolders.Index(ressourceFolder+ISO639_lng)>=0 || lngFolders.Index(ressourceFolder+Canonical_lng)>=0 ) + if(lngFolders.Index(ressourceFolder+Canonical_lng)>=0) { if(systemLanguage==idlang) defaultSelection=flagList->GetItemCount(); wxString flag_filepath=flagsFolder+wxString::Format("%s.png",ISO3166_lng); - //if(wxFileExists(flag_filepath)) if(flagsFileName.Index(flag_filepath)>=0) { wxIcon flagImage(flag_filepath, wxBITMAP_TYPE_PNG); diff --git a/src/isimpa/data_manager/appconfig.cpp b/src/isimpa/data_manager/appconfig.cpp index c35b5dc9..b115e978 100644 --- a/src/isimpa/data_manager/appconfig.cpp +++ b/src/isimpa/data_manager/appconfig.cpp @@ -639,7 +639,7 @@ bool ApplicationConfiguration::IsIdDirectivityExist(int idDirectivity) } wxString ApplicationConfiguration::getResourcesFolder() { - return wxPathOnly(wxStandardPaths::Get().GetExecutablePath()); + return wxPathOnly(wxStandardPaths::Get().GetExecutablePath())+wxFileName::GetPathSeparator(); } std::vector ApplicationConfiguration::GetLstDirectivity() diff --git a/src/isimpa/main/i_simpa_main.cpp b/src/isimpa/main/i_simpa_main.cpp index b14b358a..b19343e1 100644 --- a/src/isimpa/main/i_simpa_main.cpp +++ b/src/isimpa/main/i_simpa_main.cpp @@ -426,7 +426,7 @@ MainUiFrame::MainUiFrame(wxLocale &lang) : wxFrame(NULL, -1, _("Interface ")+APP toolbarGl = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); - slPlan = new wxSlider(toolbarGl, ID_slPlan, 0, 0, 1000,wxDefaultPosition,wxSize(100,-1)); + slPlan = new wxSlider(toolbarGl, ID_slPlan, 0, 0, 1000,wxDefaultPosition,wxSize(100,16)); xPlan = new wxRadioButton(toolbarGl,ID_xPlan,"x",wxDefaultPosition,wxDefaultSize,wxRB_GROUP ); yPlan = new wxRadioButton(toolbarGl,ID_yPlan,"y"); zPlan = new wxRadioButton(toolbarGl,ID_zPlan,"z"); @@ -436,11 +436,11 @@ MainUiFrame::MainUiFrame(wxLocale &lang) : wxFrame(NULL, -1, _("Interface ")+APP wxToolBar* tbProjet= new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER ); mousetool= new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); - mousetool->SetToolBitmapSize(wxSize(16,20)); - toolbarGl->SetToolBitmapSize(wxSize(16,20)); - simulation->SetToolBitmapSize(wxSize(16,20)); - visualisation->SetToolBitmapSize(wxSize(16,20)); - tbProjet->SetToolBitmapSize(wxSize(16,20)); + mousetool->SetToolBitmapSize(wxSize(16,16)); + toolbarGl->SetToolBitmapSize(wxSize(16,16)); + simulation->SetToolBitmapSize(wxSize(16,16)); + visualisation->SetToolBitmapSize(wxSize(16,16)); + tbProjet->SetToolBitmapSize(wxSize(16,16)); wxString ressourceFolder=ApplicationConfiguration::getResourcesFolder(); @@ -484,14 +484,6 @@ MainUiFrame::MainUiFrame(wxLocale &lang) : wxFrame(NULL, -1, _("Interface ")+APP visualisation->Realize(); tbProjet->Realize(); mousetool->Realize(); -/* - wxAuiNotebook* glFrameNotebook = new wxAuiNotebook(this, wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS ); - glFrameNotebook->AddPage(&(*(GlFrame)), _("Vue 3D") , true); -*/ - m_mgr.AddPane(GlFrame.get(), wxAuiPaneInfo().Name("3Dview").Caption(_("Main window")). CenterPane()); @@ -1045,7 +1037,6 @@ void MainUiFrame::OnSaveToProject(wxCommandEvent& event) int MainUiFrame::AskApplicationLanguage(int defaultLanguage) { int choosenLanguage=defaultLanguage; -// LanguageSelector langSelection(NULL,_("Please choose language:"),_("Language"),ApplicationConfiguration::CONST_RESOURCE_FOLDER,ApplicationConfiguration::CONST_RESOURCE_FOLDER+ApplicationConfiguration::CONST_RESOURCE_DATA_FOLDER+wxString("flags")+wxFileName::GetPathSeparator()); LanguageSelector langSelection(NULL,_("Please choose language:"),_("Language"),ApplicationConfiguration::getResourcesFolder()+wxString("locale")+wxFileName::GetPathSeparator(),ApplicationConfiguration::getResourcesFolder()+ApplicationConfiguration::CONST_RESOURCE_BITMAP_FOLDER+wxString("flags")+wxFileName::GetPathSeparator()); wxInt32 choice=langSelection.ShowModal(); if(choice==wxID_OK) From 239d6662c37d79c20f372b2e4034ec1908f90fc3 Mon Sep 17 00:00:00 2001 From: nicolas-f Date: Fri, 2 Sep 2016 11:56:59 +0200 Subject: [PATCH 2/2] Automatic version update in source files --- CMakeLists.txt | 4 ++-- src/isimpa/CMakeLists.txt | 11 +++++++---- src/isimpa/data_manager/appconfig.cpp | 3 --- src/isimpa/data_manager/appconfig_version.cpp.in | 5 +++++ src/isimpa/main/i_simpa_main.cpp | 4 ++-- 5 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/isimpa/data_manager/appconfig_version.cpp.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 15600164..8f90f9e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.6.0) # Maps to a solution file (isimpa.sln). The solution will # have all targets (exe, lib, dll) as projects (.vcproj) -project (isimpa) +project (isimpa VERSION 1.3.1) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/bin" CACHE PATH "default install path" FORCE ) diff --git a/src/isimpa/CMakeLists.txt b/src/isimpa/CMakeLists.txt index 10151010..80ba4443 100644 --- a/src/isimpa/CMakeLists.txt +++ b/src/isimpa/CMakeLists.txt @@ -371,6 +371,8 @@ ADD_CUSTOM_COMMAND( # Before using element_pywrap.cpp build enum_def.cpp set_property(SOURCE data_manager/python_interface/py_ui_module/element_pywrap.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/enum_def.cpp) +configure_file(data_manager/appconfig_version.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/generated/appconfig_version.cpp ) + # Set Properties->General->Configuration Type to Application # Creates isimpa with the listed sources # Adds sources to the Solution Explorer @@ -394,7 +396,8 @@ add_executable(isimpa ${MAIN_SOURCES} ${MANAGER_SOURCES} ${ISIMPA_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/enum_def.cpp) + ${CMAKE_CURRENT_BINARY_DIR}/enum_def.cpp + ${CMAKE_CURRENT_BINARY_DIR}/generated/appconfig_version.cpp) # Creates a folder "executables" and adds target # project (isimpa.vcproj) under it @@ -506,9 +509,9 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "I-SIMPA") SET(CPACK_PACKAGE_VENDOR "Ifsttar") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/DESCRIPTION.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.md") -SET(CPACK_PACKAGE_VERSION_MAJOR "1") -SET(CPACK_PACKAGE_VERSION_MINOR "3") -SET(CPACK_PACKAGE_VERSION_PATCH "0") +SET(CPACK_PACKAGE_VERSION_MAJOR ${isimpa_VERSION_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${isimpa_VERSION_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${isimpa_VERSION_PATCH}) SET(CPACK_PACKAGE_INSTALL_DIRECTORY "I-SIMPA") IF(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make diff --git a/src/isimpa/data_manager/appconfig.cpp b/src/isimpa/data_manager/appconfig.cpp index b115e978..54844baa 100644 --- a/src/isimpa/data_manager/appconfig.cpp +++ b/src/isimpa/data_manager/appconfig.cpp @@ -86,9 +86,6 @@ const wxString ApplicationConfiguration::CONST_CORE_PATH=wxString("core") + wxFi const wxString ApplicationConfiguration::CONST_PREPROCESS_EXE_PATH=ApplicationConfiguration::CONST_TETROOT_PATH+"tetgen"+wxFileName::GetPathSeparator(); const wxString ApplicationConfiguration::CONST_STATIC_XML_FILE="appconst.xml"; //const unsigned long ApplicationConfiguration::CONST_WORKINGLIMIT=1325329200; -const int ApplicationConfiguration::SPPS_UI_VERSION_MAJOR=1; -const int ApplicationConfiguration::SPPS_UI_VERSION_MINOR=3; -const int ApplicationConfiguration::SPPS_UI_VERSION_REVISION=0; diff --git a/src/isimpa/data_manager/appconfig_version.cpp.in b/src/isimpa/data_manager/appconfig_version.cpp.in new file mode 100644 index 00000000..e29ebad3 --- /dev/null +++ b/src/isimpa/data_manager/appconfig_version.cpp.in @@ -0,0 +1,5 @@ +#include "data_manager/appconfig.h" + +const int ApplicationConfiguration::SPPS_UI_VERSION_MAJOR=@isimpa_VERSION_MAJOR@; +const int ApplicationConfiguration::SPPS_UI_VERSION_MINOR=@isimpa_VERSION_MINOR@; +const int ApplicationConfiguration::SPPS_UI_VERSION_REVISION=@isimpa_VERSION_PATCH@; \ No newline at end of file diff --git a/src/isimpa/main/i_simpa_main.cpp b/src/isimpa/main/i_simpa_main.cpp index b19343e1..974d1476 100644 --- a/src/isimpa/main/i_simpa_main.cpp +++ b/src/isimpa/main/i_simpa_main.cpp @@ -886,14 +886,14 @@ void MainUiFrame::OnShowPreferenceTree(wxCommandEvent& event) void MainUiFrame::OnShowAboutDialog(wxCommandEvent& event) { wxAboutDialogInfo aboutDlg; - aboutDlg.SetVersion(wxString::Format("2014 [%i.%i.%i]",ApplicationConfiguration::SPPS_UI_VERSION_MAJOR,ApplicationConfiguration::SPPS_UI_VERSION_MINOR,ApplicationConfiguration::SPPS_UI_VERSION_REVISION)); + aboutDlg.SetVersion(wxString::Format("[%i.%i.%i]",ApplicationConfiguration::SPPS_UI_VERSION_MAJOR,ApplicationConfiguration::SPPS_UI_VERSION_MINOR,ApplicationConfiguration::SPPS_UI_VERSION_REVISION)); aboutDlg.SetName(APPLICATION_NAME); aboutDlg.SetWebSite(wxT("http://i-simpa.ifsttar.fr")); //aboutDlg.SetLicence(GetLicenseText()); aboutDlg.SetLicence("I-Simpa is an open source software (GPL v3)."); aboutDlg.AddDeveloper("Nicolas FORTIN (Ifsttar)"); aboutDlg.AddDeveloper("Judicaƫl PICAUT (Ifsttar)"); - aboutDlg.SetCopyright("(c) 2014 - Ifsttar "); + aboutDlg.SetCopyright("(c) Ifsttar "); //wxArraySting devs; //devs.