Skip to content

Commit 2f6b9ca

Browse files
author
David Bannon
committed
relates to #153 and #141, help notes no longer modal and better sync mode support
1 parent 6a442cf commit 2f6b9ca

7 files changed

+164
-9
lines changed

po/tomboy-ng.es.po

+15
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,20 @@ msgctxt "resourcestr.rscannotfindnote"
283283
msgid "ERROR, cannot find "
284284
msgstr "ERROR: no se encuentra "
285285

286+
#: resourcestr.rschangefilesync
287+
#, fuzzy
288+
msgctxt "resourcestr.rschangefilesync"
289+
msgid "Change File Sync Repo"
290+
msgstr "Cambiar repositorio de sincronización"
291+
286292
#: resourcestr.rschangenameofnotebook
287293
msgid "Change the name of this Notebook"
288294
msgstr "Cambiar el nombre de este cuaderno"
289295

296+
#: resourcestr.rschangenetsync
297+
msgid "Change Net Sync Repo"
298+
msgstr ""
299+
290300
#: resourcestr.rscreatenewrepo
291301
msgctxt "resourcestr.rscreatenewrepo"
292302
msgid "Create a new Repo ?"
@@ -1484,6 +1494,7 @@ msgid "Set Spell Library"
14841494
msgstr "Establecer Biblioteca Ortográfica"
14851495

14861496
#: tsett.buttonsetsynserver.caption
1497+
msgctxt "tsett.buttonsetsynserver.caption"
14871498
msgid "Change File Sync Repo"
14881499
msgstr "Cambiar repositorio de sincronización"
14891500

@@ -1652,6 +1663,10 @@ msgctxt "tsett.labelsnapdir.caption"
16521663
msgid ".... and its not available just yet !"
16531664
msgstr "... y ¡no está disponible en este momento!"
16541665

1666+
#: tsett.labelsyncurl.caption
1667+
msgid "LabelSyncURL"
1668+
msgstr ""
1669+
16551670
#: tsett.menufriday.caption
16561671
msgid "Friday"
16571672
msgstr "Viernes"

po/tomboy-ng.nl.po

+15
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,20 @@ msgctxt "resourcestr.rscannotfindnote"
283283
msgid "ERROR, cannot find "
284284
msgstr ""
285285

286+
#: resourcestr.rschangefilesync
287+
#, fuzzy
288+
msgctxt "resourcestr.rschangefilesync"
289+
msgid "Change File Sync Repo"
290+
msgstr "Bestandssynchronisatie aanpassen"
291+
286292
#: resourcestr.rschangenameofnotebook
287293
msgid "Change the name of this Notebook"
288294
msgstr ""
289295

296+
#: resourcestr.rschangenetsync
297+
msgid "Change Net Sync Repo"
298+
msgstr ""
299+
290300
#: resourcestr.rscreatenewrepo
291301
#, fuzzy
292302
msgctxt "resourcestr.rscreatenewrepo"
@@ -1487,6 +1497,7 @@ msgid "Set Spell Library"
14871497
msgstr "Spellingcontrolebiblotheek instellen"
14881498

14891499
#: tsett.buttonsetsynserver.caption
1500+
msgctxt "tsett.buttonsetsynserver.caption"
14901501
msgid "Change File Sync Repo"
14911502
msgstr "Bestandssynchronisatie aanpassen"
14921503

@@ -1648,6 +1659,10 @@ msgstr "Een momentopname is een kopie van je huidige notitiemap."
16481659
msgid ".... and its not available just yet !"
16491660
msgstr "... en is nog niet beschikbaar!"
16501661

1662+
#: tsett.labelsyncurl.caption
1663+
msgid "LabelSyncURL"
1664+
msgstr ""
1665+
16511666
#: tsett.menufriday.caption
16521667
msgid "Friday"
16531668
msgstr "vrijdag"

po/tomboy-ng.po

+14
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,19 @@ msgctxt "resourcestr.rscannotfindnote"
261261
msgid "ERROR, cannot find "
262262
msgstr ""
263263

