Changeset 7 for trunk


Ignore:
Timestamp:
Dec 25, 2010, 9:53:55 PM (14 years ago)
Author:
george
Message:
  • Updated: USqlDatabase library.
  • Added: Dependency to TemplateGenerics package.
  • Modified: Rest of czech strings translated to english.
Location:
trunk
Files:
6 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/USqlDatabase.pas

    r2 r7  
    22
    33{$mode Delphi}{$H+}
    4 // Upraveno: 30.5.2010
     4
     5// Modified: 2010-12-24
    56
    67interface
    78
    89uses
    9   SysUtils, Classes, Dialogs, mysql50, TypInfo;
     10  SysUtils, Classes, Dialogs, mysql50, TypInfo,
     11  SpecializedDictionary, SpecializedList;
    1012
    1113type
    12   EQueryError = Exception;
     14  EQueryError = class(Exception);
    1315
    1416  TClientCapabilities = (_CLIENT_LONG_PASSWORD, _CLIENT_FOUND_ROWS,
     
    1921  TSetClientCapabilities = set of TClientCapabilities;
    2022
    21   TAssociativeArray = class(TStringList)
     23  TDbRows = class(TListObject)
    2224  private
    23     function GetValues(Index: string): string;
    24     function GetValuesAtIndex(Index: Integer): string;
    25     procedure SetValues(Index: string; const Value: string);
     25    function GetData(Index: Integer): TDictionaryStringString;
     26    procedure SetData(Index: Integer; const Value: TDictionaryStringString);
    2627  public
    27     constructor Create;
    28     destructor Destroy; override;
    29     function GetAllValues: string;
    30     procedure AddKeyValue(Key, Value: string);
    31     property ValuesAtIndex[Index: Integer]: string read GetValuesAtIndex;
    32     property Values[Index: string]: string read GetValues write SetValues; default;
    33   end;
    34 
    35   TDbRows = class(TList)
    36   private
    37     function GetData(Index: Integer): TAssociativeArray;
    38     procedure SetData(Index: Integer; const Value: TAssociativeArray);
    39   public
    40     property Data[Index: Integer]: TAssociativeArray read GetData write SetData; default;
     28    property Data[Index: Integer]: TDictionaryStringString read GetData write SetData; default;
    4129    destructor Destroy; override;
    4230  end;
     
    5139    function GetLastErrorMessage: string;
    5240    function GetLastErrorNumber: Integer;
    53     function CheckError: Boolean;
    5441    function GetCharset: string;
    55     procedure SetSchema(const Value: string);
     42    procedure SetDatabase(const Value: string);
    5643  public
    5744    Hostname: string;
     
    6552    procedure CreateTable(Name: string);
    6653    procedure CreateColumn(Table, ColumnName: string; ColumnType: TTypeKind);
    67     function Query(Data: string): TDbRows;
    68     function Select(ATable: string; Filter: string = '*'; Condition: string = '1'): TDbRows;
     54    procedure Query(DbRows: TDbRows; Data: string);
     55    procedure Select(DbRows: TDbRows; ATable: string; Filter: string = '*'; Condition: string = '1');
    6956    procedure Delete(ATable: string; Condition: string = '1');
    70     procedure Insert(ATable: string; Data: TAssociativeArray);
    71     procedure Update(ATable: string; Data: TAssociativeArray; Condition: string = '1');
    72     procedure Replace(ATable: string; Data: TAssociativeArray);
     57    procedure Insert(ATable: string; Data: TDictionaryStringString);
     58    procedure Update(ATable: string; Data: TDictionaryStringString; Condition: string = '1');
     59    procedure Replace(ATable: string; Data: TDictionaryStringString);
    7360    procedure Connect;
    7461    procedure Disconnect;
     
    8067    destructor Destroy; override;
    8168    property Charset: string read GetCharset;
    82     property Schema: string read FDatabase write SetSchema;
     69    property Database: string read FDatabase write SetDatabase;
    8370  end;
    8471
    8572  function MySQLFloatToStr(F: Real): string;
    8673  function MySQLStrToFloat(S: string): Real;
     74  function SQLToDateTime(Value: string): TDateTime;
     75  function DateTimeToSQL(Value: TDateTime): string;
    8776
    8877implementation
    8978
    90 uses DateUtils;
     79uses
     80  DateUtils, Math;
     81
     82resourcestring
     83  SDatabaseQueryError = 'Database query error: "%s"';
    9184
    9285const
     
    10598  CLIENT_TRANSACTIONS = 8192;    // Client knows about transactions
    10699
    107 { TDataModule2 }
    108 
    109100function MySQLFloatToStr(F: Real): string;
    110101var
     
    112103begin
    113104  S := FloatToStr(F);
    114   if Pos(',', S) > 0 then S[Pos(',',S)] := '.';
     105  if Pos(',', S) > 0 then S[Pos(',', S)] := '.';
    115106  Result := S;
    116107end;
     
    118109function MySQLStrToFloat(S: string): Real;
    119110begin
    120   if Pos('.', S) > 0 then  S[Pos('.',S)] := ',';
     111  if Pos('.', S) > 0 then S[Pos('.', S)] := ',';
    121112  Result := StrToFloat(S);
    122113end;
     114
     115function StrToStr(Value: string): string;
     116begin
     117  Result := Value;
     118end;
     119
     120function SQLToDateTime(Value: string): TDateTime;
     121var
     122  Parts: TListString;
     123  DateParts: TListString;
     124  TimeParts: TListString;
     125begin
     126  try
     127    Parts := TListString.Create;
     128    DateParts := TListString.Create;
     129    TimeParts := TListString.Create;
     130
     131    Parts.Explode(Value, ' ', StrToStr);
     132    DateParts.Explode(Parts[0], '-', StrToStr);
     133    Result := EncodeDate(StrToInt(DateParts[0]), StrToInt(DateParts[1]),
     134      StrToInt(DateParts[2]));
     135    if Parts.Count > 1 then begin
     136      TimeParts.Explode(Parts[1], ':', StrToStr);
     137      Result := Result + EncodeTime(StrToInt(TimeParts[0]), StrToInt(TimeParts[1]),
     138        StrToInt(TimeParts[2]), 0);
     139    end;
     140  finally
     141    DateParts.Free;
     142    TimeParts.Free;
     143    Parts.Free;
     144  end;
     145end;
     146
     147function DateTimeToSQL(Value: TDateTime): string;
     148begin
     149  Result := FormatDateTime('yyyy-mm-dd hh.nn.ss', Value);
     150end;
     151
     152{ TSqlDatabase }
    123153
    124154procedure TSqlDatabase.Connect;
     
    132162//  FSession.charset := 'latin2';
    133163  NewSession := mysql_real_connect(FSession, PChar(HostName), PChar(UserName),
    134     PChar(Password), PChar(Schema), 3306, nil, CLIENT_LONG_PASSWORD + CLIENT_CONNECT_WITH_DB);
     164    PChar(Password), PChar(Database), 3306, nil, CLIENT_LONG_PASSWORD + CLIENT_CONNECT_WITH_DB);
    135165  if Assigned(NewSession) then begin
    136166    FConnected := True;
    137167    FSession := NewSession;
    138168  end else FConnected := False;
    139   CheckError;
    140   Rows := Query('SET NAMES ' + Encoding);
    141   Rows.Free;
    142 end;
    143 
    144 procedure TSqlDatabase.Insert(ATable: string; Data: TAssociativeArray);
     169
     170  if LastErrorNumber <> 0 then
     171    raise EQueryError.Create(Format(SDatabaseQueryError, [LastErrorMessage]));
     172
     173  try
     174    Rows := TDbRows.Create;
     175    Query(Rows, 'SET NAMES ' + Encoding);
     176  finally
     177    Rows.Free;
     178  end;
     179end;
     180
     181procedure TSqlDatabase.Insert(ATable: string; Data: TDictionaryStringString);
    145182var
    146183  DbNames: string;
     
    154191  DbValues := '';
    155192  for I := 0 to Data.Count - 1 do begin
    156     Value := Data.ValuesAtIndex[I];
     193    Value := Data.Items[I].Value;
    157194    StringReplace(Value, '"', '\"', [rfReplaceAll]);
    158195    if Value = 'NOW()' then DbValues := DbValues + ',' + Value
    159196    else DbValues := DbValues + ',"' + Value + '"';
    160     DbNames := DbNames + ',`' + Data.Names[I] + '`';
     197    DbNames := DbNames + ',`' + Data.Keys[I] + '`';
    161198  end;
    162199  System.Delete(DbNames, 1, 1);
    163200  System.Delete(DbValues, 1, 1);
    164   DbResult := Query('INSERT INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')');
    165   DbResult.Free;
    166 end;
    167 
    168 function TSqlDatabase.Query(Data: string): TDbRows;
     201  try
     202    DbResult := TDbRows.Create;
     203    Query(DbResult, 'INSERT INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')');
     204  finally
     205    DbResult.Free;
     206  end;
     207end;
     208
     209procedure TSqlDatabase.Query(DbRows: TDbRows; Data: string);
    169210var
    170211  I, II: Integer;
     
    172213  DbRow: MYSQL_ROW;
    173214begin
     215  DbRows.Clear;
    174216  //DebugLog('SqlDatabase query: '+Data);
    175217  RepeatLastAction := False;
    176218  LastQuery := Data;
    177   //if not Connected then NastaveniPripojeni.ShowModal;
    178   Result := TDbRows.Create;
    179   //repeat
    180219  mysql_query(FSession, PChar(Data));
    181   //until not
    182   CheckError;
    183   //if not CheckError then
    184   begin
    185     DbResult := mysql_store_result(FSession);
    186     if Assigned(DbResult) then begin
    187       Result.Count := mysql_num_rows(DbResult);
    188       for I := 0 to Result.Count - 1 do begin
    189         DbRow := mysql_fetch_row(DbResult);
    190         Result[I] := TAssociativeArray.Create;
    191         with Result[I] do begin
    192           for II := 0 to mysql_num_fields(DbResult) - 1 do begin
    193             Add(mysql_fetch_field_direct(DbResult, II)^.Name +
    194               NameValueSeparator + PChar((DbRow + II)^));
     220  if LastErrorNumber <> 0 then begin
     221    raise EQueryError.Create(Format(SDatabaseQueryError, [LastErrorMessage]));
     222  end;
     223
     224  DbResult := mysql_store_result(FSession);
     225  if Assigned(DbResult) then begin
     226    DbRows.Count := mysql_num_rows(DbResult);
     227    for I := 0 to DbRows.Count - 1 do begin
     228      DbRow := mysql_fetch_row(DbResult);
     229      DbRows[I] := TDictionaryStringString.Create;
     230      with DbRows[I] do begin
     231        for II := 0 to mysql_num_fields(DbResult) - 1 do begin
     232          Add(mysql_fetch_field_direct(DbResult, II)^.Name,
     233            PChar((DbRow + II)^));
    195234          end;
    196235        end;
    197236      end;
    198     end;
    199237  end;
    200238  mysql_free_result(DbResult);
    201   (*
    202   if Assigned(DatabaseIntegrity) then
    203   with DatabaseIntegrity do if not Checking then begin
    204     Check;
    205     DebugLog('Database integrity: Unreferenced='+IntToStr(Unreferenced)+' BadReferences='+IntToStr(BadReferences));
    206   end;
    207   *)
    208 end;
    209 
    210 procedure TSqlDatabase.Replace(ATable: string; Data: TAssociativeArray);
     239end;
     240
     241procedure TSqlDatabase.Replace(ATable: string; Data: TDictionaryStringString);
    211242var
    212243  DbNames: string;
     
    220251  DbValues := '';
    221252  for I := 0 to Data.Count - 1 do begin
    222     Value := Data.ValuesAtIndex[I];
     253    Value := Data.Items[I].Value;
    223254    StringReplace(Value, '"', '\"', [rfReplaceAll]);
    224255    if Value = 'NOW()' then DbValues := DbValues + ',' + Value
    225256    else DbValues := DbValues + ',"' + Value + '"';
    226     DbNames := DbNames + ',`' + Data.Names[I] + '`';
     257    DbNames := DbNames + ',`' + Data.Keys[I] + '`';
    227258  end;
    228259  System.Delete(DbNames, 1, 1);
    229260  System.Delete(DbValues, 1, 1);
    230   DbResult := Query('REPLACE INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')');
    231   DbResult.Free;
    232 end;
    233 
    234 function TSqlDatabase.Select(ATable: string; Filter: string = '*'; Condition: string = '1'): TDbRows;
     261  try
     262    DbResult := TDbRows.Create;
     263    Query(DbResult, 'REPLACE INTO `' + Table + '` (' + DbNames + ') VALUES (' + DbValues + ')');
     264  finally
     265    DbResult.Free;
     266  end;
     267end;
     268
     269procedure TSqlDatabase.Select(DbRows: TDbRows; ATable: string; Filter: string = '*'; Condition: string = '1');
    235270begin
    236271  Table := ATable;
    237   Result := Query('SELECT ' + Filter + ' FROM `' + Table + '` WHERE '+Condition);
    238 end;
    239 
    240 procedure TSqlDatabase.Update(ATable: string; Data: TAssociativeArray; Condition: string = '1');
     272  Query(DbRows, 'SELECT ' + Filter + ' FROM `' + Table + '` WHERE ' + Condition);
     273end;
     274
     275procedure TSqlDatabase.Update(ATable: string; Data: TDictionaryStringString; Condition: string = '1');
    241276var
    242277  DbValues: string;
     
    248283  DbValues := '';
    249284  for I := 0 to Data.Count - 1 do begin
    250     Value := Data.ValuesAtIndex[I];
     285    Value := Data.Items[I].Value;
    251286    StringReplace(Value, '"', '\"', [rfReplaceAll]);
    252287    if Value = 'NOW()' then DbValues := DbValues + ',' + Value
    253     else DbValues := DbValues + ',' + Data.Names[I] + '=' + '"' + Value + '"';
     288    else DbValues := DbValues + ',' + Data.Keys[I] + '=' + '"' + Value + '"';
    254289  end;
    255290  System.Delete(DbValues, 1, 1);
    256   DbResult := Query('UPDATE `' + Table + '` SET (' + DbValues + ') WHERE ' + Condition);
    257   DbResult.Free;
     291  try
     292    DbResult := TDbRows.Create;
     293    Query(DbResult, 'UPDATE `' + Table + '` SET (' + DbValues + ') WHERE ' + Condition);
     294  finally
     295    DbResult.Free;
     296  end;
    258297end;
    259298
     
    263302end;
    264303
    265 { TAssocArray }
    266 
    267 procedure TAssociativeArray.AddKeyValue(Key, Value: string);
    268 begin
    269   Add(Key + NameValueSeparator + Value);
    270 end;
    271 
    272 constructor TAssociativeArray.Create;
    273 begin
    274   NameValueSeparator := '|';
    275 end;
    276 
    277 destructor TAssociativeArray.Destroy;
    278 begin
    279   inherited;
    280 end;
    281 
    282 function TAssociativeArray.GetAllValues: string;
    283 var
    284   I: Integer;
    285 begin
    286   Result := '';
    287   for I := 0 to Count - 1 do begin
    288     Result := Result + Names[I] + '=' + ValuesAtIndex[I] + ',';
    289   end;
    290 end;
    291 
    292 function TAssociativeArray.GetValues(Index: string): string;
    293 begin
    294   Result := inherited Values[Index];
    295 end;
    296 
    297 function TAssociativeArray.GetValuesAtIndex(Index: Integer): string;
    298 begin
    299   Result := inherited Values[Names[Index]];
    300 end;
    301 
    302304procedure TSqlDatabase.Delete(ATable: string; Condition: string = '1');
    303305var
     
    305307begin
    306308  Table := ATable;
    307   DbResult := Query('DELETE FROM `' + Table + '` WHERE ' + Condition);
    308   DbResult.Free;
     309  try
     310    DbResult := TDbRows.Create;
     311    Query(DbResult, 'DELETE FROM `' + Table + '` WHERE ' + Condition);
     312  finally
     313    DbResult.Free;
     314  end;
    309315end;
    310316
     
    327333end;
    328334
    329 procedure TAssociativeArray.SetValues(Index: string; const Value: string);
    330 begin
    331   inherited Values[Index] := Value;
    332 end;
    333 
    334 { TDbRows }
    335 
    336 destructor TDbRows.Destroy;
    337 var
    338   I: Integer;
    339 begin
    340   for I := 0 to Count - 1 do
    341     Data[I].Free;
    342   inherited;
    343 end;
    344 
    345 function TDbRows.GetData(Index: Integer): TAssociativeArray;
    346 begin
    347   Result := Items[Index];
    348 end;
    349 
    350 procedure TDbRows.SetData(Index: Integer; const Value: TAssociativeArray);
    351 begin
    352   Items[Index] := Value;
    353 end;
    354 
    355335function TSqlDatabase.LastInsertId: Integer;
    356336begin
     
    368348end;
    369349
    370 function TSqlDatabase.CheckError: Boolean;
    371 begin
    372   Result := LastErrorNumber <> 0;
    373   if Result then
    374     raise EQueryError.Create('Database query error: "' + LastErrorMessage + '"');
    375 end;
    376 
    377350procedure TSqlDatabase.CreateDatabase;
    378351var
    379352  TempDatabase: string;
    380 begin
    381   TempDatabase := Schema;
    382   Schema := 'mysql';
     353  DbRows: TDbRows;
     354begin
     355  TempDatabase := Database;
     356  Database := 'mysql';
    383357  Connect;
    384   Query('CREATE DATABASE ' + TempDatabase);
     358  try
     359    DbRows := TDbRows.Create;
     360    Query(DbRows, 'CREATE DATABASE ' + TempDatabase);
     361  finally
     362    DbRows.Free;
     363  end;
    385364  Disconnect;
    386   Schema := TempDatabase;
     365  Database := TempDatabase;
    387366end;
    388367
    389368procedure TSqlDatabase.CreateTable(Name: string);
    390 begin
    391   Query('CREATE TABLE `' + Name + '`' +
    392   ' (`Id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`Id`));');
     369var
     370  DbRows: TDbRows;
     371begin
     372  try
     373    DbRows := TDbRows.Create;
     374    Query(DbRows, 'CREATE TABLE `' + Name + '`' +
     375    ' (`Id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`Id`));');
     376  finally
     377    DbRows.Free;
     378  end;
    393379end;
    394380
     
    398384  ColTypes: array[0..17] of string = ('', 'INT', 'CHAR', 'INT', 'DOUBLE',
    399385  'VARCHAR(255)', 'SET', 'INT', '', '', 'TEXT', 'TEXT', '', '', '', '', '', '');
    400 begin
    401   Query('ALTER TABLE `' + Table + '` ADD `' + ColumnName + '` ' +
    402     ColTypes[Integer(ColumnType)] + ' NOT NULL');
     386var
     387  DbRows: TDbRows;
     388begin
     389  try
     390    DbRows := TDbRows.Create;
     391    Query(DbRows, 'ALTER TABLE `' + Table + '` ADD `' + ColumnName + '` ' +
     392      ColTypes[Integer(ColumnType)] + ' NOT NULL');
     393  finally
     394    DbRows.Free;
     395  end;
    403396end;
    404397
     
    413406end;
    414407
    415 procedure TSqlDatabase.SetSchema(const Value: string);
     408procedure TSqlDatabase.SetDatabase(const Value: string);
    416409begin
    417410  FDatabase := Value;
     
    419412end;
    420413
     414{ TDbRows }
     415
     416destructor TDbRows.Destroy;
     417begin
     418  inherited;
     419end;
     420
     421function TDbRows.GetData(Index: Integer): TDictionaryStringString;
     422begin
     423  Result := TDictionaryStringString(Items[Index]);
     424end;
     425
     426procedure TDbRows.SetData(Index: Integer; const Value: TDictionaryStringString);
     427begin
     428  Items[Index] := Value;
     429end;
     430
    421431end.
    422432
  • trunk/Forms/UItemAdd.lfm

    r5 r7  
    22  Left = 400
    33  Height = 421
    4   Top = 156
     4  Top = 130
    55  Width = 567
    6   Caption = 'Přidání položky'
     6  Caption = 'Add item'
    77  ClientHeight = 421
    88  ClientWidth = 567
     
    2626    Width = 75
    2727    Anchors = [akRight, akBottom]
    28     Caption = 'Zrušit'
     28    Caption = 'Cancel'
    2929    OnClick = ButtonCancelClick
    3030    TabOrder = 1
     
    3636    Width = 75
    3737    Anchors = [akRight, akBottom]
    38     Caption = 'Přidat'
     38    Caption = 'Add'
    3939    OnClick = ButtonSaveClick
    4040    TabOrder = 2
  • trunk/Forms/UItemAdd.pas

    r5 r7  
    7777  LastTop := 8;
    7878  Column := 0;
    79   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     79  try
     80  ObjectInfo := TDbRows.Create;
     81  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8082  if ObjectInfo.Count = 1 then begin
    8183
    8284    for I := Panel1.ControlCount - 1 downto 0 do
    83       Panel1.Controls[I].Destroy;
     85      Panel1.Controls[I].Free;
    8486
    8587    // Load column names
    86     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     88    try
     89    Properties := TDbRows.Create;
     90    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    8791      IntToStr(MainForm.SelectedObject));
    8892    for I := 0 to Properties.Count - 1 do begin
     
    145149      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    146150    end;
    147     Properties.Destroy;
    148   end else ShowMessage('Objekt nenalezen');
    149   ObjectInfo.Destroy;
     151
     152    finally
     153      Properties.Free;
     154    end;
     155  end else ShowMessage(SObjectNotFound);
     156  finally
     157    ObjectInfo.Free;
     158  end;
    150159end;
    151160
  • trunk/Forms/UItemEdit.lfm

    r6 r7  
    22  Left = 295
    33  Height = 429
    4   Top = 174
     4  Top = 122
    55  Width = 558
    66  ActiveControl = Panel1
    7   Caption = 'Úprava položky'
     7  Caption = 'Edit item'
    88  ClientHeight = 429
    99  ClientWidth = 558
     
    2727    Width = 75
    2828    Anchors = [akRight, akBottom]
    29     Caption = 'Zrušit'
     29    Caption = 'Cancel'
    3030    OnClick = ButtonCancelClick
    3131    TabOrder = 1
     
    3737    Width = 75
    3838    Anchors = [akRight, akBottom]
    39     Caption = 'Uložit'
     39    Caption = 'Save'
    4040    OnClick = ButtonSaveClick
    4141    TabOrder = 2
  • trunk/Forms/UItemEdit.pas

    r6 r7  
    7878  LastTop := 8;
    7979  Column := 0;
    80   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     80  try
     81  ObjectInfo := TDbRows.Create;
     82  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8183  if ObjectInfo.Count = 1 then begin
    8284
    8385    for I := Panel1.ControlCount - 1 downto 0 do
    84       Panel1.Controls[I].Destroy;
     86      Panel1.Controls[I].Free;
    8587
    8688    // Load column names
    87     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     89    try
     90    Properties := TDbRows.Create;
     91    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    8892      IntToStr(MainForm.SelectedObject));
    89     Values := MainForm.Database.Query('SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
     93    Values := TDbRows.Create;
     94    MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
    9095      ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    9196      IntToStr(MainForm.SelectedItem));
     
    155160      Column := (Column + 1) mod 2;
    156161      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    157     end else ShowMessage('Položka nenalezena');
    158     Values.Destroy;
    159     Properties.Destroy;
    160   end else ShowMessage('Objekt nenalezen');
    161   ObjectInfo.Destroy;
     162    end else ShowMessage(SItemNotFound);
     163    finally
     164      Values.Free;
     165      Properties.Free;
     166    end;
     167  end else ShowMessage(SObjectNotFound);
     168  finally
     169    ObjectInfo.Free;
     170  end;
    162171end;
    163172
  • trunk/Forms/UItemView.lfm

    r6 r7  
    44  Top = 135
    55  Width = 552
    6   Caption = 'Zobrazení položky'
     6  Caption = 'View item'
    77  ClientHeight = 416
    88  ClientWidth = 552
     
    1616    Width = 75
    1717    Anchors = [akRight, akBottom]
    18     Caption = 'Zavřít'
     18    Caption = 'Close'
    1919    OnClick = ButtonCloseClick
    2020    TabOrder = 0
     
    3636    Width = 75
    3737    Anchors = [akRight, akBottom]
    38     Caption = 'Editovat'
     38    Caption = 'Edit'
    3939    OnClick = ButtonEditClick
    4040    TabOrder = 2
  • trunk/Forms/UItemView.pas

    r6 r7  
    8282  LastTop := 8;
    8383  Column := 0;
    84   ObjectInfo := MainForm.Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
     84  try
     85  ObjectInfo := TDbRows.Create;
     86  MainForm.Database.Query(ObjectInfo, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(MainForm.SelectedObject));
    8587  if ObjectInfo.Count = 1 then begin
    8688
     
    8991
    9092    // Load column names
    91     Properties := MainForm.Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     93    try
     94    Properties := TDbRows.Create;
     95    MainForm.Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    9296      IntToStr(MainForm.SelectedObject));
    93     Values := MainForm.Database.Query('SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
     97    Values := TDbRows.Create;
     98    MainForm.Database.Query(Values, 'SELECT * FROM `' + ObjectInfo[0].Values['Schema'] + '`.`' +
    9499      ObjectInfo[0].Values['Table'] + '` WHERE ' + ObjectInfo[0].Values['PrimaryKey'] + ' = ' +
    95100      IntToStr(MainForm.SelectedItem));
     
    110115      Column := (Column + 1) mod 2;
    111116      if Column = 0 then LastTop := LastTop + NewControl.Height + 4;
    112     end else ShowMessage('Položka nenalezena');
    113     Values.Destroy;
    114     Properties.Destroy;
    115   end else ShowMessage('Objekt nenalezen');
    116   ObjectInfo.Free;
     117    end else ShowMessage(SItemNotFound);
     118    finally
     119      Values.Free;
     120      Properties.Free;
     121    end;
     122  end else ShowMessage(SObjectNotFound);
     123  finally
     124    ObjectInfo.Free;
     125  end;
    117126end;
    118127
  • trunk/Forms/ULoginForm.lfm

    r3 r7  
    66  BorderIcons = [biSystemMenu]
    77  BorderStyle = bsDialog
    8   Caption = 'Přihlášení'
     8  Caption = 'Login'
    99  ClientHeight = 177
    1010  ClientWidth = 405
     
    1212  object Label1: TLabel
    1313    Left = 16
    14     Height = 18
     14    Height = 14
    1515    Top = 48
    16     Width = 47
    17     Caption = 'Jméno:'
     16    Width = 61
     17    Caption = 'Username:'
    1818    ParentColor = False
    1919  end
    2020  object Label2: TLabel
    2121    Left = 16
    22     Height = 18
     22    Height = 14
    2323    Top = 80
    24     Width = 43
    25     Caption = 'Heslo:'
     24    Width = 57
     25    Caption = 'Password:'
    2626    ParentColor = False
    2727  end
     
    3131    Top = 128
    3232    Width = 75
    33     Caption = 'Ukončit'
     33    Caption = 'Close'
    3434    TabOrder = 0
    3535  end
     
    3939    Top = 128
    4040    Width = 75
    41     Caption = 'Přihlásit'
     41    Caption = 'Login'
    4242    TabOrder = 1
    4343  end
    4444  object Edit1: TEdit
    45     Left = 72
    46     Height = 27
     45    Left = 88
     46    Height = 23
    4747    Top = 40
    48     Width = 120
     48    Width = 104
    4949    TabOrder = 2
    50     Text = 'Edit1'
    5150  end
    5251  object MaskEdit1: TMaskEdit
    53     Left = 72
    54     Height = 27
     52    Left = 88
     53    Height = 23
    5554    Top = 71
    56     Width = 120
     55    Width = 104
    5756    CharCase = ecNormal
    5857    MaxLength = 1
  • trunk/Forms/UMainForm.lfm

    r6 r7  
    2828      Height = 14
    2929      Top = 4
    30       Width = 46
    31       Caption = 'Skupiny:'
     30      Width = 44
     31      Caption = 'Groups:'
    3232      ParentColor = False
    3333    end
     
    6060      Height = 14
    6161      Top = 4
    62       Width = 38
    63       Caption = 'Výpisy:'
     62      Width = 46
     63      Caption = 'Reports:'
    6464      ParentColor = False
    6565    end
     
    112112    object AItemDelete: TAction
    113113      Category = 'Item'
    114       Caption = 'Smazat'
     114      Caption = 'Delete'
    115115    end
    116116    object AItemAdd: TAction
    117117      Category = 'Item'
    118       Caption = 'Přidat'
     118      Caption = 'Add'
    119119      OnExecute = AItemAddExecute
    120120    end
    121121    object AItemEdit: TAction
    122122      Category = 'Item'
    123       Caption = 'Upravit'
     123      Caption = 'Edit'
    124124      OnExecute = AItemEditExecute
    125125    end
    126126    object AItemView: TAction
    127127      Category = 'Item'
    128       Caption = 'Zobrazit'
     128      Caption = 'View'
    129129      OnExecute = AItemViewExecute
    130130    end
    131131    object AObjectGroupDelete: TAction
    132132      Category = 'ObjectGroup'
    133       Caption = 'Odebrat'
     133      Caption = 'Delete'
    134134    end
    135135    object AObjectGroupAddGroup: TAction
    136136      Category = 'ObjectGroup'
    137       Caption = 'Přidat skupinu'
     137      Caption = 'Add group'
    138138      OnExecute = AObjectGroupAddGroupExecute
    139139    end
    140140    object AObjectGroupAddObject: TAction
    141141      Category = 'ObjectGroup'
    142       Caption = 'Přidat objekt'
     142      Caption = 'Add object'
    143143    end
    144144    object AObjectGroupEdit: TAction
    145145      Category = 'ObjectGroup'
    146       Caption = 'Upravit'
     146      Caption = 'Edit'
    147147      OnExecute = AObjectGroupEditExecute
    148148    end
    149149    object AObjectDelete: TAction
    150150      Category = 'Object'
    151       Caption = 'Odstranit'
     151      Caption = 'Delete'
    152152    end
    153153    object AObjectEdit: TAction
    154154      Category = 'Object'
    155       Caption = 'Upravit'
     155      Caption = 'Edit'
    156156      OnExecute = AObjectEditExecute
    157157    end
     
    161161    end
    162162    object AToggleFullscreen: TAction
    163       Caption = 'Fullscreen mode F11'
     163      Caption = 'Fullscreen mode'
    164164      OnExecute = AToggleFullscreenExecute
    165165      ShortCut = 122
  • trunk/Forms/UMainForm.lrt

    r6 r7  
    11TMAINFORM.MAINFORM.CAPTION=ChronIS
    2 TMAINFORM.LABEL1.CAPTION=Skupiny:
    3 TMAINFORM.LABEL2.CAPTION=Výpisy:
    4 TMAINFORM.AITEMDELETE.CAPTION=Smazat
    5 TMAINFORM.AITEMADD.CAPTION=Přidat
    6 TMAINFORM.AITEMEDIT.CAPTION=Upravit
    7 TMAINFORM.AITEMVIEW.CAPTION=Zobrazit
    8 TMAINFORM.AOBJECTGROUPDELETE.CAPTION=Odebrat
    9 TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION=Přidat skupinu
    10 TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION=Přidat objekt
    11 TMAINFORM.AOBJECTGROUPEDIT.CAPTION=Upravit
    12 TMAINFORM.AOBJECTDELETE.CAPTION=Odstranit
    13 TMAINFORM.AOBJECTEDIT.CAPTION=Upravit
     2TMAINFORM.LABEL1.CAPTION=Groups:
     3TMAINFORM.LABEL2.CAPTION=Reports:
     4TMAINFORM.AITEMDELETE.CAPTION=Delete
     5TMAINFORM.AITEMADD.CAPTION=Add
     6TMAINFORM.AITEMEDIT.CAPTION=Edit
     7TMAINFORM.AITEMVIEW.CAPTION=View
     8TMAINFORM.AOBJECTGROUPDELETE.CAPTION=Delete
     9TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION=Add group
     10TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION=Add object
     11TMAINFORM.AOBJECTGROUPEDIT.CAPTION=Edit
     12TMAINFORM.AOBJECTDELETE.CAPTION=Delete
     13TMAINFORM.AOBJECTEDIT.CAPTION=Edit
    1414TMAINFORM.AEXIT.CAPTION=Exit
    15 TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode F11
     15TMAINFORM.ATOGGLEFULLSCREEN.CAPTION=Fullscreen mode
    1616TMAINFORM.MENUITEM13.CAPTION=Server
    1717TMAINFORM.MENUITEM11.CAPTION=View
  • trunk/Forms/UMainForm.pas

    r6 r7  
    100100  MainForm: TMainForm;
    101101
     102resourcestring
     103  SItemNotFound = 'Item not found';
     104  SObjectNotFound = 'Object not found';
     105
     106
    102107implementation
    103108
     
    129134            Database.HostName := TextContent;
    130135          if NodeName = 'schema' then
    131             Database.Schema := TextContent;
     136            Database.Database := TextContent;
    132137          if NodeName = 'username' then
    133138            Database.UserName := TextContent;
     
    306311    TopItem.SelectedIndex := 0;
    307312    try
    308       DbRows := Database.Query('SELECT * FROM `ObjectGroup`');
     313      DbRows := TDbRows.Create;
     314      Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`');
    309315      for I := 0 to DbRows.Count - 1 do begin
    310316        NewNode := AddChild(TopItem, DbRows[I].Values['Name']);
     
    313319        NewNode.Data := Pointer(StrToInt(DbRows[I].Values['Id']));
    314320        try
    315           ObjectDbRows := Database.Query('SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
     321          ObjectDbRows := TDbRows.Create;
     322          Database.Query(ObjectDbRows, 'SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
    316323          for O := 0 to ObjectDbRows.Count - 1 do begin
    317324            NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']);
     
    348355    Clear;
    349356    try
    350     DbRows := Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
     357    DbRows := TDbRows.Create;
     358    Database.Query(DbRows, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
    351359    if DbRows.Count = 1 then begin
    352360      SelectedObject := StrToInt(DbRows[0].Values['Id']);
     
    354362      // Load column names
    355363      try
    356         Properties := Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     364        Properties := TDbRows.Create;
     365        Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    357366          DbRows[0].Values['Id']);
    358367        Columns.Clear;
     
    371380      // Load items
    372381      try
    373       Values := Database.Query('SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
     382      Values := TDbRows.Create;
     383      Database.Query(Values, 'SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
    374384        DbRows[0].Values['Table'] + '`');
    375385      for I := 0 to Values.Count - 1 do begin
  • trunk/chronis.lpi

    r6 r7  
    3535      </local>
    3636    </RunParams>
    37     <RequiredPackages Count="1">
     37    <RequiredPackages Count="2">
    3838      <Item1>
     39        <PackageName Value="TemplateGenerics"/>
     40      </Item1>
     41      <Item2>
    3942        <PackageName Value="LCL"/>
    40       </Item1>
     43      </Item2>
    4144    </RequiredPackages>
    4245    <Units Count="13">
     
    99102        <EditorIndex Value="2"/>
    100103        <WindowIndex Value="0"/>
    101         <TopLine Value="264"/>
    102         <CursorPos X="3" Y="307"/>
     104        <TopLine Value="50"/>
     105        <CursorPos X="5" Y="45"/>
    103106        <UsageCount Value="264"/>
    104107        <Loaded Value="True"/>
     
    119122        <ResourceBaseClass Value="Form"/>
    120123        <UnitName Value="UItemView"/>
     124        <IsVisibleTab Value="True"/>
    121125        <EditorIndex Value="0"/>
    122126        <WindowIndex Value="0"/>
    123         <TopLine Value="65"/>
    124         <CursorPos X="41" Y="68"/>
     127        <TopLine Value="76"/>
     128        <CursorPos X="37" Y="98"/>
    125129        <UsageCount Value="327"/>
    126130        <Loaded Value="True"/>
     
    135139        <EditorIndex Value="1"/>
    136140        <WindowIndex Value="0"/>
    137         <TopLine Value="56"/>
    138         <CursorPos X="23" Y="78"/>
     141        <TopLine Value="80"/>
     142        <CursorPos X="30" Y="93"/>
    139143        <UsageCount Value="318"/>
    140144        <Loaded Value="True"/>
     
    144148        <Filename Value="Forms/ULoginForm.pas"/>
    145149        <IsPartOfProject Value="True"/>
     150        <ComponentName Value="LoginForm"/>
    146151        <HasResources Value="True"/>
     152        <ResourceBaseClass Value="Form"/>
    147153        <UnitName Value="ULoginForm"/>
     154        <EditorIndex Value="5"/>
     155        <WindowIndex Value="0"/>
     156        <TopLine Value="1"/>
     157        <CursorPos X="1" Y="1"/>
    148158        <UsageCount Value="317"/>
     159        <Loaded Value="True"/>
     160        <LoadedDesigner Value="True"/>
    149161      </Unit9>
    150162      <Unit10>
     
    155167        <ResourceBaseClass Value="Form"/>
    156168        <UnitName Value="UMainForm"/>
    157         <IsVisibleTab Value="True"/>
    158169        <EditorIndex Value="3"/>
    159170        <WindowIndex Value="0"/>
    160         <TopLine Value="235"/>
    161         <CursorPos X="28" Y="245"/>
     171        <TopLine Value="372"/>
     172        <CursorPos X="30" Y="383"/>
    162173        <UsageCount Value="317"/>
    163174        <Loaded Value="True"/>
     
    178189        <EditorIndex Value="4"/>
    179190        <WindowIndex Value="0"/>
    180         <TopLine Value="47"/>
    181         <CursorPos X="6" Y="48"/>
     191        <TopLine Value="69"/>
     192        <CursorPos X="41" Y="90"/>
    182193        <UsageCount Value="313"/>
    183194        <Loaded Value="True"/>
     
    188199      <Position1>
    189200        <Filename Value="Forms/UItemAdd.pas"/>
    190         <Caret Line="51" Column="33" TopLine="31"/>
     201        <Caret Line="9" Column="27" TopLine="1"/>
    191202      </Position1>
    192203      <Position2>
    193204        <Filename Value="Forms/UItemAdd.pas"/>
    194         <Caret Line="57" Column="32" TopLine="38"/>
     205        <Caret Line="138" Column="28" TopLine="116"/>
    195206      </Position2>
    196207      <Position3>
    197         <Filename Value="Forms/UItemAdd.pas"/>
    198         <Caret Line="23" Column="1" TopLine="5"/>
     208        <Filename Value="Forms/UItemEdit.pas"/>
     209        <Caret Line="137" Column="16" TopLine="125"/>
    199210      </Position3>
    200211      <Position4>
    201         <Filename Value="Forms/UItemAdd.pas"/>
    202         <Caret Line="88" Column="1" TopLine="81"/>
     212        <Filename Value="Forms/UItemEdit.pas"/>
     213        <Caret Line="78" Column="23" TopLine="56"/>
    203214      </Position4>
    204215      <Position5>
    205         <Filename Value="Forms/UItemAdd.pas"/>
    206         <Caret Line="121" Column="27" TopLine="97"/>
     216        <Filename Value="Forms/UMainForm.pas"/>
     217        <Caret Line="339" Column="43" TopLine="214"/>
    207218      </Position5>
    208219      <Position6>
    209         <Filename Value="Forms/UItemAdd.pas"/>
    210         <Caret Line="124" Column="31" TopLine="97"/>
     220        <Filename Value="Forms/UMainForm.pas"/>
     221        <Caret Line="340" Column="43" TopLine="317"/>
    211222      </Position6>
    212223      <Position7>
    213         <Filename Value="Forms/UItemAdd.pas"/>
    214         <Caret Line="125" Column="32" TopLine="104"/>
     224        <Filename Value="Forms/UMainForm.pas"/>
     225        <Caret Line="341" Column="43" TopLine="318"/>
    215226      </Position7>
    216227      <Position8>
    217         <Filename Value="Forms/UItemAdd.pas"/>
    218         <Caret Line="126" Column="32" TopLine="105"/>
     228        <Filename Value="Forms/UMainForm.pas"/>
     229        <Caret Line="342" Column="43" TopLine="319"/>
    219230      </Position8>
    220231      <Position9>
    221         <Filename Value="Forms/UItemAdd.pas"/>
    222         <Caret Line="125" Column="32" TopLine="104"/>
     232        <Filename Value="Forms/UMainForm.pas"/>
     233        <Caret Line="343" Column="43" TopLine="320"/>
    223234      </Position9>
    224235      <Position10>
    225         <Filename Value="Forms/UItemEdit.pas"/>
    226         <Caret Line="148" Column="1" TopLine="112"/>
     236        <Filename Value="Forms/UMainForm.pas"/>
     237        <Caret Line="344" Column="43" TopLine="321"/>
    227238      </Position10>
    228239      <Position11>
    229         <Filename Value="Forms/UItemEdit.pas"/>
    230         <Caret Line="9" Column="50" TopLine="1"/>
     240        <Filename Value="Forms/UMainForm.pas"/>
     241        <Caret Line="345" Column="43" TopLine="322"/>
    231242      </Position11>
    232243      <Position12>
    233         <Filename Value="Forms/UItemAdd.pas"/>
    234         <Caret Line="9" Column="27" TopLine="1"/>
     244        <Filename Value="Forms/UMainForm.pas"/>
     245        <Caret Line="346" Column="43" TopLine="323"/>
    235246      </Position12>
    236247      <Position13>
    237         <Filename Value="Forms/UItemAdd.pas"/>
    238         <Caret Line="138" Column="28" TopLine="116"/>
     248        <Filename Value="Forms/UMainForm.pas"/>
     249        <Caret Line="345" Column="43" TopLine="322"/>
    239250      </Position13>
    240251      <Position14>
    241         <Filename Value="Forms/UItemEdit.pas"/>
    242         <Caret Line="137" Column="16" TopLine="125"/>
     252        <Filename Value="Forms/UMainForm.pas"/>
     253        <Caret Line="344" Column="43" TopLine="321"/>
    243254      </Position14>
    244255      <Position15>
    245         <Filename Value="Forms/UItemEdit.pas"/>
    246         <Caret Line="78" Column="23" TopLine="56"/>
     256        <Filename Value="Forms/UMainForm.pas"/>
     257        <Caret Line="345" Column="43" TopLine="322"/>
    247258      </Position15>
    248259      <Position16>
    249260        <Filename Value="Forms/UMainForm.pas"/>
    250         <Caret Line="339" Column="43" TopLine="214"/>
     261        <Caret Line="352" Column="43" TopLine="329"/>
    251262      </Position16>
    252263      <Position17>
    253264        <Filename Value="Forms/UMainForm.pas"/>
    254         <Caret Line="340" Column="43" TopLine="317"/>
     265        <Caret Line="218" Column="1" TopLine="195"/>
    255266      </Position17>
    256267      <Position18>
    257268        <Filename Value="Forms/UMainForm.pas"/>
    258         <Caret Line="341" Column="43" TopLine="318"/>
     269        <Caret Line="79" Column="21" TopLine="67"/>
    259270      </Position18>
    260271      <Position19>
    261272        <Filename Value="Forms/UMainForm.pas"/>
    262         <Caret Line="342" Column="43" TopLine="319"/>
     273        <Caret Line="81" Column="21" TopLine="69"/>
    263274      </Position19>
    264275      <Position20>
    265         <Filename Value="Forms/UMainForm.pas"/>
    266         <Caret Line="343" Column="43" TopLine="320"/>
     276        <Filename Value="Forms/UItemView.pas"/>
     277        <Caret Line="118" Column="39" TopLine="98"/>
    267278      </Position20>
    268279      <Position21>
    269         <Filename Value="Forms/UMainForm.pas"/>
    270         <Caret Line="344" Column="43" TopLine="321"/>
     280        <Filename Value="Forms/UItemEdit.pas"/>
     281        <Caret Line="39" Column="1" TopLine="26"/>
    271282      </Position21>
    272283      <Position22>
    273         <Filename Value="Forms/UMainForm.pas"/>
    274         <Caret Line="345" Column="43" TopLine="322"/>
     284        <Filename Value="Forms/UItemEdit.pas"/>
     285        <Caret Line="81" Column="31" TopLine="70"/>
    275286      </Position22>
    276287      <Position23>
    277         <Filename Value="Forms/UMainForm.pas"/>
    278         <Caret Line="346" Column="43" TopLine="323"/>
     288        <Filename Value="Forms/UItemAdd.pas"/>
     289        <Caret Line="153" Column="39" TopLine="2"/>
    279290      </Position23>
    280291      <Position24>
    281292        <Filename Value="Forms/UMainForm.pas"/>
    282         <Caret Line="345" Column="43" TopLine="322"/>
     293        <Caret Line="102" Column="1" TopLine="91"/>
    283294      </Position24>
    284295      <Position25>
    285296        <Filename Value="Forms/UMainForm.pas"/>
    286         <Caret Line="344" Column="43" TopLine="321"/>
     297        <Caret Line="138" Column="26" TopLine="125"/>
    287298      </Position25>
    288299      <Position26>
    289300        <Filename Value="Forms/UMainForm.pas"/>
    290         <Caret Line="345" Column="43" TopLine="322"/>
     301        <Caret Line="136" Column="30" TopLine="125"/>
    291302      </Position26>
    292303      <Position27>
    293304        <Filename Value="Forms/UMainForm.pas"/>
    294         <Caret Line="352" Column="43" TopLine="329"/>
     305        <Caret Line="314" Column="30" TopLine="302"/>
    295306      </Position27>
    296307      <Position28>
    297308        <Filename Value="Forms/UMainForm.pas"/>
    298         <Caret Line="218" Column="1" TopLine="195"/>
     309        <Caret Line="343" Column="11" TopLine="322"/>
    299310      </Position28>
    300311      <Position29>
    301312        <Filename Value="Forms/UMainForm.pas"/>
    302         <Caret Line="79" Column="21" TopLine="67"/>
     313        <Caret Line="368" Column="9" TopLine="346"/>
    303314      </Position29>
    304315      <Position30>
    305         <Filename Value="Forms/UMainForm.pas"/>
    306         <Caret Line="81" Column="21" TopLine="69"/>
     316        <Filename Value="Forms/UItemView.pas"/>
     317        <Caret Line="86" Column="24" TopLine="80"/>
    307318      </Position30>
    308319    </JumpHistory>
  • trunk/chronis.lpr

    r5 r7  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UPersistentForm, URegistry, USqlDatabase, UTreeState,
    11 UItemView, UItemEdit, ULoginForm, UMainForm, UItemAdd
     11UItemView, UItemEdit, ULoginForm, UMainForm, UItemAdd, TemplateGenerics
    1212  { you can add units after this };
    1313
  • trunk/languages/chronis.po

    r6 r7  
    11msgid ""
    22msgstr "Content-Type: text/plain; charset=UTF-8"
     3
     4#: TITEMADDFORM.BUTTONCANCEL.CAPTION
     5msgctxt "TITEMADDFORM.BUTTONCANCEL.CAPTION"
     6msgid "Cancel"
     7msgstr ""
     8
     9#: TITEMADDFORM.BUTTONSAVE.CAPTION
     10msgctxt "TITEMADDFORM.BUTTONSAVE.CAPTION"
     11msgid "Add"
     12msgstr ""
     13
     14#: TITEMADDFORM.ITEMADDFORM.CAPTION
     15msgid "Add item"
     16msgstr ""
     17
     18#: TITEMEDITFORM.BUTTONCANCEL.CAPTION
     19msgctxt "TITEMEDITFORM.BUTTONCANCEL.CAPTION"
     20msgid "Cancel"
     21msgstr ""
     22
     23#: TITEMEDITFORM.BUTTONSAVE.CAPTION
     24msgid "Save"
     25msgstr ""
     26
     27#: TITEMEDITFORM.ITEMEDITFORM.CAPTION
     28msgid "Edit item"
     29msgstr ""
     30
     31#: TITEMVIEWFORM.BUTTONCLOSE.CAPTION
     32msgctxt "TITEMVIEWFORM.BUTTONCLOSE.CAPTION"
     33msgid "Close"
     34msgstr ""
     35
     36#: TITEMVIEWFORM.BUTTONEDIT.CAPTION
     37msgctxt "TITEMVIEWFORM.BUTTONEDIT.CAPTION"
     38msgid "Edit"
     39msgstr ""
     40
     41#: TITEMVIEWFORM.ITEMVIEWFORM.CAPTION
     42msgid "View item"
     43msgstr ""
     44
     45#: TLOGINFORM.BUTTONCANCEL.CAPTION
     46msgctxt "TLOGINFORM.BUTTONCANCEL.CAPTION"
     47msgid "Close"
     48msgstr ""
     49
     50#: TLOGINFORM.BUTTONLOGIN.CAPTION
     51msgctxt "TLOGINFORM.BUTTONLOGIN.CAPTION"
     52msgid "Login"
     53msgstr ""
     54
     55#: TLOGINFORM.LABEL1.CAPTION
     56msgid "Username:"
     57msgstr ""
     58
     59#: TLOGINFORM.LABEL2.CAPTION
     60msgid "Password:"
     61msgstr ""
     62
     63#: TLOGINFORM.LOGINFORM.CAPTION
     64msgctxt "TLOGINFORM.LOGINFORM.CAPTION"
     65msgid "Login"
     66msgstr ""
    367
    468#: TMAINFORM.AEXIT.CAPTION
     
    771
    872#: TMAINFORM.AITEMADD.CAPTION
    9 msgid "Přidat"
     73msgctxt "TMAINFORM.AITEMADD.CAPTION"
     74msgid "Add"
    1075msgstr ""
    1176
    1277#: TMAINFORM.AITEMDELETE.CAPTION
    13 msgid "Smazat"
     78msgctxt "TMAINFORM.AITEMDELETE.CAPTION"
     79msgid "Delete"
    1480msgstr ""
    1581
    1682#: TMAINFORM.AITEMEDIT.CAPTION
    1783msgctxt "TMAINFORM.AITEMEDIT.CAPTION"
    18 msgid "Upravit"
     84msgid "Edit"
    1985msgstr ""
    2086
    2187#: TMAINFORM.AITEMVIEW.CAPTION
    22 msgid "Zobrazit"
     88msgctxt "TMAINFORM.AITEMVIEW.CAPTION"
     89msgid "View"
    2390msgstr ""
    2491
    2592#: TMAINFORM.AOBJECTDELETE.CAPTION
    26 msgid "Odstranit"
     93msgctxt "TMAINFORM.AOBJECTDELETE.CAPTION"
     94msgid "Delete"
    2795msgstr ""
    2896
    2997#: TMAINFORM.AOBJECTEDIT.CAPTION
    3098msgctxt "TMAINFORM.AOBJECTEDIT.CAPTION"
    31 msgid "Upravit"
     99msgid "Edit"
    32100msgstr ""
    33101
    34102#: TMAINFORM.AOBJECTGROUPADDGROUP.CAPTION
    35 msgid "Přidat skupinu"
     103msgid "Add group"
    36104msgstr ""
    37105
    38106#: TMAINFORM.AOBJECTGROUPADDOBJECT.CAPTION
    39 msgid "Přidat objekt"
     107msgid "Add object"
    40108msgstr ""
    41109
    42110#: TMAINFORM.AOBJECTGROUPDELETE.CAPTION
    43 msgid "Odebrat"
     111msgctxt "TMAINFORM.AOBJECTGROUPDELETE.CAPTION"
     112msgid "Delete"
    44113msgstr ""
    45114
    46115#: TMAINFORM.AOBJECTGROUPEDIT.CAPTION
    47116msgctxt "TMAINFORM.AOBJECTGROUPEDIT.CAPTION"
    48 msgid "Upravit"
     117msgid "Edit"
    49118msgstr ""
    50119
    51120#: TMAINFORM.ATOGGLEFULLSCREEN.CAPTION
    52 msgid "Fullscreen mode F11"
     121msgid "Fullscreen mode"
    53122msgstr ""
    54123
    55124#: TMAINFORM.LABEL1.CAPTION
    56 msgid "Skupiny:"
     125msgid "Groups:"
    57126msgstr ""
    58127
    59128#: TMAINFORM.LABEL2.CAPTION
    60 msgid "Výpisy:"
     129msgid "Reports:"
    61130msgstr ""
    62131
     
    66135
    67136#: TMAINFORM.MENUITEM11.CAPTION
     137msgctxt "TMAINFORM.MENUITEM11.CAPTION"
    68138msgid "View"
    69139msgstr ""
     
    77147msgstr ""
    78148
     149#: umainform.sitemnotfound
     150msgid "Item not found"
     151msgstr ""
     152
     153#: umainform.sobjectnotfound
     154msgid "Object not found"
     155msgstr ""
     156
     157#: usqldatabase.sdatabasequeryerror
     158msgid "Database query error: \"%s\""
     159msgstr ""
     160
Note: See TracChangeset for help on using the changeset viewer.