Patch #3507 2013-10-11 18:47
davidallen
005693 : FindReplace dlg + multiple search masks- Download
- 3507-005693_FindRep.patch (3.0 KB)
Index: src/sdk/findreplacedlg.cpp
===================================================================
--- src/sdk/findreplacedlg.cpp (revision 9363)
+++ src/sdk/findreplacedlg.cpp (working copy)
@@ -143,7 +143,19 @@
// load search path options
XRCCTRL(*this, "txtSearchPath", wxTextCtrl)->SetValue(cfg->Read(CONF_GROUP _T("/search_path"),
(active_project ? active_project->GetBasePath() : wxT(""))));
- XRCCTRL(*this, "txtSearchMask", wxTextCtrl)->SetValue(cfg->Read(CONF_GROUP _T("/search_mask")));
+ if(cfg->Exists(CONF_GROUP _T("/search_mask")))
+ {
+ // Migrate from previous config setting of "search_mask" string (since it used to be a textbox)
+ // to new config setting of "search_masks" array for the combobox
+ XRCCTRL(*this, "cmbSearchMask", wxComboBox)->Append(cfg->Read(CONF_GROUP _T("/search_mask")));
+ cfg->UnSet(CONF_GROUP _T("/search_mask"));
+ }
+ else
+ {
+ FillComboWithLastValues(XRCCTRL(*this, "cmbSearchMask", wxComboBox), CONF_GROUP _T("/search_masks"));
+ }
+ XRCCTRL(*this, "cmbSearchMask", wxComboBox)->SetSelection(0);
+
XRCCTRL(*this, "chkSearchRecursively", wxCheckBox)->SetValue(cfg->ReadBool(CONF_GROUP _T("/search_recursive"), false));
XRCCTRL(*this, "chkSearchHidden", wxCheckBox)->SetValue(cfg->ReadBool(CONF_GROUP _T("/search_hidden"), false));
@@ -312,7 +324,7 @@
cfg->Write(CONF_GROUP _T("/delete_old_searches2"), XRCCTRL(*this, "chkDelOldSearchRes2", wxCheckBox)->GetValue());
cfg->Write(CONF_GROUP _T("/search_path"), XRCCTRL(*this, "txtSearchPath", wxTextCtrl)->GetValue());
- cfg->Write(CONF_GROUP _T("/search_mask"), XRCCTRL(*this, "txtSearchMask", wxTextCtrl)->GetValue());
+ SaveComboValues(XRCCTRL(*this, "cmbSearchMask", wxComboBox), CONF_GROUP _T("/search_masks"));
cfg->Write(CONF_GROUP _T("/search_recursive"), XRCCTRL(*this, "chkSearchRecursively", wxCheckBox)->GetValue());
cfg->Write(CONF_GROUP _T("/search_hidden"), XRCCTRL(*this, "chkSearchHidden", wxCheckBox)->GetValue());
cfg->Write(CONF_GROUP _T("/target_scope_all"),(XRCCTRL(*this, "chTarget", wxChoice)->GetSelection() == 0));
@@ -479,7 +491,7 @@
wxString FindReplaceDlg::GetSearchMask() const
{
- return XRCCTRL(*this, "txtSearchMask", wxTextCtrl)->GetValue();
+ return XRCCTRL(*this, "cmbSearchMask", wxComboBox)->GetValue();
}
int FindReplaceDlg::GetProject() const
Index: src/sdk/resources/findreplacedlg.xrc
===================================================================
--- src/sdk/resources/findreplacedlg.xrc (revision 9363)
+++ src/sdk/resources/findreplacedlg.xrc (working copy)
@@ -530,7 +530,7 @@
<border>4</border>
</object>
<object class="sizeritem">
- <object class="wxTextCtrl" name="txtSearchMask" />
+ <object class="wxComboBox" name="cmbSearchMask" />
<flag>wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
<option>1</option>
</object>
History
davidallen 2013-10-11 18:49
See Feature 005693 for details.
Its my first patch so hopefully not got too much wrong. Hope it helps.
biplab 2013-12-01 10:47
Thanks for the patch.