mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-29 16:29:33 +02:00
LCL, fix gtk2 opendialog filter selection, issue #13111
git-svn-id: trunk@19026 -
This commit is contained in:
parent
073e79c380
commit
cd1ecbf189
@ -762,11 +762,14 @@ class function TGtk2WSOpenDialog.CreateOpenDialogFilter(
|
||||
var
|
||||
ListOfFileSelFilterEntry: TFPList;
|
||||
i, j, k: integer;
|
||||
GtkFilter: PGtkFileFilter;
|
||||
GtkFilter, GtkSelFilter: PGtkFileFilter;
|
||||
MaskList: TStringList;
|
||||
FilterEntry: TFileSelFilterEntry;
|
||||
FilterIndex: Integer;
|
||||
begin
|
||||
FilterIndex := OpenDialog.FilterIndex;
|
||||
ExtractFilterList(OpenDialog.Filter, ListOfFileSelFilterEntry, false);
|
||||
GtkSelFilter := nil;
|
||||
if ListOfFileSelFilterEntry.Count > 0 then
|
||||
begin
|
||||
j := 1;
|
||||
@ -786,8 +789,8 @@ begin
|
||||
|
||||
gtk_file_chooser_add_filter(SelWidget, GtkFilter);
|
||||
|
||||
if j = OpenDialog.FilterIndex then
|
||||
gtk_file_chooser_set_filter(SelWidget, GtkFilter);
|
||||
if j = FilterIndex then
|
||||
GtkSelFilter := GtkFilter;
|
||||
|
||||
Inc(j);
|
||||
GtkFilter := nil;
|
||||
@ -798,6 +801,9 @@ begin
|
||||
FreeListOfFileSelFilterEntry(ListOfFileSelFilterEntry);
|
||||
//gtk_object_set_data(PGtkObject(SelWidget), 'LCLFilterList', ListOfFileSelFilterEntry);
|
||||
|
||||
if GtkSelFilter<>nil then
|
||||
gtk_file_chooser_set_filter(SelWidget, GtkSelFilter);
|
||||
|
||||
Result := 'hm'; { Don't use '' as null return as this is used for *.* }
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user