Skip to content

Commit

Permalink
Merge pull request #46 from nicolas-f/fix_bin_paths
Browse files Browse the repository at this point in the history
Release fix
  • Loading branch information
nicolas-f authored Sep 2, 2016
2 parents 0db5cc1 + 239d666 commit 501886c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 29 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 )
Expand Down
24 changes: 20 additions & 4 deletions src/isimpa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -474,11 +477,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
Expand All @@ -493,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
Expand Down
3 changes: 1 addition & 2 deletions src/isimpa/IHM/languageSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/isimpa/data_manager/appconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;



Expand Down Expand Up @@ -639,7 +636,7 @@ bool ApplicationConfiguration::IsIdDirectivityExist(int idDirectivity)
}

wxString ApplicationConfiguration::getResourcesFolder() {
return wxPathOnly(wxStandardPaths::Get().GetExecutablePath());
return wxPathOnly(wxStandardPaths::Get().GetExecutablePath())+wxFileName::GetPathSeparator();
}

std::vector<ApplicationConfiguration::t_lstDirectiv> ApplicationConfiguration::GetLstDirectivity()
Expand Down
5 changes: 5 additions & 0 deletions src/isimpa/data_manager/appconfig_version.cpp.in
Original file line number Diff line number Diff line change
@@ -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@;
25 changes: 8 additions & 17 deletions src/isimpa/main/i_simpa_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();

Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -894,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 <[email protected]>");
aboutDlg.SetCopyright("(c) Ifsttar <[email protected]>");

//wxArraySting devs;
//devs.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 501886c

Please sign in to comment.