Fix infinite loop of error messages when an invalid command is displayed in the hotkey editor

This commit is contained in:
Thomas Goyne 2014-01-01 19:20:50 -08:00
parent 1d69efc35e
commit 5298634721
1 changed files with 8 additions and 3 deletions

View File

@ -91,10 +91,15 @@ public:
if (col == 0) if (col == 0)
variant = to_wx(combo.Str()); variant = to_wx(combo.Str());
else if (col == 1) { else if (col == 1) {
auto icon_bmp = cmd::get(combo.CmdName())->Icon(16);
wxIcon icon; wxIcon icon;
try {
auto icon_bmp = cmd::get(combo.CmdName())->Icon(16);
if (icon_bmp.IsOk()) if (icon_bmp.IsOk())
icon.CopyFromBitmap(icon_bmp); icon.CopyFromBitmap(icon_bmp);
}
catch (agi::Exception const& e) {
// Just use no icon; error is reported in the description column
}
variant << wxDataViewIconText(to_wx(combo.CmdName()), icon); variant << wxDataViewIconText(to_wx(combo.CmdName()), icon);
} }
else if (col == 2) { else if (col == 2) {