264+
#: resourcestr.rschangefilesync
265+
msgctxt "resourcestr.rschangefilesync"
266+
msgid "Change File Sync Repo"
267+
msgstr ""
268+
264269
#: resourcestr.rschangenameofnotebook
265270
msgid "Change the name of this Notebook"
266271
msgstr ""
267272

273+
#: resourcestr.rschangenetsync
274+
msgid "Change Net Sync Repo"
275+
msgstr ""
276+
268277
#: resourcestr.rscreatenewrepo
269278
msgctxt "resourcestr.rscreatenewrepo"
270279
msgid "Create a new Repo ?"
@@ -1431,6 +1440,7 @@ msgid "Set Spell Library"
14311440
msgstr ""
14321441

14331442
#: tsett.buttonsetsynserver.caption
1443+
msgctxt "tsett.buttonsetsynserver.caption"
14341444
msgid "Change File Sync Repo"
14351445
msgstr ""
14361446

@@ -1589,6 +1599,10 @@ msgstr ""
15891599
msgid ".... and its not available just yet !"
15901600
msgstr ""
15911601

1602+
#: tsett.labelsyncurl.caption
1603+
msgid "LabelSyncURL"
1604+
msgstr ""
1605+
15921606
#: tsett.menufriday.caption
15931607
msgid "Friday"
15941608
msgstr ""

tomboy-ng/mainunit.pas

+50-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
2019/12/11 Heavily restructured Startup, Main Menu everywhere !
6464
2019/12/20 Added option --delay-start for when desktop is slow to determine its (dark) colours
6565
2020/03/30 Allow user to set display colours.
66+
2020/04/10 Make help files non modal
6667
6768
CommandLine Switches
6869
@@ -110,6 +111,9 @@ interface
110111
// These are the possible kinds of main menu items
111112
// type TMenuKind = (mkFileMenu, mkRecentMenu, mkHelpMenu);
112113

114+
115+
116+
113117
type
114118

115119
{ TMainForm }
@@ -155,6 +159,7 @@ TMainForm = class(TForm)
155159
procedure TrayIconClick(Sender: TObject);
156160
procedure TrayMenuTomdroidClick(Sender: TObject);
157161
private
162+
HelpList : TStringList;
158163
CommsClient : TSimpleIPCClient;
159164
CommsServer : TSimpleIPCServer;
160165
// Don't assign if desktop is KDE and Qt5, it stuffs up in November 2019
@@ -280,13 +285,52 @@ procedure TMainForm.SingleNoteMode(FullFileName : string; const CloseOnExit, Vie
280285
if CloseOnExit then Close; // we also use singlenotemode internally in several places
281286
end;
282287

288+
283289
// ---------------- HELP NOTES STUFF ------------------
284290

285291
procedure TMainForm.ShowHelpNote(HelpNoteName: string);
292+
var
293+
EBox : TEditBoxForm;
294+
TheForm : TForm;
295+
Index : integer;
286296
begin
287-
if FileExists(ActualHelpNotesPath() + HelpNoteName) then
288-
SingleNoteMode(ActualHelpNotesPath() + HelpNoteName, False, True)
289-
else showmessage('Unable to find ' + HelpNotesPath + HelpNoteName);
297+
if FileExists(ActualHelpNotesPath() + HelpNoteName) then begin
298+
If HelpList = nil then
299+
HelpList := TStringList.Create
300+
else begin
301+
if HelpList.Find(HelpNoteName, Index) then begin
302+
// Bring TForm(HelpList.Objects[Index]) to front
303+
TheForm := TForm(HelpList.Objects[Index]);
304+
try
305+
//writeln('Attempting a reshow');
306+
TheForm.Show;
307+
SearchForm.MoveWindowHere(TheForm.Caption);
308+
TheForm.EnsureVisible(true);
309+
exit;
310+
except on E: Exception do {showmessage(E.Message)};
311+
// If user had this help page open but then closed it entry is still in
312+
// list so we catch the exception, ignore it and upen a new note.
313+
// its pretty ugly under debugger but user does not see this.
314+
end;
315+
end;
316+
end;
317+
// If we did not find it in the list and exit, above, we will make a new one.
318+
//SingleNoteMode(ActualHelpNotesPath() + HelpNoteName, False, True)
319+
EBox := TEditBoxForm.Create(Application);
320+
EBox.SetReadOnly(False);
321+
EBox.SearchedTerm := '';
322+
EBox.NoteTitle:= '';
323+
EBox.NoteFileName := ActualHelpNotesPath() + HelpNoteName;
324+
Ebox.TemplateIs := '';
325+
EBox.Show;
326+
EBox.Dirty := False;
327+
writeln('Adding to list');
328+
HelpList.AddObject(HelpNoteName, EBox);
329+
HelpList.Sort;
330+
//showmessage('List is sorted ' + booltostr(HelpList.Sorted, true));
331+
HelpList.Sorted:=True;
332+
333+
end else showmessage('Unable to find ' + HelpNotesPath + HelpNoteName);
290334
end;
291335

292336
function TMainForm.ActualHelpNotesPath(): string;
@@ -399,6 +443,7 @@ function TMainForm.HaveCMDParam() : boolean;
399443

400444
procedure TMainForm.FormCreate(Sender: TObject);
401445
begin
446+
HelpList := Nil;
402447
if Application.HasOption('delay-start') then // This to allow eg Enlightenment to decide its colours.
403448
sleep(2000);
404449
AssignPopupToTray := True;
@@ -452,6 +497,8 @@ procedure TMainForm.FormDestroy(Sender: TObject);
452497
begin
453498
freeandnil(CommsServer);
454499
freeandnil(HelpNotes);
500+
//if HelpList <> Nil then writeln('Help List has ' + inttostr(HelpList.Count));
501+
freeandnil(HelpList);
455502
end;
456503

457504
procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);

