mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Change button caption from time to time
This commit is contained in:
@@ -1016,6 +1016,8 @@ type
|
||||
FGridPasting: Boolean;
|
||||
FHasDonatedDatabaseCheck: TThreeStateBoolean;
|
||||
FFocusedTables: TDBObjectList;
|
||||
FCaptions: TStringList;
|
||||
FLastCaptionChange: Cardinal;
|
||||
|
||||
// Host subtabs backend structures
|
||||
FHostListResults: TDBQueryList;
|
||||
@@ -1650,6 +1652,12 @@ begin
|
||||
end;
|
||||
FHasDonatedDatabaseCheck := nbUnset;
|
||||
btnDonate.Visible := HasDonated(True) <> nbTrue;
|
||||
FCaptions := Explode(',',
|
||||
f_('Become a donor of the %s project', [AppName])+','+
|
||||
_('Donate')+','+
|
||||
_('Send a donation')+','+
|
||||
f_('Donate to the %s project', [AppName])
|
||||
);
|
||||
|
||||
actQueryStopOnErrors.Checked := AppSettings.ReadBool(asStopOnErrorsInBatchMode);
|
||||
actBlobAsText.Checked := AppSettings.ReadBool(asDisplayBLOBsAsText);
|
||||
@@ -11576,6 +11584,18 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMainForm.ApplicationEvents1Idle(Sender: TObject; var Done: Boolean);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if FLastCaptionChange < GetTickCount-10000 then begin
|
||||
Randomize;
|
||||
i := RandomRange(0, FCaptions.Count);
|
||||
btnDonate.Caption := FCaptions[i];
|
||||
FLastCaptionChange := GetTickCount;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.ApplicationDeActivate(Sender: TObject);
|
||||
begin
|
||||
// Prevent completion window from showing up after Alt-Tab. See issue #2640
|
||||
|
||||
Reference in New Issue
Block a user