Make insertion of node text on double click customizable, per tree style options menu. See http://www.heidisql.com/forum.php?t=16104

This commit is contained in:
Ansgar Becker
2015-11-11 20:27:54 +00:00
parent 0f467ed167
commit daac6caab7
4 changed files with 43 additions and 2 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2015-11-03 07:26+0100\n"
"PO-Revision-Date: 2015-11-11 21:25+0100\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/"
"language/en/)\n"
@ -5966,3 +5966,6 @@ msgstr "GUI font (requires restart):"
msgid "Default system font"
msgstr "Default system font"
msgid "Doubleclick inserts node text"
msgstr "Doubleclick inserts node text"

View File

@ -167,7 +167,7 @@ type
asFieldEditorSet, asFieldNullBackground, asRowBackgroundEven, asRowBackgroundOdd, asGroupTreeObjects, asDisplayObjectSizeColumn, asSQLfile,
asActionShortcut1, asActionShortcut2, asHighlighterForeground, asHighlighterBackground, asHighlighterStyle,
asListColWidths, asListColsVisible, asListColPositions, asListColSort, asSessionFolder,
asRecentFilter, asTimestampColumns, asDateTimeEditorCursorPos, asAppLanguage, asAutoExpand, asForeignDropDown, asQueryHistoryEnabled,
asRecentFilter, asTimestampColumns, asDateTimeEditorCursorPos, asAppLanguage, asAutoExpand, asDoubleClickInsertsNodeText, asForeignDropDown, asQueryHistoryEnabled,
asColumnSelectorWidth, asColumnSelectorHeight, asDonatedEmail, asFavoriteObjects, asFavoriteObjectsOnly, asFullTableStatus, asLineBreakStyle,
asUnused);
TAppSetting = record
@ -3350,6 +3350,7 @@ begin
InitSetting(asDateTimeEditorCursorPos, 'DateTimeEditor_CursorPos_Type%s', 0);
InitSetting(asAppLanguage, 'Language', 0, False, '');
InitSetting(asAutoExpand, 'AutoExpand', 0, False);
InitSetting(asDoubleClickInsertsNodeText, 'DoubleClickInsertsNodeText', 0, True);
InitSetting(asForeignDropDown, 'ForeignDropDown', 0, True);
InitSetting(asQueryHistoryEnabled, 'QueryHistory', 0, True);
InitSetting(asColumnSelectorWidth, 'ColumnSelectorWidth', 200, False, '');

View File

@ -164,6 +164,7 @@ object MainForm: TMainForm
OnAfterCellPaint = DBtreeAfterCellPaint
OnBeforeCellPaint = DBtreeBeforeCellPaint
OnChange = DBtreeChange
OnDblClick = DBtreeDblClick
OnExpanded = DBtreeExpanded
OnExpanding = DBtreeExpanding
OnFocusChanged = DBtreeFocusChanged
@ -9239,6 +9240,10 @@ object MainForm: TMainForm
Caption = 'Auto expand on click'
OnClick = menuAutoExpandClick
end
object menuDoubleClickInsertsNodeText: TMenuItem
Caption = 'Doubleclick inserts node text'
OnClick = menuDoubleClickInsertsNodeTextClick
end
object menuSelectBGColor: TMenuItem
Action = actSelectTreeBackground
end

View File

@ -614,6 +614,7 @@ type
DataGUIDwobraces: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
menuDoubleClickInsertsNodeText: TMenuItem;
procedure actCreateDBObjectExecute(Sender: TObject);
procedure menuConnectionsPopup(Sender: TObject);
procedure actExitApplicationExecute(Sender: TObject);
@ -970,6 +971,8 @@ type
procedure actSaveSynMemoToTextfileExecute(Sender: TObject);
procedure ApplicationEvents1Idle(Sender: TObject; var Done: Boolean);
procedure editDatabaseTableFilterRightButtonClick(Sender: TObject);
procedure menuDoubleClickInsertsNodeTextClick(Sender: TObject);
procedure DBtreeDblClick(Sender: TObject);
private
// Executable file details
FAppVerMajor: Integer;
@ -1720,6 +1723,8 @@ begin
menuShowSizeColumn.Click;
if AppSettings.ReadBool(asAutoExpand) then
menuAutoExpand.Click;
if AppSettings.ReadBool(asDoubleClickInsertsNodeText) then
menuDoubleClickInsertsNodeText.Click;
// Restore width of columns of all VirtualTrees
RestoreListSetup(ListDatabases);
@ -6683,6 +6688,17 @@ begin
end;
procedure TMainForm.menuDoubleClickInsertsNodeTextClick(Sender: TObject);
var
Item: TMenuItem;
begin
// Activate doubleclick node feature
Item := Sender as TMenuItem;
Item.Checked := not Item.Checked;
AppSettings.ResetPath;
AppSettings.WriteBool(asDoubleClickInsertsNodeText, Item.Checked);
end;
{**
Load snippet at cursor
}
@ -7957,6 +7973,22 @@ begin
end;
procedure TMainForm.DBtreeDblClick(Sender: TObject);
var
DBObj: PDBObject;
m: TSynMemo;
begin
// Paste DB or table name into query window on treeview double click.
if AppSettings.ReadBool(asDoubleClickInsertsNodeText) and QueryTabActive and Assigned(DBtree.FocusedNode) then begin
DBObj := DBtree.GetNodeData(DBtree.FocusedNode);
if DBObj.NodeType in [lntDb, lntTable..lntEvent] then begin
m := ActiveQueryMemo;
m.DragDrop(Sender, m.CaretX, m.CaretY);
end;
end;
end;
procedure TMainForm.DBtreeExpanded(Sender: TBaseVirtualTree;
Node: PVirtualNode);
begin