Patch #3508 2013-10-11 18:47
davidallen
005693 : FindReplace dlg + multiple search masks- Download
- 3508-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
ollydbg 2013-11-07 14:54
Do you post the same patch twice??? #003507 and #003508???
davidallen 2013-11-07 18:47
Hi ollydbg,
I am afraid that I did. After creating the patch, I navigated backwards within my browser (chrome) and it proceeded to create another patch as it did a resubmit. I will try and avoid this in future.
Cheers
David
ollydbg 2013-11-13 00:33
OK, I close this one as a duplicate patch.