View Issue Details

IDProjectCategoryView StatusLast Update
0029996LazarusLCLpublic2018-09-19 15:49
Reportersilvioprog Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Product Version1.7 (SVN) 
Summary0029996: [PATCH] add the "Select All" and "Invert Selection" checkboxes to Converte Encoding window
DescriptionThe attached patch adds the "Select All" and "Invert Selection" checkboxes to Converte Encoding window.
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0029979 closedBart Broersma [FEATURE REQUEST] Choosing the files to be converted in the tool "Converte Encoding of Project/Packages" 

Activities

silvioprog

2016-04-12 01:44

reporter  

0001-Improves-the-Convert-Encoding-window.-patch-by-silvi.patch (5,498 bytes)   
From 64d759044fde92058f012a1c42d4b9dac8729c9c Mon Sep 17 00:00:00 2001
From: silvioprog <silvioprog@gmail.com>
Date: Mon, 11 Apr 2016 10:31:33 -0300
Subject: [PATCH 1/1] Improves the Convert Encoding window. (patch by
 silvioprog)

---
 converter/chgencodingdlg.lfm | 53 +++++++++++++++++++++++++++++++++++++-------
 converter/chgencodingdlg.pas | 25 +++++++++++++++++++++
 ide/lazarusidestrconsts.pas  |  1 +
 3 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/converter/chgencodingdlg.lfm b/converter/chgencodingdlg.lfm
index 455f5ad..8533f35 100644
--- a/converter/chgencodingdlg.lfm
+++ b/converter/chgencodingdlg.lfm
@@ -1,12 +1,12 @@
 object ChgEncodingDialog: TChgEncodingDialog
   Left = 290
-  Height = 560
+  Height = 590
   Top = 163
   Width = 683
   ActiveControl = OwnerComboBox
   BorderIcons = [biSystemMenu, biMaximize]
   Caption = 'ChgEncodingDialog'
-  ClientHeight = 560
+  ClientHeight = 590
   ClientWidth = 683
   OnCreate = FormCreate
   OnDestroy = FormDestroy
@@ -114,7 +114,7 @@ object ChgEncodingDialog: TChgEncodingDialog
   object BtnPanel: TPanel
     Left = 0
     Height = 38
-    Top = 522
+    Top = 552
     Width = 683
     Align = alBottom
     AutoSize = True
@@ -221,19 +221,19 @@ object ChgEncodingDialog: TChgEncodingDialog
   end
   object PreviewGroupBox: TGroupBox
     Left = 6
-    Height = 243
+    Height = 273
     Top = 273
     Width = 671
     Align = alClient
     BorderSpacing.Around = 6
     Caption = 'PreviewGroupBox'
-    ClientHeight = 223
+    ClientHeight = 253
     ClientWidth = 667
     TabOrder = 2
     object PreviewListView: TListView
       Left = 5
-      Height = 213
-      Top = 5
+      Height = 212
+      Top = 36
       Width = 657
       Align = alClient
       BorderSpacing.Around = 5
@@ -251,9 +251,46 @@ object ChgEncodingDialog: TChgEncodingDialog
         end>
       SortColumn = 1
       SortType = stText
-      TabOrder = 0
+      TabOrder = 1
       ViewStyle = vsReport
     end
+    object PreviewHeaderPanel: TPanel
+      Left = 5
+      Height = 31
+      Top = 0
+      Width = 657
+      Align = alTop
+      AutoSize = True
+      BorderSpacing.Left = 5
+      BorderSpacing.Right = 5
+      ClientHeight = 31
+      ClientWidth = 657
+      TabOrder = 0
+      object PreviewSelectAllCheckBox: TCheckBox
+        Left = 6
+        Height = 19
+        Top = 6
+        Width = 158
+        Align = alLeft
+        BorderSpacing.Around = 5
+        Caption = 'PreviewSelectAllCheckBox'
+        Checked = True
+        OnChange = PreviewSelectAllCheckBoxChange
+        State = cbChecked
+        TabOrder = 0
+      end
+      object PreviewInvertSelectionCheckBox: TCheckBox
+        Left = 169
+        Height = 19
+        Top = 6
+        Width = 191
+        Align = alLeft
+        BorderSpacing.Around = 5
+        Caption = 'PreviewInvertSelectionCheckBox'
+        OnChange = PreviewInvertSelectionCheckBoxChange
+        TabOrder = 1
+      end
+    end
   end
   object LabelNoPreview: TLabel
     Left = 20
