From 27f75c1076842ebbf158a4bf316ec34ff827a0e8 Mon Sep 17 00:00:00 2001 From: xulihang Date: Thu, 19 Nov 2020 13:29:33 +0800 Subject: [PATCH] add Preserve only first occurences --- BasicCAT/BasicCAT.b4j.meta | 2 +- BasicCAT/Files/searchandreplace.bjl | Bin 12489 -> 12522 bytes BasicCAT/searchAndReplaceDialog.bas | 43 +++++++++++++++++++++------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/BasicCAT/BasicCAT.b4j.meta b/BasicCAT/BasicCAT.b4j.meta index cc8f255..a363d45 100644 --- a/BasicCAT/BasicCAT.b4j.meta +++ b/BasicCAT/BasicCAT.b4j.meta @@ -238,6 +238,6 @@ ModuleClosedNodes78= ModuleClosedNodes79= ModuleClosedNodes8= ModuleClosedNodes9= -NavigationStack=searchAndReplaceDialog,InTimeRange,100,0,searchAndReplaceDialog,ResultsMap,534,6,searchAndReplaceDialog,resultListView_SelectedIndexChanged,38,0,searchAndReplaceDialog,findButton_Click,44,6,searchAndReplaceDialog,findTextField_TextChanged,506,0,searchAndReplaceDialog,replaceTextField_TextChanged,504,0,searchAndReplaceDialog,CheckShouldShowBasedonExtendedItem,56,0,searchAndReplaceDialog,FilterButton_MouseClicked,529,0,searchAndReplaceDialog,showRegexResult,124,6,searchAndReplaceDialog,showResult,267,6 +NavigationStack=searchAndReplaceDialog,showRegexResult,102,6,searchAndReplaceDialog,Class_Globals,4,0,searchAndReplaceDialog,showResult,355,6,searchAndReplaceDialog,replaceTextField_TextChanged,521,0,searchAndReplaceDialog,findTextField_TextChanged,527,0,searchAndReplaceDialog,GetTimestampButton_MouseClicked,577,0,Visual Designer,searchandreplace.bjl,-100,6,searchAndReplaceDialog,FilterButton_MouseClicked,544,0,searchAndReplaceDialog,replaceSelectedButton_MouseClicked,424,0,searchAndReplaceDialog,resultListView_Action,498,6 SelectedBuild=0 VisibleModules=1,2,3,4,5,6,7,8,9,10,11 diff --git a/BasicCAT/Files/searchandreplace.bjl b/BasicCAT/Files/searchandreplace.bjl index 43d16d0e19f0c5f98941fa9e717bf5fa77852812..8e080d437b69771307e04c450c89efebf403e246 100644 GIT binary patch delta 69 zcmX?^_$qP35e^G81_p*`CHH)V5+KS*RVYqP&rQuMQPNQgC`v6(EhaMain.currentProject.currentFilename Then - Main.currentProject.openFile(filename,False) - End If - Main.editorLV.ScrollTo(tagMap.get("index")) - Main.MainForm.AlwaysOnTop=True - Main.MainForm.AlwaysOnTop=False + Dim mi As MenuItem=Sender + Select mi.Text + Case "Preserve only first occurences" + Dim new As List + new.Initialize + Dim map1 As Map + map1.Initialize + For Each p As Pane In resultListView.Items + Dim tagMap As Map + tagMap=p.Tag + Dim source As String + source=Regex.Split(CRLF&"- ",tagMap.Get("text"))(0) + If map1.ContainsKey(source)=False Then + map1.Put(source,"") + new.Add(p) + End If + Next + resultListView.Items.Clear + resultListView.Items.AddAll(new) + Case "Go to the segment" + Dim p As Pane + p=resultListView.Items.Get(resultListView.SelectedIndex) + Dim tagMap As Map + tagMap=p.Tag + Dim filename As String=tagMap.Get("filename") + If filename<>Main.currentProject.currentFilename Then + Main.currentProject.openFile(filename,False) + End If + Main.editorLV.ScrollTo(tagMap.get("index")) + Main.MainForm.AlwaysOnTop=True + Main.MainForm.AlwaysOnTop=False + End Select End Sub Sub searchSourceCheckBox_CheckedChange(Checked As Boolean)