~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/codesnippets/Search/ThreadSearchConfPanel.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************
 
2
 * Name:      ThreadSearchConfPanel
 
3
 * Purpose:   This class implements the configuration panel used
 
4
 *            in modal dialog called on "Options" button click
 
5
 *            and by C::B on "Environment" settings window.
 
6
 * Author:    Jerome ANTOINE
 
7
 * Created:   2007-10-08
 
8
 * Copyright: Jerome ANTOINE
 
9
 * License:   GPL
 
10
 **************************************************************/
 
11
 
 
12
#include <sdk.h> // Code::Blocks SDK
 
13
#ifndef CB_PRECOMP
 
14
        #include <wx/checkbox.h>
 
15
        #include <wx/radiobox.h>
 
16
        #include <wx/sizer.h>
 
17
        #include <wx/statbox.h>
 
18
        #include <wx/stattext.h>
 
19
#endif
 
20
 
 
21
#include "ThreadSearch.h"
 
22
#include "SearchInPanel.h"
 
23
#include "DirectoryParamsPanel.h"
 
24
#include "ThreadSearchConfPanel.h"
 
25
#include "ThreadSearchControlIds.h"
 
26
#include "ThreadSearchViewManagerBase.h"
 
27
#include "ThreadSearchFindData.h"
 
28
#include "InsertIndexManager.h"
 
29
 
 
30
// begin wxGlade: ::extracode
 
31
 
 
32
// end wxGlade
 
33
 
 
34
 
 
35
ThreadSearchConfPanel::ThreadSearchConfPanel(ThreadSearch& threadSearchPlugin, wxWindow* parent,wxWindowID id)
 
36
                                          :m_ThreadSearchPlugin(threadSearchPlugin)
 
