mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Make foreign values drop down optionally. See http://www.heidisql.com/forum.php?t=11816
This commit is contained in:
@ -172,7 +172,7 @@ type
|
||||
asFieldEditorSet, asFieldNullBackground, asGroupTreeObjects, asDisplayObjectSizeColumn, asSQLfile,
|
||||
asActionShortcut1, asActionShortcut2, asHighlighterForeground, asHighlighterBackground, asHighlighterStyle,
|
||||
asListColWidths, asListColsVisible, asListColPositions, asListColSort, asSessionFolder,
|
||||
asRecentFilter, asDateTimeEditorCursorPos, asAppLanguage, asAutoExpand, asUnused);
|
||||
asRecentFilter, asDateTimeEditorCursorPos, asAppLanguage, asAutoExpand, asForeignDropDown, asUnused);
|
||||
TAppSetting = record
|
||||
Name: String;
|
||||
Session: Boolean;
|
||||
@ -3209,6 +3209,7 @@ begin
|
||||
InitSetting(asDateTimeEditorCursorPos, 'DateTimeEditor_CursorPos_Type%s', 0);
|
||||
InitSetting(asAppLanguage, 'Language', 0, False, '');
|
||||
InitSetting(asAutoExpand, 'AutoExpand', 0, False);
|
||||
InitSetting(asForeignDropDown, 'ForeignDropDown', 0, True);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -7896,7 +7896,8 @@ begin
|
||||
Conn := Results.Connection;
|
||||
|
||||
// Find foreign key values on InnoDB table cells
|
||||
if Sender = DataGrid then for ForeignKey in SelectedTableForeignKeys do begin
|
||||
if AppSettings.ReadBool(asForeignDropDown) and (Sender = DataGrid) then begin
|
||||
for ForeignKey in SelectedTableForeignKeys do begin
|
||||
idx := ForeignKey.Columns.IndexOf(DataGrid.Header.Columns[Column].Text);
|
||||
if idx > -1 then try
|
||||
// Find the first text column if available and use that for displaying in the pulldown instead of using meaningless id numbers
|
||||
@ -7937,6 +7938,7 @@ begin
|
||||
// Error gets logged, do nothing more here. All other exception types raise please.
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
FGridEditFunctionMode := FGridEditFunctionMode or Results.IsFunction(Column);
|
||||
if FGridEditFunctionMode then begin
|
||||
|
@ -835,6 +835,14 @@ object optionsform: Toptionsform
|
||||
Caption = 'Remember filters, sorting and column selection across sessions'
|
||||
TabOrder = 17
|
||||
end
|
||||
object chkForeignDropDown: TCheckBox
|
||||
Left = 8
|
||||
Top = 302
|
||||
Width = 433
|
||||
Height = 17
|
||||
Caption = 'Drop down values from foreign table in InnoDB rows'
|
||||
TabOrder = 18
|
||||
end
|
||||
end
|
||||
object tabShortcuts: TTabSheet
|
||||
Caption = 'Shortcuts'
|
||||
|
@ -119,6 +119,7 @@ type
|
||||
chkRememberFilters: TCheckBox;
|
||||
lblLanguage: TLabel;
|
||||
comboAppLanguage: TComboBox;
|
||||
chkForeignDropDown: TCheckBox;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Modified(Sender: TObject);
|
||||
procedure Apply(Sender: TObject);
|
||||
@ -276,6 +277,7 @@ begin
|
||||
AppSettings.WriteBool(asFieldEditorEnum, chkEditorEnum.Checked);
|
||||
AppSettings.WriteBool(asFieldEditorSet, chkEditorSet.Checked);
|
||||
AppSettings.WriteBool(asRememberFilters, chkRememberFilters.Checked);
|
||||
AppSettings.WriteBool(asForeignDropDown, chkForeignDropDown.Checked);
|
||||
|
||||
AppSettings.WriteBool(asCompletionProposal, chkCompletionProposal.Checked);
|
||||
AppSettings.WriteBool(asTabsToSpaces, chkTabsToSpaces.Checked);
|
||||
@ -478,6 +480,7 @@ begin
|
||||
chkEditorEnum.Checked := AppSettings.ReadBool(asFieldEditorEnum);
|
||||
chkEditorSet.Checked := AppSettings.ReadBool(asFieldEditorEnum);
|
||||
chkRememberFilters.Checked := AppSettings.ReadBool(asRememberFilters);
|
||||
chkForeignDropDown.Checked := AppSettings.ReadBool(asForeignDropDown);
|
||||
|
||||
// Shortcuts
|
||||
TreeShortcutItems.ReinitChildren(nil, True);
|
||||
|
Reference in New Issue
Block a user