Skip to content

Commit a8cd67e

Browse files
author
delphidabbler
committed
Merge branch 'feature/fixup-ui' into develop
2 parents f11bd3a + ace8b38 commit a8cd67e

File tree

10 files changed

+58
-88
lines changed

10 files changed

+58
-88
lines changed

Src/CodeSnip.todo

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{TODO -cUI : Remove unused tool bar button in main window}
21
{TODO -cPreRelease : Remove -[**dev**] from product and file versions in .vi files before bumping release number}

Src/DB.UMetaData.pas

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ TLaterDBMetaFiles = class sealed(TDBMetaFiles)
391391
end;
392392

393393
/// <summary>Class that is present to represent unknown database meta file
394-
/// formats.</summary>
394+
/// formats. Also used when database is not present.</summary>
395395
/// <remarks>Accesses no files and returns null results for all methods
396396
/// except IsVersionSupported.</remarks>
397-
TUnknownMetaFiles = class sealed(TDBMetaFiles)
397+
TUnknownOrMissingMetaFiles = class sealed(TDBMetaFiles)
398398
public
399399
/// <summary>Returns the empty string.</summary>
400400
/// <remarks>The file format is unknown, so the version file cannot be read
@@ -852,37 +852,37 @@ function TLaterDBMetaFiles.Version: string;
852852
Result := StrTrim(ReadFileText(cVersionFile));
853853
end;
854854

855-
{ TUnknownMetaFiles }
855+
{ TUnknownOrMissingMetaFiles }
856856

857-
function TUnknownMetaFiles.AreAllFilesPresent: Boolean;
857+
function TUnknownOrMissingMetaFiles.AreAllFilesPresent: Boolean;
858858
resourcestring
859859
sNotSupportedError = 'Calling %s.AreAllFilesPresent is not supported for an '
860-
+ 'unrecognised database format';
860+
+ 'unrecognised database format or missing database';
861861
begin
862862
raise ENotSupportedException.CreateFmt(sNotSupportedError, [ClassName]);
863863
end;
864864

865-
function TUnknownMetaFiles.Contributors: TStringDynArray;
865+
function TUnknownOrMissingMetaFiles.Contributors: TStringDynArray;
866866
begin
867867
SetLength(Result, 0);
868868
end;
869869

870-
function TUnknownMetaFiles.LicenseInfo: TStringDynArray;
870+
function TUnknownOrMissingMetaFiles.LicenseInfo: TStringDynArray;
871871
begin
872872
SetLength(Result, 0);
873873
end;
874874

875-
function TUnknownMetaFiles.LicenseText: string;
875+
function TUnknownOrMissingMetaFiles.LicenseText: string;
876876
begin
877877
Result := '';
878878
end;
879879

880-
function TUnknownMetaFiles.Testers: TStringDynArray;
880+
function TUnknownOrMissingMetaFiles.Testers: TStringDynArray;
881881
begin
882882
SetLength(Result, 0);
883883
end;
884884

885-
function TUnknownMetaFiles.Version: string;
885+
function TUnknownOrMissingMetaFiles.Version: string;
886886
begin
887887
Result := '';
888888
end;
@@ -891,16 +891,15 @@ function TUnknownMetaFiles.Version: string;
891891

892892
class function TDBMetaFilesFactory.GetInstance(const DBDir: string):
893893
TDBMetaFiles;
894-
resourcestring
895-
sBadDirError = 'Database directory "%s" does not exist';
896894
var
897895
VersionFile: string;
898896
VersionStr: string;
899897
Version: TVersionNumber;
900898
DBPath: string;
901899
begin
902900
if not TDirectory.Exists(ExcludeTrailingPathDelimiter(DBDir)) then
903-
raise EDBMetaData.CreateFmt(sBadDirError, [DBDir]);
901+
// Database is not installed
902+
Exit(TUnknownOrMissingMetaFiles.Create(DBDir));
904903

905904
DBPath := IncludeTrailingPathDelimiter(DBDir);
906905

