Example #1
0
void FindInFilesDialog::DoSearchReplace()
{
    SearchData data = DoGetSearchData();
    data.SetOwner(clMainFrame::Get()->GetOutputPane()->GetReplaceResultsTab());
    DoSaveOpenFiles();
    SearchThreadST::Get()->PerformSearch(data);
    Close();
}
Example #2
0
void FindInFilesDialog::DoSearch()
{
    SearchData data = DoGetSearchData();
    data.SetOwner(clMainFrame::Get()->GetOutputPane()->GetFindResultsTab());

    // check to see if we require to save the files
    DoSaveOpenFiles();
    SearchThreadST::Get()->PerformSearch(data);
    Close();
}
Example #3
0
SearchData TaskPanel::DoGetSearchData()
{
    SearchData data;
    data.SetDisplayScope(true);
    data.SetRegularExpression(true);
    data.SetMatchCase(false);
    data.SetMatchWholeWord(false);
    data.SetEncoding(m_choiceEncoding->GetStringSelection());
    data.SetOwner(this);

    wxString sfind;

    // Load all info from disk
    TasksPanelData d;
    EditorConfigST::Get()->ReadObject(wxT("TasksPanelData"), &d);

    std::map<wxString, wxString>::const_iterator iter = d.GetTasks().begin();
    for(; iter != d.GetTasks().end(); iter++) {
        wxString name = iter->first;
        wxString regex = iter->second;
        bool enabled = (d.GetEnabledItems().Index(iter->first) != wxNOT_FOUND);

        regex.Trim().Trim(false);
        wxRegEx re(regex);
        if(enabled && !regex.IsEmpty() && re.IsValid()) sfind << wxT("(") << regex << wxT(")|");
    }

    if(sfind.empty() == false) sfind.RemoveLast();

    data.SetFindString(sfind);

    wxString rootDir = m_scope->GetStringSelection();
    wxArrayString rootDirs;
    rootDirs.push_back(rootDir);
    data.SetRootDirs(rootDirs);

    wxArrayString files;
    if(rootDir == wxGetTranslation(SEARCH_IN_WORKSPACE)) {
        ManagerST::Get()->GetWorkspaceFiles(files);

    } else if(rootDir == wxGetTranslation(SEARCH_IN_PROJECT)) {
        ManagerST::Get()->GetActiveProjectFiles(files);

    } else if(rootDir == wxGetTranslation(SEARCH_IN_CURR_FILE_PROJECT)) {
        ManagerST::Get()->GetActiveFileProjectFiles(files);
    }
    data.SetFiles(files);
    data.SetExtensions(wxT("*.*"));

    return data;
}
Example #4
0
SearchData TaskPanel::DoGetSearchData()
{
    SearchData data;
    data.SetDisplayScope(true);
    data.SetRegularExpression(true);
    data.SetMatchCase(false);
    data.SetMatchWholeWord(false);
    data.SetEncoding(m_choiceEncoding->GetStringSelection());
    data.SetOwner(this);

    wxString sfind;

    // Load all info from disk
    TasksPanelData d;
    EditorConfigST::Get()->ReadObject(wxT("TasksPanelData"), &d);

    wxStringMap_t::const_iterator iter = d.GetTasks().begin();
    for(; iter != d.GetTasks().end(); iter++) {
        wxString name = iter->first;
        wxString regex = iter->second;
        bool enabled = (d.GetEnabledItems().Index(iter->first) != wxNOT_FOUND);

        regex.Trim().Trim(false);
        wxRegEx re(regex);
        if(enabled && !regex.IsEmpty() && re.IsValid()) sfind << wxT("(") << regex << wxT(")|");
    }

    if(sfind.empty() == false) sfind.RemoveLast();

    data.SetFindString(sfind);

    wxString rootDir = clWorkspaceManager::Get().GetWorkspace()->GetFileName().GetPath();
    wxArrayString rootDirs;
    rootDirs.push_back(rootDir);
    data.SetRootDirs(rootDirs);
    data.SetExtensions(wxT("*.*"));
    return data;
}