Skip to content

Commit b488ca2

Browse files
committed
fix: confusion with (selected) folder icons
1 parent b4c0566 commit b488ca2

File tree

4 files changed

+115
-113
lines changed

4 files changed

+115
-113
lines changed

source/const.inc

Lines changed: 110 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,110 @@
1-
// Common constants
2-
{$WARN 5028 off : Local $1 "$2" is not used}
3-
{$WARN 5025 off : Local variable "$1" not used}
4-
const
5-
6-
// Line breaks
7-
// TODO: use sLineBreak instead
8-
CRLF = #13#10;
9-
LB_UNIX = #10;
10-
LB_MAC = #13;
11-
LB_WIDE = WideChar($2027);
12-
13-
// Placeholder text for NULL values
14-
TEXT_NULL = '(NULL)';
15-
16-
// General things
17-
APPNAME = 'HeidiSQL';
18-
APPDOMAIN = 'https://www.heidisql.com/';
19-
REGKEY_SESSIONS = 'Servers';
20-
REGKEY_QUERYHISTORY = 'QueryHistory';
21-
REGKEY_RECENTFILTERS = 'RecentFilters';
22-
// Some unique char, used to separate e.g. selected columns in registry
23-
DELIM = '|';
24-
CHR10REPLACEMENT = '<}}}>';
25-
CHR13REPLACEMENT = '<{{{>';
26-
LINEDELIMITER = '<|||>';
27-
28-
COLORSHIFT_NULLFIELDS = 70; // Brightness adjustment to add to normal field colors for NULL values
29-
COLORSHIFT_SORTCOLUMNS = 10; // Brightness adjustment to add to sorted column backgrounds
30-
31-
// Various iconindexes
32-
ICONINDEX_PRIMARYKEY = 25;
33-
ICONINDEX_FIELD = 42;
34-
ICONINDEX_INDEXKEY = 23;
35-
ICONINDEX_UNIQUEKEY = 24;
36-
ICONINDEX_FULLTEXTKEY = 22;
37-
ICONINDEX_SPATIALKEY = 126;
38-
ICONINDEX_VECTORKEY = 207;
39-
ICONINDEX_FOREIGNKEY = 136;
40-
ICONINDEX_SERVER = 36;
41-
ICONINDEX_DB = 5;
42-
ICONINDEX_HIGHLIGHTMARKER = 157;
43-
ICONINDEX_TABLE = 14;
44-
ICONINDEX_VIEW = 81;
45-
ICONINDEX_STOREDPROCEDURE = 119;
46-
ICONINDEX_STOREDFUNCTION = 35;
47-
ICONINDEX_TRIGGER = 137;
48-
ICONINDEX_FUNCTION = 13;
49-
ICONINDEX_EVENT = 80;
50-
ICONINDEX_KEYWORD = 25;
51-
52-
// Size of byte units
53-
{Kibibyte} SIZE_KB = Int64(1024);
54-
{Mebibyte} SIZE_MB = Int64(1048576);
55-
{Gibibyte} SIZE_GB = Int64(1073741824);
56-
{Tebibyte} SIZE_TB = Int64(1099511627776);
57-
{Pebibyte} SIZE_PB = Int64(1125899906842624);
58-
{Exbibyte} SIZE_EB = Int64(1152921504606846976);
59-
60-
// Size of byte units for formatting purposes
61-
{Kibibyte} FSIZE_KB = Int64(1000);
62-
{Mebibyte} FSIZE_MB = Int64(1024000);
63-
{Gibibyte} FSIZE_GB = Int64(1048576000);
64-
{Tebibyte} FSIZE_TB = Int64(1073741824000);
65-
{Pebibyte} FSIZE_PB = Int64(1099511627776000);
66-
{Exbibyte} FSIZE_EB = Int64(1125899906842624000);
67-
68-
// Abbreviations of byte unit names
69-
{Bytes} NAME_BYTES = ' B';
70-
{Kibibyte} NAME_KB = ' KiB';
71-
{Mebibyte} NAME_MB = ' MiB';
72-
{Gibibyte} NAME_GB = ' GiB';
73-
{Tebibyte} NAME_TB = ' TiB';
74-
{Pebibyte} NAME_PB = ' PiB';
75-
{Exbibyte} NAME_EB = ' EiB';
76-
77-
// Data grid: How many bytes to fetch from data fields that are potentially large.
78-
GRIDMAXDATA: Int64 = 256;
79-
80-
BACKUP_MAXFILESIZE = 10 * SIZE_MB;
81-
BACKUP_FILEPATTERN: String = 'query-tab-%s.sql';
82-
83-
VTREE_NOTLOADED = 0;
84-
VTREE_NOTLOADED_PURGECACHE = 1;
85-
VTREE_LOADED = 2;
86-
87-
// Modification indicator for TControl.Tag
88-
MODIFIEDFLAG = 10;
89-
90-
SUnhandledNodeIndex = 'Unhandled tree node index';
91-
MSG_NOGRIDEDITING = 'Selected columns don''t contain a sufficient set of key columns to allow editing. Please select primary or unique key columns, or just all columns.';
92-
SIdle = 'Idle.';
93-
SUnsupported = 'Unsupported by this server';
94-
SUnsupportedSettingsDatatype = 'Unsupported datatype for setting "%s"';
95-
SNotImplemented = 'Method not implemented for this connection type';
96-
MsgSQLError: String = 'SQL Error (%d): %s';
97-
MsgSQLErrorMultiStatements: String = 'SQL Error (%d) in statement #%d: %s';
98-
MsgUnhandledNetType: String = 'Unhandled connection type (%d)';
99-
MsgUnhandledControl: String = 'Unhandled control in %s';
100-
MsgDisconnect: String = 'Connection to %s closed at %s';
101-
MsgInvalidColumn: String = 'Column #%d not available. Query returned %d columns and %d rows.';
102-
FILEFILTER_SQLITEDB = '*.sqlite3;*.sqlite;*.db;*.s3db';
103-
FILEEXT_SQLITEDB = 'sqlite3';
104-
PROPOSAL_ITEM_HEIGHT = 18;
105-
// Note the following should be in sync to what MySQL returns from SHOW WARNINGS
106-
SLogPrefixWarning = 'Warning';
107-
SLogPrefixNote = 'Note';
108-
SLogPrefixInfo = 'Info';
109-
1+
// Common constants
2+
{$WARN 5028 off : Local $1 "$2" is not used}
3+
{$WARN 5025 off : Local variable "$1" not used}
4+
const
5+
6+
// Line breaks
7+
// TODO: use sLineBreak instead
8+
CRLF = #13#10;
9+
LB_UNIX = #10;
10+
LB_MAC = #13;
11+
LB_WIDE = WideChar($2027);
12+
13+
// Placeholder text for NULL values
14+
TEXT_NULL = '(NULL)';
15+
16+
// General things
17+
APPNAME = 'HeidiSQL';
18+
APPDOMAIN = 'https://www.heidisql.com/';
19+
REGKEY_SESSIONS = 'Servers';
20+
REGKEY_QUERYHISTORY = 'QueryHistory';
21+
REGKEY_RECENTFILTERS = 'RecentFilters';
22+
// Some unique char, used to separate e.g. selected columns in registry
23+
DELIM = '|';
24+
CHR10REPLACEMENT = '<}}}>';
25+
CHR13REPLACEMENT = '<{{{>';
26+
LINEDELIMITER = '<|||>';
27+
28+
COLORSHIFT_NULLFIELDS = 70; // Brightness adjustment to add to normal field colors for NULL values
29+
COLORSHIFT_SORTCOLUMNS = 10; // Brightness adjustment to add to sorted column backgrounds
30+
31+
// Various iconindexes
32+
ICONINDEX_PRIMARYKEY = 25;
33+
ICONINDEX_FIELD = 42;
34+
ICONINDEX_INDEXKEY = 23;
35+
ICONINDEX_UNIQUEKEY = 24;
36+
ICONINDEX_FULLTEXTKEY = 22;
37+
ICONINDEX_SPATIALKEY = 126;
38+
ICONINDEX_VECTORKEY = 207;
39+
ICONINDEX_FOREIGNKEY = 136;
40+
ICONINDEX_SERVER = 36;
41+
ICONINDEX_DB = 5;
42+
ICONINDEX_HIGHLIGHTMARKER = 157;
43+
ICONINDEX_TABLE = 14;
44+
ICONINDEX_VIEW = 81;
45+
ICONINDEX_STOREDPROCEDURE = 119;
46+
ICONINDEX_STOREDFUNCTION = 35;
47+
ICONINDEX_TRIGGER = 137;
48+
ICONINDEX_FUNCTION = 13;
49+
ICONINDEX_EVENT = 80;
50+
ICONINDEX_KEYWORD = 25;
51+
ICONINDEX_FOLDER = 174;
52+
53+
// Size of byte units
54+
{Kibibyte} SIZE_KB = Int64(1024);
55+
{Mebibyte} SIZE_MB = Int64(1048576);
56+
{Gibibyte} SIZE_GB = Int64(1073741824);
57+
{Tebibyte} SIZE_TB = Int64(1099511627776);
58+
{Pebibyte} SIZE_PB = Int64(1125899906842624);
59+
{Exbibyte} SIZE_EB = Int64(1152921504606846976);
60+
61+
// Size of byte units for formatting purposes
62+
{Kibibyte} FSIZE_KB = Int64(1000);
63+
{Mebibyte} FSIZE_MB = Int64(1024000);
64+
{Gibibyte} FSIZE_GB = Int64(1048576000);
65+
{Tebibyte} FSIZE_TB = Int64(1073741824000);
66+
{Pebibyte} FSIZE_PB = Int64(1099511627776000);
67+
{Exbibyte} FSIZE_EB = Int64(1125899906842624000);
68+
69+
// Abbreviations of byte unit names
70+
{Bytes} NAME_BYTES = ' B';
71+
{Kibibyte} NAME_KB = ' KiB';
72+
{Mebibyte} NAME_MB = ' MiB';
73+
{Gibibyte} NAME_GB = ' GiB';
74+
{Tebibyte} NAME_TB = ' TiB';
75+
{Pebibyte} NAME_PB = ' PiB';
76+
{Exbibyte} NAME_EB = ' EiB';
77+
78+
// Data grid: How many bytes to fetch from data fields that are potentially large.
79+
GRIDMAXDATA: Int64 = 256;
80+
81+
BACKUP_MAXFILESIZE = 10 * SIZE_MB;
82+
BACKUP_FILEPATTERN: String = 'query-tab-%s.sql';
83+
84+
VTREE_NOTLOADED = 0;
85+
VTREE_NOTLOADED_PURGECACHE = 1;
86+
VTREE_LOADED = 2;
87+
88+
// Modification indicator for TControl.Tag
89+
MODIFIEDFLAG = 10;
90+
91+
SUnhandledNodeIndex = 'Unhandled tree node index';
92+
MSG_NOGRIDEDITING = 'Selected columns don''t contain a sufficient set of key columns to allow editing. Please select primary or unique key columns, or just all columns.';
93+
SIdle = 'Idle.';
94+
SUnsupported = 'Unsupported by this server';
95+
SUnsupportedSettingsDatatype = 'Unsupported datatype for setting "%s"';
96+
SNotImplemented = 'Method not implemented for this connection type';
97+
MsgSQLError: String = 'SQL Error (%d): %s';
98+
MsgSQLErrorMultiStatements: String = 'SQL Error (%d) in statement #%d: %s';
99+
MsgUnhandledNetType: String = 'Unhandled connection type (%d)';
100+
MsgUnhandledControl: String = 'Unhandled control in %s';
101+
MsgDisconnect: String = 'Connection to %s closed at %s';
102+
MsgInvalidColumn: String = 'Column #%d not available. Query returned %d columns and %d rows.';
103+
FILEFILTER_SQLITEDB = '*.sqlite3;*.sqlite;*.db;*.s3db';
104+
FILEEXT_SQLITEDB = 'sqlite3';
105+
PROPOSAL_ITEM_HEIGHT = 18;
106+
// Note the following should be in sync to what MySQL returns from SHOW WARNINGS
107+
SLogPrefixWarning = 'Warning';
108+
SLogPrefixNote = 'Note';
109+
SLogPrefixInfo = 'Info';
110+

source/dbconnection.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ function TConnectionParameters.SshIsPlink: Boolean;
17191719
function TConnectionParameters.GetImageIndex: Integer;
17201720
begin
17211721
if IsFolder then
1722-
Result := 174
1722+
Result := ICONINDEX_FOLDER
17231723
else case NetTypeGroup of
17241724
ngMySQL: begin
17251725
if IsPercona then Result := 169

source/extfiledialog.lfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ object frmExtFileDialog: TfrmExtFileDialog
88
ClientHeight = 544
99
ClientWidth = 872
1010
DesignTimePPI = 120
11+
Position = poOwnerFormCenter
1112
OnCloseQuery = FormCloseQuery
1213
OnCreate = FormCreate
1314
OnDestroy = FormDestroy

source/extfiledialog.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ procedure TfrmExtFileDialog.ShellListViewFileAdded(Sender: TObject;
323323
Ext: String;
324324
begin
325325
if TShellListItem(Item).IsFolder then
326-
Item.ImageIndex := 51
326+
Item.ImageIndex := ICONINDEX_FOLDER
327327
else begin
328328
Ext := ExtractFileExt(ShellListView.GetPathFromItem(Item));
329329
Item.ImageIndex := GetFileExtImageIndex(Ext);
@@ -360,13 +360,13 @@ procedure TfrmExtFileDialog.ShellTreeViewChanging(Sender: TObject;
360360
procedure TfrmExtFileDialog.ShellTreeViewGetImageIndex(Sender: TObject;
361361
Node: TTreeNode);
362362
begin
363-
Node.ImageIndex := IfThen(Node.Level = 0, 1, 51);
363+
Node.ImageIndex := IfThen(Node.Level = 0, 1, ICONINDEX_FOLDER);
364364
end;
365365

366366
procedure TfrmExtFileDialog.ShellTreeViewGetSelectedIndex(Sender: TObject;
367367
Node: TTreeNode);
368368
begin
369-
Node.ImageIndex := IfThen(Node.Level = 0, 1, 51);
369+
Node.SelectedIndex := IfThen(Node.Level = 0, 1, ICONINDEX_FOLDER);
370370
end;
371371

372372
procedure TfrmExtFileDialog.SetTitle(AValue: String);

0 commit comments

Comments
 (0)