Commit b08a3bb3 authored by dickelbeck's avatar dickelbeck
Browse files

added comment

parent afb2eb9b
Loading
Loading
Loading
Loading
+74 −67
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ bool TreePrjItemData::Rename( const wxString& name, bool check )
    //this is broken & unsafe to use on linux.
    if( m_Type == TREE_DIRECTORY )
        return false;
    
    if( name.IsEmpty() )
        return false;

@@ -282,8 +283,7 @@ bool TreePrjItemData::Rename( const wxString& name, bool check )
    if( check && !ext.IsEmpty() && !reg.Matches( newFile ) )
    {
        wxMessageDialog dialog( m_Parent,
                                           _(
                                               "Changing file extension will change file type.\n Do you want to continue ?" ),
          _( "Changing file extension will change file type.\n Do you want to continue ?" ),
          _( "Rename File" ),
          wxYES_NO | wxICON_QUESTION );

@@ -367,8 +367,10 @@ void TreePrjItemData::Activate(WinEDA_PrjFrame* prjframe)
        break;

    case TREE_DIRECTORY:
		if(prjframe){
        if( prjframe )
        {
            dir = new wxDir( FullFileName );

            count = 0;
            if( dir && dir->IsOpened() && dir->GetFirst( &dir_filename ) )
            {
@@ -376,28 +378,33 @@ void TreePrjItemData::Activate(WinEDA_PrjFrame* prjframe)
                {
                    wxString fil = FullFileName + sep + dir_filename;

					if( prjframe->AddFile(fil, id) ){
                    if( prjframe->AddFile( fil, id ) )
                    {
                        count++;
                    }
                } while( dir->GetNext( &dir_filename ) );
            }
            
            if( count == 0 )
            {
                /*  The AddFile() text below should match the filter added to handle
                    it in treeprj_frame.cpp in the line looking like this:
                    m_Filters.push_back( wxT( "^no kicad files found" ) );
                */
				prjframe->AddFile( wxString(_("no kicad files found in this directory")), id ); 
            }
            
            /* Sort filenames by alphabetic order */
            m_Parent->SortChildren( id );
			if(dir) delete dir; 
            delete dir;
        }
        m_Parent->Toggle( id );
        break;

    case TREE_SCHEMA:
    {
        AddDelimiterString( FullFileName );
        ExecuteFile( m_Parent, EESCHEMA_EXE, FullFileName );
        break;
    }

    case TREE_PCB:
        AddDelimiterString( FullFileName );