mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 10:02:10 +08:00
Indicate modified query contents by appending an asterisk to the tabsheet's caption.
This commit is contained in:
@ -3859,6 +3859,8 @@ procedure TMainForm.ValidateQueryControls(Sender: TObject);
|
|||||||
var
|
var
|
||||||
NotEmpty, HasSelection: Boolean;
|
NotEmpty, HasSelection: Boolean;
|
||||||
Memo: TSynMemo;
|
Memo: TSynMemo;
|
||||||
|
tab: TQueryTab;
|
||||||
|
cap: WideString;
|
||||||
begin
|
begin
|
||||||
if QueryTabActive then
|
if QueryTabActive then
|
||||||
Memo := ActiveQueryMemo
|
Memo := ActiveQueryMemo
|
||||||
@ -3881,6 +3883,15 @@ begin
|
|||||||
actClearQueryEditor.Enabled := QueryTabActive and NotEmpty;
|
actClearQueryEditor.Enabled := QueryTabActive and NotEmpty;
|
||||||
actSetDelimiter.Enabled := QueryTabActive;
|
actSetDelimiter.Enabled := QueryTabActive;
|
||||||
actCloseQueryTab.Enabled := IsQueryTab(PageControlMain.ActivePageIndex, False);
|
actCloseQueryTab.Enabled := IsQueryTab(PageControlMain.ActivePageIndex, False);
|
||||||
|
if Assigned(Memo) then begin
|
||||||
|
tab := ActiveQueryTab;
|
||||||
|
cap := trim(tab.TabSheet.Caption);
|
||||||
|
if cap[Length(cap)] = '*' then
|
||||||
|
cap := copy(cap, 1, Length(cap)-1);
|
||||||
|
if Memo.Modified then
|
||||||
|
cap := cap + '*';
|
||||||
|
SetTabCaption(tab.TabSheet.PageIndex, cap);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user