mirror of https://gitlab.com/basile.b/dexed.git
fix #419 - Todo list is again cleared when clicking an item
This commit is contained in:
parent
05e6820932
commit
a7a2284942
|
@ -325,20 +325,13 @@ end;
|
||||||
{$REGION IDocumentObserver ---------------------------------------------------}
|
{$REGION IDocumentObserver ---------------------------------------------------}
|
||||||
procedure TTodoListWidget.docNew(document: TDexedMemo);
|
procedure TTodoListWidget.docNew(document: TDexedMemo);
|
||||||
begin
|
begin
|
||||||
|
fDoc := document;
|
||||||
|
if Visible and fAutoRefresh then
|
||||||
|
callToolProcess;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTodoListWidget.docFocused(document: TDexedMemo);
|
procedure TTodoListWidget.docFocused(document: TDexedMemo);
|
||||||
begin
|
begin
|
||||||
if document.isNil then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
// issue 412 :
|
|
||||||
// 1. the file name is in a first time "<new document>"
|
|
||||||
// 2. document assigned the fDoc var
|
|
||||||
// 3. once the filename loaded it exited on next focused
|
|
||||||
// because diff for filename was not tested.
|
|
||||||
if fDoc.isNotNil and (document = fDoc) and (fDoc.fileName = document.fileName) then
|
|
||||||
exit;
|
|
||||||
fDoc := document;
|
fDoc := document;
|
||||||
if Visible and fAutoRefresh then
|
if Visible and fAutoRefresh then
|
||||||
callToolProcess;
|
callToolProcess;
|
||||||
|
@ -383,8 +376,6 @@ end;
|
||||||
|
|
||||||
procedure TTodoListWidget.projFocused(project: ICommonProject);
|
procedure TTodoListWidget.projFocused(project: ICommonProject);
|
||||||
begin
|
begin
|
||||||
if project = fProj then
|
|
||||||
exit;
|
|
||||||
fProj := project;
|
fProj := project;
|
||||||
if Visible and fAutoRefresh then
|
if Visible and fAutoRefresh then
|
||||||
callToolProcess;
|
callToolProcess;
|
||||||
|
@ -505,8 +496,10 @@ end;
|
||||||
|
|
||||||
procedure TTodoListWidget.clearTodoList;
|
procedure TTodoListWidget.clearTodoList;
|
||||||
begin
|
begin
|
||||||
|
lstItems.BeginUpdate;
|
||||||
lstItems.Clear;
|
lstItems.Clear;
|
||||||
fTodos.items.Clear;
|
fTodos.items.Clear;
|
||||||
|
lstItems.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTodoListWidget.fillTodoList;
|
procedure TTodoListWidget.fillTodoList;
|
||||||
|
@ -516,6 +509,7 @@ var
|
||||||
trg: TListItem;
|
trg: TListItem;
|
||||||
flt: string;
|
flt: string;
|
||||||
begin
|
begin
|
||||||
|
lstItems.BeginUpdate;
|
||||||
lstItems.Clear;
|
lstItems.Clear;
|
||||||
lstItems.Column[1].Visible := False;
|
lstItems.Column[1].Visible := False;
|
||||||
lstItems.Column[2].Visible := False;
|
lstItems.Column[2].Visible := False;
|
||||||
|
@ -555,6 +549,7 @@ begin
|
||||||
if src.priority.isNotEmpty then
|
if src.priority.isNotEmpty then
|
||||||
lstItems.Column[4].Visible := True;
|
lstItems.Column[4].Visible := True;
|
||||||
end;
|
end;
|
||||||
|
lstItems.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTodoListWidget.handleListClick(Sender: TObject);
|
procedure TTodoListWidget.handleListClick(Sender: TObject);
|
||||||
|
@ -677,15 +672,21 @@ end;
|
||||||
|
|
||||||
procedure TTodoListWidget.refreshVisibleColumns;
|
procedure TTodoListWidget.refreshVisibleColumns;
|
||||||
begin
|
begin
|
||||||
if lstItems.isNil then exit;
|
|
||||||
if lstItems.Columns.isNil then exit;
|
if lstItems.isNil then
|
||||||
if lstItems.ColumnCount <> 6 then exit;
|
exit;
|
||||||
//
|
if lstItems.Columns.isNil then
|
||||||
|
exit;
|
||||||
|
if lstItems.ColumnCount <> 6 then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
lstItems.BeginUpdate;
|
||||||
lstItems.Column[1].Visible := TTodoColumn.category in fColumns ;
|
lstItems.Column[1].Visible := TTodoColumn.category in fColumns ;
|
||||||
lstItems.Column[2].Visible := TTodoColumn.assignee in fColumns ;
|
lstItems.Column[2].Visible := TTodoColumn.assignee in fColumns ;
|
||||||
lstItems.Column[3].Visible := TTodoColumn.status in fColumns ;
|
lstItems.Column[3].Visible := TTodoColumn.status in fColumns ;
|
||||||
lstItems.Column[4].Visible := TTodoColumn.priority in fColumns ;
|
lstItems.Column[4].Visible := TTodoColumn.priority in fColumns ;
|
||||||
lstItems.Column[5].Visible := TTodoColumn.filename in fColumns ;
|
lstItems.Column[5].Visible := TTodoColumn.filename in fColumns ;
|
||||||
|
lstItems.EndUpdate;
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue