Advertisement
Guest User

Multi ExcludeConfigForFile

a guest
Dec 21st, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.88 KB | None | 0 0
  1. diff --git a/LiteEditor/fileview.cpp b/LiteEditor/fileview.cpp
  2. index 2e8dac4..c10d2c5 100644
  3. --- a/LiteEditor/fileview.cpp
  4. +++ b/LiteEditor/fileview.cpp
  5. @@ -2237,47 +2237,53 @@ void FileViewTree::OnCleanProjectOnlyInternal(wxCommandEvent& e)
  6.  
  7.  void FileViewTree::OnExcludeFromBuild(wxCommandEvent& e)
  8.  {
  9. -    wxUnusedVar( e );
  10. -    wxTreeItemId item = GetSingleSelection();
  11. -    if ( item.IsOk() ) {
  12. -        FilewViewTreeItemData *data = static_cast<FilewViewTreeItemData*>( GetItemData( item ) );
  13. -        if (data->GetData().GetKind() == ProjectItem::TypeFile) {
  14. -            Manager *mgr = ManagerST::Get();
  15. -            wxTreeItemId parent = GetItemParent( item );
  16. -            if ( parent.IsOk() ) {
  17. -                wxString path = GetItemPath( parent );
  18. -                wxString proj = path.BeforeFirst(wxT(':'));
  19. -                ProjectPtr p = mgr->GetProject(proj);
  20. -                if ( p ) {
  21. -                    wxString vdPath   = path.AfterFirst(':');
  22. -                    wxString filename = data->GetData().GetFile();
  23. -                    
  24. -                    BuildConfigPtr buildConf = WorkspaceST::Get()->GetProjBuildConf(proj, "");
  25. -                    if ( !buildConf ) {
  26. -                        return;
  27. -                    }
  28. -                    
  29. -                    wxString current_build_config = buildConf->GetName();
  30. -                    
  31. -                    wxArrayString configs = p->GetExcludeConfigForFile( filename, vdPath );
  32. -                    
  33. -                    if ( e.IsChecked() ) {
  34. -                        configs.Add( current_build_config );
  35. -                        //SetItemTextColour(item, wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) );
  36. -        
  37. -                    } else {
  38. -                        int where = configs.Index(current_build_config);
  39. -                        if ( where != wxNOT_FOUND ) {
  40. -                            configs.RemoveAt(where);
  41. -                        }
  42. -                        
  43. -                        //SetItemTextColour(item, DrawingUtils::GetOutputPaneFgColour() );
  44. -                    }
  45. -                    p->SetExcludeConfigForFile( filename, vdPath, configs);
  46. -                }
  47. -            }
  48. -        }
  49. -    }
  50. +   wxUnusedVar( e );
  51. +
  52. +   wxArrayTreeItemIds selections;
  53. +   size_t count = GetSelections(selections);
  54. +   for( int selectionIndex=0; selectionIndex<count; selectionIndex++)
  55. +   {
  56. +       wxTreeItemId item = selections[selectionIndex];
  57. +       if ( item.IsOk() ) {
  58. +           FilewViewTreeItemData *data = static_cast<FilewViewTreeItemData*>( GetItemData( item ) );
  59. +           if (data->GetData().GetKind() == ProjectItem::TypeFile) {
  60. +               Manager *mgr = ManagerST::Get();
  61. +               wxTreeItemId parent = GetItemParent( item );
  62. +               if ( parent.IsOk() ) {
  63. +                   wxString path = GetItemPath( parent );
  64. +                   wxString proj = path.BeforeFirst(wxT(':'));
  65. +                   ProjectPtr p = mgr->GetProject(proj);
  66. +                   if ( p ) {
  67. +                       wxString vdPath   = path.AfterFirst(':');
  68. +                       wxString filename = data->GetData().GetFile();
  69. +                      
  70. +                       BuildConfigPtr buildConf = WorkspaceST::Get()->GetProjBuildConf(proj, "");
  71. +                       if ( !buildConf ) {
  72. +                           return;
  73. +                       }
  74. +                      
  75. +                       wxString current_build_config = buildConf->GetName();
  76. +                      
  77. +                       wxArrayString configs = p->GetExcludeConfigForFile( filename, vdPath );
  78. +                      
  79. +                       if ( e.IsChecked() ) {
  80. +                           configs.Add( current_build_config );
  81. +                           //SetItemTextColour(item, wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) );
  82. +          
  83. +                       } else {
  84. +                           int where = configs.Index(current_build_config);
  85. +                           if ( where != wxNOT_FOUND ) {
  86. +                               configs.RemoveAt(where);
  87. +                           }
  88. +                          
  89. +                           //SetItemTextColour(item, DrawingUtils::GetOutputPaneFgColour() );
  90. +                       }
  91. +                       p->SetExcludeConfigForFile( filename, vdPath, configs);
  92. +                   }
  93. +               }
  94. +           }
  95. +       }
  96. +   }
  97.  }
  98.  
  99.  void FileViewTree::OnExcludeFromBuildUI(wxUpdateUIEvent& event)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement