Skip to content

Commit b1ae57a

Browse files
committed
Change Save Annotated Dlg Title for snippets and categories.
Fixes issue #11 where Save Annotated Snippet dialogue box was displaying "Snippet" when displaying a category.
1 parent a05e250 commit b1ae57a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Src/USaveSnippetMgr.pas

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2020, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Defines a class that manages generation, previewing and saving of a code
99
* snippet.
@@ -92,7 +92,8 @@ implementation
9292

9393
resourcestring
9494
// Dialog box title
95-
sSaveDlgTitle = 'Save %0:s Snippet';
95+
sSaveSnippetDlgTitle = 'Save %0:s Snippet';
96+
sSaveCategoryDlgTitle = 'Save %0:s Category';
9697
// Output document title for snippets and categories
9798
sDocTitle = '"%0:s" %1:s';
9899
sCategory = 'category';
@@ -145,7 +146,12 @@ function TSaveSnippetMgr.GetDlgHelpKeyword: string;
145146

146147
function TSaveSnippetMgr.GetDlgTitle: string;
147148
begin
148-
Result := Format(sSaveDlgTitle, [fView.Description]);
149+
if Supports(fView, ICategoryView) then
150+
Result := Format(sSaveCategoryDlgTitle, [fView.Description])
151+
else if Supports(fView, ISnippetView) then
152+
Result := Format(sSaveSnippetDlgTitle, [fView.Description])
153+
else
154+
Result := '';
149155
end;
150156

151157
function TSaveSnippetMgr.GetDocTitle: string;

0 commit comments

Comments
 (0)