Skip to content

Commit

Permalink
Set LCD for clash resolved as uploadedit - still looking for v0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbannon committed Nov 5, 2018
1 parent 5903e07 commit 7878abb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tomboy-ng/recover.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ object FormRecover: TFormRecover
Height = 172
Top = 44
Width = 675
ActivePage = TabSheetIntro
ActivePage = TabSheetSnapshots
Anchors = [akTop, akLeft, akRight]
TabIndex = 0
TabIndex = 2
TabOrder = 1
object TabSheetIntro: TTabSheet
Caption = 'Introduction'
Expand Down
5 changes: 3 additions & 2 deletions tomboy-ng/recover.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
on the main 'Restore' tab.
2018/10/28 Much changes, now working reasonably well.
2018/10/29 Set attributes of Unzipped files on the Mac, it apparently leaves then 000
2018/11/05 Altered name of safety zip file
}

Expand Down Expand Up @@ -268,8 +269,8 @@ function TFormRecover.ExpandZipName(AFileName : string) : string;
begin
// gets eg /somepath/20180826_2135_Sun.zip, 20180826_2135_Sun_Man.zip, 20180826_2135_Sun_Month.zip
FName := ExtractFileName(AFileName);
if FName = 'Exist.zip' then
Result := 'Snapshot from Intro Tab'
if FName = 'Safety.zip' then
Result := 'from Intro Tab'
else begin
Result := copy(FName, 1, 4) + '-' + copy(FName, 5, 2) + '-' + copy(FName, 7, 2);
Result := Result + ' ' + copy(FName, 10, 2) + ':' + copy(FName, 12, 2);
Expand Down
4 changes: 2 additions & 2 deletions tomboy-ng/settings.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ object Sett: TSett
Height = 371
Top = 0
Width = 525
ActivePage = TabSpell
ActivePage = TabBasic
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Bottom = 2
TabIndex = 5
TabIndex = 0
TabOrder = 0
OnChange = PageControl1Change
object TabBasic: TTabSheet
Expand Down
2 changes: 2 additions & 0 deletions tomboy-ng/settings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
2018/08/23 Ensured that an ini file without a notedir returns a sensible value, TEST
2018/10/28 Much changes, support Backup management, snapshots and new sync Model.
2018/11/01 Ensure we have a valid Spell, even after a hide !
2018/11/05 Set default tab.
}

{$mode objfpc}{$H+}
Expand Down Expand Up @@ -536,6 +537,7 @@ procedure TSett.FormClose(Sender: TObject; var CloseAction: TCloseAction);

procedure TSett.FormCreate(Sender: TObject);
begin
PageControl1.ActivePage := TabBasic;
MaskSettingsChanged := true;
NeedRefresh := False;
ExportPath := '';
Expand Down
14 changes: 12 additions & 2 deletions tomboy-ng/sync.pas
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
The Model as implemented in tomboy-ng, October 2018
We call TestTransportEarly() and/or TestTransport()
Its tests and may, or may not populate NoteMetaData with remote notes.
Its tests and may, or may not populate NoteMetaData with remote notes. It may, or may not
put the remote LCD in NoteMetaData.
We call StartSync() (not talking about Andro mode here.)
---------------------
Expand All @@ -99,7 +100,8 @@
If it finds a potential clash, aborts if it does not have last-change-date for
the remote note. In that case, we recall LoadReopData(True) this time demanding
last change date. And then run CheckUsingLCD again. Note this method is an
alternative to CheckUsingRev()
alternative to CheckUsingRev(). Any notes thats determined here to be an UpLoad
has its LCD (in NoteMetaData) set to the local note's LCD.
Because a join cannot use loacal manifest, we do not honour remote or local deletes.
CheckNewNotes() looks in Notes dir for any notes there that are not yet listed
in NoteMetaData. These notes are UploadNew.
Expand Down Expand Up @@ -139,6 +141,7 @@
2018/10/29 Tell TB_Sdiff about note title before showing it.
2018/11/03 Call checkmetadata before resolving clashes.
2018/11/04 No longer call MarkNoteReadOnly as we now rely on searchForm.ProcessSyncUpdates
2018/11/05 Now set Notemeatdata LCD to LCD of local note when Clash handler sets SyUpLoadEdit
}

interface
Expand Down Expand Up @@ -431,6 +434,13 @@ procedure TSync.ProcessClashes();
end else
Action := ResolveAllClash(ProceedAction, ID, RemoteNote); // user has already said "all something"
end;
if Action = SyUpLoadEdit then begin
LastChange := GetNoteLastChangeSt(NotesDir + ID + '.note', ErrorString);
if LastChange <> '' then
LastChangeGMT := GetGMTFromStr(LastChange)
else
debugln('ERROR, Failed to get LCD from local ' + ID + ' --- ' + ErrorString);
end;
end;
end;

Expand Down
6 changes: 4 additions & 2 deletions tomboy-ng/syncgui.pas
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ TFormSync = class(TForm)
LocalTimer : TTimer;
procedure AdjustNoteList();
procedure AfterShown(Sender : TObject);
// Display a summary of sync actions to user.
procedure DisplaySync();
{ Called when user wants to join a (possibly uninitialised) Repo,
will handle some problems with user's help. }
procedure JoinSync;
{ Called to do a sync assuming its all setup. Any problem is fatal }
procedure ManualSync;

procedure ShowReport;
{ Populates the string grid with details of notes to be actioned }
procedure ShowReport;
//procedure TestRepo();
//procedure DoSetUp();

Expand Down Expand Up @@ -374,6 +375,7 @@ procedure TFormSync.ButtonSaveClick(Sender: TObject);
ASync.TestRun := False;
if ASync.StartSync() then begin
DisplaySync();
ShowReport();
AdjustNoteList();
Label1.Caption:='All Done';
Label2.Caption := 'Press Close';
Expand Down

0 comments on commit 7878abb

Please sign in to comment.