From 858aa92677f44a99bc65e72d3d9ea3e3712253b4 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 15 Aug 2011 06:01:02 +0000 Subject: [PATCH] Fix wrong icons in process list, use a different "idle" icon, and indicate broken and own thread with an overlay icon. --- res/icons/bullet_black.png | Bin 0 -> 211 bytes res/icons/bullet_star.png | Bin 0 -> 354 bytes source/main.dfm | 150 ++++++++++++++++++++++++++++++++++--- source/main.pas | 35 ++++++--- 4 files changed, 166 insertions(+), 19 deletions(-) create mode 100644 res/icons/bullet_black.png create mode 100644 res/icons/bullet_star.png diff --git a/res/icons/bullet_black.png b/res/icons/bullet_black.png new file mode 100644 index 0000000000000000000000000000000000000000..57619706d10d9736b1849a83f2c5694fbe09c53b GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$h^>lFz(Kw&{<9vg>5sw~gS5O!4 zr|{HuUFIBKiQyL}eBJ-L{`UVT|6_O~L{G%N{Wbre{kQtZ_0LvEhpF8FWQhbW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE;u(kfL#Cp0N+VOK~y+TV_+Bsqai?I2>iGd (Sender as TVirtualStringTree).Header.MainColumn) then exit; - ImageIndex := 25; if Sender = ListProcesses then begin + Idx := Sender.GetNodeData(Node); Results := GridResult(Sender); - if AnsiCompareText(Results.Col(4), 'Killed') = 0 then - ImageIndex := 26 // killed - else begin - if Results.Col('Info') = '' then - ImageIndex := 55 // idle - else - ImageIndex := 57 // running query + Results.RecNo := Idx^; + case Kind of + ikNormal, ikSelected: begin + if Results.Col('Info') = '' then begin + if MakeInt(Results.Col(5)) < 60 then + ImageIndex := 151 // Idle, same icon as in lower right status panel + else + ImageIndex := 167 // Long idle thread + end else + ImageIndex := actExecuteQuery.ImageIndex; // Running query + end; + ikOverlay: begin + if IntToStr(Results.Connection.ThreadId) = Results.Col(0) then + ImageIndex := 168; // Indicate users own thread id + if CompareText(Results.Col(4), 'Killed') = 0 then + ImageIndex := 158; // Broken + end; + else; + end; + end else begin + case Kind of + ikNormal, ikSelected: ImageIndex := 25; + else; end; end; end;