@@ -917,7 +916,7 @@ class function TDBMetaFilesFactory.GetInstance(const DBDir: string):
917916
begin
918917
VersionStr := TFileIO.ReadAllText(VersionFile, TEncoding.UTF8, True);
919918
if not TVersionNumber.TryStrToVersionNumber(VersionStr, Version) then
920-
Result := TUnknownMetaFiles.Create(DBDir)
919+
Result := TUnknownOrMissingMetaFiles.Create(DBDir)
921920
else if Version.V1 = 2 then
922921
Result := TV2DBMetaFiles.Create(DBDir)
923922
else
@@ -929,7 +928,7 @@ class function TDBMetaFilesFactory.GetInstance(const DBDir: string):
929928
and TFile.Exists(DBPath + TDBMetaFileNames.TestersV1, False) then
930929
Result := TV1DBMetaFiles.Create(DBDir)
931930
else
932-
Result := TUnknownMetaFiles.Create(DBDir);
931+
Result := TUnknownOrMissingMetaFiles.Create(DBDir);
933932
end;
934933
end;
935934

Src/FmCodeImportDlg.dfm

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ inherited CodeImportDlg: TCodeImportDlg
99
ExplicitHeight = 321
1010
inherited pcWizard: TPageControl
1111
Height = 288
12-
ActivePage = tsFile
12+
ActivePage = tsInfo
1313
ExplicitHeight = 288
1414
object tsInfo: TTabSheet
1515
Caption = 'tsInfo'
1616
TabVisible = False
17-
ExplicitLeft = 0
18-
ExplicitTop = 0
19-
ExplicitWidth = 0
20-
ExplicitHeight = 0
2117
object lblIntro: TLabel
2218
Left = 0
2319
Top = 8
@@ -98,9 +94,9 @@ inherited CodeImportDlg: TCodeImportDlg
9894
Height = 40
9995
AutoSize = False
10096
Caption =
101-
'The imported functions are listed below. Select, deselect and re' +
102-
'name as required then click the "Update" button to update the da' +
103-
'tabase. Use "Cancel" to abandon the import.'
97+
'The functions to be imported are listed below. Select, deselect ' +
98+
'and rename as required then click the "Update" button to update ' +
99+
'the database. Use "Cancel" to abandon the import.'
104100
WordWrap = True
105101
end
106102
object lvImports: TListView
@@ -153,10 +149,6 @@ inherited CodeImportDlg: TCodeImportDlg
153149
Caption = 'tsFinish'
154150
ImageIndex = 5
155151
TabVisible = False
156-
ExplicitLeft = 0
157-
ExplicitTop = 0
158-
ExplicitWidth = 0
159-
ExplicitHeight = 0
160152
object lblFinish: TLabel
161153
Left = 0
162154
Top = 8

Src/FmDBUpdateDlg.dfm

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ inherited DBUpdateDlg: TDBUpdateDlg
33
Top = 0
44
Caption = 'Install or Update DelphiDabbler Snippets Database'
55
Position = poDesigned
6+
ExplicitWidth = 565
7+
ExplicitHeight = 436
68
PixelsPerInch = 96
79
TextHeight = 13
810
inherited pnlBody: TPanel
@@ -14,15 +16,11 @@ inherited DBUpdateDlg: TDBUpdateDlg
1416
end
1517
inherited pcWizard: TPageControl
1618
Width = 409
17-
ActivePage = tsFinish
19+
ActivePage = tsFolder
1820
ExplicitWidth = 409
1921
object tsIntro: TTabSheet
2022
Caption = 'tsIntro'
2123
TabVisible = False
22-
ExplicitLeft = 0
23-
ExplicitTop = 0
24-
ExplicitWidth = 0
25-
ExplicitHeight = 0
2624
inline frmIntro: THTMLTpltDlgFrame
2725
Left = 0
2826
Top = 0
@@ -52,10 +50,6 @@ inherited DBUpdateDlg: TDBUpdateDlg
5250
Caption = 'tsFolder'
5351
ImageIndex = 1
5452
TabVisible = False
55-
ExplicitLeft = 0
56-
ExplicitTop = 0
57-
ExplicitWidth = 0
58-
ExplicitHeight = 0
5953
object lblFolder: TLabel
6054
Left = 0
6155
Top = 8
@@ -69,9 +63,9 @@ inherited DBUpdateDlg: TDBUpdateDlg
6963
object lblFolderPageInfo: TLabel
7064
Left = 0
7165
Top = 72
72-
Width = 246
66+
Width = 220
7367
Height = 13
74-
Caption = 'Click the Next button to update the local database.'
68+
Caption = 'Click the Next button when ready to proceed.'
7569
end
7670
object edPath: TEdit
7771
Left = 0
@@ -99,10 +93,6 @@ inherited DBUpdateDlg: TDBUpdateDlg
9993
Caption = 'tsLoad'
10094
ImageIndex = 2
10195
TabVisible = False
102-
ExplicitLeft = 0
103-
ExplicitTop = 0
104-
ExplicitWidth = 0
105-
ExplicitHeight = 0
10696
inline frmLoad: TFixedHTMLDlgFrame
10797
Left = 0
10898
Top = 0
@@ -126,10 +116,6 @@ inherited DBUpdateDlg: TDBUpdateDlg
126116
Caption = 'tsFinish'
127117
ImageIndex = 3
128118
TabVisible = False
129-
ExplicitLeft = 0
130-
ExplicitTop = 0
131-
ExplicitWidth = 0
132-
ExplicitHeight = 0
133119
inline frmFinish: TFixedHTMLDlgFrame
134120
Left = 0
135121
Top = 0
@@ -166,9 +152,6 @@ inherited DBUpdateDlg: TDBUpdateDlg
166152
end
167153
end
168154
end
169-
inherited btnHelp: TButton
170-
Visible = False
171-
end
172155
object alMain: TActionList
173156
Left = 448
174157
Top = 208

