Revision | 11 (tree) |
---|---|
Zeit | 2014-06-29 04:59:01 |
Autor | twm |
replaced the TOpenDialog and TSaveDialog with calls to TOpen/SaveDialog_Execute with appropriate file filters
@@ -1,6 +1,6 @@ | ||
1 | 1 | [Version Info] |
2 | 2 | AutoIncBuild=0 |
3 | -Build=25 | |
3 | +Build=28 | |
4 | 4 | MajorVer=1 |
5 | 5 | MinorVer=0 |
6 | 6 | Release=0 |
@@ -7,7 +7,7 @@ | ||
7 | 7 | Revision=0 |
8 | 8 | |
9 | 9 | [Version Info Keys] |
10 | -FileVersion=1.0.0.25 | |
10 | +FileVersion=1.0.0.28 | |
11 | 11 | ProductVersion={today} |
12 | 12 | FileDescription=INI file formatter |
13 | 13 | OriginalFilename=IniFileFormatter |
@@ -11,7 +11,6 @@ | ||
11 | 11 | Graphics, |
12 | 12 | Controls, |
13 | 13 | Forms, |
14 | - Dialogs, | |
15 | 14 | StdCtrls, |
16 | 15 | ComCtrls, |
17 | 16 | u_dzTranslator; |
@@ -20,7 +19,6 @@ | ||
20 | 19 | Tf_IniFileFormatter = class(TForm) |
21 | 20 | l_Filename: TLabel; |
22 | 21 | ed_Filename: TEdit; |
23 | - od_Filename: TOpenDialog; | |
24 | 22 | b_Filename: TButton; |
25 | 23 | pc_Input: TPageControl; |
26 | 24 | ts_Original: TTabSheet; |
@@ -40,7 +38,6 @@ | ||
40 | 38 | rb_ItemsByTemplate: TRadioButton; |
41 | 39 | b_Close: TButton; |
42 | 40 | b_SaveAs: TButton; |
43 | - sd_Filename: TSaveDialog; | |
44 | 41 | l_Template: TLabel; |
45 | 42 | ed_Template: TEdit; |
46 | 43 | b_Template: TButton; |
@@ -70,7 +67,8 @@ | ||
70 | 67 | uses |
71 | 68 | u_dzIniFileFormatter, |
72 | 69 | u_dzIniSections, |
73 | - u_dzVclUtils; | |
70 | + u_dzVclUtils, | |
71 | + u_dzDialogUtils; | |
74 | 72 | |
75 | 73 | constructor Tf_IniFileFormatter.Create(_Owner: TComponent); |
76 | 74 | begin |
@@ -88,28 +86,35 @@ | ||
88 | 86 | end; |
89 | 87 | |
90 | 88 | procedure Tf_IniFileFormatter.b_FilenameClick(Sender: TObject); |
89 | +var | |
90 | + fn: string; | |
91 | 91 | begin |
92 | - od_Filename.Filename := ed_Filename.Text; | |
93 | - if od_Filename.Execute then begin | |
94 | - ed_Filename.Text := od_Filename.Filename; | |
95 | - LoadAndSort(ed_Filename.Text); | |
96 | - end; | |
92 | + fn := ed_Filename.Text; | |
93 | + if not TOpenDialog_Execute(Self, _('Select file to format'), FileFilterBuilder().AddIni.Filter, fn) then | |
94 | + Exit; | |
95 | + ed_Filename.Text := fn; | |
96 | + LoadAndSort(fn); | |
97 | 97 | end; |
98 | 98 | |
99 | 99 | procedure Tf_IniFileFormatter.b_TemplateClick(Sender: TObject); |
100 | +var | |
101 | + fn: string; | |
100 | 102 | begin |
101 | - od_Filename.Filename := ed_Template.Text; | |
102 | - if od_Filename.Execute then begin | |
103 | - ed_Template.Text := od_Filename.Filename; | |
104 | - end; | |
103 | + fn := ed_Template.Text; | |
104 | + if not TOpenDialog_Execute(Self, _('Select template file'), FileFilterBuilder().AddIni.Filter, fn) then | |
105 | + Exit; | |
106 | + ed_Template.Text := fn; | |
105 | 107 | FormatIni; |
106 | 108 | end; |
107 | 109 | |
108 | 110 | procedure Tf_IniFileFormatter.b_SaveAsClick(Sender: TObject); |
111 | +var | |
112 | + fn: string; | |
109 | 113 | begin |
110 | - sd_Filename.Filename := ed_Filename.Text; | |
111 | - if sd_Filename.Execute then | |
112 | - m_Preview.Lines.SaveToFile(sd_Filename.Filename); | |
114 | + fn := ed_Filename.Text; | |
115 | + if not TSaveDialog_Execute(Self, _('Save File As'), FileFilterBuilder().AddIni.Filter, fn) then | |
116 | + Exit; | |
117 | + m_Preview.Lines.SaveToFile(fn); | |
113 | 118 | end; |
114 | 119 | |
115 | 120 | function Tf_IniFileFormatter.Execute(const _Value: string): Boolean; |
@@ -6,14 +6,14 @@ | ||
6 | 6 | msgid "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | -"POT-Creation-Date: 2014-06-28 21:31\n" | |
9 | +"POT-Creation-Date: 2014-06-28 21:57\n" | |
10 | 10 | "PO-Revision-Date: 2010-10-23 16:47\n" |
11 | 11 | "Last-Translator: Somebody <your.email@address.com>\n" |
12 | +"Language-Team: <>\n" | |
12 | 13 | "MIME-Version: 1.0\n" |
13 | 14 | "Content-Type: text/plain; charset=UTF-8\n" |
14 | 15 | "Content-Transfer-Encoding: 8bit\n" |
15 | 16 | "X-Generator: dxgettext 1.2.2\n" |
16 | -"Language-Team: <>\n" | |
17 | 17 | "X-Poedit-Language: German\n" |
18 | 18 | "X-Poedit-Basepath: \n" |
19 | 19 |
@@ -38,69 +38,53 @@ | ||
38 | 38 | msgstr "Original" |
39 | 39 | |
40 | 40 | #. f_IniFileFormatter..pc_Input..ts_Template..Caption |
41 | -#: w_IniFileFormatter.dfm:80 | |
41 | +#: w_IniFileFormatter.dfm:83 | |
42 | 42 | msgid "Template" |
43 | 43 | msgstr "Vorlage" |
44 | 44 | |
45 | 45 | #. f_IniFileFormatter..pc_Output..ts_Preview..Caption |
46 | -#: w_IniFileFormatter.dfm:108 | |
46 | +#: w_IniFileFormatter.dfm:106 | |
47 | 47 | msgid "Preview" |
48 | 48 | msgstr "Vorschau" |
49 | 49 | |
50 | 50 | #. f_IniFileFormatter..gb_SortSections..Caption |
51 | -#: w_IniFileFormatter.dfm:131 | |
51 | +#: w_IniFileFormatter.dfm:124 | |
52 | 52 | msgid "Sort Sections" |
53 | 53 | msgstr "Sektionen sortieren" |
54 | 54 | |
55 | 55 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsUnsorted..Caption |
56 | 56 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsUnsorted..Caption |
57 | -#: w_IniFileFormatter.dfm:138 w_IniFileFormatter.dfm:175 | |
57 | +#: w_IniFileFormatter.dfm:131 w_IniFileFormatter.dfm:168 | |
58 | 58 | msgid "Unsorted" |
59 | 59 | msgstr "Unsortiert" |
60 | 60 | |
61 | 61 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsAlpha..Caption |
62 | 62 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsAlpha..Caption |
63 | -#: w_IniFileFormatter.dfm:147 w_IniFileFormatter.dfm:184 | |
63 | +#: w_IniFileFormatter.dfm:140 w_IniFileFormatter.dfm:177 | |
64 | 64 | msgid "Alphabetically" |
65 | 65 | msgstr "Alphabetisch" |
66 | 66 | |
67 | 67 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsByTemplate..Caption |
68 | 68 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsByTemplate..Caption |
69 | -#: w_IniFileFormatter.dfm:158 w_IniFileFormatter.dfm:195 | |
69 | +#: w_IniFileFormatter.dfm:151 w_IniFileFormatter.dfm:188 | |
70 | 70 | msgid "By Template" |
71 | 71 | msgstr "Nach einer Vorlage" |
72 | 72 | |
73 | 73 | #. f_IniFileFormatter..gb_SortItems..Caption |
74 | -#: w_IniFileFormatter.dfm:168 | |
74 | +#: w_IniFileFormatter.dfm:161 | |
75 | 75 | msgid "Sort Items" |
76 | 76 | msgstr "Einträge sortieren" |
77 | 77 | |
78 | 78 | #. f_IniFileFormatter..b_Close..Caption |
79 | -#: w_IniFileFormatter.dfm:207 | |
79 | +#: w_IniFileFormatter.dfm:200 | |
80 | 80 | msgid "Close" |
81 | 81 | msgstr "Schließen" |
82 | 82 | |
83 | 83 | #. f_IniFileFormatter..b_SaveAs..Caption |
84 | -#: w_IniFileFormatter.dfm:217 | |
84 | +#: w_IniFileFormatter.dfm:210 | |
85 | 85 | msgid "Save As ..." |
86 | 86 | msgstr "Speichern unter ..." |
87 | 87 | |
88 | -#. f_IniFileFormatter..od_Filename..Filter | |
89 | -#. f_IniFileFormatter..sd_Filename..Filter | |
90 | -#: w_IniFileFormatter.dfm:240 w_IniFileFormatter.dfm:246 | |
91 | -msgid "All files (*.*)|*.*" | |
92 | -msgstr "Alle Dateien (*.*)|*.*" | |
93 | - | |
94 | -#. f_IniFileFormatter..od_Filename..Title | |
95 | -#: w_IniFileFormatter.dfm:241 | |
96 | -msgid "Select file" | |
97 | -msgstr "Wählen Sie eine Datei" | |
98 | - | |
99 | -#. f_IniFileFormatter..sd_Filename..Title | |
100 | -#: w_IniFileFormatter.dfm:247 | |
101 | -msgid "Save File As" | |
102 | -msgstr "Datei speichern unter" | |
103 | - | |
104 | 88 | #: u_IniFileFormatterMain.pas:29 |
105 | 89 | msgid "Sort sections. Possible values: no, alpha, template (default: alpha)" |
106 | 90 | msgstr "Sektionen sortieren, mögliche Werte: no, alpha, template (Vorgabe: alpha)" |
@@ -126,3 +110,15 @@ | ||
126 | 110 | msgid "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\"" |
127 | 111 | msgstr "Ungültiger Wert \"%s\" für Option SortSections, muss eines von \"no\", \"alpha\" oder \"template\" sein." |
128 | 112 | |
113 | +#: w_IniFileFormatter.pas:93 | |
114 | +msgid "Select file to format" | |
115 | +msgstr "Wählen Sie die zu formatierende Datei" | |
116 | + | |
117 | +#: w_IniFileFormatter.pas:104 | |
118 | +msgid "Select template file" | |
119 | +msgstr "Wählen Sie die Vorlagen-Datei" | |
120 | + | |
121 | +#: w_IniFileFormatter.pas:115 | |
122 | +msgid "Save File As" | |
123 | +msgstr "Datei speichern unter" | |
124 | + |
@@ -6,14 +6,14 @@ | ||
6 | 6 | msgid "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | -"POT-Creation-Date: 2014-06-28 21:31\n" | |
9 | +"POT-Creation-Date: 2014-06-28 21:57\n" | |
10 | 10 | "PO-Revision-Date: 2010-10-23 16:47\n" |
11 | 11 | "Last-Translator: Somebody <your.email@address.com>\n" |
12 | +"Language-Team: <>\n" | |
12 | 13 | "MIME-Version: 1.0\n" |
13 | 14 | "Content-Type: text/plain; charset=UTF-8\n" |
14 | 15 | "Content-Transfer-Encoding: 8bit\n" |
15 | 16 | "X-Generator: dxgettext 1.2.2\n" |
16 | -"Language-Team: <>\n" | |
17 | 17 | "X-Poedit-Language: English\n" |
18 | 18 | "X-Poedit-Basepath: \n" |
19 | 19 |
@@ -38,69 +38,53 @@ | ||
38 | 38 | msgstr "Original" |
39 | 39 | |
40 | 40 | #. f_IniFileFormatter..pc_Input..ts_Template..Caption |
41 | -#: w_IniFileFormatter.dfm:80 | |
41 | +#: w_IniFileFormatter.dfm:83 | |
42 | 42 | msgid "Template" |
43 | 43 | msgstr "Template" |
44 | 44 | |
45 | 45 | #. f_IniFileFormatter..pc_Output..ts_Preview..Caption |
46 | -#: w_IniFileFormatter.dfm:108 | |
46 | +#: w_IniFileFormatter.dfm:106 | |
47 | 47 | msgid "Preview" |
48 | 48 | msgstr "Preview" |
49 | 49 | |
50 | 50 | #. f_IniFileFormatter..gb_SortSections..Caption |
51 | -#: w_IniFileFormatter.dfm:131 | |
51 | +#: w_IniFileFormatter.dfm:124 | |
52 | 52 | msgid "Sort Sections" |
53 | 53 | msgstr "Sort Sections" |
54 | 54 | |
55 | 55 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsUnsorted..Caption |
56 | 56 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsUnsorted..Caption |
57 | -#: w_IniFileFormatter.dfm:138 w_IniFileFormatter.dfm:175 | |
57 | +#: w_IniFileFormatter.dfm:131 w_IniFileFormatter.dfm:168 | |
58 | 58 | msgid "Unsorted" |
59 | 59 | msgstr "Unsorted" |
60 | 60 | |
61 | 61 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsAlpha..Caption |
62 | 62 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsAlpha..Caption |
63 | -#: w_IniFileFormatter.dfm:147 w_IniFileFormatter.dfm:184 | |
63 | +#: w_IniFileFormatter.dfm:140 w_IniFileFormatter.dfm:177 | |
64 | 64 | msgid "Alphabetically" |
65 | 65 | msgstr "Alphabetically" |
66 | 66 | |
67 | 67 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsByTemplate..Caption |
68 | 68 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsByTemplate..Caption |
69 | -#: w_IniFileFormatter.dfm:158 w_IniFileFormatter.dfm:195 | |
69 | +#: w_IniFileFormatter.dfm:151 w_IniFileFormatter.dfm:188 | |
70 | 70 | msgid "By Template" |
71 | 71 | msgstr "By Template" |
72 | 72 | |
73 | 73 | #. f_IniFileFormatter..gb_SortItems..Caption |
74 | -#: w_IniFileFormatter.dfm:168 | |
74 | +#: w_IniFileFormatter.dfm:161 | |
75 | 75 | msgid "Sort Items" |
76 | 76 | msgstr "Sort Items" |
77 | 77 | |
78 | 78 | #. f_IniFileFormatter..b_Close..Caption |
79 | -#: w_IniFileFormatter.dfm:207 | |
79 | +#: w_IniFileFormatter.dfm:200 | |
80 | 80 | msgid "Close" |
81 | 81 | msgstr "Close" |
82 | 82 | |
83 | 83 | #. f_IniFileFormatter..b_SaveAs..Caption |
84 | -#: w_IniFileFormatter.dfm:217 | |
84 | +#: w_IniFileFormatter.dfm:210 | |
85 | 85 | msgid "Save As ..." |
86 | 86 | msgstr "Save As ..." |
87 | 87 | |
88 | -#. f_IniFileFormatter..od_Filename..Filter | |
89 | -#. f_IniFileFormatter..sd_Filename..Filter | |
90 | -#: w_IniFileFormatter.dfm:240 w_IniFileFormatter.dfm:246 | |
91 | -msgid "All files (*.*)|*.*" | |
92 | -msgstr "All files (*.*)|*.*" | |
93 | - | |
94 | -#. f_IniFileFormatter..od_Filename..Title | |
95 | -#: w_IniFileFormatter.dfm:241 | |
96 | -msgid "Select file" | |
97 | -msgstr "Select file" | |
98 | - | |
99 | -#. f_IniFileFormatter..sd_Filename..Title | |
100 | -#: w_IniFileFormatter.dfm:247 | |
101 | -msgid "Save File As" | |
102 | -msgstr "Save File As" | |
103 | - | |
104 | 88 | #: u_IniFileFormatterMain.pas:29 |
105 | 89 | msgid "Sort sections. Possible values: no, alpha, template (default: alpha)" |
106 | 90 | msgstr "Sort sections. Possible values: no, alpha, template (default: alpha)" |
@@ -126,3 +110,15 @@ | ||
126 | 110 | msgid "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\"" |
127 | 111 | msgstr "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\"" |
128 | 112 | |
113 | +#: w_IniFileFormatter.pas:93 | |
114 | +msgid "Select file to format" | |
115 | +msgstr "Select file to format" | |
116 | + | |
117 | +#: w_IniFileFormatter.pas:104 | |
118 | +msgid "Select template file" | |
119 | +msgstr "Select template file" | |
120 | + | |
121 | +#: w_IniFileFormatter.pas:115 | |
122 | +msgid "Save File As" | |
123 | +msgstr "Save File As" | |
124 | + |
@@ -7,7 +7,7 @@ | ||
7 | 7 | msgid "" |
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
10 | -"POT-Creation-Date: 2014-06-28 21:31\n" | |
10 | +"POT-Creation-Date: 2014-06-28 21:57\n" | |
11 | 11 | "PO-Revision-Date: 2010-10-23 16:47\n" |
12 | 12 | "Last-Translator: Somebody <your.email@address.com>\n" |
13 | 13 | "MIME-Version: 1.0\n" |
@@ -36,69 +36,53 @@ | ||
36 | 36 | msgstr "" |
37 | 37 | |
38 | 38 | #. f_IniFileFormatter..pc_Input..ts_Template..Caption |
39 | -#: w_IniFileFormatter.dfm:80 | |
39 | +#: w_IniFileFormatter.dfm:83 | |
40 | 40 | msgid "Template" |
41 | 41 | msgstr "" |
42 | 42 | |
43 | 43 | #. f_IniFileFormatter..pc_Output..ts_Preview..Caption |
44 | -#: w_IniFileFormatter.dfm:108 | |
44 | +#: w_IniFileFormatter.dfm:106 | |
45 | 45 | msgid "Preview" |
46 | 46 | msgstr "" |
47 | 47 | |
48 | 48 | #. f_IniFileFormatter..gb_SortSections..Caption |
49 | -#: w_IniFileFormatter.dfm:131 | |
49 | +#: w_IniFileFormatter.dfm:124 | |
50 | 50 | msgid "Sort Sections" |
51 | 51 | msgstr "" |
52 | 52 | |
53 | 53 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsUnsorted..Caption |
54 | 54 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsUnsorted..Caption |
55 | -#: w_IniFileFormatter.dfm:138 w_IniFileFormatter.dfm:175 | |
55 | +#: w_IniFileFormatter.dfm:131 w_IniFileFormatter.dfm:168 | |
56 | 56 | msgid "Unsorted" |
57 | 57 | msgstr "" |
58 | 58 | |
59 | 59 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsAlpha..Caption |
60 | 60 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsAlpha..Caption |
61 | -#: w_IniFileFormatter.dfm:147 w_IniFileFormatter.dfm:184 | |
61 | +#: w_IniFileFormatter.dfm:140 w_IniFileFormatter.dfm:177 | |
62 | 62 | msgid "Alphabetically" |
63 | 63 | msgstr "" |
64 | 64 | |
65 | 65 | #. f_IniFileFormatter..gb_SortSections..rb_SectionsByTemplate..Caption |
66 | 66 | #. f_IniFileFormatter..gb_SortItems..rb_ItemsByTemplate..Caption |
67 | -#: w_IniFileFormatter.dfm:158 w_IniFileFormatter.dfm:195 | |
67 | +#: w_IniFileFormatter.dfm:151 w_IniFileFormatter.dfm:188 | |
68 | 68 | msgid "By Template" |
69 | 69 | msgstr "" |
70 | 70 | |
71 | 71 | #. f_IniFileFormatter..gb_SortItems..Caption |
72 | -#: w_IniFileFormatter.dfm:168 | |
72 | +#: w_IniFileFormatter.dfm:161 | |
73 | 73 | msgid "Sort Items" |
74 | 74 | msgstr "" |
75 | 75 | |
76 | 76 | #. f_IniFileFormatter..b_Close..Caption |
77 | -#: w_IniFileFormatter.dfm:207 | |
77 | +#: w_IniFileFormatter.dfm:200 | |
78 | 78 | msgid "Close" |
79 | 79 | msgstr "" |
80 | 80 | |
81 | 81 | #. f_IniFileFormatter..b_SaveAs..Caption |
82 | -#: w_IniFileFormatter.dfm:217 | |
82 | +#: w_IniFileFormatter.dfm:210 | |
83 | 83 | msgid "Save As ..." |
84 | 84 | msgstr "" |
85 | 85 | |
86 | -#. f_IniFileFormatter..od_Filename..Filter | |
87 | -#. f_IniFileFormatter..sd_Filename..Filter | |
88 | -#: w_IniFileFormatter.dfm:240 w_IniFileFormatter.dfm:246 | |
89 | -msgid "All files (*.*)|*.*" | |
90 | -msgstr "" | |
91 | - | |
92 | -#. f_IniFileFormatter..od_Filename..Title | |
93 | -#: w_IniFileFormatter.dfm:241 | |
94 | -msgid "Select file" | |
95 | -msgstr "" | |
96 | - | |
97 | -#. f_IniFileFormatter..sd_Filename..Title | |
98 | -#: w_IniFileFormatter.dfm:247 | |
99 | -msgid "Save File As" | |
100 | -msgstr "" | |
101 | - | |
102 | 86 | #: u_IniFileFormatterMain.pas:29 |
103 | 87 | msgid "Sort sections. Possible values: no, alpha, template (default: alpha)" |
104 | 88 | msgstr "" |
@@ -123,3 +107,15 @@ | ||
123 | 107 | #, object-pascal-format |
124 | 108 | msgid "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\"" |
125 | 109 | msgstr "" |
110 | + | |
111 | +#: w_IniFileFormatter.pas:93 | |
112 | +msgid "Select file to format" | |
113 | +msgstr "" | |
114 | + | |
115 | +#: w_IniFileFormatter.pas:104 | |
116 | +msgid "Select template file" | |
117 | +msgstr "" | |
118 | + | |
119 | +#: w_IniFileFormatter.pas:115 | |
120 | +msgid "Save File As" | |
121 | +msgstr "" |