diff --git a/converter/chgencodingdlg.pas b/converter/chgencodingdlg.pas
index f3e7376..6acd7ee 100644
--- a/converter/chgencodingdlg.pas
+++ b/converter/chgencodingdlg.pas
@@ -50,10 +50,13 @@ type
 
   TChgEncodingDialog = class(TForm)
     ApplyButton: TBitBtn;
+    PreviewSelectAllCheckBox: TCheckBox;
+    PreviewInvertSelectionCheckBox: TCheckBox;
     HelpButton: TBitBtn;
     BtnPanel: TPanel;
     CloseButton: TBitBtn;
     LabelNoPreview: TLabel;
+    PreviewHeaderPanel: TPanel;
     RegExprErrorLabel: TLabel;
     NewEncodingComboBox: TComboBox;
     FileFilterCombobox: TComboBox;
@@ -72,6 +75,8 @@ type
     procedure FormDestroy(Sender: TObject);
     procedure HelpButtonClick(Sender: TObject);
     procedure PreviewClick(Sender: TObject);
+    procedure PreviewInvertSelectionCheckBoxChange(Sender: TObject);
+    procedure PreviewSelectAllCheckBoxChange(Sender: TObject);
   private
     FFiles: TFilenameToStringTree;
     function GetFiles: Boolean;
@@ -121,6 +126,9 @@ begin
   ApplyButton.LoadGlyphFromResourceName(hInstance, 'btn_ok');
   HelpButton.LoadGlyphFromResourceName(hInstance, 'btn_help');
 
+  PreviewSelectAllCheckBox.Caption := lisMenuSelectAll;
+  PreviewInvertSelectionCheckBox.Caption := lisMenuInvertSelection;
+
   PreviewGroupBox.Caption:=dlgWRDPreview;
   PreviewListView.Column[0].Caption:=dlgEnvFiles;
   PreviewListView.Column[0].Width:=350;
@@ -244,6 +252,23 @@ begin
   UpdatePreview;
 end;
 
+procedure TChgEncodingDialog.PreviewInvertSelectionCheckBoxChange(
+  Sender: TObject);
+var
+  Item: TListItem;
+begin
+  for Item in PreviewListView.Items do
+    Item.Checked := not Item.Checked;
+end;
+
+procedure TChgEncodingDialog.PreviewSelectAllCheckBoxChange(Sender: TObject);
+var
+  Item: TListItem;
+begin
+  for Item in PreviewListView.Items do
+    Item.Checked := PreviewSelectAllCheckBox.Checked;
+end;
+
 function TChgEncodingDialog.GetFiles: Boolean;
 // Returns true if some files were found, even if they were not added to list.
 var
diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas
index faa6a8a..889a4cf 100644
--- a/ide/lazarusidestrconsts.pas
+++ b/ide/lazarusidestrconsts.pas
@@ -339,6 +339,7 @@ resourcestring
   lisUseAndClose = 'Use and close';
   lisMenuSelect = 'Select';
   lisMenuSelectAll = 'Select All';
+  lisMenuInvertSelection = 'Invert Selection';
   lisCheckAll = 'Check All';
   lisUncheckAll = 'Uncheck All';
   dlgFiles = '%s files';
-- 
1.9.5.msysgit.0

Bart Broersma

2016-04-24 11:44

developer   ~0092168