37
{
 
38
    Create(parent,id,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL);
 
39
 
 
40
    // begin wxGlade: ThreadSearchConfPanel::ThreadSearchConfPanel
 
41
    SizerOptions_staticbox = new wxStaticBox(this, -1, wxT("Options"));
 
42
    SizerThreadSearchOptions_staticbox = new wxStaticBox(this, -1, wxT("Snippets search options"));
 
43
    SizerThreadSearchLayoutGlobal_staticbox = new wxStaticBox(this, -1, wxT("Show/Hide"));
 
44
    SizerListControlOptions_staticbox = new wxStaticBox(this, -1, wxT("List control options"));
 
45
    SizerThreadSearchLayout_staticbox = new wxStaticBox(this, -1, wxT("Layout"));
 
46
    SizerSearchIn_staticbox = new wxStaticBox(this, -1, wxT("Search in"));
 
47
    m_pPnlSearchIn = new SearchInPanel(this, wxID_ANY);
 
48
    m_pPnlDirParams = new DirectoryParamsPanel(this, wxID_ANY);
 
49
    m_pChkWholeWord = new wxCheckBox(this, idChkWholeWord, wxT("Whole word"));
 
50
    m_pChkStartWord = new wxCheckBox(this, idChkStartWord, wxT("Start word"));
 
51
    m_pChkMatchCase = new wxCheckBox(this, idChkMatchCase, wxT("Match case"));
 
52
    m_pChkRegExp = new wxCheckBox(this, idChkRegularExpression, wxT("Regular expression"));
 
53
    m_pChkThreadSearchEnable = new wxCheckBox(this, idChkThreadSearchEnable, wxT("Enable 'Find occurrences' contextual menu item"));
 
54
    m_pChkUseDefaultOptionsForThreadSearch = new wxCheckBox(this, idChkUseDefaultOptionsOnThreadSearch, wxT("Use default options when running 'Find occurrences' "));
 
55
    //-moved-below-m_pChkShowThreadSearchToolBar = new wxCheckBox(this, idChkViewThreadSearchToolBar, wxT("Show ThreadSearch toolbar."));
 
56
    m_pChkShowThreadSearchWidgets = new wxCheckBox(this, idChkShowThreadSearchWidgets, wxT("Show search widgets in ThreadSearch Messages panel."));
 
57
    m_pChkShowCodePreview = new wxCheckBox(this, idChkShowCodePreview, wxT("Show code preview editor."));
 
58
    m_pChkShowThreadSearchToolBar = new wxCheckBox(this, idChkViewThreadSearchToolBar, wxT("Show ThreadSearch toolbar."));
 
59
    m_pChkDisplayLogHeaders = new wxCheckBox(this, idChkDisplayLogHeaders, wxT("Display header in log window."));
 
60
    m_pChkDrawLogLines = new wxCheckBox(this, idChkDrawLogLines, wxT("Draw lines between log columns."));
 
61
 
 
62
    const wxString m_pRadPanelManagement_choices[] = {
 
63
        wxT("Messages notebook"),
 
64
        wxT("Layout")
 
65
    };
 
66
    m_pRadPanelManagement = new wxRadioBox(this, wxID_ANY, wxT("SnippetsSearch panel management by"), wxDefaultPosition, wxDefaultSize, 2, m_pRadPanelManagement_choices, 1, wxRA_SPECIFY_ROWS);
 
67
 
 
68
    const wxString m_pRadLoggerType_choices[] = {
 
69
        wxT("List"),
 
70
        wxT("Tree")
 
71
    };
 
72
    m_pRadLoggerType = new wxRadioBox(this, wxID_ANY, wxT("Logger type"), wxDefaultPosition, wxDefaultSize, 2, m_pRadLoggerType_choices, 1, wxRA_SPECIFY_ROWS);
 
73
 
 
74
    const wxString m_pRadSplitterWndMode_choices[] = {
 
75
        wxT("Horizontal"),
 
76
        wxT("Vertical")
 
77
    };
 
78
    m_pRadSplitterWndMode = new wxRadioBox(this, wxID_ANY, wxT("Splitter window mode"), wxDefaultPosition, wxDefaultSize, 2, m_pRadSplitterWndMode_choices, 1, wxRA_SPECIFY_ROWS);
 
79
 
 
80
    const wxString m_pRadSortBy_choices[] = {
 
81
        wxT("file path"),
 
82
        wxT("file name")
 
83
    };
 
84
    m_pRadSortBy = new wxRadioBox(this, wxID_ANY, wxT("Sort results by"), wxDefaultPosition, wxDefaultSize, 2, m_pRadSortBy_choices, 1, wxRA_SPECIFY_ROWS);
 
85
 
 
86
    set_properties();
 
87
    do_layout();
 
88
    // end wxGlade
 
89
 
 
90
    // CodeSnippets does not show the SearchToolBar or use Layout options
 
91
    m_pChkShowThreadSearchToolBar->Show(false); //(pecan 2008/5/22)
 
92
    m_pRadPanelManagement->Show(false);         //(pecan 2008/5/22)
 
93
    // Not yet supported
 
94
    //SizerThreadSearchOptions_staticbox->Show(false);     //(pecan 2008/5/22)
 
95
    m_pChkThreadSearchEnable->Show(false);               //(pecan 2008/5/22)
 
96
    m_pChkUseDefaultOptionsForThreadSearch->Show(false); //(pecan 2008/5/22)
 
97
}
 
98
 
 
99
 
 
100
BEGIN_EVENT_TABLE(ThreadSearchConfPanel, wxPanel)
 
101
    // begin wxGlade: ThreadSearchConfPanel::event_table
 
102
    EVT_CHECKBOX(idChkThreadSearchEnable, ThreadSearchConfPanel::OnThreadSearchEnable)
 
103
    EVT_CHECKBOX(idChkViewThreadSearchToolBar, ThreadSearchConfPanel::OnChkShowThreadSearchToolBarClick)
 
104
    EVT_CHECKBOX(idChkShowCodePreview, ThreadSearchConfPanel::OnChkCodePreview)
 
105
    EVT_CHECKBOX(idChkShowThreadSearchWidgets, ThreadSearchConfPanel::OnChkShowThreadSearchWidgetsClick)
 
