diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index f27b91cd22..1fa78eb0b4 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -339,8 +339,15 @@ void DIALOG_CONFIGURE_PATHS::OnGridCellChanging( wxGridEvent& event ) } else if( col == EV_NAME_COL && m_EnvVars->GetCellValue( row, EV_NAME_COL ) != text ) { - // Changing name; clear external flag - m_EnvVars->SetCellValue( row, EV_FLAG_COL, wxEmptyString ); + if( text == PROJECT_VAR_NAME ) // This env var name is reserved and cannot be added here: + { + wxMessageBox( wxString::Format( + _( "The name %s is reserved, and cannot be used here" ), + PROJECT_VAR_NAME ) ); + event.Veto(); + } + else // Changing name; clear external flag + m_EnvVars->SetCellValue( row, EV_FLAG_COL, wxEmptyString ); } } } diff --git a/common/dialogs/dialog_configure_paths_base.fbp b/common/dialogs/dialog_configure_paths_base.fbp index 68978cf609..c56d63329c 100644 --- a/common/dialogs/dialog_configure_paths_base.fbp +++ b/common/dialogs/dialog_configure_paths_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_configure_paths_base 1000 none + 1 DIALOG_CONFIGURE_PATHS_BASE @@ -52,41 +53,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnUpdateUI @@ -105,7 +71,6 @@ wxVERTICAL 1 none - 5 wxEXPAND|wxBOTTOM @@ -132,10 +97,10 @@ wxALIGN_TOP 0 1 - wxALIGN_CENTRE + wxALIGN_CENTER 22 "Name" "Path" - wxALIGN_CENTRE + wxALIGN_CENTER 2 150,454 @@ -178,10 +143,10 @@ 1 Resizable - wxALIGN_CENTRE + wxALIGN_CENTER 0 - wxALIGN_CENTRE + wxALIGN_CENTER 1 1 @@ -192,61 +157,8 @@ - - - OnGridCellChange - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnGridSize - @@ -280,6 +192,7 @@ 1 1 + 0 0 @@ -293,9 +206,10 @@ 0 0 - wxID_ANY Add Environment Variable + + 0 0 @@ -310,8 +224,9 @@ protected 1 + + Resizable - 1 @@ -326,29 +241,6 @@ OnAddEnvVar - - - - - - - - - - - - - - - - - - - - - - - @@ -383,6 +275,7 @@ 1 1 + 0 0 @@ -396,9 +289,10 @@ 0 0 - wxID_ANY Delete Environment Variable + + 0 0 @@ -413,8 +307,9 @@ protected 1 + + Resizable - 1 @@ -429,29 +324,6 @@ OnRemoveEnvVar - - - - - - - - - - - - - - - - - - - - - - - @@ -470,7 +342,6 @@ wxVERTICAL 1 protected - 5 wxEXPAND|wxBOTTOM @@ -497,10 +368,10 @@ wxALIGN_TOP 0 1 - wxALIGN_CENTRE + wxALIGN_CENTER 22 "Alias" "Path" "Description" - wxALIGN_CENTRE + wxALIGN_CENTER 3 150,300,154 @@ -543,10 +414,10 @@ 1 Resizable - wxALIGN_CENTRE + wxALIGN_CENTER 0 - wxALIGN_CENTRE + wxALIGN_CENTER 1 1 @@ -557,61 +428,8 @@ - - - OnGridCellChange - - OnGridCellRightClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -645,6 +463,7 @@ 1 1 + 0 0 @@ -658,9 +477,10 @@ 0 0 - wxID_ANY Add Path + + 0 0 @@ -675,8 +495,9 @@ protected 1 + + Resizable - 1 @@ -691,29 +512,6 @@ OnAddSearchPath - - - - - - - - - - - - - - - - - - - - - - - @@ -738,6 +536,7 @@ 1 1 + 0 0 @@ -751,9 +550,10 @@ 0 0 - wxID_ANY Move Up + + 0 0 @@ -768,8 +568,9 @@ protected 1 + + Resizable - 1 @@ -784,29 +585,6 @@ OnSearchPathMoveUp - - - - - - - - - - - - - - - - - - - - - - - @@ -831,6 +609,7 @@ 1 1 + 0 0 @@ -844,9 +623,10 @@ 0 0 - wxID_ANY Move Down + + 0 0 @@ -861,8 +641,9 @@ protected 1 + + Resizable - 1 @@ -877,29 +658,6 @@ OnSearchPathMoveDown - - - - - - - - - - - - - - - - - - - - - - - @@ -934,6 +692,7 @@ 1 1 + 0 0 @@ -947,9 +706,10 @@ 0 0 - wxID_ANY Delete Path + + 0 0 @@ -964,8 +724,9 @@ protected 1 + + Resizable - 1 @@ -980,29 +741,6 @@ OnDeleteSearchPath - - - - - - - - - - - - - - - - - - - - - - - @@ -1025,14 +763,7 @@ m_sdbSizer protected - - - OnHelp - - - - diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 55c192a8be..182d56da4d 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -612,6 +612,12 @@ void PGM_BASE::loadCommonSettings() { wxLogTrace( traceEnvVars, "Enumerating over entry %s, %ld.", GetChars( entry ), index ); + + // Do not store the env var PROJECT_VAR_NAME ("KIPRJMOD") definition if for some reason + // it is found in config. (It is reserved and defined as project path) + if( entry == PROJECT_VAR_NAME ) + continue; + entries.Add( entry ); } @@ -626,7 +632,9 @@ void PGM_BASE::loadCommonSettings() } for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it ) + { SetLocalEnvVariable( it->first, it->second.GetValue() ); + } m_common_settings->SetPath( oldPath ); }