-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprefsunit.pas
More file actions
787 lines (683 loc) · 19.6 KB
/
prefsunit.pas
File metadata and controls
787 lines (683 loc) · 19.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
unit prefsunit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, inifiles, Math, muihelper, mui,
MUIClass.Window, MUIClass.Group, MUIClass.Gadget,
MUIClass.Area, MUIClass.Dialog, MUIClass.Image, AmiTubelocale;
type
{ TPrefsWindow }
TPrefsWindow = class(TMUIWindow)
private
FOnFancyListChange: TNotifyEvent;
Ini: TIniFile;
NumEdit: TMUIString;
MaxLenEdit: TMUIString;
MPEGPlayerEdit, PlayerEdit, URLPlayerEdit, WGetEdit: TMUIString;
MPEGParamEdit, ParamEdit, URLParamEdit, WGetParamEdit: TMUIString;
ChooseFormat: TMUICycle;
ChooseAllFormats: TMUICheckmark;
ChooseAskDest: TMUICheckmark;
FOnFormatChanged: TNotifyEvent;
ChooseAutoStart: TMUICheckmark;
ChooseAutoIcon: TMUICheckmark;
ChooseFancyList: TMUICheckmark;
ChooseBootup: TMUICycle;
ChooseClip: TMUICheckmark;
FOnClipChanged: TNotifyEvent;
Reg: TMUIRegister;
procedure ChoosePlayerClick(Sender: TObject);
procedure ChooseMPEGPlayerClick(Sender: TObject);
procedure ChooseURLPlayerClick(Sender: TObject);
procedure ChooseWGetClick(Sender: TObject);
function GetFancyList: Boolean;
function GetSplitterPos: Integer;
procedure NumEditACK(Sender: TObject);
procedure MaxLenACK(Sender: TObject);
procedure FormatChanged(Sender: TObject);
procedure SetSplitterPos(AValue: Integer);
procedure StartupChanged(Sender: TObject);
procedure AutoChange(Sender: TObject);
procedure ClipChange(Sender: TObject);
procedure CloseWindow(Sender: TObject; var CloseAction: TCloseAction);
procedure AutoIconChange(Sender: TObject);
procedure FancyListChange(Sender: TObject);
procedure AllFormatChange(Sender: TObject);
procedure AskDestChange(Sender: TObject);
function GetPlayerPath: string;
function GetMPEGPlayerPath: string;
function GetURLPlayerPath: string;
function GetWGetPath: string;
function GetPlayerParam: string;
function GetMPEGPlayerParam: string;
function GetURLPlayerParam: string;
function GetWGetParam: string;
function GetNumSearch: Integer;
function GetFormat: Integer;
function GetAutoStart: Boolean;
function GetAutoIcon: Boolean;
function GetAskDest: Boolean;
function GetStartup: Integer;
function GetClip: Boolean;
function GetAllFormats: Boolean;
function GetMaxTitleLen: Integer;
public
constructor Create; override;
destructor Destroy; override;
procedure UpdateSettings;
procedure SaveSettings;
property PlayerPath: string read GetPlayerPath;
property MPEGPlayerPath: string read GetMPEGPlayerPath;
property URLPlayerPath: string read GetURLPlayerPath;
property WGetPath: string read GetWGetPath;
property PlayerParam: string read GetPlayerParam;
property MPEGPlayerParam: string read GetMPEGPlayerParam;
property URLPlayerParam: string read GetURLPlayerParam;
property WGetParam: string read GetWGetParam;
property NumSearch: Integer read GetNumSearch;
property Format: integer read GetFormat;
property AutoStart: Boolean read GetAutoStart;
property AutoIcon: Boolean read GetAutoIcon;
property AskDest: Boolean read GetAskDest;
property Startup: Integer read GetStartup;
property ObserveClip: Boolean read GetClip;
property AllFormats: Boolean read GetAllFormats;
property MaxTitleLen: Integer read GetMaxTitleLen;
property FancyList: Boolean read GetFancyList;
//
property SplitterPos: Integer read GetSplitterPos write SetSplitterPos;
//
property OnFormatChanged: TNotifyEvent read FOnFormatChanged write FOnFormatChanged;
property OnClipChanged: TNotifyEvent read FOnClipChanged write FOnClipChanged;
property OnFancyListChange: TNotifyEvent read FOnFancyListChange write FOnFancyListChange;
end;
var
Prefs: TPrefsWindow;
implementation
{ TPrefsWindow }
procedure TPrefsWindow.UpdateSettings;
begin
ChooseFormat.Active := Ini.ReadInteger('General', 'Format', 0);
end;
{ some values are not updated automatically on change, so we change them on exit }
procedure TPrefsWindow.SaveSettings;
begin
Ini.WriteString('Player', 'Path', PlayerEdit.Contents);
Ini.WriteString('Player', 'Parameter', PlayerParam);
Ini.WriteString('Player', 'MPEGPath', MPEGPlayerEdit.Contents);
Ini.WriteString('Player', 'MPEGParameter', MPEGPlayerParam);
Ini.WriteString('Player', 'URLPlayerPath', URLPlayerEdit.Contents);
Ini.WriteString('Player', 'URLParameter', URLPlayerParam);
Ini.WriteString('Player', 'WGetPath', WGetEdit.Contents);
Ini.WriteString('Player', 'WGetParameter', WGetParam);
end;
{ Choose player for CDXL }
procedure TPrefsWindow.ChoosePlayerClick(Sender: TObject);
var
Player: string;
begin
Player := PlayerEdit.Contents;
with TFileDialog.Create do
begin
SaveMode := False;
Directory := ExtractFilePath(Player);
Filename := ExtractFilename(Player);
if Execute then
begin
Player := Filename;
if FileExists(Player) then
begin
PlayerEdit.Contents := Player;
Ini.WriteString('Player', 'Path', PlayerEdit.Contents);
end
else
ShowMessage(StringReplace(GetLocString(MSG_ERROR_PLAYER), '%s', Player, [rfReplaceAll]), GetLocString(MSG_ERROR_ERROR), GetLocString(MSG_GUI_OK));
end;
Free;
end;
end;
procedure TPrefsWindow.ChooseMPEGPlayerClick(Sender: TObject);
var
Player: string;
begin
Player := MPEGPlayerEdit.Contents;
with TFileDialog.Create do
begin
SaveMode := False;
Directory := ExtractFilePath(Player);
Filename := ExtractFilename(Player);
if Execute then
begin
Player := Filename;
if FileExists(Player) then
begin
MPEGPlayerEdit.Contents := Player;
Ini.WriteString('Player', 'MPEGPath', MPEGPlayerEdit.Contents);
end
else
ShowMessage(StringReplace(GetLocString(MSG_ERROR_PLAYER), '%s', Player, [rfReplaceAll]), GetLocString(MSG_ERROR_ERROR), GetLocString(MSG_GUI_OK));
end;
Free;
end;
end;
procedure TPrefsWindow.ChooseURLPlayerClick(Sender: TObject);
var
Player: string;
begin
Player := URLPlayerEdit.Contents;
with TFileDialog.Create do
begin
SaveMode := False;
Directory := ExtractFilePath(Player);
Filename := ExtractFilename(Player);
if Execute then
begin
Player := Filename;
if FileExists(Player) then
begin
URLPlayerEdit.Contents := Player;
Ini.WriteString('Player', 'URLPlayerPath', URLPlayerEdit.Contents);
end
else
ShowMessage(StringReplace(GetLocString(MSG_ERROR_PLAYER), '%s', Player, [rfReplaceAll]), GetLocString(MSG_ERROR_ERROR), GetLocString(MSG_GUI_OK));
end;
Free;
end;
end;
procedure TPrefsWindow.ChooseWGetClick(Sender: TObject);
var
Player: string;
begin
Player := WGetEdit.Contents;
with TFileDialog.Create do
begin
SaveMode := False;
Directory := ExtractFilePath(Player);
Filename := ExtractFilename(Player);
if Execute then
begin
Player := Filename;
if FileExists(Player) then
begin
URLPlayerEdit.Contents := Player;
Ini.WriteString('Player', 'WGetPath', WGetEdit.Contents);
end
else
ShowMessage(StringReplace(GetLocString(MSG_ERROR_PLAYER), '%s', Player, [rfReplaceAll]), GetLocString(MSG_ERROR_ERROR), GetLocString(MSG_GUI_OK));
end;
Free;
end;
end;
function TPrefsWindow.GetFancyList: Boolean;
begin
Result := ChooseFancyList.Selected;
end;
function TPrefsWindow.GetSplitterPos: Integer;
begin
Result := Ini.ReadInteger('General', 'Splitter', 100);
end;
function TPrefsWindow.GetPlayerPath: string;
begin
Result := PlayerEdit.Contents;
end;
function TPrefsWindow.GetMPEGPlayerPath: string;
begin
Result := MPEGPlayerEdit.Contents;
end;
function TPrefsWindow.GetURLPlayerPath: string;
begin
Result := URLPlayerEdit.Contents;
end;
function TPrefsWindow.GetWGetPath: string;
begin
Result := WGetEdit.Contents;
end;
function TPrefsWindow.GetPlayerParam: string;
begin
Result := ParamEdit.Contents;
if Pos('%f', Result) = 0 then
Result := Result + ' %f';
end;
function TPrefsWindow.GetMPEGPlayerParam: string;
begin
Result := MPEGParamEdit.Contents;
if Pos('%f', Result) = 0 then
Result := Result + ' %f';
end;
function TPrefsWindow.GetURLPlayerParam: string;
begin
Result := URLParamEdit.Contents;
if Pos('%u', Result) = 0 then
Result := Result + ' %u';
end;
function TPrefsWindow.GetWGetParam: string;
begin
Result := WGetParamEdit.Contents;
if Pos('%u', Result) = 0 then
Result := Result + ' %u';
end;
function TPrefsWindow.GetNumSearch: Integer;
begin
Result := EnsureRange(NumEdit.IntegerValue, 1, 100);
end;
function TPrefsWindow.GetMaxTitleLen: Integer;
begin
Result := EnsureRange(MaxLenEdit.IntegerValue, 1, 999);
end;
function TPrefsWindow.GetFormat: Integer;
begin
Result := ChooseFormat.Active;
if Result < 0 then
Result := 0;
end;
function TPrefsWindow.GetStartup: Integer;
begin
Result := ChooseBootup.Active;
if Result < 0 then
Result := 0;
end;
function TPrefsWindow.GetAutoStart: Boolean;
begin
Result := ChooseAutoStart.Selected;
end;
function TPrefsWindow.GetAutoIcon: Boolean;
begin
Result := ChooseAutoIcon.Selected;
end;
function TPrefsWindow.GetAskDest: Boolean;
begin
Result := ChooseAskDest.Selected;
end;
function TPrefsWindow.GetClip: Boolean;
begin
Result := ChooseClip.Selected;
end;
function TPrefsWindow.GetAllFormats: Boolean;
begin
Result := ChooseAllFormats.Selected;
end;
procedure TPrefsWindow.NumEditACK(Sender: TObject);
begin
//
NumEdit.IntegerValue := EnsureRange(NumEdit.IntegerValue, 1, 100);
Ini.WriteInteger('Search', 'MaxNum', NumEdit.IntegerValue);
end;
procedure TPrefsWindow.MaxLenACK(Sender: TObject);
begin
//
MaxLenEdit.IntegerValue := EnsureRange(MaxLenEdit.IntegerValue, 1, 999);
Ini.WriteInteger('Search', 'MaxLen', MaxLenEdit.IntegerValue);
end;
procedure TPrefsWindow.FormatChanged(Sender: TObject);
begin
Ini.WriteInteger('General', 'Format', ChooseFormat.Active);
if Assigned(FOnFormatChanged) then
FOnFormatChanged(Self)
end;
procedure TPrefsWindow.SetSplitterPos(AValue: Integer);
begin
Ini.WriteInteger('General', 'Splitter', AValue);
end;
procedure TPrefsWindow.StartupChanged(Sender: TObject);
begin
Ini.WriteInteger('General', 'Startup', ChooseBootup.Active);
end;
procedure TPrefsWindow.AutoChange(Sender: TObject);
begin
Ini.WriteBool('Player', 'AutoStart', ChooseAutoStart.Selected);
end;
procedure TPrefsWindow.ClipChange(Sender: TObject);
begin
Ini.WriteBool('Search', 'Clipboard', ChooseClip.Selected);
if Assigned(FOnClipChanged) then
FOnClipChanged(Self);
end;
procedure TPrefsWindow.AllFormatChange(Sender: TObject);
begin
Ini.WriteBool('General', 'AllFormats', ChooseAllFormats.Selected);
end;
procedure TPrefsWindow.AskDestChange(Sender: TObject);
begin
Ini.WriteBool('General', 'AskDestination', ChooseAskDest.Selected);
end;
procedure TPrefsWindow.AutoIconChange(Sender: TObject);
begin
Ini.WriteBool('Search', 'AutoIcon', ChooseAutoIcon.Selected);
if Assigned(FOnFancyListChange) then
FOnFancyListChange(Self);
end;
procedure TPrefsWindow.FancyListChange(Sender: TObject);
begin
Ini.WriteBool('Search', 'FancyList', ChooseFancyList.Selected);
if Assigned(FOnFancyListChange) then
FOnFancyListChange(Self);
end;
procedure TPrefsWindow.CloseWindow(Sender: TObject; var CloseAction: TCloseAction);
begin
SaveSettings;
end;
constructor TPrefsWindow.Create;
var
Grp1, Grp2: TMUIGroup;
begin
inherited Create;
HelpNode := 'PrefsWindow';
Title := GetLocString(MSG_PREFS_WINDOW);
OnCloseRequest := @CloseWindow;
Ini := TIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
ID := MAKE_ID('A','T','P', 'r');
Horizontal := False;
// ### Startup group
Grp1 := TMUIGroup.Create;
with Grp1 do
begin
FrameTitle := GetLocString(MSG_PREFS_STARTUP);
Horiz := True;
Parent := Self;
end;
// -- Choose bootup
ChooseBootup := TMUICycle.Create;
with ChooseBootup do
begin
Entries := [GetLocString(MSG_PREFS_STARTUP1), GetLocString(MSG_PREFS_STARTUP2), GetLocString(MSG_PREFS_STARTUP3)];
Active := Ini.ReadInteger('General', 'Startup', 0);
OnActiveChange := @StartupChanged;
Parent := Grp1;
end;
// ### Format group
Grp1 := TMUIGroup.Create;
with Grp1 do
begin
FrameTitle := GetLocString(MSG_PREFS_FORMAT);
Columns := 2;
Parent := Self;
end;
with TMUIText.Create(''{GetLocString(MSG_PREFS_SEARCHNUM)}) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
// -- choose format
ChooseFormat := TMUICycle.Create;
with ChooseFormat do
begin
Entries := [GetLocString(MSG_PREFS_FORMAT1), GetLocString(MSG_PREFS_FORMAT2), GetLocString(MSG_PREFS_FORMAT3), GetLocString(MSG_PREFS_FORMAT4)];
Active := Ini.ReadInteger('General', 'Format', 0);
OnActiveChange := @FormatChanged;
Parent := Grp1;
end;
// -- All formats
with TMUIText.Create(GetLocString(MSG_PREFS_ALLFORMATS)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
ChooseAllFormats := TMUICheckmark.Create;
with ChooseAllFormats do
begin
Selected := Ini.ReadBool('General', 'AllFormats', False);
OnSelected := @AllFormatChange;
Parent := Grp1;
end;
// -- Ask for Destination
with TMUIText.Create(GetLocString(MSG_PREFS_ASKDESTINATION){'Ask for destination path'}) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
ChooseAskDest := TMUICheckmark.Create;
with ChooseAskDest do
begin
Selected := Ini.ReadBool('General', 'AskDestination', False);
OnSelected := @AskDestChange;
Parent := Grp1;
end;
// ### Search group
Grp1 := TMUIGroup.Create;
with Grp1 do
begin
FrameTitle := GetLocString(MSG_PREFS_SEARCH);
Columns := 2;
Parent := Self;
end;
// -- Number of search results
with TMUIText.Create(GetLocString(MSG_PREFS_SEARCHNUM)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
NumEdit := TMUIString.Create;
with NumEdit do
begin
Accept := '0123456789';
MaxLen := 3;
IntegerValue := Ini.ReadInteger('Search', 'MaxNum', 10);
OnAcknowledge := @NumEditACK;
Parent := Grp1;
end;
// -- max title length
with TMUIText.Create(GetLocString(MSG_PREFS_MAXTITLELEN)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
MaxLenEdit := TMUIString.Create;
with MaxLenEdit do
begin
Accept := '0123456789';
MaxLen := 3;
IntegerValue := Ini.ReadInteger('Search', 'MaxLen', 30);
OnAcknowledge := @MaxLenACK;
Parent := Grp1;
end;
// -- observe Clipboard
with TMUIText.Create(GetLocString(MSG_PREFS_CLIP)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
ChooseClip := TMUICheckmark.Create;
with ChooseClip do
begin
Selected := Ini.ReadBool('Search', 'Clipboard', False);
OnSelected := @ClipChange;
Parent := Grp1;
end;
// -- Auto load Icon
with TMUIText.Create(GetLocString(MSG_PREFS_AUTOICON)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
ChooseAutoIcon := TMUICheckmark.Create;
with ChooseAutoIcon do
begin
Selected := Ini.ReadBool('Search', 'AutoIcon', False);
OnSelected := @AutoIconChange;
Parent := Grp1;
end;
// -- Fancy List
with TMUIText.Create(GetLocString(MSG_PREFS_FANCYLIST)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp1;
end;
ChooseFancyList := TMUICheckmark.Create;
with ChooseFancyList do
begin
Selected := Ini.ReadBool('Search', 'FancyList', False);
OnSelected := @FancyListChange;
Parent := Grp1;
end;
// ### Player group
Grp1 := TMUIGroup.Create;
with Grp1 do
begin
FrameTitle := GetLocString(MSG_PREFS_PLAYER);
Parent := Self;
end;
Grp2 := TMUIGroup.Create;
with Grp2 do
begin
Frame := MUIV_FRAME_NONE;
Horiz := True;
Parent := Grp1;
end;
// -- Auto Start
with TMUIText.Create(GetLocString(MSG_PREFS_AUTOSTART)) do
begin
Frame := MUIV_FRAME_NONE;
Parent := Grp2;
end;
ChooseAutoStart := TMUICheckmark.Create;
with ChooseAutoStart do
begin
Selected := Ini.ReadBool('Player', 'AutoStart', False);
OnSelected := @AutoChange;
Parent := Grp2;
end;
Reg := TMUIRegister.Create;
with Reg do
begin
Titles := ['CDXL', 'MPEG', 'Play URL', 'Download URL'];
Parent := Grp1;
end;
// ++ CDXL Player
Grp2 := TMUIGroup.Create;
with Grp2 do
begin
Columns := 2;
Parent := Reg;
end;
PlayerEdit := TMUIString.Create;
with PlayerEdit do
begin
Contents := Ini.ReadString('Player', 'Path', 'Sys:Utilities/MultiView');
Parent := Grp2;
end;
with TMUIButton.Create do
begin
HorizWeight := 20;
Contents := GetLocString(MSG_PREFS_CHOOSEPLAYER);
FixWidthTxt := ' '+GetLocString(MSG_PREFS_CHOOSEPLAYER)+' ';
OnClick := @ChoosePlayerClick;
Parent := Grp2;
end;
ParamEdit := TMUIString.Create;
with ParamEdit do
begin
Contents := Ini.ReadString('Player', 'Parameter', '%f');
Parent := Grp2;
end;
with TMUIText.Create(GetLocString(MSG_PREFS_PLAYERPARAM)) do
begin
FixWidthTxt := ' '+GetLocString(MSG_PREFS_PLAYERPARAM)+' ';
Frame := MUIV_FRAME_NONE;
Parent := Grp2;
end;
//++ MPEG Player
Grp2 := TMUIGroup.Create;
with Grp2 do
begin
Columns := 2;
Parent := Reg;
end;
MPEGPlayerEdit := TMUIString.Create;
with MPEGPlayerEdit do
begin
Contents := Ini.ReadString('Player', 'MPEGPath', 'Sys:Utilities/MultiView');
Parent := Grp2;
end;
with TMUIButton.Create do
begin
HorizWeight := 20;
Contents := GetLocString(MSG_PREFS_CHOOSEPLAYER);
FixWidthTxt := ' '+GetLocString(MSG_PREFS_CHOOSEPLAYER)+' ';
OnClick := @ChooseMPEGPlayerClick;
Parent := Grp2;
end;
MPEGParamEdit := TMUIString.Create;
with MPEGParamEdit do
begin
Contents := Ini.ReadString('Player', 'MPEGParameter', '%f');
Parent := Grp2;
end;
with TMUIText.Create(GetLocString(MSG_PREFS_PLAYERPARAM)) do
begin
FixWidthTxt := ' ' + GetLocString(MSG_PREFS_PLAYERPARAM) + ' ';
Frame := MUIV_FRAME_NONE;
Parent := Grp2;
end;
//++ URL Player
Grp2 := TMUIGroup.Create;
with Grp2 do
begin
Columns := 2;
Parent := Reg;
end;
URLPlayerEdit := TMUIString.Create;
with URLPlayerEdit do
begin
Contents := Ini.ReadString('Player', 'URLPlayerPath', 'MPlayer:MPlayer');
Parent := Grp2;
end;
with TMUIButton.Create do
begin
HorizWeight := 20;
Contents := GetLocString(MSG_PREFS_CHOOSEPLAYER);
FixWidthTxt := ' '+GetLocString(MSG_PREFS_CHOOSEPLAYER)+' ';
OnClick := @ChooseURLPlayerClick;
Parent := Grp2;
end;
URLParamEdit := TMUIString.Create;
with URLParamEdit do
begin
Contents := Ini.ReadString('Player', 'URLParameter', '%u');
Parent := Grp2;
end;
with TMUIText.Create(GetLocString(MSG_PREFS_PLAYERPARAM)) do
begin
FixWidthTxt := ' ' + GetLocString(MSG_PREFS_PLAYERPARAM) + ' ';
Frame := MUIV_FRAME_NONE;
Parent := Grp2;
end;
//++ WGet Player
Grp2 := TMUIGroup.Create;
with Grp2 do
begin
Columns := 2;
Parent := Reg;
end;
WGetEdit := TMUIString.Create;
with WGetEdit do
begin
Contents := Ini.ReadString('Player', 'WGetPath', {$ifdef MorphOS}'gg:bin/wget'{$else}'C:wget'{$endif});
Parent := Grp2;
end;
with TMUIButton.Create do
begin
HorizWeight := 20;
Contents := GetLocString(MSG_PREFS_CHOOSEPLAYER);
FixWidthTxt := ' '+GetLocString(MSG_PREFS_CHOOSEPLAYER)+' ';
OnClick := @ChooseWGetClick;
Parent := Grp2;
end;
WGetParamEdit := TMUIString.Create;
with WGetParamEdit do
begin
Contents := Ini.ReadString('Player', 'WGetParameter', '%u -O %f');
Parent := Grp2;
end;
with TMUIText.Create(GetLocString(MSG_PREFS_PLAYERPARAM)) do
begin
FixWidthTxt := ' ' + GetLocString(MSG_PREFS_PLAYERPARAM) + ' ';
Frame := MUIV_FRAME_NONE;
Parent := Grp2;
end;
end;
destructor TPrefsWindow.Destroy;
begin
Ini.Free;
inherited Destroy;
end;
end.