106
    // end wxGlade
 
107
END_EVENT_TABLE();
 
108
 
 
109
 
 
110
void ThreadSearchConfPanel::OnThreadSearchEnable(wxCommandEvent &event)
 
111
{
 
112
        m_pChkUseDefaultOptionsForThreadSearch->Enable(event.IsChecked());
 
113
    event.Skip();
 
114
}
 
115
 
 
116
 
 
117
void ThreadSearchConfPanel::OnChkShowThreadSearchToolBarClick(wxCommandEvent &event)
 
118
{
 
119
        if ( (event.IsChecked() == false) && (m_pChkShowThreadSearchWidgets->GetValue() == false) )
 
120
        {
 
121
                if ( wxID_YES != cbMessageBox(wxT("Do you really want to hide both ThreadSearch toolbar and widgets ?"),
 
122
                                                                          wxT("Sure ?"), wxICON_QUESTION|wxYES_NO) )
 
123
                {
 
124
                        m_pChkShowThreadSearchToolBar->SetValue(true);
 
125
                }
 
126
        }
 
127
        event.Skip();
 
128
}
 
129
 
 
130
 
 
131
void ThreadSearchConfPanel::OnChkCodePreview(wxCommandEvent &event)
 
132
{
 
133
        m_pRadSplitterWndMode->Enable(event.IsChecked());
 
134
        event.Skip();
 
135
}
 
136
 
 
137
 
 
138
void ThreadSearchConfPanel::OnChkShowThreadSearchWidgetsClick(wxCommandEvent &event)
 
139
{
 
140
        if ( (event.IsChecked() == false) && (m_pChkShowThreadSearchToolBar->GetValue() == false) )
 
141
        {
 
142
                if ( wxID_YES != cbMessageBox(wxT("Do you really want to hide both ThreadSearch toolbar and widgets ?"),
 
143
                                                                          wxT("Sure ?"), wxICON_QUESTION|wxYES_NO) )
 
144
                {
 
145
                        m_pChkShowThreadSearchWidgets->SetValue(true);
 
146
                }
 
147
        }
 
148
        event.Skip();
 
149
}
 
150
 
 
151
 
 
152
// wxGlade: add ThreadSearchConfPanel event handlers
 
153
 
 
154
 
 
155
void ThreadSearchConfPanel::set_properties()
 
156
{
 
157
    // begin wxGlade: ThreadSearchConfPanel::set_properties
 
158
    m_pChkWholeWord->SetToolTip(wxT("Search text matches only whole words"));
 
159
    m_pChkWholeWord->SetValue(1);
 
160
    m_pChkStartWord->SetToolTip(wxT("Matches only word starting with search expression"));
 
161
    m_pChkMatchCase->SetToolTip(wxT("Case sensitive search."));
 
162
    m_pChkMatchCase->SetValue(1);
 
163
    m_pChkRegExp->SetToolTip(wxT("Search expression is a regular expression"));
 
164
    m_pChkThreadSearchEnable->SetValue(1);
 
165
    m_pChkUseDefaultOptionsForThreadSearch->SetValue(1);
 
166
    m_pChkShowThreadSearchToolBar->SetValue(1);
 
167
    m_pChkShowThreadSearchWidgets->SetValue(1);
 
168
    m_pChkShowCodePreview->SetValue(1);
 
169
    m_pChkDisplayLogHeaders->SetValue(1);
 
170
    m_pRadPanelManagement->SetSelection(0);
 
171
    m_pRadLoggerType->SetSelection(0);
 
172
    m_pRadSplitterWndMode->SetSelection(0);
 
173
    m_pRadSortBy->SetSelection(0);
 
174
    // end wxGlade
 
175
 
 
176
        ThreadSearchFindData findData;
 
177
        m_ThreadSearchPlugin.GetFindData(findData);
 
178
 
 
179
    m_pChkWholeWord->SetValue(findData.GetMatchWord());
 
180
    m_pChkStartWord->SetValue(findData.GetStartWord());
 
181
    m_pChkMatchCase->SetValue(findData.GetMatchCase());
 
182
    m_pChkRegExp->SetValue(findData.GetRegEx());
 
183
    m_pChkThreadSearchEnable->SetValue(m_ThreadSearchPlugin.GetCtxMenuIntegration());
 
184
    m_pChkUseDefaultOptionsForThreadSearch->SetValue(m_ThreadSearchPlugin.GetUseDefValsForThreadSearch());
 
185
    m_pChkUseDefaultOptionsForThreadSearch->Enable(m_ThreadSearchPlugin.GetCtxMenuIntegration());
 
186
    m_pChkDisplayLogHeaders->SetValue(m_ThreadSearchPlugin.GetDisplayLogHeaders());
 
187
    m_pChkDrawLogLines->SetValue(m_ThreadSearchPlugin.GetDrawLogLines());
 
188
    m_pChkShowThreadSearchToolBar->SetValue(m_ThreadSearchPlugin.IsToolbarVisible());
 
189
    m_pChkShowThreadSearchWidgets->SetValue(m_ThreadSearchPlugin.GetShowSearchControls());
 
190
    m_pChkShowCodePreview->SetValue(m_ThreadSearchPlugin.GetShowCodePreview());
 
191
 
 
192
    int radIndex = 0;
 
193
    switch (m_ThreadSearchPlugin.GetManagerType())
 
194
    {
 
195
                case ThreadSearchViewManagerBase::TypeLayout :
 
196
                {
 
197
                        radIndex = 1;
 
198
                        break;
 
199
                }
 
200
                default:
 
201
                // case ThreadSearchViewManagerBase::TypeMessagesNotebook :
 
202
                {
 
203
                        radIndex = 0;
 
204
                        break;
 
205
                }
 
206
    }
 
207
    m_pRadPanelManagement->SetSelection(radIndex);
 
208
 
 
209
    radIndex = 0;
 
210
    switch (m_ThreadSearchPlugin.GetLoggerType())
 
211
    {
 
212
                case ThreadSearchLoggerBase::TypeTree:
 
213
                {
 
214
                        radIndex = 1;
 
215
                        break;
 
216
                }
 
217
                default:
 
218
                // case ThreadSearchLoggerBase::TypeList :
 
219
                {
 
220
                        radIndex = 0;
 
221
                        break;
 
222
                }
 
223
    }
 
224
    m_pRadLoggerType->SetSelection(radIndex);
 
225
 
 
226
    radIndex = 0;
 
227
    switch (m_ThreadSearchPlugin.GetSplitterMode())
 
228
    {
 
229
                case wxSPLIT_HORIZONTAL:
 
230
                {
 
231
                        radIndex = 0;
 
232
                        break;
 
233
                }
 
234
                default :
 
235
                // case wxSPLIT_VERTICAL:
 
236
                {
 
237
                        radIndex = 1;
 
238
                        break;
 
239
                }
 
240
    }
 
241
    m_pRadSplitterWndMode->SetSelection(radIndex);
 
242
    m_pRadSplitterWndMode->Enable(m_ThreadSearchPlugin.GetShowCodePreview());
 
243
 
 
244
    radIndex = 0;
 
245
    switch (m_ThreadSearchPlugin.GetFileSorting())
 
246
    {
 
247
                case InsertIndexManager::SortByFileName:
 
248
                {
 
249
                        radIndex = 1;
 
250
                        break;
 
251
                }
 
252
                default:
 
253
                // case ThreadSearch::SortByFilePath :
 
254
                {
 
255
                        radIndex = 0;
 
256
                        break;
 
257
                }
 
258
    }
 
259
    m_pRadSortBy->SetSelection(radIndex);
 
260
 
 
261
    m_pPnlDirParams->SetSearchDirHidden(findData.GetHiddenSearch());
 
262
    m_pPnlDirParams->SetSearchDirRecursively(findData.GetRecursiveSearch());
 
263
    m_pPnlDirParams->SetSearchDirPath(findData.GetSearchPath());
 
264
    m_pPnlDirParams->SetSearchMask(findData.GetSearchMask());
 
265
 
 
266
    m_pPnlSearchIn->SetSearchInOpenFiles(findData.MustSearchInOpenFiles());
 
267
    m_pPnlSearchIn->SetSearchInSnippetFiles(findData.MustSearchInProject());
 
268
    m_pPnlSearchIn->SetSearchInSnippetFiles(findData.MustSearchInCodeSnippetsTree());
 
269
    //-m_pPnlSearchIn->SetSearchInWorkspaceFiles(findData.MustSearchInWorkspace());
 
270
    m_pPnlSearchIn->SetSearchInDirectory(findData.MustSearchInDirectory());
 
271
}
 