Src/FmMain.dfm

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,8 @@ inherited MainForm: TMainForm
166166
ImageIndex = 12
167167
Style = tbsSeparator
168168
end
169-
object tbUpdateDbase: TToolButton
170-
Left = 423
171-
Top = 0
172-
Action = actUpdateDbase
173-
end
174-
object tbSpacer4: TToolButton
175-
Left = 446
176-
Top = 0
177-
Width = 8
178-
Caption = 'tbSpacer4'
179-
ImageIndex = 12
180-
Style = tbsSeparator
181-
end
182169
object tbHelpContents: TToolButton
183-
Left = 454
170+
Left = 423
184171
Top = 0
185172
Action = actHelpContents
186173
end
@@ -323,7 +310,7 @@ inherited MainForm: TMainForm
323310
Caption = 'Save Annotated Source...'
324311
Hint =
325312
'Save annotated source code|Save the annotated source code of the' +
326-
' selected snippet or category to a file'
313+
' selected routine or category to a file'
327314
ImageIndex = 18
328315
ShortCut = 24654
329316
OnExecute = actSaveSnippetExecute
@@ -354,8 +341,8 @@ inherited MainForm: TMainForm
354341
Category = 'File'
355342
Caption = 'Save Unit...'
356343
Hint =
357-
'Save unit|Generate and save a Pascal unit containing the snippet' +
358-
's in the current selection'
344+
'Save unit|Generate and save a Pascal unit containing valid snipp' +
345+
'ets in the current selection'
359346
ImageIndex = 14
360347
ShortCut = 16469
361348
OnExecute = actSaveUnitExecute
@@ -450,7 +437,7 @@ inherited MainForm: TMainForm
450437
Caption = 'Copy Annotated Source'
451438
Hint =
452439
'Copy annotated source code|Copy the annotated source code of the' +
453-
' selected snippet or category to the clipboard'
440+
' selected routine or category to the clipboard'
454441
ShortCut = 16462
455442
OnExecute = actCopySnippetExecute
456443
OnUpdate = actCopySnippetUpdate
@@ -495,7 +482,7 @@ inherited MainForm: TMainForm
495482
object actHelpQuickStart: TAction
496483
Category = 'Help'
497484
Caption = 'QuickStart Guide'
498-
Hint = 'QuickStart guide|Display the QuickStart help page'
485+
Hint = 'QuickStart guide|Display the QuickStart help topic'
499486
OnExecute = actHelpQuickStartExecute
500487
end
501488
object actCompilers: TAction
@@ -531,7 +518,7 @@ inherited MainForm: TMainForm
531518
object actLicense: TAction
532519
Category = 'Help'
533520
Caption = 'License'
534-
Hint = 'View license|View the end user license agreement'
521+
Hint = 'View license|View a summary of the end user license agreement'
535522
ImageIndex = 35
536523
OnExecute = actLicenseExecute
537524
end
@@ -695,7 +682,7 @@ inherited MainForm: TMainForm
695682
Caption = 'Dependencies...'
696683
Hint =
697684
'View dependencies|Display the names of snippets that depend on, ' +
698-
'or are required, by the selected snippet'
685+
'or are required by, the selected snippet'
699686
ImageIndex = 31
700687
ShortCut = 16452
701688
OnExecute = actViewDependenciesExecute
@@ -794,12 +781,12 @@ inherited MainForm: TMainForm
794781
Caption = 'FAQs'
795782
Hint =
796783
'FAQs|Display CodeSnip'#39's online Frequently Asked Questions in the' +
797-
' default browser'
784+
' default web browser'
798785
ImageIndex = 6
799786
end
800787
object actDuplicateSnippet: TAction
801788
Category = 'Snippets'
802-
Caption = 'Duplicate Snippet'
789+
Caption = 'Duplicate Snippet...'
803790
Hint =
804791
'Duplicate snippet|Duplicate the selected snippet and add it to t' +
805792
'he user-defined database'
@@ -812,8 +799,8 @@ inherited MainForm: TMainForm
812799
Category = 'File'
813800
Caption = 'Save Selection...'
814801
Hint =
815-
'Save current selection|Save information about the current snippe' +
816-
't selection to a file'
802+
'Save current selection|Save information about the currently sele' +
803+
'cted snippets to a file'
817804
ShortCut = 41043
818805
OnExecute = actSaveSelectionExecute
819806
OnUpdate = actSaveSelectionUpdate
@@ -833,7 +820,7 @@ inherited MainForm: TMainForm
833820
Caption = 'Close All Other Tabs'
834821
Hint =
835822
'Close all other tabs|Close all tabs in the Details pane except f' +
836-
'or the current tab'
823+
'or the current one'
837824
ShortCut = 24691
838825
OnExecute = actCloseUnselectedDetailsTabsExecute
839826
OnUpdate = actCloseDetailsTabsUpdate
@@ -874,7 +861,7 @@ inherited MainForm: TMainForm
874861
Caption = 'Import Snippets From SWAG...'
875862
Hint =
876863
'Import snippets from SWAG|Import one or more snippets into the u' +
877-
'ser database from the online SWAG database'
864+
'ser database from the SWAG database'
878865
OnExecute = actSWAGImportExecute
879866
end
880867
object actBlog: TBrowseURL

