Changeset 249 for trunk


Ignore:
Timestamp:
Sep 22, 2018, 9:37:16 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Use different interface language if installed as deb Linux package.
  • Fixed: Propagate status bar, toolbar visibilit, and toolbar icons size to client form.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r245 r249  
    124124      Caption = 'Toolbar big icons'
    125125      OnExecute = AToolBarBigIconsExecute
     126      OnUpdate = AToolBarBigIconsUpdate
    126127    end
    127128    object AToolBarVisible: TAction
    128129      Caption = 'Toolbar visible'
    129130      OnExecute = AToolBarVisibleExecute
     131      OnUpdate = AToolBarVisibleUpdate
    130132    end
    131133    object AStatusBarVisible: TAction
    132134      Caption = 'Statusbar visible'
    133135      OnExecute = AStatusBarVisibleExecute
     136      OnUpdate = AStatusBarVisibleUpdate
    134137    end
    135138    object AGameEndTurn: TAction
  • trunk/Forms/UFormClient.pas

    r248 r249  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math,
    10   UGeometry, UGameClient, UGameProtocol, UThreading, UPlayer, UClientGUI;
     10  UGeometry, UGameClient, UGameProtocol, UThreading, UPlayer, UClientGUI, UFormMain;
    1111
    1212const
     
    4444    procedure AGameEndTurnExecute(Sender: TObject);
    4545    procedure AStatusBarVisibleExecute(Sender: TObject);
     46    procedure AStatusBarVisibleUpdate(Sender: TObject);
    4647    procedure ASurrenderExecute(Sender: TObject);
    4748    procedure AToolBarBigIconsExecute(Sender: TObject);
     49    procedure AToolBarBigIconsUpdate(Sender: TObject);
    4850    procedure AToolBarVisibleExecute(Sender: TObject);
     51    procedure AToolBarVisibleUpdate(Sender: TObject);
    4952    procedure AZoomAllExecute(Sender: TObject);
    5053    procedure AZoomInExecute(Sender: TObject);
     
    9295    procedure DoClientDestroy(Sender: TObject);
    9396  public
     97    FormMain: TFormMain;
    9498    procedure LoadConfig(Config: TXmlConfig; Path: string);
    9599    procedure SaveConfig(Config: TXmlConfig; Path: string);
     
    416420begin
    417421  AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked;
     422end;
     423
     424procedure TFormClient.AToolBarBigIconsUpdate(Sender: TObject);
     425begin
    418426  UpdateInterface;
    419427end;
     
    422430begin
    423431  AStatusBarVisible.Checked := not AStatusBarVisible.Checked;
     432  UpdateInterface;
     433end;
     434
     435procedure TFormClient.AStatusBarVisibleUpdate(Sender: TObject);
     436begin
    424437  UpdateInterface;
    425438end;
     
    444457begin
    445458  AToolBarVisible.Checked := not AToolBarVisible.Checked;
     459  UpdateInterface;
     460end;
     461
     462procedure TFormClient.AToolBarVisibleUpdate(Sender: TObject);
     463begin
    446464  UpdateInterface;
    447465end;
  • trunk/Forms/UFormMain.lfm

    r243 r249  
    11object FormMain: TFormMain
    2   Left = 801
     2  Left = 826
    33  Height = 621
    4   Top = 352
     4  Top = 419
    55  Width = 775
    66  Caption = 'xTactics'
    7   ClientHeight = 596
     7  ClientHeight = 587
    88  ClientWidth = 775
    9   DesignTimePPI = 120
     9  DesignTimePPI = 144
    1010  Menu = MainMenu1
    1111  OnActivate = FormActivate
     
    7979  object PanelMain: TPanel
    8080    Left = 0
    81     Height = 556
     81    Height = 547
    8282    Top = 40
    8383    Width = 775
     
    147147      end
    148148      object MenuItem22: TMenuItem
    149         Caption = 'Statusbar visible'
     149        Action = AStatusBarVisible
    150150      end
    151151      object MenuItem26: TMenuItem
     
    208208      OnExecute = AToolBarVisibleExecute
    209209    end
     210    object AStatusBarVisible: TAction
     211      Caption = 'Status bar visible'
     212      OnExecute = AStatusBarVisibleExecute
     213    end
    210214  end
    211215  object PopupMenuToolbar: TPopupMenu
  • trunk/Forms/UFormMain.pas

    r243 r249  
    1818
    1919  TFormMain = class(TForm)
     20    AStatusBarVisible: TAction;
    2021    AToolBarVisible: TAction;
    2122    AToolBarBigIcons: TAction;
     
    6768    ToolButton5: TToolButton;
    6869    ToolButton9: TToolButton;
     70    procedure AStatusBarVisibleExecute(Sender: TObject);
    6971    procedure AToolBarBigIconsExecute(Sender: TObject);
    7072    procedure AToolBarVisibleExecute(Sender: TObject);
     
    8082    FormActivated: Boolean;
    8183    procedure ApplicationStart(Ptr: IntPtr);
     84    procedure UpdateClientForms;
    8285  public
    8386    procedure LoadConfig(Config: TXmlConfig; Path: string);
     
    121124    AToolBarBigIcons.Checked := GetValue(DOMString(Path + '/LargeIcons'), False);
    122125    AToolBarVisible.Checked := GetValue(DOMString(Path + '/ToolBarVisible'), True);
     126    AStatusBarVisible.Checked := GetValue(DOMString(Path + '/StatusBarVisible'), False);
    123127  end;
    124128end;
     
    129133    SetValue(DOMString(Path + '/LargeIcons'), AToolBarBigIcons.Checked);
    130134    SetValue(DOMString(Path + '/ToolBarVisible'), AToolBarVisible.Checked);
     135    SetValue(DOMString(Path + '/StatusBarVisible'), AStatusBarVisible.Checked);
    131136  end;
    132137end;
     
    164169end;
    165170
     171procedure TFormMain.AStatusBarVisibleExecute(Sender: TObject);
     172begin
     173  AStatusBarVisible.Checked := not AStatusBarVisible.Checked;
     174  UpdateClientForms;
     175end;
     176
    166177procedure TFormMain.AToolBarBigIconsExecute(Sender: TObject);
    167178begin
    168179  AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked;
    169180  ReloadView;
     181  UpdateClientForms;
    170182end;
    171183
     
    174186  AToolBarVisible.Checked := not AToolBarVisible.Checked;
    175187  ReloadView;
     188  UpdateClientForms;
    176189end;
    177190
     
    206219begin
    207220  Core.ReopenGameOnInit;
     221end;
     222
     223procedure TFormMain.UpdateClientForms;
     224var
     225  I: Integer;
     226begin
     227  FormClient.AToolBarBigIcons.Checked := AToolBarBigIcons.Checked;
     228  FormClient.AToolBarBigIcons.Update;
     229  FormClient.AToolBarVisible.Checked := AToolBarVisible.Checked;
     230  FormClient.AToolBarVisible.Update;
     231  FormClient.AStatusBarVisible.Checked := AStatusBarVisible.Checked;
     232  FormClient.AStatusBarVisible.Update;
     233  for I := 0 to Core.FormClients.Count - 1 do begin
     234    Core.FormClients[I].AToolBarBigIcons.Checked := AToolBarBigIcons.Checked;
     235    Core.FormClients[I].AToolBarBigIcons.Update;
     236    Core.FormClients[I].AToolBarVisible.Checked := AToolBarVisible.Checked;
     237    Core.FormClients[I].AToolBarVisible.Update;
     238    Core.FormClients[I].AStatusBarVisible.Checked := AStatusBarVisible.Checked;
     239    Core.FormClients[I].AStatusBarVisible.Update;
     240  end;
    208241end;
    209242
     
    218251  ReloadView;
    219252  FormClient.Show;
     253  UpdateClientForms;
    220254  Application.QueueAsyncCall(ApplicationStart, 0);
    221255end;
  • trunk/Languages/xtactics.cs.po

    r245 r249  
    226226msgstr "Vykonat"
    227227
     228#: tformmain.astatusbarvisible.caption
     229msgid "Status bar visible"
     230msgstr "Viditelná stavová lišta"
     231
    228232#: tformmain.atoolbarbigicons.caption
    229233msgctxt "tformmain.atoolbarbigicons.caption"
     
    270274msgid "Help"
    271275msgstr "Nápověda"
    272 
    273 #: tformmain.menuitem22.caption
    274 msgctxt "tformmain.menuitem22.caption"
    275 msgid "Statusbar visible"
    276 msgstr "Viditelná stavová lišta"
    277276
    278277#: tformmain.menuitem8.caption
  • trunk/Languages/xtactics.po

    r245 r249  
    216216msgstr ""
    217217
     218#: tformmain.astatusbarvisible.caption
     219msgid "Status bar visible"
     220msgstr ""
     221
    218222#: tformmain.atoolbarbigicons.caption
    219223msgctxt "tformmain.atoolbarbigicons.caption"
     
    259263msgctxt "tformmain.menuitem16.caption"
    260264msgid "Help"
    261 msgstr ""
    262 
    263 #: tformmain.menuitem22.caption
    264 msgctxt "tformmain.menuitem22.caption"
    265 msgid "Statusbar visible"
    266265msgstr ""
    267266
  • trunk/UCore.lfm

    r243 r249  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 676
    6   HorizontalOffset = 353
    7   VerticalOffset = 312
    8   Width = 1048
    9   PPI = 120
     5  Height = 811
     6  HorizontalOffset = 424
     7  VerticalOffset = 374
     8  Width = 1258
     9  PPI = 144
    1010  object ActionListMain: TActionList
    1111    Images = ImageListSmall
    12     left = 114
    13     top = 50
     12    left = 137
     13    top = 60
    1414    object AExit: TAction
    1515      Caption = 'Exit'
     
    105105  end
    106106  object ImageListSmall: TImageList
    107     left = 655
    108     top = 350
     107    left = 786
     108    top = 420
    109109    Bitmap = {
    110110      4C690C00000010000000100000000000000000000000E3AA4BD6E5B35EFFE3B1
     
    498498    POFilesFolder = 'Languages'
    499499    OnTranslate = CoolTranslator1Translate
    500     left = 114
    501     top = 363
     500    left = 137
     501    top = 436
    502502  end
    503503  object ImageListLarge: TImageList
    504504    Height = 32
    505505    Width = 32
    506     left = 655
    507     top = 238
     506    left = 786
     507    top = 286
    508508    Bitmap = {
    509509      4C690C0000002000000020000000000000000000000000000000E2AA4B36E2A9
     
    20502050    RootName = 'CONFIG'
    20512051    ReadOnly = False
    2052     left = 114
    2053     top = 463
     2052    left = 137
     2053    top = 556
    20542054  end
    20552055  object OpenDialog1: TOpenDialog
    20562056    DefaultExt = '.xtmap'
    2057     left = 938
    2058     top = 243
     2057    left = 1126
     2058    top = 292
    20592059  end
    20602060  object SaveDialog1: TSaveDialog
    20612061    DefaultExt = '.xtmap'
    2062     left = 938
    2063     top = 138
     2062    left = 1126
     2063    top = 166
    20642064  end
    20652065  object ApplicationInfo: TApplicationInfo
     
    20742074    AuthorsName = 'Chronos'
    20752075    AppName = 'xTactics'
    2076     ReleaseDate = 43293
     2076    ReleaseDate = 43365
    20772077    RegistryKey = '\Software\xTactics'
    20782078    RegistryRoot = rrKeyCurrentUser
    20792079    License = 'CC0'
    2080     left = 114
    2081     top = 150
     2080    left = 137
     2081    top = 180
    20822082  end
    20832083  object PersistentForm: TPersistentForm
    20842084    MinVisiblePart = 50
    20852085    EntireVisible = False
    2086     left = 650
    2087     top = 500
     2086    left = 780
     2087    top = 600
    20882088  end
    20892089  object ScaleDPI1: TScaleDPI
    20902090    AutoDetect = False
    2091     left = 113
    2092     top = 563
     2091    left = 136
     2092    top = 676
    20932093  end
    20942094  object LastOpenedList1: TLastOpenedList
    20952095    MaxCount = 10
    20962096    OnChange = LastOpenedList1Change
    2097     left = 114
    2098     top = 250
     2097    left = 137
     2098    top = 300
    20992099  end
    21002100  object ThemeManager1: TThemeManager
    2101     left = 337
    2102     top = 270
     2101    left = 404
     2102    top = 324
    21032103  end
    21042104end
  • trunk/UCore.pas

    r243 r249  
    228228  I: Integer;
    229229begin
    230   {$ifdef DEBUG}
     230  //{$ifdef DEBUG}
    231231  with Core.ScaleDPI1 do begin
    232232    //DesignDPI := Point(144, 144);
     
    243243    end;
    244244  end;
    245   {$endif}
     245  //{$endif}
    246246end;
    247247
     
    433433  FormClients := TFPGObjectList<TFormClient>.Create;
    434434  ServerList := TServerList.Create;
     435
     436  {$IFDEF Linux}
     437  // If installed in Linux system then use installation directory for po files
     438  if Application.ExeName = '/usr/bin/xtactics' then
     439    CoolTranslator1.POFilesFolder := '/usr/share/xtactics/languages';
     440  {$ENDIF}
    435441end;
    436442
     
    637643begin
    638644  if not Core.Initialized then begin
    639     {$IFDEF Linux}
    640     // If installed in Linux system then use installation directory for po files
    641     if Application.ExeName = '/usr/bin/xtactics' then
    642       CoolTranslator1.POFilesFolder := '/usr/share/xtactics/languages';
    643     {$ENDIF}
    644645    FInitialized := True;
    645646
Note: See TracChangeset for help on using the changeset viewer.