From 2fbe144735d7c45aba920acbbbb9f74889fd5c62 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Wed, 30 Apr 2008 12:35:23 +0000 Subject: [PATCH] beautify --- kicad/prjconfig.cpp | 83 ++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index 485b06c506..86482fe548 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -1,7 +1,7 @@ - /*************************************************************/ - /** prjconfig.cpp : load and save configuration (file *.pro) */ - /*************************************************************/ - +/*************************************************************/ +/** prjconfig.cpp : load and save configuration (file *.pro) */ +/*************************************************************/ + #ifdef KICAD_PYTHON #include @@ -20,25 +20,26 @@ void WinEDA_MainFrame::Load_Prj_Config() /*******************************************/ { + if( !wxFileExists( m_PrjFileName ) ) + { + wxString msg = _( "Project File <" ) + m_PrjFileName + _( "> not found" ); + DisplayError( this, msg ); + return; + } - if ( ! wxFileExists(m_PrjFileName) ) - { - wxString msg = _("Project File <") + m_PrjFileName + _("> not found"); - DisplayError(this, msg); - return; - } + wxSetWorkingDirectory( wxPathOnly( m_PrjFileName ) ); + SetTitle( g_Main_Title + wxT( " " ) + GetBuildVersion() + wxT( " " ) + m_PrjFileName ); + ReCreateMenuBar(); + m_LeftWin->ReCreateTreePrj(); - wxSetWorkingDirectory(wxPathOnly(m_PrjFileName) ); - SetTitle(g_Main_Title + wxT(" ") + GetBuildVersion() + wxT(" ") + m_PrjFileName); - ReCreateMenuBar(); - m_LeftWin->ReCreateTreePrj(); + wxString msg = _( "\nWorking dir: " ) + wxGetCwd(); + msg << _( "\nProject: " ) << m_PrjFileName << wxT( "\n" ); + PrintMsg( msg ); - wxString msg = _("\nWorking dir: ") + wxGetCwd(); - msg << _("\nProject: ") << m_PrjFileName << wxT("\n"); - PrintMsg(msg); - #ifdef KICAD_PYTHON - PyHandler::GetInstance()->TriggerEvent( wxT("kicad::LoadProject"), PyHandler::Convert(m_PrjFileName) ); - #endif +#ifdef KICAD_PYTHON + PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::LoadProject" ), + PyHandler::Convert( m_PrjFileName ) ); +#endif } @@ -46,27 +47,31 @@ void WinEDA_MainFrame::Load_Prj_Config() void WinEDA_MainFrame::Save_Prj_Config() /*********************************************/ { -wxString FullFileName; -wxString mask( wxT("*")); - - g_Prj_Config_Filename_ext = wxT(".pro"); - mask += g_Prj_Config_Filename_ext; - FullFileName = m_PrjFileName; - ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext); + wxString FullFileName; - FullFileName = EDA_FileSelector(_("Save project file"), - wxGetCwd(), /* Chemin par defaut */ - FullFileName, /* nom fichier par defaut */ - g_Prj_Config_Filename_ext, /* extension par defaut */ - mask, /* Masque d'affichage */ - this, - wxFD_SAVE, - TRUE - ); - if ( FullFileName.IsEmpty() ) return; + wxString mask( wxT( "*" ) ); - /* ecriture de la configuration */ - g_EDA_Appl->WriteProjectConfig(FullFileName, wxT("/general"), CfgParamList); + g_Prj_Config_Filename_ext = wxT( ".pro" ); + mask += g_Prj_Config_Filename_ext; + FullFileName = m_PrjFileName; + ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext ); + + FullFileName = EDA_FileSelector( _( "Save project file" ), + wxGetCwd(), /* Chemin par defaut */ + FullFileName, /* nom fichier par defaut */ + g_Prj_Config_Filename_ext, /* extension par defaut */ + mask, /* Masque d'affichage */ + this, + wxFD_SAVE, + TRUE + ); + + if( FullFileName.IsEmpty() ) + return; + + /* ecriture de la configuration */ + g_EDA_Appl->WriteProjectConfig( FullFileName, wxT( "/general" ), CfgParamList ); } + // vim: set tabstop=4 : noexpandtab :