Changeset 149 for trunk/Forms/FormSettings.pas
- Timestamp:
- Jun 5, 2023, 8:45:38 PM (18 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormSettings.pas
r148 r149 1 unit UFormSettings;1 unit FormSettings; 2 2 3 3 interface … … 40 40 end; 41 41 42 var43 FormSettings: TFormSettings;44 45 42 46 43 implementation … … 49 46 50 47 uses 51 UCore, Theme;48 Core, Theme; 52 49 53 50 { TFormSettings } … … 55 52 procedure TFormSettings.FormShow(Sender: TObject); 56 53 begin 57 Core. PersistentForm1.Load(Self);54 Core.Core.PersistentForm1.Load(Self); 58 55 59 Core. Translator.LanguageListToStrings(ComboBoxLanguage.Items);60 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core. Translator.Language);56 Core.Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 57 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator.Language); 61 58 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 62 59 63 Core. ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);64 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core. ThemeManager1.Theme);60 Core.Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 61 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager1.Theme); 65 62 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 66 63 end; … … 69 66 begin 70 67 if ComboBoxLanguage.ItemIndex <> -1 then 71 Core. Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);68 Core.Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 72 69 if ComboBoxTheme.ItemIndex <> -1 then 73 Core. ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);70 Core.Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 74 71 end; 75 72 … … 87 84 ); 88 85 begin 89 Core. PersistentForm1.Save(Self);86 Core.Core.PersistentForm1.Save(Self); 90 87 end; 91 88 92 89 procedure TFormSettings.FormCreate(Sender: TObject); 93 90 begin 94 Core. Translator.TranslateComponentRecursive(Self);95 Core. ThemeManager1.UseTheme(Self);91 Core.Core.Translator.TranslateComponentRecursive(Self); 92 Core.Core.ThemeManager1.UseTheme(Self); 96 93 end; 97 94 98 95 procedure TFormSettings.LoadData; 99 96 begin 100 CheckBoxAutomaticDPI.Checked := Core.ScaleDPI1.AutoDetect; 101 SpinEditDPI.Value := Core.ScaleDPI1.DPI.X; 102 CheckBoxReopenLastFileOnStart.Checked := Core.ReopenLastFileOnStart; 103 EditDefaultVcardVersion.Text := Core.DefaultVcardVersion; 104 EditMapUrl.Text := Core.MapUrl; 97 with Core.Core do begin 98 CheckBoxAutomaticDPI.Checked := ScaleDPI1.AutoDetect; 99 SpinEditDPI.Value := ScaleDPI1.DPI.X; 100 CheckBoxReopenLastFileOnStart.Checked := ReopenLastFileOnStart; 101 EditDefaultVcardVersion.Text := DefaultVcardVersion; 102 EditMapUrl.Text := MapUrl; 103 end; 105 104 UpdateInterface; 106 105 end; … … 108 107 procedure TFormSettings.SaveData; 109 108 begin 110 Core.ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked; 111 Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 112 Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 113 Core.DefaultVcardVersion := EditDefaultVcardVersion.Text; 114 Core.MapUrl := EditMapUrl.Text; 109 with Core.Core do begin 110 ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked; 111 ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 112 ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 113 DefaultVcardVersion := EditDefaultVcardVersion.Text; 114 MapUrl := EditMapUrl.Text; 115 end; 115 116 end; 116 117
Note:
See TracChangeset
for help on using the changeset viewer.