Changeset 151 for trunk/UCore.pas
- Timestamp:
- Oct 16, 2017, 2:31:46 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r148 r151 44 44 StartOnLogon: Boolean; 45 45 StartMinimizedToTray: Boolean; 46 ReopenLastFileOnStart: Boolean; 46 47 InitializeStarted: Boolean; 47 48 InitializeFinished: Boolean; … … 107 108 var 108 109 FileNameOption: string; 110 ExampleFileName: string; 109 111 begin 110 112 if not InitializeStarted then begin … … 126 128 end; 127 129 130 ExampleFileName := ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile; 128 131 FileNameOption := FindFirstNonOption; 129 132 if FileNameOption <> '' then begin … … 131 134 FormMain.ProjectOpen(FileNameOption); 132 135 end else 133 if (FormMain.LastOpenedList1.Items.Count > 0) and FileExists(FormMain.LastOpenedList1.Items[0]) then begin 136 if ReopenLastFileOnStart and (FormMain.LastOpenedList1.Items.Count > 0) and 137 FileExists(FormMain.LastOpenedList1.Items[0]) then begin 134 138 // Open last opened file 135 139 FormMain.ProjectOpen(FormMain.LastOpenedList1.Items[0]) 136 end else begin 140 end else 141 if FileExists(ExampleFileName) then begin 137 142 // Open default database with examples if no item is in recent openned history 138 143 FileNameOption := ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile; … … 143 148 {$ENDIF} 144 149 FormMain.ProjectOpen(FileNameOption); 150 end else begin 151 // Create empty file 152 FormMain.AFileNew.Execute; 145 153 end; 146 154 … … 164 172 ScaleDPI1.DPI := Point(ReadIntegerWithDefault('DPIX', 96), ReadIntegerWithDefault('DPIY', 96)); 165 173 ScaleDPI1.AutoDetect := ReadBoolWithDefault('DPIAuto', True); 174 if ValueExists('LanguageCode') then 175 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', '')) 176 else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(''); 177 AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False); 178 StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False); 179 ReopenLastFileOnStart := ReadBoolWithDefault('ReopenLastFileOnStart', True); 166 180 finally 167 181 Free; … … 180 194 WriteInteger('DPIY', ScaleDPI1.DPI.Y); 181 195 WriteBool('DPIAuto', ScaleDPI1.AutoDetect); 196 if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then 197 WriteString('LanguageCode', CoolTranslator1.Language.Code) 198 else DeleteValue('LanguageCode'); 199 WriteBool('AlwaysOnTop', AlwaysOnTop); 200 WriteBool('StartMinimizedToTray', StartMinimizedToTray); 201 WriteBool('ReopenLastFileOnStart', ReopenLastFileOnStart); 182 202 finally 183 203 Free;
Note:
See TracChangeset
for help on using the changeset viewer.