Skip to content
Permalink
Browse files

Issue #360: add unique session colors only to the background color se…

…lector, and label them "Custom color". See https://www.heidisql.com/forum.php?t=34168#p34194
  • Loading branch information...
ansgarbecker committed Jul 12, 2019
1 parent 7f214ed commit 36ae8f26b60064cf52f385f3164a75d1fab52020
Showing with 8 additions and 5 deletions.
  1. +4 −1 out/locale/en/LC_MESSAGES/default.po
  2. +4 −4 source/connections.pas
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2019-07-11 21:34+0200\n"
"PO-Revision-Date: 2019-07-12 18:20+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n"
@@ -173,6 +173,9 @@ msgstr "Session manager"
msgid "Session"
msgstr "Session"

msgid "Custom color:"
msgstr "Custom color:"

#. connform..btnSave..Caption
#. connform..popupSessions..menuSave..Caption
#. frmEventEditor..btnSave..Caption
@@ -11,7 +11,7 @@ interface
uses
Windows, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
VirtualTrees, Menus, Graphics, Generics.Collections, ActiveX, extra_controls, Messages,
dbconnection, gnugettext, SynRegExpr, System.Types, System.IOUtils;
dbconnection, gnugettext, SynRegExpr, System.Types, System.IOUtils, Vcl.GraphUtil;

type
Tconnform = class(TFormWithSizeGrip)
@@ -321,15 +321,15 @@ procedure Tconnform.RefreshSessions(ParentNode: PVirtualNode);
ListSessions.DeleteChildren(ParentNode, True);
end;
SessionNames := NodeSessionNames(ParentNode, RegKey);
ColorNamePrefix := _('Session') + ' "';
ColorNamePrefix := _('Custom color:') + ' ';
for i:=0 to SessionNames.Count-1 do begin
Params := TConnectionParameters.Create(RegKey+SessionNames[i]);
SessNode := ListSessions.AddChild(ParentNode, PConnectionParameters(Params));
if Params.IsFolder then begin
RefreshSessions(SessNode);
end else begin
ColorName := ColorNamePrefix + Params.SessionPath + '"';
if Params.SessionColor <> clNone then begin
ColorName := ColorNamePrefix + ColorToWebColorStr(Params.SessionColor);
if (Params.SessionColor <> clNone) and (FCustomBackgroundColors.IndexOf(ColorName) = -1) then begin
FCustomBackgroundColors.AddObject(ColorName, TObject(Params.SessionColor));
end;
end;

0 comments on commit 36ae8f2

Please sign in to comment.
You can’t perform that action at this time.