Can you please supply a patch-file that is compatibe with the patch.exe program?
(svn diff > patchfile.patch will do nicely)

Juha Manninen

2016-04-24 12:03

developer   ~0092170

Bart, the patch is made with Git. Both "patch -p1" and TortoiseMerge can apply it without problems as explained here:
 http://wiki.freepascal.org/Creating_A_Patch#A_patch_made_with_.22git_format-patch.22

Bart Broersma

2016-04-24 13:43

developer   ~0092174

@Juha: yes, my mistake. Used a wrong value for -p

Bart Broersma

2016-04-24 14:16

developer   ~0092175

Last edited: 2016-04-24 14:17

View 3 revisions

@Silvio: I have 2 "problems" with your patch:

1.
The "invert selection" should not be a checkbox, since it's state (checked or not) does not have any meaning.

2.
The "select all" checkbox ideally should only be unchecked if at least one of the items in the listview is unchecked.
Check select all, then click "invert selection". Nothing is selected but "select all" is still checked.

Replacing both controls with buttons would resolve both problems I think.
There is no need for an "unselect all" since that can be accomplished by clicking "select all" followed clicking "invert selection"

silvioprog

2016-05-03 21:03

reporter   ~0092377

No problem, I can make a new patch soon (I'm very busy these days... bad days. :-( ).

Bart Broersma

2018-09-16 16:50

developer   ~0110795

@Silvio: are you going to supply a new patch?
Otherwise I will resolve as "won't fix".

silvioprog

2018-09-19 02:21

reporter   ~0110861

@Bart: please mark it as closed. The current feature behavior is nice to me too.

Juha Manninen

2018-09-19 09:07

developer   ~0110870

silvioprog, why you wanted to change it in the first place if the current behavior is nice?

Bart Broersma

2018-09-19 11:59

developer   ~0110874

As per original reporter.
Please close.

silvioprog

2018-09-19 15:49

reporter   ~0110877

@Juha: just to improve the window, but I think it is not required anymore.
@Bart: thank you very much.

Issue History

Date Modified Username Field Change
2016-04-12 01:44 silvioprog New Issue
2016-04-12 01:44 silvioprog File Added: 0001-Improves-the-Convert-Encoding-window.-patch-by-silvi.patch
2016-04-12 15:31 Bart Broersma Assigned To => Bart Broersma
2016-04-12 15:31 Bart Broersma Status new => assigned
2016-04-12 16:04 Juha Manninen Relationship added related to 0029979
2016-04-24 11:44 Bart Broersma LazTarget => -
2016-04-24 11:44 Bart Broersma Note Added: 0092168
2016-04-24 11:44 Bart Broersma Status assigned => feedback
2016-04-24 12:03 Juha Manninen Note Added: 0092170
2016-04-24 13:43 Bart Broersma Note Added: 0092174
2016-04-24 14:16 Bart Broersma Note Added: 0092175
2016-04-24 14:17 Bart Broersma Note Edited: 0092175 View Revisions
2016-04-24 14:17 Bart Broersma Note Edited: 0092175 View Revisions
2016-05-03 21:03 silvioprog Note Added: 0092377
2016-05-03 21:03 silvioprog Status feedback => assigned
2018-09-16 16:50 Bart Broersma Note Added: 0110795
2018-09-16 16:50 Bart Broersma Status assigned => feedback
2018-09-19 02:21 silvioprog Note Added: 0110861
2018-09-19 02:21 silvioprog Status feedback => assigned
2018-09-19 09:07 Juha Manninen Note Added: 0110870
2018-09-19 11:59 Bart Broersma Note Added: 0110874
2018-09-19 11:59 Bart Broersma Status assigned => resolved
2018-09-19 11:59 Bart Broersma Resolution open => no change required
2018-09-19 15:49 silvioprog Note Added: 0110877
2018-09-19 15:49 silvioprog Status resolved => closed