From 42f65d8cc97376549f15e2a3c3781ae21dfaa2e9 Mon Sep 17 00:00:00 2001 From: Martin Drab Date: Sat, 8 Feb 2020 23:06:44 +0100 Subject: [PATCH] [gui]: Remove the Sort By Id capability --- gui/MainForm.dfm | 13 +++++++++---- gui/MainForm.pas | 8 -------- gui/RequestListModel.pas | 31 ------------------------------- 3 files changed, 9 insertions(+), 43 deletions(-) diff --git a/gui/MainForm.dfm b/gui/MainForm.dfm index bb8118b..53e2eea 100644 --- a/gui/MainForm.dfm +++ b/gui/MainForm.dfm @@ -881,6 +881,10 @@ object MainFrm: TMainFrm TabOrder = 0 object RequestTabSheet: TTabSheet Caption = 'Requests' + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object RequestListView: TListView Left = 0 Top = 0 @@ -895,12 +899,17 @@ object MainFrm: TMainFrm TabOrder = 0 ViewStyle = vsReport OnDblClick = RequestDetailsMenuItemClick + ExplicitTop = -2 end end object DataParsersTabSheet: TTabSheet Caption = 'Data Parsers' ImageIndex = 1 OnShow = DataParsersTabSheetShow + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object DataParsersListView: TListView Left = 0 Top = 0 @@ -1002,10 +1011,6 @@ object MainFrm: TMainFrm object N6: TMenuItem Caption = '-' end - object SortbyIDMenuItem: TMenuItem - Caption = 'Sort by ID' - OnClick = SortbyIDMenuItemClick - end object ClearMenuItem: TMenuItem Caption = 'Clear' OnClick = ClearMenuItemClick diff --git a/gui/MainForm.pas b/gui/MainForm.pas index 791bb45..564fc52 100644 --- a/gui/MainForm.pas +++ b/gui/MainForm.pas @@ -44,7 +44,6 @@ WatchedClassesMenuItem: TMenuItem; WatchDriverNameMenuItem: TMenuItem; WatchedDriversMenuItem: TMenuItem; - SortbyIDMenuItem: TMenuItem; DriverMenuItem: TMenuItem; UnloadOnExitMenuItem: TMenuItem; UninstallOnExitMenuItem: TMenuItem; @@ -94,7 +93,6 @@ procedure SaveMenuItemClick(Sender: TObject); procedure WatchClassMenuItemClick(Sender: TObject); procedure WatchDriverNameMenuItemClick(Sender: TObject); - procedure SortbyIDMenuItemClick(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure DriverMenuItemClick(Sender: TObject); procedure Documentation1Click(Sender: TObject); @@ -692,7 +690,6 @@ 2 : fn := ChangeFIleExt(fn, '.bin'); end; - FModel.Sort; FModel.SaveToFile(fn, LogSaveDialog.FilterIndex = 2, CompressMenuItem.Checked); end; end; @@ -708,11 +705,6 @@ EnumerateHooks; end; -Procedure TMainFrm.SortbyIDMenuItemClick(Sender: TObject); -begin -FModel.Sort; -end; - Procedure TMainFrm.StatusTimerTimer(Sender: TObject); Var err : Cardinal; diff --git a/gui/RequestListModel.pas b/gui/RequestListModel.pas index cbd040c..abc9808 100644 --- a/gui/RequestListModel.pas +++ b/gui/RequestListModel.pas @@ -164,15 +164,6 @@ Property HighlightColor : Cardinal Read FHighlightColor Write FHighlightColor; end; - TDriverRequestComparer = Class (TComparer) - Public -{$IFDEF FPC} - Function Compare(Constref Left, Right:TDriverRequest):Integer; Override; -{$ELSE} - Function Compare(Const Left, Right:TDriverRequest):Integer; Override; -{$ENDIF} - end; - TDriverUnloadRequest = Class (TDriverRequest) Public Constructor Create(Var ARequest:REQUEST_UNLOAD); Overload; @@ -242,7 +233,6 @@ Constructor Create; Reintroduce; Destructor Destroy; Override; Function RefreshMaps:Cardinal; - Procedure Sort; Procedure Clear; Override; Function RowCount : Cardinal; Override; @@ -266,16 +256,6 @@ XXXDetectedRequests, FileObjectNameXXXRequest, ProcessXXXRequests, Utils, BinaryLogHeader; -(** TDriverRequestComparer **) - -{$IFDEF FPC} -Function TDriverRequestComparer.Compare(Constref Left, Right:TDriverRequest):Integer; -{$ELSE} -Function TDriverRequestComparer.Compare(Const Left, Right:TDriverRequest):Integer; -{$ENDIF} -begin -Result := Integer(Left.Id - Right.Id); -end; (** TDriverRequest **) @@ -963,17 +943,6 @@ end; end; -Procedure TRequestListModel.Sort; -Var - c : TDriverRequestComparer; -begin -c := TDriverRequestComparer.Create; -FRequests.Sort(c); -c.Free; -If Assigned(Displayer) Then - Displayer.Invalidate; -end; - Procedure TRequestListModel.OnAdvancedCustomDrawItemCallback(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage; var DefaultDraw: Boolean); Var dr : TDriverRequest;