From 44bcd316353f747bed229b4a4acb66fc70095f4a Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 29 Jan 2011 06:45:49 +0000 Subject: [PATCH] Add a "Cancel" button to the main toolbar, so users are able to stop long running query grid sort operations. See http://www.heidisql.com/forum.php?t=7674 --- res/icons/cancel.png | Bin 0 -> 587 bytes res/icons/cancel_blink.png | Bin 0 -> 605 bytes source/helpers.pas | 2 + source/main.dfm | 354 ++++++++++++++++++++++++++----------- source/main.pas | 46 ++++- 5 files changed, 296 insertions(+), 106 deletions(-) create mode 100644 res/icons/cancel.png create mode 100644 res/icons/cancel_blink.png diff --git a/res/icons/cancel.png b/res/icons/cancel.png new file mode 100644 index 0000000000000000000000000000000000000000..c149c2bc017d5ce5a8ae9330dd7dbd012482e0f4 GIT binary patch literal 587 zcmV-R0<`^!P)FS^-G}e*;M)Q6>s#cP zI`Y#S($G6W`W@NI5g|L-MKl0Zmu$m^(0~^Lwo5OO~d#(vPfzpF8FWQhbW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE;i7Ety%y80oqAKK~y+Tt&>|z8&MR6&ughrsnQlfgd(ES(h?&?>jkvXc!3nL zt*HI0l@^;CjYNzQZ7q#eYc3~9VkeWiF4q~IFoVG-2Np9g-`acay+?@qevlTDf-h%N zARu{XJwjz1_5tNpY6Wg-nOcHd{75ar&OL{f61A2lO;~;geow>QkHXDG;OxDIlYI&M zFb4ZP0dubhdQy}_CL#EE3D7cdj}{2OBK(5z9NhnDSij=1&Sqd_yP>TIOuW3RWmZ-& zoJ+u}5S)j7Fw1WV*fpAL!psfAJe|VjH-Tms%D~H;8-nxmy$Aay-nW8H$@VAE*m?@% zWD?b{0RuH<9MuvLGiPB{y@MF|B z9-;9!cH6)yED-J|{H~c|r=@zi>#N&`!ri*JDW6n`3=H=D@L literal 0 HcmV?d00001 diff --git a/source/helpers.pas b/source/helpers.pas index 62f58e41..a585a4cf 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -1786,6 +1786,8 @@ begin // Apply case insensitive incremental search event if VT.IncrementalSearch <> isNone then VT.OnIncrementalSearch := Mainform.vstIncrementalSearch; + VT.OnStartOperation := Mainform.AnyGridStartOperation; + VT.OnEndOperation := Mainform.AnyGridEndOperation; end; diff --git a/source/main.dfm b/source/main.dfm index 80e94a68..b5980ffe 100644 --- a/source/main.dfm +++ b/source/main.dfm @@ -2,7 +2,7 @@ object MainForm: TMainForm Left = 241 Top = 114 ClientHeight = 486 - ClientWidth = 756 + ClientWidth = 824 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -21,7 +21,7 @@ object MainForm: TMainForm object splitterTopBottom: TSplitter Left = 0 Top = 383 - Width = 756 + Width = 824 Height = 4 Cursor = crSizeNS Align = alBottom @@ -31,7 +31,7 @@ object MainForm: TMainForm object SynMemoSQLLog: TSynMemo Left = 0 Top = 387 - Width = 756 + Width = 824 Height = 80 SingleLineMode = True Align = alBottom @@ -60,7 +60,7 @@ object MainForm: TMainForm object StatusBar: TStatusBar Left = 0 Top = 467 - Width = 756 + Width = 824 Height = 19 AutoHint = True DoubleBuffered = True @@ -97,7 +97,7 @@ object MainForm: TMainForm object ControlBar1: TControlBar Left = 0 Top = 0 - Width = 756 + Width = 824 Height = 26 Align = alTop AutoSize = True @@ -260,7 +260,7 @@ object MainForm: TMainForm object ToolBarQuery: TToolBar Left = 494 Top = 2 - Width = 268 + Width = 306 Height = 22 Align = alNone AutoSize = True @@ -278,63 +278,68 @@ object MainForm: TMainForm Style = tbsDropDown end object btnLoadSQL: TToolButton - Left = 23 + Left = 38 Top = 0 Action = actLoadSQL DropdownMenu = PopupQueryLoad Style = tbsDropDown end object btnSaveSQL: TToolButton - Left = 61 + Left = 76 Top = 0 Action = actSaveSQLAs end object btnSaveSQLSnippet: TToolButton - Left = 84 + Left = 99 Top = 0 Action = actSaveSQLSnippet end object btnQueryFind: TToolButton - Left = 107 + Left = 122 Top = 0 Action = actQueryFind end object btnQueryReplace: TToolButton - Left = 130 + Left = 145 Top = 0 Action = actQueryReplace end object btnReformatSQL: TToolButton - Left = 153 + Left = 168 Top = 0 Action = actReformatSQL end object btnStopOnErrors: TToolButton - Left = 176 + Left = 191 Top = 0 Action = actQueryStopOnErrors end object btnBlobAsText: TToolButton - Left = 199 + Left = 214 Top = 0 Action = actBlobAsText end object btnQueryWordwrap: TToolButton - Left = 222 + Left = 237 Top = 0 Action = actQueryWordWrap end object btnSetDelimiter: TToolButton - Left = 245 + Left = 260 Top = 0 Action = actSetDelimiter end + object btnCancelOperation: TToolButton + Left = 283 + Top = 0 + Action = actCancelOperation + end end end object panelTop: TPanel Left = 0 Top = 26 - Width = 756 + Width = 824 Height = 357 Align = alClient AutoSize = True @@ -524,7 +529,7 @@ object MainForm: TMainForm object pnlRight: TPanel Left = 173 Top = 0 - Width = 583 + Width = 651 Height = 357 Align = alClient BevelOuter = bvNone @@ -532,7 +537,7 @@ object MainForm: TMainForm object pnlFilterVT: TPanel Left = 0 Top = 331 - Width = 583 + Width = 651 Height = 26 Align = alBottom BevelOuter = bvNone @@ -578,7 +583,7 @@ object MainForm: TMainForm object PageControlMain: TPageControl Left = 0 Top = 0 - Width = 583 + Width = 651 Height = 331 ActivePage = tabHost Align = alClient @@ -597,7 +602,7 @@ object MainForm: TMainForm object PageControlHost: TPageControl Left = 0 Top = 0 - Width = 575 + Width = 643 Height = 302 ActivePage = tabDatabases Align = alClient @@ -611,8 +616,8 @@ object MainForm: TMainForm object ListDatabases: TVirtualStringTree Left = 0 Top = 0 - Width = 567 - Height = 274 + Width = 635 + Height = 273 Align = alClient Header.AutoSizeIndex = 0 Header.DefaultHeight = 17 @@ -694,8 +699,8 @@ object MainForm: TMainForm object ListVariables: TVirtualStringTree Left = 0 Top = 0 - Width = 567 - Height = 274 + Width = 635 + Height = 273 Align = alClient DragOperations = [] Header.AutoSizeIndex = 1 @@ -736,7 +741,7 @@ object MainForm: TMainForm end item Position = 1 - Width = 403 + Width = 471 WideText = 'Value' end> end @@ -747,8 +752,8 @@ object MainForm: TMainForm object ListStatus: TVirtualStringTree Left = 0 Top = 0 - Width = 567 - Height = 274 + Width = 635 + Height = 273 Align = alClient DragOperations = [] Header.AutoSizeIndex = 1 @@ -789,7 +794,7 @@ object MainForm: TMainForm item Alignment = taRightJustify Position = 1 - Width = 203 + Width = 271 WideText = 'Value' end item @@ -811,8 +816,8 @@ object MainForm: TMainForm ImageIndex = 57 object Splitter3: TSplitter Left = 0 - Top = 201 - Width = 567 + Top = 200 + Width = 635 Height = 4 Cursor = crSizeNS Align = alBottom @@ -821,8 +826,8 @@ object MainForm: TMainForm object ListProcesses: TVirtualStringTree Left = 0 Top = 0 - Width = 567 - Height = 201 + Width = 635 + Height = 200 Align = alClient Header.AutoSizeIndex = 7 Header.DefaultHeight = 17 @@ -893,14 +898,14 @@ object MainForm: TMainForm end item Position = 7 - Width = 73 + Width = 141 WideText = 'Info' end> end object pnlProcessViewBox: TPanel Left = 0 - Top = 205 - Width = 567 + Top = 204 + Width = 635 Height = 69 Align = alBottom BevelOuter = bvNone @@ -908,7 +913,7 @@ object MainForm: TMainForm object pnlProcessView: TPanel Left = 0 Top = 0 - Width = 567 + Width = 635 Height = 18 Align = alTop Alignment = taLeftJustify @@ -935,7 +940,7 @@ object MainForm: TMainForm object SynMemoProcessView: TSynMemo Left = 0 Top = 18 - Width = 567 + Width = 635 Height = 51 SingleLineMode = False Align = alClient @@ -968,8 +973,8 @@ object MainForm: TMainForm object ListCommandStats: TVirtualStringTree Left = 0 Top = 0 - Width = 567 - Height = 274 + Width = 635 + Height = 273 Align = alClient Header.AutoSizeIndex = 4 Header.DefaultHeight = 17 @@ -1028,7 +1033,7 @@ object MainForm: TMainForm end item Position = 4 - Width = 143 + Width = 211 WideText = 'Percentage' end> end @@ -1041,7 +1046,7 @@ object MainForm: TMainForm object ListTables: TVirtualStringTree Left = 0 Top = 0 - Width = 575 + Width = 643 Height = 302 Align = alClient EditDelay = 500 @@ -1201,7 +1206,7 @@ object MainForm: TMainForm object lblSorryNoData: TLabel Left = 0 Top = 91 - Width = 575 + Width = 643 Height = 211 Align = alClient Alignment = taCenter @@ -1212,7 +1217,7 @@ object MainForm: TMainForm object pnlDataTop: TPanel Left = 0 Top = 0 - Width = 575 + Width = 643 Height = 25 Align = alTop Alignment = taLeftJustify @@ -1222,7 +1227,7 @@ object MainForm: TMainForm object lblDataTop: TLabel Left = 1 Top = 1 - Width = 293 + Width = 361 Height = 23 Align = alLeft Anchors = [akLeft, akTop, akRight, akBottom] @@ -1232,7 +1237,7 @@ object MainForm: TMainForm WordWrap = True end object tlbDataButtons: TToolBar - Left = 231 + Left = 299 Top = 1 Width = 343 Height = 23 @@ -1296,17 +1301,17 @@ object MainForm: TMainForm object pnlFilter: TPanel Left = 0 Top = 25 - Width = 575 + Width = 643 Height = 66 Align = alTop BevelOuter = bvNone TabOrder = 1 Visible = False DesignSize = ( - 575 + 643 66) object lblTableFilter: TLabel - Left = 412 + Left = 480 Top = 0 Width = 123 Height = 13 @@ -1321,7 +1326,7 @@ object MainForm: TMainForm Caption = 'Recent filters:' end object btnFilterApply: TButton - Left = 412 + Left = 480 Top = 41 Width = 76 Height = 22 @@ -1330,7 +1335,7 @@ object MainForm: TMainForm TabOrder = 2 end object btnFilterClear: TButton - Left = 492 + Left = 560 Top = 41 Width = 76 Height = 22 @@ -1341,7 +1346,7 @@ object MainForm: TMainForm object SynMemoFilter: TSynMemo Left = 0 Top = 21 - Width = 409 + Width = 477 Height = 42 SingleLineMode = False Anchors = [akLeft, akTop, akRight, akBottom] @@ -1371,7 +1376,7 @@ object MainForm: TMainForm OnStatusChange = SynMemoFilterStatusChange end object editFilterSearch: TEdit - Left = 412 + Left = 480 Top = 15 Width = 156 Height = 21 @@ -1384,7 +1389,7 @@ object MainForm: TMainForm object comboRecentFilters: TComboBox Left = 75 Top = 0 - Width = 298 + Width = 366 Height = 21 Style = csDropDownList Anchors = [akLeft, akTop, akRight] @@ -1392,7 +1397,7 @@ object MainForm: TMainForm OnSelect = LoadRecentFilter end object btnClearFilters: TButton - Left = 373 + Left = 441 Top = 0 Width = 36 Height = 21 @@ -1409,7 +1414,7 @@ object MainForm: TMainForm object DataGrid: TVirtualStringTree Left = 0 Top = 91 - Width = 575 + Width = 643 Height = 211 Align = alClient AutoScrollDelay = 50 @@ -1461,7 +1466,7 @@ object MainForm: TMainForm Tag = 8 Left = 0 Top = 96 - Width = 575 + Width = 643 Height = 4 Cursor = crSizeNS Align = alTop @@ -1472,7 +1477,7 @@ object MainForm: TMainForm Tag = 1 Left = 0 Top = 0 - Width = 575 + Width = 643 Height = 96 Align = alTop BevelOuter = bvNone @@ -1480,7 +1485,7 @@ object MainForm: TMainForm OnCanResize = pnlQueryMemoCanResize object spltQueryHelpers: TSplitter Tag = 5 - Left = 380 + Left = 448 Top = 0 Width = 4 Height = 96 @@ -1492,7 +1497,7 @@ object MainForm: TMainForm Tag = 6 Left = 0 Top = 0 - Width = 380 + Width = 448 Height = 96 SingleLineMode = False Align = alClient @@ -1538,7 +1543,7 @@ object MainForm: TMainForm end> end object treeQueryHelpers: TVirtualStringTree - Left = 384 + Left = 452 Top = 0 Width = 191 Height = 96 @@ -1590,7 +1595,7 @@ object MainForm: TMainForm Tag = 7 Left = 0 Top = 124 - Width = 575 + Width = 643 Height = 178 Align = alClient AutoScrollDelay = 50 @@ -1640,7 +1645,7 @@ object MainForm: TMainForm object tabsetQuery: TTabSet Left = 0 Top = 100 - Width = 575 + Width = 643 Height = 24 Align = alTop DitherBackground = False @@ -2628,6 +2633,15 @@ object MainForm: TMainForm GroupIndex = 1 OnExecute = actBatchInOneGoExecute end + object actCancelOperation: TAction + Category = 'Various' + Caption = 'Cancel running operation' + Enabled = False + Hint = 'Cancel running operation' + ImageIndex = 159 + ShortCut = 27 + OnExecute = actCancelOperationExecute + end end object SaveDialog2: TSaveDialog DefaultExt = 'reg' @@ -2657,9 +2671,137 @@ object MainForm: TMainForm Left = 104 Top = 160 Bitmap = { - 494C01019F00A400040010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600 - 0000000000003600000028000000400000008002000001002000000000000080 + 494C0101A100A4002C0010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000009002000001002000000000000090 0200000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000A5CEEC00C0F1FF00C0F1FF00C0F1FF00BEEFFF00BEEFFF00BDEDFF00A3 + CCED000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000A6 + D2EC18CFF5FF3AE3F9FF38E1F8FF36E1F8FF33E1F8FF32DFF7FF30E0F7FF12CC + F1FF009CC4E80000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000A8D4EC1BD3 + F9FF42E5FAFF22D3F9FF11C9F7FF0EC8F6FF0BC5F5FF08C5F5FF14CDF5FF31E0 + F7FF12CCF1FF009CC4E800000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000AAD4EC1DD4FAFF48E6 + FBFF40DBFBFFC9F3FDFF39D3F9FF12C9F7FF0FC8F6FF31D0F7FFC4F2FDFF2ED4 + F7FF32E0F7FF12CDF2FF009CC4E8000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000C9FBFF4DE8FDFF30D8 + FBFFCBF4FEFFF2FCFFFFEBFAFEFF39D3F9FF37D2F8FFEAFAFEFFF1FBFEFFC4F2 + FDFF16CFF6FF31E0F7FF00BEEFFF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000CAFDFF50E8FDFF26D2 + FCFF45D8FCFFECFBFFFFF2FCFFFFECFBFFFFECFAFEFFF1FCFFFFEAFAFEFF32D0 + F7FF0AC5F5FF33E1F8FF00BEEFFF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000CAFDFF53E9FEFF2AD3 + FDFF27D2FCFF46D8FCFFEDFBFFFFF2FCFFFFF2FCFFFFECFAFEFF38D3F9FF11C9 + F7FF0EC8F6FF36E2F8FF00C0F1FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000CAFDFF55EAFEFF2ED4 + FDFF2BD3FDFF49D9FCFFEDFBFFFFF2FCFFFFF2FCFFFFECFBFFFF3BD3F9FF14CB + F8FF12C9F7FF3AE1F8FF00C0F1FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000CCFFFF58EAFEFF31D5 + FEFF4EDAFDFFEDFBFFFFF3FDFFFFEDFBFFFFEDFBFFFFF2FCFFFFECFAFEFF3CD4 + FAFF15CBF8FF3DE3F9FF00C0F1FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000CCFFFF59EBFFFF41DD + FEFFCFF5FFFFF3FDFFFFEDFBFFFF4AD9FCFF48D8FCFFECFBFFFFF2FCFFFFCAF4 + FEFF28D5FAFF40E4FAFF00C1F3FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000ADD8EB24D9FFFF5BEC + FFFF56E1FFFFCFF5FFFF50DCFEFF2DD4FDFF2AD3FDFF49D9FCFFCCF4FEFF46DB + FBFF47E5FBFF1BD3F9FF00A6D0EB000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000ADD8EB24D9 + FFFF5BECFFFF41DDFFFF32D6FEFF30D5FEFF2ED4FDFF2BD3FDFF36D9FCFF4DE7 + FCFF1DD4FAFF00A7D2EB00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000AD + D8EB24D9FFFF5AEBFFFF59EBFFFF58EAFEFF56EAFEFF54E9FEFF52E9FEFF20D5 + FCFF00B5E1F20000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000AFDAEC00CCFFFF00CCFFFF00CCFFFF00CAFDFF00CAFDFF00CAFDFF00AD + D8EC000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000020000000360000003600000036000000360000 00360000003600000036000000330000001D0000000000000000000000000000 0003000000010000000000000000000000000000000000000000000000000000 @@ -2674,112 +2816,112 @@ object MainForm: TMainForm 00000000000000000000000000000000000000000303161545493937BDC80B0B 2C2F000000000000000007062A2F2222B5C70B0A424900000303000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000184B73C260A4D7FF63A7DAFF62A5 + 00000000CEEC0000F1FF0000F1FF0000F1FF0000EFFF0000EFFF0000EDFF0000 + CCED00000000000000000000000000000000184B73C260A4D7FF63A7DAFF62A5 D9FF60A3D8FF60A1D7FF4B7EA9FFFCFCFCFF0D7D00FF0D7D00FF0D7D00FF0D7D 00FF0D7D00FF0D7D00FFFCFCFCFF0000003600000000060C061438763EC260B2 69FF4C9B53FF0F27115300000001000000000000000000000000000000000000 000000000000000000000000000000000000060612144845C5CD6260FAFF4341 D3DF0C0C303309092F333331CFDF4D4BF7FF2827BCCD02021214000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF66AADCFF468DCFFF448A + D2EC181EF5FF3A4AF9FF3847F8FF3645F8FF3343F8FF3241F7FF3040F7FF1219 + F1FF0000C4E80000000000000000000000001E6197FF66AADCFF468DCFFF448A CEFF4186CDFF4084CBFF3268A0FFFCFCFCFF0D7D00FF0D7D00FF0D7D00FF0D7D 00FF0D7D00FF0D7D00FFFCFCFCFF0000003609130A1C42814ABE6EC079FF72C4 7DFF70C37AFF499550F316331763000000010000000000000000000000000000 0000000000000000000000000000000000000101020215153D3F5554DEE56664 FBFF4D4BE0EA4745DFEB5957F9FF3C3AD6E40C0B3A3F00000202000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF67ADDCFF4892D1FF468E + 00000000000000000000000000000000000000000000000000000000D4EC1B21 + F9FF4251FAFF2227F9FF1111F7FF0E0EF6FF0B0BF5FF0808F5FF1419F5FF3141 + F7FF1219F1FF0000C4E800000000000000001E6197FF67ADDCFF4892D1FF468E D0FF448ACEFF4388CCFF346BA1FFFCFCFCFFFCFCFCFFFFFFFFFFFCFCFCFFFAFA FAFFF9F9F9FFFFFFFFFFFCFCFCFF0000003629542E776BBE77FB6FBF7AFE3D78 44B4569F5FE473C57DFF4A9552F3102812530000000100000000000000000000 0000000000000000000000000000000000000000000001010202181743455D5C E9EE6866FFFF6462FFFF4F4DE5EE0F0F40450000020200000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF69B0DEFF4B96D3FF4992 + 000000000000000000000000000000000000000000000000D4EC1D23FAFF4856 + FBFF4045FBFFC9C9FDFF3939F9FF1212F7FF0F0FF6FF3131F7FFC4C4FDFF2E33 + F7FF3242F7FF1219F2FF0000C4E8000000001E6197FF69B0DEFF4B96D3FF4992 D2FF468ED0FF468CCEFF376EA2FFFCFCFCFFFFFFFFFFFCFCFCFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFCFCFCFF00000036040A050E3364388C336039850206 02091023123957A161E575C781FF52A05AFE1532175F00000001000000000000 000000000000000000000000000000000000000000000000000013133233615E E6EB706CFFFF6B69FFFF504EE1EB0D0C30330000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF6BB2DFFF4E9BD5FF4C97 + 000000000000000000000000000000000000000000000000FBFF4D5BFDFF3035 + FBFFCBCBFEFFF2F2FFFFEBEBFEFF3939F9FF3737F8FFEAEAFEFFF1F1FEFFC4C4 + FDFF161BF6FF3141F7FF0000EFFF000000001E6197FF6BB2DFFF4E9BD5FF4C97 D3FF4993D1FF4891D0FF3872A4FFFCFCFCFFFCFCFCFFFFFFFFFFF8F8F8FFF6F6 F6FFF3F3F3FFEFEFEFFFFCFCFCFF0000003600000000040A050E0409040D0000 00000000000018331B51589D60DD77C883FF4D9755EF132D1555000000000000 0000000000000000000000000000000000000000000014142F2F6360DCDF7A77 FDFF6765EAEE615FE9EE6D6AFBFF4A47D5DF0D0D2C2F00000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF6EB4E0FF509ED7FF4E9B + 000000000000000000000000000000000000000000000000FDFF505DFDFF2626 + FCFF4545FCFFECECFFFFF2F2FFFFECECFFFFECECFEFFF1F1FFFFEAEAFEFF3232 + F7FF0A0AF5FF3343F8FF0000EFFF000000001E6197FF6EB4E0FF509ED7FF4E9B D6FF4C97D4FF4B95D2FF3B75A5FFFCFCFCFF0D7D00FF0D7D00FF0D7D00FF0D7D 00FF0D7D00FF0D7D00FFFCFCFCFF000000360000000000000000000000000000 00000000000000000000152D17465BA365E45FAA69EE1D40226D000000000000 000000000000000000000000000000000000020207075A58C4C4817DFEFF6967 E2E41B1B4345191843455C59DEE4716FFCFF4644C4CD06061416000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF71B6E1FF55A2D7FF519F + 000000000000000000000000000000000000000000000000FDFF5360FEFF2A2A + FDFF2727FCFF4646FCFFEDEDFFFFF2F2FFFFF2F2FFFFECECFEFF3838F9FF1111 + F7FF0E0EF6FF3646F8FF0000F1FF000000001E6197FF71B6E1FF55A2D7FF519F D7FF4E9CD5FF4E9AD4FF3D79A7FFFCFCFCFF0D7D00FF0D7D00FF0D7D00FF0D7D 00FF0D7D00FF0D7D00FFFCFCFCFF000000360000000000000000000000000000 0000000000000000000001010102162D18461B371E5901030106000000000000 000000000000000000000000000000000000000001011B1A3A3A5F5DC9C91C1B 3F3F010102020101020217163D3F5554CED32E2C7E8403030E0F000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF74B8E2FF5AA6D9FF56A3 + 000000000000000000000000000000000000000000000000FDFF5562FEFF2E2E + FDFF2B2BFDFF4949FCFFEDEDFFFFF2F2FFFFF2F2FFFFECECFFFF3B3BF9FF1414 + F8FF1212F7FF3A49F8FF0000F1FF000000001E6197FF74B8E2FF5AA6D9FF56A3 D8FF519FD7FF509DD6FF3F7BA8FFFCFCFCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFCFCFCFFF6F6F6FF56565691000000200000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000010105050E0E0101 02020000000000000000010102020C0B1F200606141500000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF78BAE3FF5FA9DBFF58A4 + 000000000000000000000000000000000000000000000000FFFF5865FEFF3131 + FEFF4E4EFDFFEDEDFFFFF3F3FFFFEDEDFFFFEDEDFFFFF2F2FFFFECECFEFF3C3C + FAFF1515F8FF3D4CF9FF0000F1FF000000001E6197FF78BAE3FF5FA9DBFF58A4 D9FF519FD7FF509ED7FF3F7CA9FFF6F8F9FFFCFCFCFFFCFCFCFFFCFCFCFFFCFC FCFFF8F8F8FF5454549100000020000000020000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF7ABCE4FF63ADDDFF60AA + 000000000000000000000000000000000000000000000000FFFF5966FFFF4145 + FEFFCFCFFFFFF3F3FFFFEDEDFFFF4A4AFCFF4848FCFFECECFFFFF2F2FFFFCACA + FEFF282DFAFF404FFAFF0000F3FF000000001E6197FF7ABCE4FF63ADDDFF60AA DCFF5CA7DAFF5AA6D9FF4F92BEFF4783ABFF4783AAFF3F7BA8FF4B7EA9FF174C 76FF000000360000002000000002000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001E6197FF7DBEE4FF67B1DEFF489A + 000000000000000000000000000000000000000000000000D8EB2429FFFF5B68 + FFFF5659FFFFCFCFFFFF5050FEFF2D2DFDFF2A2AFDFF4949FCFFCCCCFEFF464A + FBFF4755FBFF1B21F9FF0000D0EB000000001E6197FF7DBEE4FF67B1DEFF489A DAFF4296DCFF4195DCFF4095DCFF4094DCFF3F93DAFF4F9CD5FF6AB0DDFF1E61 96FF000000010000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001B5585E06FB1DAFE7CBEE4FF4C9C + 00000000000000000000000000000000000000000000000000000000D8EB2429 + FFFF5B68FFFF4145FFFF3232FEFF3030FEFF2E2EFDFF2B2BFDFF363AFCFF4D5B + FCFF1D23FAFF0000D2EB00000000000000001B5585E06FB1DAFE7CBEE4FF4C9C DFFFB4EEFDFF73D4F0FF73D4F0FFB4EEFDFF499ADEFF6CB3E0FF69AED9F91D5D 90F3000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000006121E32164368B21E6197FF3573 + D8EB2429FFFF5A67FFFF5966FFFF5865FEFF5663FEFF5461FEFF525FFEFF2025 + FCFF0000E1F200000000000000000000000006121E32164368B21E6197FF3573 A3FFB5EFFEFF7EDBF3FF7EDBF3FFB5EFFEFF2C6CA0FF1E6197FF133E61A50A1F 3153000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000040F192A1E61 + 00000000DAEC0000FFFF0000FFFF0000FFFF0000FDFF0000FDFF0000FDFF0000 + D8EC000000000000000000000000000000000000000000000000040F192A1E61 97FF1E6197FF1E6197FF1E6197FF1E6197FF1D5B8EF000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -7780,7 +7922,7 @@ object MainForm: TMainForm 000000000000000000000000000000000000854F2FAAA46B43CEB1764ADEAE74 48DBAF7448DBAE7349DBA46A3FD054331B6E0603020800000000000000000000 000000000000000000000000000000000000424D3E000000000000003E000000 - 2800000040000000800200000100010000000000001400000000000000000000 + 2800000040000000900200000100010000000000801400000000000000000000 000000000000000000000000FFFFFF0000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -7942,6 +8084,10 @@ object MainForm: TMainForm 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 000000000000} end object PopupQueryLoad: TPopupMenu diff --git a/source/main.pas b/source/main.pas index 27bc6765..c3afb706 100644 --- a/source/main.pas +++ b/source/main.pas @@ -517,6 +517,8 @@ type actSingleQueries: TAction; Sendqueriesonebyone1: TMenuItem; N3: TMenuItem; + btnCancelOperation: TToolButton; + actCancelOperation: TAction; procedure actCreateDBObjectExecute(Sender: TObject); procedure menuConnectionsPopup(Sender: TObject); procedure actExitApplicationExecute(Sender: TObject); @@ -835,6 +837,7 @@ type procedure Copylinetonewquerytab1Click(Sender: TObject); procedure menuLogHorizontalScrollbarClick(Sender: TObject); procedure actBatchInOneGoExecute(Sender: TObject); + procedure actCancelOperationExecute(Sender: TObject); private LastHintMousepos: TPoint; LastHintControlIndex: Integer; @@ -862,6 +865,7 @@ type FSnippetFilenames: TStringList; FConnections: TMySQLConnectionList; FTreeClickHistory: TNodeArray; + FOperationTicker: Cardinal; procedure ParseCommandLineParameters(Parameters: TStringlist); procedure SetDelimiter(Value: String); procedure DisplayRowCountStats(Sender: TBaseVirtualTree); @@ -885,6 +889,7 @@ type procedure PaintColorBar(Value, Max: Extended; TargetCanvas: TCanvas; CellRect: TRect); procedure SetSnippetFilenames; function TreeClickHistoryPrevious(MayBeNil: Boolean=False): PVirtualNode; + procedure OperationRunning(Runs: Boolean); public AllDatabasesDetails: TMySQLQuery; btnAddTab: TSpeedButton; @@ -5970,6 +5975,7 @@ var begin VT := Sender as TVirtualStringTree; Result := CompareAnyNode(VT.Text[Node1, Column], VT.Text[Node2, Column]); + OperationRunning(True); end; @@ -9628,16 +9634,52 @@ end; procedure TMainForm.AnyGridStartOperation(Sender: TBaseVirtualTree; OperationKind: TVTOperationKind); begin // Display status message on long running sort operations - if OperationKind = okSortTree then + if OperationKind = okSortTree then begin ShowStatusMsg('Sorting grid nodes ...'); + OperationRunning(True); + end; end; procedure TMainForm.AnyGridEndOperation(Sender: TBaseVirtualTree; OperationKind: TVTOperationKind); begin // Reset status message after long running operations - if OperationKind = okSortTree then + if OperationKind = okSortTree then begin ShowStatusMsg; + OperationRunning(False); + end; +end; + + +procedure TMainForm.actCancelOperationExecute(Sender: TObject); +begin + // Stop current sort operation + ActiveGrid.CancelOperation; + LogSQL('Sorting cancelled.'); +end; + + +procedure TMainForm.OperationRunning(Runs: Boolean); +begin + if actCancelOperation.Enabled <> Runs then begin + actCancelOperation.ImageIndex := 159; + actCancelOperation.Enabled := Runs; + if Runs then + FOperationTicker := GetTickCount + else + FOperationTicker := 0; + Application.ProcessMessages; + end else if Runs then begin + if (GetTickCount-FOperationTicker) > 250 then begin + // Signalize running operation + if actCancelOperation.ImageIndex = 159 then + actCancelOperation.ImageIndex := 160 + else + actCancelOperation.ImageIndex := 159; + Application.ProcessMessages; + FOperationTicker := GetTickCount; + end; + end; end;