Changeset 151 for trunk


Ignore:
Timestamp:
Oct 16, 2017, 2:31:46 PM (7 years ago)
Author:
chronos
Message:
  • Added: Option to disable auto reopen last file on start.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/AcronymDecoder.lpi

    r135 r151  
    22<CONFIG>
    33  <ProjectOptions>
    4     <Version Value="9"/>
     4    <Version Value="10"/>
    55    <PathDelim Value="\"/>
    66    <General>
  • trunk/Forms/UFormMain.lfm

    r149 r151  
    1414  OnHide = FormHide
    1515  OnShow = FormShow
    16   LCLVersion = '1.6.2.0'
     16  LCLVersion = '1.6.4.0'
    1717  object PanelMain: TPanel
    1818    Left = 0
  • trunk/Forms/UFormMain.pas

    r150 r151  
    689689    RootKey := HKEY_CURRENT_USER;
    690690    OpenKey(DefaultRegKey, True);
    691     if ValueExists('LanguageCode') then
    692       Core.CoolTranslator1.Language := Core.CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
    693       else Core.CoolTranslator1.Language := Core.CoolTranslator1.Languages.SearchByCode('');
    694     Core.AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False);
    695     Core.StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False);
    696691    AFilterSameLength.Checked := ReadBoolWithDefault('SameLength', False);
    697692    AFilterSameLetterCase.Checked := ReadBoolWithDefault('SameLetterCase', False);
     
    722717    RootKey := HKEY_CURRENT_USER;
    723718    OpenKey(DefaultRegKey, True);
    724     if Assigned(Core.CoolTranslator1.Language) and (Core.CoolTranslator1.Language.Code <> '') then
    725       WriteString('LanguageCode', Core.CoolTranslator1.Language.Code)
    726       else DeleteValue('LanguageCode');
    727     WriteBool('AlwaysOnTop', Core.AlwaysOnTop);
    728     WriteBool('StartMinimizedToTray', Core.StartMinimizedToTray);
    729719    WriteBool('SameLength', AFilterSameLength.Checked);
    730720    WriteBool('SameLetterCase', AFilterSameLetterCase.Checked);
  • trunk/Forms/UFormSettings.lfm

    r105 r151  
    1010  OnShow = FormShow
    1111  Position = poScreenCenter
    12   LCLVersion = '1.6.0.4'
     12  LCLVersion = '1.6.4.0'
    1313  object ComboBoxLanguage: TComboBox
    1414    Left = 184
     
    104104    Visible = False
    105105  end
     106  object CheckBoxReopenLastFileOnStart: TCheckBox
     107    Left = 360
     108    Height = 24
     109    Top = 64
     110    Width = 181
     111    Caption = 'Reopen last file on start'
     112    TabOrder = 8
     113  end
    106114end
  • trunk/Forms/UFormSettings.lrt

    r105 r151  
    88TFORMSETTINGS.CHECKBOXAUTOMATICDPI.CAPTION=Automatic DPI
    99TFORMSETTINGS.LABEL2.CAPTION=DPI:
     10TFORMSETTINGS.CHECKBOXREOPENLASTFILEONSTART.CAPTION=Reopen last file on start
  • trunk/Forms/UFormSettings.pas

    r105 r151  
    1616    ButtonOk: TButton;
    1717    ButtonCancel: TButton;
     18    CheckBoxReopenLastFileOnStart: TCheckBox;
    1819    CheckBoxAutomaticDPI: TCheckBox;
    1920    CheckBoxStartMinimizedToTray: TCheckBox;
     
    8485  CheckBoxAutomaticDPI.Checked := Core.ScaleDPI1.AutoDetect;
    8586  SpinEditDPI.Value := Core.ScaleDPI1.DPI.X;
     87  CheckBoxReopenLastFileOnStart.Checked := Core.ReopenLastFileOnStart;
    8688  UpdateInterface;
    8789end;
     
    9496  Core.ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked;
    9597  Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value);
     98  Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked;
    9699end;
    97100
  • trunk/Languages/AcronymDecoder.cs.po

    r149 r151  
    693693msgstr "Automatické DPI"
    694694
     695#: tformsettings.checkboxreopenlastfileonstart.caption
     696msgid "Reopen last file on start"
     697msgstr "Při startu znovu otevřít poslední soubor"
     698
    695699#: tformsettings.checkboxstartminimizedtotray.caption
    696700msgid "Start minimized to tray"
  • trunk/Languages/AcronymDecoder.po

    r149 r151  
    683683msgstr ""
    684684
     685#: tformsettings.checkboxreopenlastfileonstart.caption
     686msgid "Reopen last file on start"
     687msgstr ""
     688
    685689#: tformsettings.checkboxstartminimizedtotray.caption
    686690msgid "Start minimized to tray"
  • trunk/UCore.pas

    r148 r151  
    4444    StartOnLogon: Boolean;
    4545    StartMinimizedToTray: Boolean;
     46    ReopenLastFileOnStart: Boolean;
    4647    InitializeStarted: Boolean;
    4748    InitializeFinished: Boolean;
     
    107108var
    108109  FileNameOption: string;
     110  ExampleFileName: string;
    109111begin
    110112  if not InitializeStarted then begin
     
    126128    end;
    127129
     130    ExampleFileName := ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile;
    128131    FileNameOption := FindFirstNonOption;
    129132    if FileNameOption <> '' then begin
     
    131134      FormMain.ProjectOpen(FileNameOption);
    132135    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
    134138      // Open last opened file
    135139      FormMain.ProjectOpen(FormMain.LastOpenedList1.Items[0])
    136     end else begin
     140    end else
     141    if FileExists(ExampleFileName) then begin
    137142      // Open default database with examples if no item is in recent openned history
    138143      FileNameOption := ExtractFileDir(Application.ExeName) + DirectorySeparator + ExampleFile;
     
    143148      {$ENDIF}
    144149      FormMain.ProjectOpen(FileNameOption);
     150    end else begin
     151      // Create empty file
     152      FormMain.AFileNew.Execute;
    145153    end;
    146154
     
    164172    ScaleDPI1.DPI := Point(ReadIntegerWithDefault('DPIX', 96), ReadIntegerWithDefault('DPIY', 96));
    165173    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);
    166180  finally
    167181    Free;
     
    180194    WriteInteger('DPIY', ScaleDPI1.DPI.Y);
    181195    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);
    182202  finally
    183203    Free;
Note: See TracChangeset for help on using the changeset viewer.