tomboy-ng/resourcestr.pas

+7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ interface
5858
rsSyncError = 'A Sync Error occured';
5959
rsLastSync = 'Last Sync'; // Followed by a date and simplified sync report
6060

61+
62+
// Settings but only part ...
63+
64+
rsChangeNetSync = 'Change Net Sync Repo'; // These are labels on the button used to set sync repo
65+
rsChangeFileSync = 'Change File Sync Repo';
66+
67+
6168
implementation
6269

6370
end.

tomboy-ng/settings.lfm

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object Sett: TSett
2-
Left = 483
2+
Left = 1230
33
Height = 525
4-
Top = 220
4+
Top = 184
55
Width = 630
66
BorderIcons = []
77
Caption = 'tomboy-ng Settings'
@@ -451,14 +451,16 @@ object Sett: TSett
451451
ParentFont = False
452452
end
453453
object GroupBoxSyncType: TGroupBox
454+
AnchorSideLeft.Control = GroupBox4
455+
AnchorSideLeft.Side = asrCenter
454456
AnchorSideRight.Control = GroupBox4
455457
AnchorSideRight.Side = asrBottom
456458
AnchorSideBottom.Control = GroupBox4
457459
Left = 432
458460
Height = 107
459461
Top = 24
460462
Width = 185
461-
Anchors = [akTop, akLeft, akRight, akBottom]
463+
Anchors = [akTop, akRight, akBottom]
462464
BorderSpacing.Bottom = 4
463465
Caption = 'Sync Type'
464466
ClientHeight = 86
@@ -471,6 +473,7 @@ object Sett: TSett
471473
Width = 90
472474
Caption = 'Net Sync'
473475
Checked = True
476+
OnChange = RadioNetSyncChange
474477
TabOrder = 0
475478
end
476479
object RadioFileSync: TRadioButton
@@ -479,9 +482,18 @@ object Sett: TSett
479482
Top = 48
480483
Width = 89
481484
Caption = 'File Sync'
485+
OnChange = RadioFileSyncChange
482486
TabOrder = 1
483487
end
484488
end
489+
object LabelSyncURL: TLabel
490+
Left = 7
491+
Height = 19
492+
Top = 39
493+
Width = 100
494+
Caption = 'LabelSyncURL'
495+
ParentColor = False
496+
end
485497
end
486498
object TabBackUp: TTabSheet
487499
Caption = 'BackUp'

0 commit comments

Comments
 (0)