Changeset 134


Ignore:
Timestamp:
Mar 5, 2022, 9:27:57 AM (3 years ago)
Author:
chronos
Message:
  • Fixed: Do not try to open last opened file on start if it doesn't exist.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r133 r134  
    187187  SCloseProjectFirst = 'Project need to be closed before it can be openned';
    188188  SError = 'Error';
     189  SFileNotFound = 'File %s not found.';
    189190
    190191{ TFormMain }
     
    196197  PageControlMain.TabIndex := 0;
    197198  try
    198     if Core.OpenProjectOnStart and (Core.LastOpenedList.Items.Count > 0) then
     199    if Core.OpenProjectOnStart and (Core.LastOpenedList.Items.Count > 0) and
     200      FileExists(Core.LastOpenedList.Items[0]) then
    199201      ProjectOpen(Core.LastOpenedList.Items[0])
    200202      else AProjectNew.Execute;
     
    669671
    670672procedure TFormMain.AProjectOpenRecentExecute(Sender: TObject);
    671 begin
    672   AProjectClose.Execute;
    673   if Core.Project.Openned then Exit;
    674   ProjectOpen(Core.LastOpenedList.Items[TMenuItem(Sender).MenuIndex]);
     673var
     674  FileName: string;
     675begin
     676  FileName := Core.LastOpenedList.Items[TMenuItem(Sender).MenuIndex];
     677  if FileExists(FileName) then begin
     678    AProjectClose.Execute;
     679    if Core.Project.Openned then Exit;
     680    ProjectOpen(FileName);
     681  end else ShowMessage(Format(SFileNotFound, [FileName]));
    675682end;
    676683
  • trunk/Languages/LazFuck.cs.po

    r133 r134  
    1717
    1818#: tformcompilemultiple.buttoncancel.caption
    19 #, fuzzy
    2019msgctxt "tformcompilemultiple.buttoncancel.caption"
    2120msgid "Cancel"
     
    552551msgstr "Chyba"
    553552
     553#: uformmain.sfilenotfound
     554#, object-pascal-format
     555msgid "File %s not found."
     556msgstr "Soubor %s nenalezen."
     557
    554558#: uformmain.snewproject
    555559msgid "New project"
     
    615619msgid "Unsupported command"
    616620msgstr "NepodporovanÃœ příkaz"
    617 
  • trunk/Languages/LazFuck.pot

    r133 r134  
    541541msgstr ""
    542542
     543#: uformmain.sfilenotfound
     544#, object-pascal-format
     545msgid "File %s not found."
     546msgstr ""
     547
    543548#: uformmain.snewproject
    544549msgid "New project"
Note: See TracChangeset for help on using the changeset viewer.