• R/O
  • SSH
  • HTTPS

dzinifileformatter: Commit


Commit MetaInfo

Revision11 (tree)
Zeit2014-06-29 04:59:01
Autortwm

Log Message

replaced the TOpenDialog and TSaveDialog with calls to TOpen/SaveDialog_Execute with appropriate file filters

Ändern Zusammenfassung

Diff

--- trunk/src/dzIniFileFormatter_version.ini (revision 10)
+++ trunk/src/dzIniFileFormatter_version.ini (revision 11)
@@ -1,6 +1,6 @@
11 [Version Info]
22 AutoIncBuild=0
3-Build=25
3+Build=28
44 MajorVer=1
55 MinorVer=0
66 Release=0
@@ -7,7 +7,7 @@
77 Revision=0
88
99 [Version Info Keys]
10-FileVersion=1.0.0.25
10+FileVersion=1.0.0.28
1111 ProductVersion={today}
1212 FileDescription=INI file formatter
1313 OriginalFilename=IniFileFormatter
--- trunk/src/w_IniFileFormatter.pas (revision 10)
+++ trunk/src/w_IniFileFormatter.pas (revision 11)
@@ -11,7 +11,6 @@
1111 Graphics,
1212 Controls,
1313 Forms,
14- Dialogs,
1514 StdCtrls,
1615 ComCtrls,
1716 u_dzTranslator;
@@ -20,7 +19,6 @@
2019 Tf_IniFileFormatter = class(TForm)
2120 l_Filename: TLabel;
2221 ed_Filename: TEdit;
23- od_Filename: TOpenDialog;
2422 b_Filename: TButton;
2523 pc_Input: TPageControl;
2624 ts_Original: TTabSheet;
@@ -40,7 +38,6 @@
4038 rb_ItemsByTemplate: TRadioButton;
4139 b_Close: TButton;
4240 b_SaveAs: TButton;
43- sd_Filename: TSaveDialog;
4441 l_Template: TLabel;
4542 ed_Template: TEdit;
4643 b_Template: TButton;
@@ -70,7 +67,8 @@
7067 uses
7168 u_dzIniFileFormatter,
7269 u_dzIniSections,
73- u_dzVclUtils;
70+ u_dzVclUtils,
71+ u_dzDialogUtils;
7472
7573 constructor Tf_IniFileFormatter.Create(_Owner: TComponent);
7674 begin
@@ -88,28 +86,35 @@
8886 end;
8987
9088 procedure Tf_IniFileFormatter.b_FilenameClick(Sender: TObject);
89+var
90+ fn: string;
9191 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);
9797 end;
9898
9999 procedure Tf_IniFileFormatter.b_TemplateClick(Sender: TObject);
100+var
101+ fn: string;
100102 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;
105107 FormatIni;
106108 end;
107109
108110 procedure Tf_IniFileFormatter.b_SaveAsClick(Sender: TObject);
111+var
112+ fn: string;
109113 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);
113118 end;
114119
115120 function Tf_IniFileFormatter.Execute(const _Value: string): Boolean;
--- trunk/translations/de/default.po (revision 10)
+++ trunk/translations/de/default.po (revision 11)
@@ -6,14 +6,14 @@
66 msgid ""
77 msgstr ""
88 "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"
1010 "PO-Revision-Date: 2010-10-23 16:47\n"
1111 "Last-Translator: Somebody <your.email@address.com>\n"
12+"Language-Team: <>\n"
1213 "MIME-Version: 1.0\n"
1314 "Content-Type: text/plain; charset=UTF-8\n"
1415 "Content-Transfer-Encoding: 8bit\n"
1516 "X-Generator: dxgettext 1.2.2\n"
16-"Language-Team: <>\n"
1717 "X-Poedit-Language: German\n"
1818 "X-Poedit-Basepath: \n"
1919
@@ -38,69 +38,53 @@
3838 msgstr "Original"
3939
4040 #. f_IniFileFormatter..pc_Input..ts_Template..Caption
41-#: w_IniFileFormatter.dfm:80
41+#: w_IniFileFormatter.dfm:83
4242 msgid "Template"
4343 msgstr "Vorlage"
4444
4545 #. f_IniFileFormatter..pc_Output..ts_Preview..Caption
46-#: w_IniFileFormatter.dfm:108
46+#: w_IniFileFormatter.dfm:106
4747 msgid "Preview"
4848 msgstr "Vorschau"
4949
5050 #. f_IniFileFormatter..gb_SortSections..Caption
51-#: w_IniFileFormatter.dfm:131
51+#: w_IniFileFormatter.dfm:124
5252 msgid "Sort Sections"
5353 msgstr "Sektionen sortieren"
5454
5555 #. f_IniFileFormatter..gb_SortSections..rb_SectionsUnsorted..Caption
5656 #. 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
5858 msgid "Unsorted"
5959 msgstr "Unsortiert"
6060
6161 #. f_IniFileFormatter..gb_SortSections..rb_SectionsAlpha..Caption
6262 #. 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
6464 msgid "Alphabetically"
6565 msgstr "Alphabetisch"
6666
6767 #. f_IniFileFormatter..gb_SortSections..rb_SectionsByTemplate..Caption
6868 #. 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
7070 msgid "By Template"
7171 msgstr "Nach einer Vorlage"
7272
7373 #. f_IniFileFormatter..gb_SortItems..Caption
74-#: w_IniFileFormatter.dfm:168
74+#: w_IniFileFormatter.dfm:161
7575 msgid "Sort Items"
7676 msgstr "Einträge sortieren"
7777
7878 #. f_IniFileFormatter..b_Close..Caption
79-#: w_IniFileFormatter.dfm:207
79+#: w_IniFileFormatter.dfm:200
8080 msgid "Close"
8181 msgstr "Schließen"
8282
8383 #. f_IniFileFormatter..b_SaveAs..Caption
84-#: w_IniFileFormatter.dfm:217
84+#: w_IniFileFormatter.dfm:210
8585 msgid "Save As ..."
8686 msgstr "Speichern unter ..."
8787
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-
10488 #: u_IniFileFormatterMain.pas:29
10589 msgid "Sort sections. Possible values: no, alpha, template (default: alpha)"
10690 msgstr "Sektionen sortieren, mögliche Werte: no, alpha, template (Vorgabe: alpha)"
@@ -126,3 +110,15 @@
126110 msgid "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\""
127111 msgstr "Ungültiger Wert \"%s\" für Option SortSections, muss eines von \"no\", \"alpha\" oder \"template\" sein."
128112
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+
--- trunk/translations/en/default.po (revision 10)
+++ trunk/translations/en/default.po (revision 11)
@@ -6,14 +6,14 @@
66 msgid ""
77 msgstr ""
88 "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"
1010 "PO-Revision-Date: 2010-10-23 16:47\n"
1111 "Last-Translator: Somebody <your.email@address.com>\n"
12+"Language-Team: <>\n"
1213 "MIME-Version: 1.0\n"
1314 "Content-Type: text/plain; charset=UTF-8\n"
1415 "Content-Transfer-Encoding: 8bit\n"
1516 "X-Generator: dxgettext 1.2.2\n"
16-"Language-Team: <>\n"
1717 "X-Poedit-Language: English\n"
1818 "X-Poedit-Basepath: \n"
1919
@@ -38,69 +38,53 @@
3838 msgstr "Original"
3939
4040 #. f_IniFileFormatter..pc_Input..ts_Template..Caption
41-#: w_IniFileFormatter.dfm:80
41+#: w_IniFileFormatter.dfm:83
4242 msgid "Template"
4343 msgstr "Template"
4444
4545 #. f_IniFileFormatter..pc_Output..ts_Preview..Caption
46-#: w_IniFileFormatter.dfm:108
46+#: w_IniFileFormatter.dfm:106
4747 msgid "Preview"
4848 msgstr "Preview"
4949
5050 #. f_IniFileFormatter..gb_SortSections..Caption
51-#: w_IniFileFormatter.dfm:131
51+#: w_IniFileFormatter.dfm:124
5252 msgid "Sort Sections"
5353 msgstr "Sort Sections"
5454
5555 #. f_IniFileFormatter..gb_SortSections..rb_SectionsUnsorted..Caption
5656 #. 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
5858 msgid "Unsorted"
5959 msgstr "Unsorted"
6060
6161 #. f_IniFileFormatter..gb_SortSections..rb_SectionsAlpha..Caption
6262 #. 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
6464 msgid "Alphabetically"
6565 msgstr "Alphabetically"
6666
6767 #. f_IniFileFormatter..gb_SortSections..rb_SectionsByTemplate..Caption
6868 #. 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
7070 msgid "By Template"
7171 msgstr "By Template"
7272
7373 #. f_IniFileFormatter..gb_SortItems..Caption
74-#: w_IniFileFormatter.dfm:168
74+#: w_IniFileFormatter.dfm:161
7575 msgid "Sort Items"
7676 msgstr "Sort Items"
7777
7878 #. f_IniFileFormatter..b_Close..Caption
79-#: w_IniFileFormatter.dfm:207
79+#: w_IniFileFormatter.dfm:200
8080 msgid "Close"
8181 msgstr "Close"
8282
8383 #. f_IniFileFormatter..b_SaveAs..Caption
84-#: w_IniFileFormatter.dfm:217
84+#: w_IniFileFormatter.dfm:210
8585 msgid "Save As ..."
8686 msgstr "Save As ..."
8787
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-
10488 #: u_IniFileFormatterMain.pas:29
10589 msgid "Sort sections. Possible values: no, alpha, template (default: alpha)"
10690 msgstr "Sort sections. Possible values: no, alpha, template (default: alpha)"
@@ -126,3 +110,15 @@
126110 msgid "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\""
127111 msgstr "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\""
128112
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+
--- trunk/translations/fr/default.po (revision 10)
+++ trunk/translations/fr/default.po (revision 11)
@@ -7,7 +7,7 @@
77 msgid ""
88 msgstr ""
99 "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"
1111 "PO-Revision-Date: 2010-10-23 16:47\n"
1212 "Last-Translator: Somebody <your.email@address.com>\n"
1313 "MIME-Version: 1.0\n"
@@ -36,69 +36,53 @@
3636 msgstr ""
3737
3838 #. f_IniFileFormatter..pc_Input..ts_Template..Caption
39-#: w_IniFileFormatter.dfm:80
39+#: w_IniFileFormatter.dfm:83
4040 msgid "Template"
4141 msgstr ""
4242
4343 #. f_IniFileFormatter..pc_Output..ts_Preview..Caption
44-#: w_IniFileFormatter.dfm:108
44+#: w_IniFileFormatter.dfm:106
4545 msgid "Preview"
4646 msgstr ""
4747
4848 #. f_IniFileFormatter..gb_SortSections..Caption
49-#: w_IniFileFormatter.dfm:131
49+#: w_IniFileFormatter.dfm:124
5050 msgid "Sort Sections"
5151 msgstr ""
5252
5353 #. f_IniFileFormatter..gb_SortSections..rb_SectionsUnsorted..Caption
5454 #. 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
5656 msgid "Unsorted"
5757 msgstr ""
5858
5959 #. f_IniFileFormatter..gb_SortSections..rb_SectionsAlpha..Caption
6060 #. 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
6262 msgid "Alphabetically"
6363 msgstr ""
6464
6565 #. f_IniFileFormatter..gb_SortSections..rb_SectionsByTemplate..Caption
6666 #. 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
6868 msgid "By Template"
6969 msgstr ""
7070
7171 #. f_IniFileFormatter..gb_SortItems..Caption
72-#: w_IniFileFormatter.dfm:168
72+#: w_IniFileFormatter.dfm:161
7373 msgid "Sort Items"
7474 msgstr ""
7575
7676 #. f_IniFileFormatter..b_Close..Caption
77-#: w_IniFileFormatter.dfm:207
77+#: w_IniFileFormatter.dfm:200
7878 msgid "Close"
7979 msgstr ""
8080
8181 #. f_IniFileFormatter..b_SaveAs..Caption
82-#: w_IniFileFormatter.dfm:217
82+#: w_IniFileFormatter.dfm:210
8383 msgid "Save As ..."
8484 msgstr ""
8585
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-
10286 #: u_IniFileFormatterMain.pas:29
10387 msgid "Sort sections. Possible values: no, alpha, template (default: alpha)"
10488 msgstr ""
@@ -123,3 +107,15 @@
123107 #, object-pascal-format
124108 msgid "Invalid value \"%s\" for option SortSections, must be one of \"no\", \"alpha\" or \"template\""
125109 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 ""
Show on old repository browser