From b730230b0930acc171a331dc0c8ce388c197eef6 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 24 Feb 2010 18:56:29 +0000 Subject: [PATCH] Add "EXPLAIN query" to context menu of process list. Fixes issue #1717. --- source/main.dfm | 17 ++++++++++++----- source/main.pas | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/source/main.dfm b/source/main.dfm index 07e92b5a..70322ea4 100644 --- a/source/main.dfm +++ b/source/main.dfm @@ -717,7 +717,7 @@ object MainForm: TMainForm Left = 0 Top = 0 Width = 567 - Height = 15 + Height = 18 Align = alTop Alignment = taLeftJustify BevelOuter = bvNone @@ -725,7 +725,7 @@ object MainForm: TMainForm TabOrder = 0 object lblExplainProcess: TLabel Left = 87 - Top = 1 + Top = 2 Width = 41 Height = 13 Cursor = crHandPoint @@ -735,16 +735,16 @@ object MainForm: TMainForm Font.Color = clBlue Font.Height = -11 Font.Name = 'Default' - Font.Style = [] + Font.Style = [fsUnderline] ParentFont = False OnClick = lblExplainProcessClick end end object SynMemoProcessView: TSynMemo Left = 0 - Top = 15 + Top = 18 Width = 567 - Height = 54 + Height = 51 SingleLineMode = False Align = alClient Font.Charset = DEFAULT_CHARSET @@ -7237,6 +7237,13 @@ object MainForm: TMainForm ShortCut = 13 OnClick = menuEditVariableClick end + object menuExplainProcess: TMenuItem + Caption = 'EXPLAIN query' + Enabled = False + Hint = 'Analyze selected process SQL' + ImageIndex = 39 + OnClick = lblExplainProcessClick + end object N1a: TMenuItem Caption = '-' end diff --git a/source/main.pas b/source/main.pas index a493553a..28db3f15 100644 --- a/source/main.pas +++ b/source/main.pas @@ -459,6 +459,7 @@ type actQueryFindAgain1: TMenuItem; Replacetext1: TMenuItem; lblExplainProcess: TLabel; + menuExplainProcess: TMenuItem; procedure refreshMonitorConfig; procedure loadWindowConfig; procedure saveWindowConfig; @@ -5916,6 +5917,7 @@ begin lblExplainProcess.Enabled := enableSQLView and (UpperCase(GetFirstWord(SynMemoProcessView.Text)) <> 'SHOW') and (SynMemoProcessView.GetTextLen > 0); + menuExplainProcess.Enabled := lblExplainProcess.Enabled; end;