mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Bugfix: changing a limitation did not cause a 'modified' icon in the account dropdown.
This commit is contained in:
@@ -321,6 +321,7 @@ object UserManagerForm: TUserManagerForm
|
||||
Anchors = [akTop, akRight]
|
||||
TabOrder = 6
|
||||
Text = '0'
|
||||
OnChange = editLimitations
|
||||
end
|
||||
object editMaxConnections: TEdit
|
||||
Left = 240
|
||||
@@ -330,6 +331,7 @@ object UserManagerForm: TUserManagerForm
|
||||
Anchors = [akTop, akRight]
|
||||
TabOrder = 4
|
||||
Text = '0'
|
||||
OnChange = editLimitations
|
||||
end
|
||||
object editMaxUpdates: TEdit
|
||||
Left = 240
|
||||
@@ -339,6 +341,7 @@ object UserManagerForm: TUserManagerForm
|
||||
Anchors = [akTop, akRight]
|
||||
TabOrder = 2
|
||||
Text = '0'
|
||||
OnChange = editLimitations
|
||||
end
|
||||
object editMaxQuestions: TEdit
|
||||
Left = 240
|
||||
@@ -348,6 +351,7 @@ object UserManagerForm: TUserManagerForm
|
||||
Anchors = [akTop, akRight]
|
||||
TabOrder = 0
|
||||
Text = '0'
|
||||
OnChange = editLimitations
|
||||
end
|
||||
object udMaxQuestions: TUpDown
|
||||
Left = 304
|
||||
|
||||
@@ -177,7 +177,6 @@ type
|
||||
procedure comboObjectsChange(Sender: TObject);
|
||||
procedure comboUsersChange(Sender: TObject);
|
||||
procedure editFromHostChange(Sender: TObject);
|
||||
procedure clickLimitations(Sender: TObject; Button: TUDBtnType);
|
||||
procedure editLimitations(Sender: TObject);
|
||||
procedure editPasswordChange(Sender: TObject);
|
||||
procedure editPasswordEnter(Sender: TObject);
|
||||
@@ -366,8 +365,7 @@ var
|
||||
uid, i, Icon: Integer;
|
||||
u: TUser;
|
||||
OneSelected, Enable: Boolean;
|
||||
t, evEd: TNotifyEvent;
|
||||
evUd: TUDClickEvent;
|
||||
t: TNotifyEvent;
|
||||
begin
|
||||
lblWarning.Visible := False;
|
||||
uid := comboUsers.ItemIndex;
|
||||
@@ -402,10 +400,19 @@ begin
|
||||
end;
|
||||
|
||||
// Limitations
|
||||
t := editMaxQuestions.OnChange;
|
||||
editMaxQuestions.OnChange := nil;
|
||||
editMaxUpdates.OnChange := nil;
|
||||
editMaxConnections.OnChange := nil;
|
||||
editMaxUserConnections.OnChange := nil;
|
||||
udMaxQuestions.Position := u.MaxQuestions;
|
||||
udMaxUpdates.Position := u.MaxUpdates;
|
||||
udMaxConnections.Position := u.MaxConnections;
|
||||
udMaxUserConnections.Position := u.MaxUserConnections;
|
||||
editMaxQuestions.OnChange := t;
|
||||
editMaxUpdates.OnChange := t;
|
||||
editMaxConnections.OnChange := t;
|
||||
editMaxUserConnections.OnChange := t;
|
||||
|
||||
// Display priv objects
|
||||
for i := 0 to u.Privileges.Count - 1 do begin
|
||||
@@ -425,8 +432,6 @@ begin
|
||||
if comboObjects.ItemsEx.Count > 0 then
|
||||
comboObjects.ItemIndex := 0;
|
||||
comboObjectsChange(Sender);
|
||||
evEd := editLimitations;
|
||||
evUd := clickLimitations;
|
||||
end else begin
|
||||
editUsername.Text := '';
|
||||
editPassword.Text := '';
|
||||
@@ -435,8 +440,6 @@ begin
|
||||
udMaxUpdates.Position := 0;
|
||||
udMaxConnections.Position := 0;
|
||||
udMaxUserConnections.Position := 0;
|
||||
evEd := nil;
|
||||
evUd := nil;
|
||||
end;
|
||||
// Update top buttons
|
||||
btnDeleteUser.Enabled := Enable;
|
||||
@@ -462,14 +465,6 @@ begin
|
||||
lblMaxUserConnections.Enabled := Enable;
|
||||
editMaxUserConnections.Enabled := Enable;
|
||||
udMaxUserConnections.Enabled := Enable;
|
||||
udMaxQuestions.OnClick := evUd;
|
||||
udMaxUpdates.OnClick := evUd;
|
||||
udMaxConnections.OnClick := evUd;
|
||||
udMaxUserConnections.OnClick := evUd;
|
||||
editMaxQuestions.OnClick := evEd;
|
||||
editMaxUpdates.OnClick := evEd;
|
||||
editMaxConnections.OnClick := evEd;
|
||||
editMaxUserConnections.OnClick := evEd;
|
||||
// Update controls for privileges
|
||||
comboObjects.Enabled := Enable;
|
||||
btnAddObject.Enabled := Enable;
|
||||
@@ -799,22 +794,19 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TUserManagerForm.clickLimitations(Sender: TObject; Button: TUDBtnType);
|
||||
begin
|
||||
editLimitations(Sender);
|
||||
end;
|
||||
|
||||
|
||||
procedure TUserManagerForm.editLimitations(Sender: TObject);
|
||||
var
|
||||
u: TUser;
|
||||
begin
|
||||
// OnChange is called during form construction, avoid that.
|
||||
if comboUsers.ItemIndex = -1 then Exit;
|
||||
u := Users[comboUsers.ItemIndex];
|
||||
u.MaxQuestions := udMaxQuestions.Position;
|
||||
u.MaxUpdates := udMaxUpdates.Position;
|
||||
u.MaxConnections := udMaxConnections.Position;
|
||||
u.MaxUserConnections := udMaxUserConnections.Position;
|
||||
u.Modified := True;
|
||||
RefreshUserPulldown;
|
||||
end;
|
||||
|
||||
|
||||
@@ -1123,7 +1115,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{ *** TUsers *** }
|
||||
|
||||
constructor TUsers.Create;
|
||||
|
||||
Reference in New Issue
Block a user