Changeset 64


Ignore:
Timestamp:
Jul 26, 2016, 5:48:35 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Main form was unexpectedly initialized and project reopened if main form was hidden to system tray and shown again.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r56 r64  
    793793      ImageIndex = 8
    794794      OnExecute = AFileOpenExecute
     795      ShortCut = 16463
    795796    end
    796797    object AFileNew: TAction
     
    798799      ImageIndex = 16
    799800      OnExecute = AFileNewExecute
     801      ShortCut = 16462
    800802    end
    801803    object AFileSave: TAction
     
    803805      ImageIndex = 10
    804806      OnExecute = AFileSaveExecute
     807      ShortCut = 16467
    805808    end
    806809    object AFileClose: TAction
     
    813816      ImageIndex = 10
    814817      OnExecute = AFileSaveAsExecute
     818      ShortCut = 24659
    815819    end
    816820    object ASettings: TAction
     
    818822      ImageIndex = 6
    819823      OnExecute = ASettingsExecute
     824      ShortCut = 121
    820825    end
    821826    object AShowCategories: TAction
     
    823828      ImageIndex = 11
    824829      OnExecute = AShowCategoriesExecute
     830      ShortCut = 116
    825831    end
    826832    object AShowAcronyms: TAction
     
    828834      ImageIndex = 15
    829835      OnExecute = AShowAcronymsExecute
     836      ShortCut = 115
    830837    end
    831838    object AShowImportSources: TAction
     
    833840      ImageIndex = 13
    834841      OnExecute = AShowImportSourcesExecute
     842      ShortCut = 117
    835843    end
    836844    object AShowAbout: TAction
     
    843851      ImageIndex = 14
    844852      OnExecute = AShowImportFormatsExecute
     853      ShortCut = 118
    845854    end
    846855    object AProcessImports: TAction
     
    848857      ImageIndex = 5
    849858      OnExecute = AProcessImportsExecute
     859      ShortCut = 119
    850860    end
    851861  end
  • trunk/Forms/UFormMain.pas

    r63 r64  
    119119    procedure TrayIcon1Click(Sender: TObject);
    120120  private
     121    Initialized: Boolean;
    121122    FAlwaysOnTop: Boolean;
    122123    RegistryContext: TRegistryContext;
    123124    ProjectClosed: Boolean;
    124125    ImportTotalItemCount: Integer;
     126    procedure Initialize;
    125127    procedure ProcessImportsJob(Job: TJob);
    126128    procedure SetAlwaysOnTop(AValue: Boolean);
     
    166168
    167169procedure TFormMain.FormCreate(Sender: TObject);
     170var
     171  I: Integer;
    168172begin
    169173  AcronymDb := TAcronymDb.Create;
     174  Initialized := False;
     175  for I := 0 to ToolBar1.ButtonCount - 1 do
     176    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
    170177end;
    171178
     
    362369
    363370procedure TFormMain.FormShow(Sender: TObject);
    364 var
    365   I: Integer;
    366 begin
    367   LoadConfig;
     371begin
     372  Initialize;
     373
    368374  PersistentForm1.Load(Self);
    369 
    370   if ParamCount > 0 then begin
    371     AcronymDB.LoadFromFile(ParamStr(1));
    372     LastOpenedList1.AddItem(OpenDialog1.FileName);
    373   end else
    374   if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then
    375     AcronymDB.LoadFromFile(LastOpenedList1.Items[0]);
    376   UpdateAcronymsList;
    377   ListViewFilter1.UpdateFromListView(ListViewAcronyms);
    378   UpdateInterface;
    379   for I := 0 to ToolBar1.ButtonCount - 1 do
    380     ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
     375  UpdateInterface;
    381376end;
    382377
     
    444439  Visible := not Visible;
    445440  if Visible then BringToFront;
     441end;
     442
     443procedure TFormMain.Initialize;
     444begin
     445  if not Initialized then begin
     446    Initialized := True;
     447    LoadConfig;
     448
     449    if ParamCount > 0 then begin
     450      AcronymDB.LoadFromFile(ParamStr(1));
     451      LastOpenedList1.AddItem(OpenDialog1.FileName);
     452    end else
     453    if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then
     454      AcronymDB.LoadFromFile(LastOpenedList1.Items[0]);
     455    UpdateAcronymsList;
     456    ListViewFilter1.UpdateFromListView(ListViewAcronyms);
     457  end;
    446458end;
    447459
  • trunk/Languages/AcronymDecoder.cs.po

    r57 r64  
    457457#: tformmain.aexit.caption
    458458msgid "Exit"
    459 msgstr "Odejít"
     459msgstr "Ukončit"
    460460
    461461#: tformmain.afileclose.caption
Note: See TracChangeset for help on using the changeset viewer.