mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-05 21:57:20 +00:00
Fix some UI problems deleting backups and sessions in DataRecoveryView
This commit is contained in:
parent
77ec6c9e17
commit
0cf5661457
@ -84,6 +84,8 @@ protected:
|
||||
}
|
||||
|
||||
void onDelete() {
|
||||
Widget* parent = getParent();
|
||||
|
||||
if (m_backup) {
|
||||
// Delete one backup
|
||||
if (Alert::show(PACKAGE
|
||||
@ -95,7 +97,6 @@ protected:
|
||||
|
||||
Widget* parent = getParent();
|
||||
parent->removeChild(this);
|
||||
View::getView(parent)->updateView();
|
||||
deferDelete();
|
||||
}
|
||||
else {
|
||||
@ -115,6 +116,9 @@ protected:
|
||||
m_session->removeFromDisk();
|
||||
Regenerate();
|
||||
}
|
||||
|
||||
parent->layout();
|
||||
View::getView(parent)->updateView();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -144,10 +148,16 @@ DataRecoveryView::~DataRecoveryView()
|
||||
|
||||
void DataRecoveryView::fillList()
|
||||
{
|
||||
for (auto child : m_listBox.getChildren())
|
||||
WidgetsList children = m_listBox.getChildren();
|
||||
for (auto child : children) {
|
||||
m_listBox.removeChild(child);
|
||||
child->deferDelete();
|
||||
}
|
||||
|
||||
for (auto& session : m_dataRecovery->sessions()) {
|
||||
if (session->isEmpty())
|
||||
continue;
|
||||
|
||||
Item* item = new Item(session.get(), nullptr);
|
||||
item->Regenerate.connect(&DataRecoveryView::fillList, this);
|
||||
m_listBox.addChild(item);
|
||||
|
Loading…
Reference in New Issue
Block a user