- Timestamp:
- Nov 14, 2012, 8:53:05 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 43 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 1 Dochazka.lps 2 Dochazka.dbg 3 Dochazka.exe 4 heaptrclog.trc 5 lib
-
- Property svn:ignore
-
trunk/Dochazka.lpi
r4 r5 12 12 </General> 13 13 <i18n> 14 <EnableI18N LFM="False"/> 14 <EnableI18N Value="True"/> 15 <OutDir Value="Languages"/> 15 16 </i18n> 16 17 <VersionInfo> 17 18 <StringTable ProductVersion=""/> 18 19 </VersionInfo> 19 <BuildModes Count="1"> 20 <Item1 Name="Default" Default="True"/> 20 <BuildModes Count="2"> 21 <Item1 Name="Debug" Default="True"/> 22 <Item2 Name="Release"> 23 <CompilerOptions> 24 <Version Value="11"/> 25 <Target> 26 <Filename Value="Dochazka"/> 27 </Target> 28 <SearchPaths> 29 <IncludeFiles Value="$(ProjOutDir)"/> 30 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 31 </SearchPaths> 32 <Parsing> 33 <SyntaxOptions> 34 <SyntaxMode Value="Delphi"/> 35 </SyntaxOptions> 36 </Parsing> 37 <CodeGeneration> 38 <SmartLinkUnit Value="True"/> 39 <Optimizations> 40 <OptimizationLevel Value="3"/> 41 </Optimizations> 42 </CodeGeneration> 43 <Linking> 44 <Debugging> 45 <GenerateDebugInfo Value="False"/> 46 </Debugging> 47 <LinkSmart Value="True"/> 48 <Options> 49 <Win32> 50 <GraphicApplication Value="True"/> 51 </Win32> 52 </Options> 53 </Linking> 54 <Other> 55 <CompilerMessages> 56 <MsgFileName Value=""/> 57 </CompilerMessages> 58 <CompilerPath Value="$(CompPath)"/> 59 </Other> 60 </CompilerOptions> 61 </Item2> 21 62 </BuildModes> 22 63 <PublishOptions> … … 31 72 </local> 32 73 </RunParams> 33 <RequiredPackages Count=" 2">74 <RequiredPackages Count="3"> 34 75 <Item1> 76 <PackageName Value="Common"/> 77 </Item1> 78 <Item2> 35 79 <PackageName Value="CoolWeb"/> 36 80 <DefaultFilename Value="Packages/CoolWeb/CoolWeb.lpk" Prefer="True"/> 37 </Item 1>38 <Item 2>81 </Item2> 82 <Item3> 39 83 <PackageName Value="LCL"/> 40 </Item 2>84 </Item3> 41 85 </RequiredPackages> 42 <Units Count=" 5">86 <Units Count="6"> 43 87 <Unit0> 44 88 <Filename Value="Dochazka.lpr"/> … … 47 91 </Unit0> 48 92 <Unit1> 49 <Filename Value=" UFormMain.pas"/>93 <Filename Value="Forms/UFormMain.pas"/> 50 94 <IsPartOfProject Value="True"/> 51 <ComponentName Value="Form 1"/>95 <ComponentName Value="FormMain"/> 52 96 <HasResources Value="True"/> 53 97 <ResourceBaseClass Value="Form"/> … … 71 115 <IsPartOfProject Value="True"/> 72 116 </Unit4> 117 <Unit5> 118 <Filename Value="Forms/UFormSetting.pas"/> 119 <IsPartOfProject Value="True"/> 120 <ComponentName Value="FormSetting"/> 121 <HasResources Value="True"/> 122 <ResourceBaseClass Value="Form"/> 123 <UnitName Value="UFormSetting"/> 124 </Unit5> 73 125 </Units> 74 126 </ProjectOptions> … … 80 132 <SearchPaths> 81 133 <IncludeFiles Value="$(ProjOutDir)"/> 134 <OtherUnitFiles Value="Forms"/> 82 135 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 83 136 </SearchPaths> … … 87 140 </SyntaxOptions> 88 141 </Parsing> 142 <CodeGeneration> 143 <Checks> 144 <IOChecks Value="True"/> 145 <RangeChecks Value="True"/> 146 <OverflowChecks Value="True"/> 147 <StackChecks Value="True"/> 148 </Checks> 149 </CodeGeneration> 89 150 <Linking> 151 <Debugging> 152 <UseHeaptrc Value="True"/> 153 <UseExternalDbgSyms Value="True"/> 154 </Debugging> 90 155 <Options> 91 156 <Win32> … … 98 163 <MsgFileName Value=""/> 99 164 </CompilerMessages> 165 <CustomOptions Value="-dDEBUG"/> 100 166 <CompilerPath Value="$(CompPath)"/> 101 167 </Other> -
trunk/Dochazka.lpr
r4 r5 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UCore, UAttendance, CoolWeb 10 Forms, UFormMain, UCore, UAttendance, CoolWeb, Common, UFormSetting, SysUtils 11 11 { you can add units after this }; 12 12 13 13 {$R *.res} 14 14 15 {$IFDEF DEBUG} 16 const 17 HeapTraceLog = 'heaptrclog.trc'; 18 {$ENDIF} 19 15 20 begin 21 {$IFDEF DEBUG} 22 // Heap trace 23 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 24 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 25 {$ENDIF} 26 16 27 RequireDerivedFormResource := True; 17 28 Application.Initialize; 18 29 Application.CreateForm(TCore, Core); 19 Application.CreateForm(TForm1, Form1); 30 Application.CreateForm(TFormMain, FormMain); 31 Application.CreateForm(TFormSetting, FormSetting); 20 32 Application.Run; 21 33 end. -
trunk/UAttendance.pas
r3 r5 30 30 end; 31 31 32 TTerminalProtocol = class 33 Name: string; 34 end; 35 32 36 TTerminal = class 33 37 Id: string; … … 35 39 IPAddress: string; 36 40 Port: string; 37 Protocol: TProtocol; 38 end; 39 40 TTerminalProtocol = class 41 Name: string; 41 Protocol: TTerminalProtocol; 42 42 end; 43 43 -
trunk/UCore.lfm
r3 r5 1 1 object Core: TCore 2 OnCreate = DataModuleCreate 2 3 OldCreateOrder = False 3 4 Height = 323 … … 5 6 VerticalOffset = 197 6 7 Width = 324 8 object ApplicationInfo1: TApplicationInfo 9 Identification = 1 10 VersionMajor = 1 11 VersionMinor = 0 12 VersionBugFix = 0 13 VersionSuffix = 'alfa' 14 CompanyName = 'Chronosoft' 15 AuthorsName = 'Chronos' 16 EmailContact = 'robie@centrum.cz' 17 AppName = 'Docházka' 18 ReleaseDate = 41227 19 RegistryKey = '\Software\Chronosoft\Dochazka' 20 RegistryRoot = rrKeyCurrentUser 21 left = 88 22 top = 72 23 end 24 object Database: TSqlDatabase 25 Connected = False 26 Port = 3306 27 Encoding = 'utf8' 28 left = 203 29 top = 71 30 end 7 31 end -
trunk/UCore.pas
r4 r5 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, USqlDatabase;8 Registry, Classes, SysUtils, FileUtil, USqlDatabase, URegistry, UApplicationInfo; 9 9 10 10 type … … 13 13 14 14 TCore = class(TDataModule) 15 ApplicationInfo1: TApplicationInfo; 16 Database: TSqlDatabase; 17 procedure DataModuleCreate(Sender: TObject); 15 18 private 16 19 public 17 Database: TSQLDatabase; 20 procedure Init; 21 procedure Done; 18 22 procedure InitData; 23 procedure Connect; 24 procedure LoadFromRegistry(Context: TRegistryContext); 25 procedure SaveToRegistry(Context: TRegistryContext); 19 26 end; 20 27 … … 28 35 { TCore } 29 36 37 procedure TCore.DataModuleCreate(Sender: TObject); 38 begin 39 end; 40 41 procedure TCore.Init; 42 begin 43 LoadFromRegistry(RegContext(HKEY(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey)); 44 Connect; 45 end; 46 47 procedure TCore.Done; 48 begin 49 SaveToRegistry(RegContext(HKEY(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey)); 50 end; 51 30 52 procedure TCore.InitData; 53 var 54 DbRows: TDbRows; 31 55 begin 32 56 try … … 38 62 end; 39 63 64 procedure TCore.Connect; 65 begin 66 Database.Connect; 67 end; 68 69 procedure TCore.LoadFromRegistry(Context: TRegistryContext); 70 begin 71 with TRegistryEx.Create do 72 try 73 RootKey := Context.RootKey; 74 OpenKey(Context.Key, True); 75 Database.HostName := ReadStringWithDefault('HostName', 'localhost'); 76 Database.Database := ReadStringWithDefault('Schema', 'dochazka'); 77 Database.UserName := ReadStringWithDefault('UserName', 'dochazka'); 78 Database.Password := ReadStringWithDefault('Password', ''); 79 finally 80 Free; 81 end; 82 end; 83 84 procedure TCore.SaveToRegistry(Context: TRegistryContext); 85 begin 86 with TRegistryEx.Create do 87 try 88 RootKey := Context.RootKey; 89 OpenKey(Context.Key, True); 90 WriteString('HostName', Database.HostName); 91 WriteString('Schema', Database.Database); 92 WriteString('UserName', Database.UserName); 93 WriteString('Password', Database.Password); 94 finally 95 Free; 96 end; 97 end; 98 40 99 end. 41 100
Note:
See TracChangeset
for help on using the changeset viewer.