272
 
 
273
 
 
274
void ThreadSearchConfPanel::do_layout()
 
275
{
 
276
    // begin wxGlade: ThreadSearchConfPanel::do_layout
 
277
    wxBoxSizer* SizerTop = new wxBoxSizer(wxVERTICAL);
 
278
    wxStaticBoxSizer* SizerThreadSearchLayout = new wxStaticBoxSizer(SizerThreadSearchLayout_staticbox, wxVERTICAL);
 
279
    wxFlexGridSizer* SizerThreadSearchGridLayout = new wxFlexGridSizer(4, 2, 0, 0);
 
280
    wxStaticBoxSizer* SizerListControlOptions = new wxStaticBoxSizer(SizerListControlOptions_staticbox, wxVERTICAL);
 
281
    wxStaticBoxSizer* SizerThreadSearchLayoutGlobal = new wxStaticBoxSizer(SizerThreadSearchLayoutGlobal_staticbox, wxVERTICAL);
 
282
    wxStaticBoxSizer* SizerThreadSearchOptions = new wxStaticBoxSizer(SizerThreadSearchOptions_staticbox, wxVERTICAL);
 
283
    wxStaticBoxSizer* SizerOptions = new wxStaticBoxSizer(SizerOptions_staticbox, wxHORIZONTAL);
 
284
    wxStaticBoxSizer* SizerSearchIn = new wxStaticBoxSizer(SizerSearchIn_staticbox, wxVERTICAL);
 
285
    SizerSearchIn->Add(m_pPnlSearchIn, 0, wxALL|wxEXPAND, 2);
 
286
    SizerSearchIn->Add(m_pPnlDirParams, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 2);
 
287
    SizerTop->Add(SizerSearchIn, 0, wxALL|wxEXPAND, 4);
 
288
    SizerOptions->Add(m_pChkWholeWord, 0, wxALL|wxADJUST_MINSIZE, 4);
 
289
    SizerOptions->Add(m_pChkStartWord, 0, wxALL|wxADJUST_MINSIZE, 4);
 
290
    SizerOptions->Add(m_pChkMatchCase, 0, wxALL|wxADJUST_MINSIZE, 4);
 
291
    SizerOptions->Add(m_pChkRegExp, 0, wxALL|wxADJUST_MINSIZE, 4);
 
292
    SizerTop->Add(SizerOptions, 0, wxALL|wxEXPAND, 4);
 
293
    SizerThreadSearchOptions->Add(m_pChkThreadSearchEnable, 0, wxALL|wxADJUST_MINSIZE, 4);
 
294
    SizerThreadSearchOptions->Add(m_pChkUseDefaultOptionsForThreadSearch, 0, wxALL|wxADJUST_MINSIZE, 4);
 
295
    //(pecan 2008/5/22) not supported yet
 
296
    //wxStaticText* m_pStaDefaultOptions = new wxStaticText(this, wxID_ANY, wxT("       ('Whole word' = true, 'Start word' = false, 'Match case' = true, 'Regular expression' = false)"));
 
297
    wxStaticText* m_pStaDefaultOptions = new wxStaticText(this, wxID_ANY, wxT(" Place holder for yet to be supported context menu option."));
 
298
    SizerThreadSearchOptions->Add(m_pStaDefaultOptions, 0, wxADJUST_MINSIZE, 0);
 
299
    SizerTop->Add(SizerThreadSearchOptions, 0, wxALL|wxEXPAND, 4);
 
300
    //--moved--belo--SizerThreadSearchLayoutGlobal->Add(m_pChkShowThreadSearchToolBar, 0, wxALL|wxADJUST_MINSIZE, 4);
 
301
    SizerThreadSearchLayoutGlobal->Add(m_pChkShowThreadSearchWidgets, 0, wxALL|wxADJUST_MINSIZE, 4);
 
302
    SizerThreadSearchLayoutGlobal->Add(m_pChkShowCodePreview, 0, wxALL|wxADJUST_MINSIZE, 4);
 
303
    SizerThreadSearchLayoutGlobal->Add(m_pChkShowThreadSearchToolBar, 0, wxALL|wxADJUST_MINSIZE, 4);
 
304
    SizerThreadSearchGridLayout->Add(SizerThreadSearchLayoutGlobal, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4);
 
305
    SizerListControlOptions->Add(m_pChkDisplayLogHeaders, 0, wxALL|wxADJUST_MINSIZE, 4);
 
306
    SizerListControlOptions->Add(m_pChkDrawLogLines, 0, wxALL|wxADJUST_MINSIZE, 4);
 
307
    SizerThreadSearchGridLayout->Add(SizerListControlOptions, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4);
 
308
    SizerThreadSearchGridLayout->Add(m_pRadPanelManagement, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4);
 
309
    SizerThreadSearchGridLayout->Add(m_pRadLoggerType, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4);
 
310
    SizerThreadSearchGridLayout->Add(m_pRadSplitterWndMode, 0, wxALL|wxEXPAND, 4);
 
311
    SizerThreadSearchGridLayout->Add(m_pRadSortBy, 0, wxALL|wxEXPAND, 4);
 
312
    SizerThreadSearchGridLayout->AddGrowableCol(0);
 
313
    SizerThreadSearchGridLayout->AddGrowableCol(1);
 
314
    SizerThreadSearchLayout->Add(SizerThreadSearchGridLayout, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 0);
 
315
    SizerTop->Add(SizerThreadSearchLayout, 0, wxALL|wxEXPAND, 4);
 
316
    SetAutoLayout(true);
 
317
    SetSizer(SizerTop);
 
318
    SizerTop->Fit(this);
 
319
    SizerTop->SetSizeHints(this);
 
320
    // end wxGlade
 
321
}
 