Src/FmMain.pas

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,11 @@ TMainForm = class(THelpAwareForm)
233233
tbSelectSnippets: TToolButton;
234234
tbSpacer1: TToolButton;
235235
tbSpacer3: TToolButton;
236-
tbSpacer4: TToolButton;
237236
tbSpacer5: TToolButton;
238237
tbSpacer6: TToolButton;
239238
tbSpacer7: TToolButton;
240239
tbSpacer8: TToolButton;
241240
tbTestCompile: TToolButton;
242-
tbUpdateDbase: TToolButton;
243241
actBlog: TBrowseURL;
244242
miBlog: TMenuItem;
245243
/// <summary>Displays About Box.</summary>

Src/FmSWAGImportDlg.dfm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inherited SWAGImportDlg: TSWAGImportDlg
1919
inherited pcWizard: TPageControl
2020
Width = 671
2121
Height = 456
22-
ActivePage = tsIntro
22+
ActivePage = tsUpdate
2323
ExplicitWidth = 671
2424
ExplicitHeight = 456
2525
object tsIntro: TTabSheet
@@ -33,10 +33,10 @@ inherited SWAGImportDlg: TSWAGImportDlg
3333
Align = alTop
3434
TabOrder = 0
3535
TabStop = True
36-
ExplicitLeft = 8
37-
ExplicitTop = 8
36+
ExplicitWidth = 663
3837
inherited pnlBrowser: TPanel
3938
Width = 663
39+
ExplicitWidth = 663
4040
inherited wbBrowser: TWebBrowser
4141
Width = 663
4242
ExplicitWidth = 320
@@ -178,10 +178,10 @@ inherited SWAGImportDlg: TSWAGImportDlg
178178
AutoSize = False
179179
Caption =
180180
'You have chosen to import the following SWAG snippets. They will' +
181-
' be imported with the given Display Names and Unique IDs. You ca' +
182-
'n change these if you wish using the Snippets Editor. To make ch' +
183-
'anges go back to the previous page. When you are ready to import' +
184-
' the snippets click "Import". This step can'#39't be undone.'
181+
' be imported with the given Display Names and Snippet IDs. You c' +
182+
'an change these if you wish using the Snippets Editor. To make c' +
183+
'hanges go back to the previous page. When you are ready to impor' +
184+
't the snippets click "Import". This step can'#39't be undone.'
185185
WordWrap = True
186186
end
187187
object lvImports: TListView

0 commit comments

Comments
 (0)