Skip to content

Commit

Permalink
+ Сохранение фильтра языка на вкладках (отдельно для каждой коллекции…
Browse files Browse the repository at this point in the history
…) issue #4
  • Loading branch information
Oleksiy Penkov committed Mar 3, 2023
1 parent 138d926 commit b34176c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Program/Forms/frm_main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ object frmMain: TfrmMain
Width = 786
Height = 685
HelpContext = 1
ActivePage = tsByAuthor
ActivePage = tsByGroup
Align = alClient
OwnerDraw = True
TabOrder = 2
Expand Down Expand Up @@ -2008,7 +2008,7 @@ object frmMain: TfrmMain
150)
object lblTotalBooksF: TLabel
AlignWithMargins = True
Left = 1930
Left = 1916
Top = 9
Width = 12
Height = 19
Expand Down
17 changes: 17 additions & 0 deletions Program/Forms/frm_main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,11 @@ procedure TfrmMain.SavePositions;
FCollection.SetProperty(PROP_LAST_AUTHOR_BOOK, FLastAuthorBookID.BookID);
FCollection.SetProperty(PROP_LAST_SERIES, FLastSeriesStr);
FCollection.SetProperty(PROP_LAST_SERIES_BOOK, FLastSeriesBookID.BookID);

FCollection.SetProperty(PROP_BOOKS_LANG_FILTER, cbLangSelectA.ItemIndex);
FCollection.SetProperty(PROP_SERIES_LANG_FILTER, cbLangSelectS.ItemIndex);
FCollection.SetProperty(PROP_GENRES_LANG_FILTER, cbLangSelectG.ItemIndex);
FCollection.SetProperty(PROP_GROUPS_LANG_FILTER, cbLangSelectF.ItemIndex);
end;
end;

Expand Down Expand Up @@ -1550,6 +1555,12 @@ procedure TfrmMain.InitCollection;
end;
end;

procedure RestoreLangFilter(const Index: integer; LangComboBox: TComboBox);
begin
LangComboBox.ItemIndex := Index;
cbLangSelectAChange(LangComboBox);
end;


begin
FIgnoreAuthorChange := True;
Expand Down Expand Up @@ -1655,6 +1666,12 @@ procedure TfrmMain.InitCollection;
UpdateActions;
UpdateAllEditActions;

// ---- Recover laguage filters
RestoreLangFilter(FCollection.GetProperty(PROP_BOOKS_LANG_FILTER), cbLangSelectA);
RestoreLangFilter(FCollection.GetProperty(PROP_SERIES_LANG_FILTER), cbLangSelectS);
RestoreLangFilter(FCollection.GetProperty(PROP_GENRES_LANG_FILTER), cbLangSelectG);
RestoreLangFilter(FCollection.GetProperty(PROP_GROUPS_LANG_FILTER), cbLangSelectF);

FInvisible := False;
FindLastBook(FCollection.GetProperty(PROP_LAST_AUTHOR_BOOK), tvBooksA);
FindLastBook(FCollection.GetProperty(PROP_LAST_SERIES_BOOK), tvBooksS);
Expand Down
4 changes: 2 additions & 2 deletions Program/MyhomeLib.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@
<DCC_DcuOutput>Out\Units</DCC_DcuOutput>
<DCC_ExeOutput>Out\Bin</DCC_ExeOutput>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Build>840</VerInfo_Build>
<VerInfo_Keys>CompanyName=;FileVersion=2.3.5.840;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=2.3.4;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Build>841</VerInfo_Build>
<VerInfo_Keys>CompanyName=;FileVersion=2.3.5.841;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=2.3.4;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>2073</VerInfo_Locale>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Private>false</VerInfo_Private>
Expand Down
Binary file modified Program/MyhomeLib.res
Binary file not shown.
5 changes: 4 additions & 1 deletion Program/Units/unit_Consts.pas
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ interface
PROP_LAST_SERIES = PROP_CLASS_COLLECTION or PROP_TYPE_STRING or $0010;
PROP_LAST_SERIES_BOOK = PROP_CLASS_COLLECTION or PROP_TYPE_INTEGER or $0011;


PROP_BOOKS_LANG_FILTER = PROP_CLASS_COLLECTION or PROP_TYPE_INTEGER or $0012;
PROP_SERIES_LANG_FILTER = PROP_CLASS_COLLECTION or PROP_TYPE_INTEGER or $0013;
PROP_GENRES_LANG_FILTER = PROP_CLASS_COLLECTION or PROP_TYPE_INTEGER or $0014;
PROP_GROUPS_LANG_FILTER = PROP_CLASS_COLLECTION or PROP_TYPE_INTEGER or $0014;
type
TColumnSet = set of 0 .. 255;

Expand Down

0 comments on commit b34176c

Please sign in to comment.