Failure to remove a tag shouldn't be fatal
This commit is contained in:
parent
a3d51b4138
commit
cb419cd85c
@ -83,7 +83,16 @@ void TagsView::NotifyTagsChanged(TagsModel * sender)
|
|||||||
tempButton->Appearance.Margin.Top += 2;
|
tempButton->Appearance.Margin.Top += 2;
|
||||||
tempButton->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
|
tempButton->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
|
||||||
tempButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
tempButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
tempButton->SetActionCallback({ [this, tag] { c->RemoveTag(tag); } });
|
tempButton->SetActionCallback({ [this, tag] {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
c->RemoveTag(tag);
|
||||||
|
}
|
||||||
|
catch(TagsModelException & ex)
|
||||||
|
{
|
||||||
|
new ErrorMessage("Could not remove tag", ByteString(ex.what()).FromUtf8());
|
||||||
|
}
|
||||||
|
} });
|
||||||
tags.push_back(tempButton);
|
tags.push_back(tempButton);
|
||||||
AddComponent(tempButton);
|
AddComponent(tempButton);
|
||||||
}
|
}
|
||||||
@ -125,7 +134,3 @@ void TagsView::addTag()
|
|||||||
}
|
}
|
||||||
tagInput->SetText("");
|
tagInput->SetText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
TagsView::~TagsView() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ public:
|
|||||||
void AttachController(TagsController * c_) { c = c_; }
|
void AttachController(TagsController * c_) { c = c_; }
|
||||||
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
|
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
|
||||||
void NotifyTagsChanged(TagsModel * sender);
|
void NotifyTagsChanged(TagsModel * sender);
|
||||||
virtual ~TagsView();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* TAGSVIEW_H_ */
|
#endif /* TAGSVIEW_H_ */
|
||||||
|
Reference in New Issue
Block a user