322
 
 
323
 
 
324
void ThreadSearchConfPanel::OnApply()
 
325
{
 
326
        ThreadSearchFindData findData;
 
327
 
 
328
        // Inits variable data from user values
 
329
        findData.SetFindText       (wxEmptyString);
 
330
        findData.SetHiddenSearch   (m_pPnlDirParams->GetSearchDirHidden());
 
331
        findData.SetRecursiveSearch(m_pPnlDirParams->GetSearchDirRecursively());
 
332
        findData.SetSearchPath     (m_pPnlDirParams->GetSearchDirPath());
 
333
        findData.SetSearchMask     (m_pPnlDirParams->GetSearchMask());
 
334
        findData.SetMatchWord      (m_pChkWholeWord->IsChecked());
 
335
        findData.SetStartWord      (m_pChkStartWord->IsChecked());
 
336
        findData.SetMatchCase      (m_pChkMatchCase->IsChecked());
 
337
        findData.SetRegEx          (m_pChkRegExp->IsChecked());
 
338
 
 
339
        findData.UpdateSearchScope(ScopeOpenFiles,      m_pPnlSearchIn->GetSearchInOpenFiles());
 
340
        findData.UpdateSearchScope(ScopeSnippetFiles,   m_pPnlSearchIn->GetSearchInSnippetFiles());
 
341
        //-findData.UpdateSearchScope(ScopeWorkspaceFiles, m_pPnlSearchIn->GetSearchInWorkspaceFiles());
 
342
        findData.UpdateSearchScope(ScopeDirectoryFiles, m_pPnlSearchIn->GetSearchInDirectory());
 
343
 
 
344
        // Updates plug-in with new datas
 
345
        m_ThreadSearchPlugin.SetFindData(findData);
 
346
        m_ThreadSearchPlugin.SetCtxMenuIntegration(m_pChkThreadSearchEnable->IsChecked());
 
347
        m_ThreadSearchPlugin.SetUseDefValsForThreadSearch(m_pChkUseDefaultOptionsForThreadSearch->IsChecked());
 
348
        m_ThreadSearchPlugin.SetShowSearchControls(m_pChkShowThreadSearchWidgets->IsChecked());
 
349
        m_ThreadSearchPlugin.SetShowCodePreview(m_pChkShowCodePreview->IsChecked());
 
350
        m_ThreadSearchPlugin.SetDisplayLogHeaders(m_pChkDisplayLogHeaders->IsChecked());
 
351
        m_ThreadSearchPlugin.SetDrawLogLines(m_pChkDrawLogLines->IsChecked());
 
352
 
 
353
    int radIndex = m_pRadPanelManagement->GetSelection();
 
354
    ThreadSearchViewManagerBase::eManagerTypes mgrType;
 
355
    switch (radIndex)
 
356
    {
 
357
                case 1 :
 
358
                {
 
359
                        mgrType = ThreadSearchViewManagerBase::TypeLayout;
 
360
                        break;
 
361
                }
 
362
                default:
 
363
                // case 0 :
 
364
                {
 
365
                        mgrType = ThreadSearchViewManagerBase::TypeMessagesNotebook;
 
366
                        break;
 
367
                }
 
368
    }
 
369
    m_ThreadSearchPlugin.SetManagerType(mgrType);
 
370
 
 
371
    radIndex = m_pRadLoggerType->GetSelection();
 
372
    ThreadSearchLoggerBase::eLoggerTypes lgrType;
 
373
    switch (radIndex)
 
374
    {
 
375
                case 1 :
 
376
                {
 
377
                        lgrType = ThreadSearchLoggerBase::TypeTree;
 
378
                        break;
 
379
                }
 
380
                default:
 
381
                // case 0 :
 
382
                {
 
383
                        lgrType = ThreadSearchLoggerBase::TypeList;
 
384
                        break;
 
385
                }
 
386
    }
 
387
    m_ThreadSearchPlugin.SetLoggerType(lgrType);
 
388
 
 
389
    radIndex = m_pRadSortBy->GetSelection();
 
390
    InsertIndexManager::eFileSorting sortingType;
 
391
    switch (radIndex)
 
392
    {
 
393
                case 1 :
 
394
                {
 
395
                        sortingType = InsertIndexManager::SortByFileName;
 
396
                        break;
 
397
                }
 
398
                default:
 
399
                // case 0 :
 
400
                {
 
401
                        sortingType = InsertIndexManager::SortByFilePath;
 
402
                        break;
 
403
                }
 
404
    }
 
405
    m_ThreadSearchPlugin.SetFileSorting(sortingType);
 
406
 
 
407
    radIndex = m_pRadSplitterWndMode->GetSelection();
 
408
    wxSplitMode splitterMode;
 
409
    switch (radIndex)
 
410
    {
 
411
                case 1 :
 
412
                {
 
413
                        splitterMode = wxSPLIT_VERTICAL;
 
414
                        break;
 
415
                }
 
416
                default:
 
417
                // case 0 :
 
418
                {
 
419
                        splitterMode = wxSPLIT_HORIZONTAL;
 
420
                        break;
 
421
                }
 
422
    }
 
423
    m_ThreadSearchPlugin.SetSplitterMode(splitterMode);
 
424
 
 
425
        // Updates toolbar visibility
 
426
        m_ThreadSearchPlugin.ShowToolBar(m_pChkShowThreadSearchToolBar->IsChecked());
 
427
 
 
428
        // Notifies plug-in observers (ThreadSearchView)
 
429
        m_ThreadSearchPlugin.Notify();
 
430
}
 
431