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