diff --git a/uppsrc/CtrlLib/FileSel.cpp b/uppsrc/CtrlLib/FileSel.cpp index 74b91b8e5..d333548bf 100644 --- a/uppsrc/CtrlLib/FileSel.cpp +++ b/uppsrc/CtrlLib/FileSel.cpp @@ -922,7 +922,8 @@ void FileSel::SearchLoad() SortBy(list, ~sortby); Update(); #ifdef GUI_WIN - lazyicons.Start(list, d, WhenIcon); + if(!noexeicons) + lazyicons.Start(list, d, WhenIcon); #endif StartLI(); } @@ -2374,6 +2375,7 @@ FileSel::FileSel() multi = false; bidname = false; appmodal = true; + noexeicons = false; AddChildBefore(GetFirstChild(), &sizegrip); diff --git a/uppsrc/CtrlLib/FileSel.h b/uppsrc/CtrlLib/FileSel.h index 23530139b..d3bedd293 100644 --- a/uppsrc/CtrlLib/FileSel.h +++ b/uppsrc/CtrlLib/FileSel.h @@ -224,6 +224,7 @@ protected: bool bidname; bool appmodal; bool loaded; + bool noexeicons; Ctrl *file_ctrl = NULL; int file_ctrl_cx; @@ -355,6 +356,7 @@ public: FileSel& FileCtrl(Ctrl& ext, int cx) { file_ctrl = &ext; file_ctrl_cx = cx; return *this; } FileSel& FileCtrl(Ctrl& ext) { return FileCtrl(ext, ext.GetMinSize().cx); } FileSel& DefaultName(const String& s) { default_name = s; return *this; } + FileSel& NoExeIcons(bool b = true) { noexeicons = b; return *this; } FileSel(); virtual ~FileSel(); diff --git a/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp b/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp index aa8eda9a4..fbb3c662d 100644 --- a/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp @@ -332,4 +332,11 @@ the width from GetMinSize().&] ]_[*@3 s])&] [s2;%% Specifies the default name for Save As operation.&] [s3;%% &] +[s4; &] +[s5;:Upp`:`:FileSel`:`:NoExeIcons`(bool`): [_^Upp`:`:FileSel^ FileSel][@(0.0.255) `&]_[* No +ExeIcons]([@(0.0.255) bool]_[*@3 b]_`=_[@(0.0.255) true])&] +[s2;%% In Win32 environment, FileSel is using background thread to +load icons from .exe files. In some contexts, this can be causing +problems. NoExeIcons suppresses loading of this information.&] +[s3;%% &] [s3;%% ]] \ No newline at end of file diff --git a/upptst/FileSelNoExe/FileSelNoExe.upp b/upptst/FileSelNoExe/FileSelNoExe.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/upptst/FileSelNoExe/FileSelNoExe.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/upptst/FileSelNoExe/main.cpp b/upptst/FileSelNoExe/main.cpp new file mode 100644 index 000000000..7be0f53a9 --- /dev/null +++ b/upptst/FileSelNoExe/main.cpp @@ -0,0 +1,13 @@ +#include + +using namespace Upp; + +GUI_APP_MAIN +{ + FileSel sel; + sel.Type("all", "*.*"); + sel.NoExeIcons(); + sel.ExecuteSaveAs(); + sel.NoExeIcons(false); + sel.ExecuteSaveAs(); +}