Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckAll checkbox in Import text file dialog get reversed #612

Closed
zhujunsan opened this issue Apr 16, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@zhujunsan
Copy link

commented Apr 16, 2019

Steps to reproduce this issue

  1. Open Import text file dialog in menu > Tools > Import CSV file... (well, the name should be aligned)
  2. That's it.

Current behavior

You can see all columns is selected and 'All' checkbox in unchecked, and if you check the 'All' checkbox, all columns is unchecked, which is the reversed action

Expected behavior

the opposite

Possible solution

i'm not familiar with pascal but i think changing a few line as below in file /source/loaddata.pas starts line 637 should work

procedure Tloaddataform.chklistColumnsClick(Sender: TObject);
var
  i, CheckedNum: Integer;
begin
  btnColDown.Enabled := (chklistColumns.ItemIndex > -1)
    and (chklistColumns.ItemIndex < chklistColumns.Count-1);
  btnColUp.Enabled := (chklistColumns.ItemIndex > -1)
    and (chklistColumns.ItemIndex > 0);
  // Toggle icon when none is selected
  CheckedNum := 0;
  for i:=0 to chklistColumns.Items.Count-1 do begin
    if chklistColumns.Checked[i] then
      Inc(CheckedNum);
  end;
  if CheckedNum < chklistColumns.Items.Count then
    btnCheckAll.ImageIndex := 127
  else
    btnCheckAll.ImageIndex := 128;
end;


procedure Tloaddataform.btnCheckAllClick(Sender: TObject);
var
  i, CheckedNum: Integer;
begin
  CheckedNum := 0;
  for i:=0 to chklistColumns.Items.Count-1 do begin
    if chklistColumns.Checked[i] then
      Inc(CheckedNum);
  end;
  if CheckedNum < chklistColumns.Items.Count then
    chklistColumns.CheckAll(cbUnchecked)
  else
    chklistColumns.CheckAll(cbChecked);
  chklistColumns.OnClick(Sender);
end;
  • HeidiSQL version:
    10.1.0.5532
@ansgarbecker

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2019

I'm not sure but I guess you're right. So I just exchanged the icons with each other to achieve the reverse logic.

@ansgarbecker ansgarbecker added this to the v10.2 milestone Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.