Merge ~lutzs/or/+git/orts-git-test:feature/example into ~twpol/or/+git/orts-git-test:develop

Proposed by Lutz Döllermann
Status: Merged
Merged at revision: c925b328fa705f9d0d1a6baabda114781aaa164f
Proposed branch: ~lutzs/or/+git/orts-git-test:feature/example
Merge into: ~twpol/or/+git/orts-git-test:develop
Diff against target: 84 lines (+9/-14)
2 files modified
Source/Contrib/TimetableEditor/about.pas (+0/-8)
Source/Contrib/TimetableEditor/unit1.pas (+9/-6)
Reviewer Review Type Date Requested Status
James Ross Approve
Review via email: mp+328860@code.launchpad.net

Description of the change

Changed allowed / default fileextensions in timetableeditor

Test of git functionality

To post a comment you must log in.
Revision history for this message
James Ross (twpol) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Source/Contrib/TimetableEditor/about.pas b/Source/Contrib/TimetableEditor/about.pas
2index c6f9d18..edb5386 100644
3--- a/Source/Contrib/TimetableEditor/about.pas
4+++ b/Source/Contrib/TimetableEditor/about.pas
5@@ -17,8 +17,6 @@ type
6 Label2: TLabel;
7 StaticText1: TStaticText;
8 procedure Button1Click(Sender: TObject);
9- procedure StaticText4Click(Sender: TObject);
10-
11 private
12 { private declarations }
13 public
14@@ -43,11 +41,5 @@ begin
15 end;
16
17
18-procedure TForm2.StaticText4Click(Sender: TObject);
19-begin
20-
21-end;
22-
23-
24 end.
25
26diff --git a/Source/Contrib/TimetableEditor/unit1.pas b/Source/Contrib/TimetableEditor/unit1.pas
27index 30001b1..7318c3f 100644
28--- a/Source/Contrib/TimetableEditor/unit1.pas
29+++ b/Source/Contrib/TimetableEditor/unit1.pas
30@@ -517,9 +517,9 @@ begin
31 savedialog1.Title:=DLGsave;
32 savedialog1.InitialDir:=utf8tosys(getroutepath+'Activities\Openrails');
33 //savedialog1.Filter:='Openrails Zeitplan|*.timetable_or';
34- savedialog1.Filter:='Openrails timetable (*.timetable_or)|*.timetable_or';
35+ savedialog1.Filter:='Openrails timetable (*.timetable-or)|*.timetable-or|Openrails timetable (*.timetable_or)|*.timetable_or';
36 if ttfilename <> '' then savedialog1.filename:=ttfilename
37- else savedialog1.filename:=title+'.timetable_or';
38+ else savedialog1.filename:=title+'.timetable-or';
39 save:=true;
40 but:=1;
41 if (savedialog1.Execute) and (savedialog1.FileName<>'') then begin
42@@ -536,7 +536,7 @@ begin
43 for r:=0 to rows do begin
44 line:='';
45 for c:=0 to cols do begin
46- line:=line+grid.cells[c,r]+';';
47+ line:=line+grid.cells[c,r]+chr(9);
48 end;
49 line:=copy(line,1,length(line)-1);
50 lines.add(line);
51@@ -593,13 +593,15 @@ procedure TForm1.SpeedButton2Click(Sender: TObject); // öffnen
52 var slist: tstringlist;
53 z,s,mcols: integer;
54 cols: tstringlist;
55+ tab: boolean;
56 begin
57 slist:=tstringlist.create;
58 cols:=tstringlist.create;
59+ tab:=false;
60 //opendialog1.Title:='Zeitplan öffnen';
61 opendialog1.Title:=DLGopenTT;
62 //opendialog1.Filter:='Openrails Zeitplan|*.timetable_or';
63- opendialog1.Filter:='Openrails timetable (*.timetable_or)|*.timetable_or';
64+ opendialog1.Filter:='Openrails timetable (*.timetable-or;*.timetable_or)|*.timetable-or;*.timetable_or';
65 opendialog1.filename:='';
66 if (opendialog1.execute) and (opendialog1.FileName<>'') then begin
67 resetgrid;
68@@ -610,13 +612,14 @@ begin
69 fces.reset;
70 fces.loadfromfile(utf8tosys(opendialog1.filename));
71 slist.text:=fces.utf8text;
72- split(';',slist[0],cols);
73+ if pos(chr(9),slist.text) > 0 then tab:=true;
74+ if tab then split(chr(9),slist[0],cols) else split(';',slist[0],cols);
75 mcols:=0;
76 mcols:=cols.count;
77 if mcols +1 > grid.colcount then grid.colcount:=mcols+1;
78 if slist.count +1 > grid.rowcount then grid.rowcount:=slist.count+1;
79 for z:=0 to slist.count -1 do begin
80- split(';',slist[z],cols);
81+ if tab then split(chr(9),slist[z],cols) else split(';',slist[z],cols);
82 for s:= 0 to cols.count -1 do begin
83 grid.cells[s,z]:=cols[s];
84 end;

Subscribers

People subscribed via source and target branches

to all changes: