mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Hide "Recover Files" button when it's disabled (fix crash clicking it in this case)
This commit is contained in:
parent
2a364c3ad2
commit
fb05e91d01
@ -54,7 +54,10 @@ HomeView::HomeView()
|
||||
{
|
||||
newFile()->Click.connect(base::Bind(&HomeView::onNewFile, this));
|
||||
openFile()->Click.connect(base::Bind(&HomeView::onOpenFile, this));
|
||||
if (m_dataRecovery)
|
||||
recoverSprites()->Click.connect(base::Bind(&HomeView::onRecoverSprites, this));
|
||||
else
|
||||
recoverSprites()->setVisible(false);
|
||||
|
||||
filesView()->attachToView(m_files);
|
||||
foldersView()->attachToView(m_folders);
|
||||
@ -201,6 +204,11 @@ void HomeView::onNewUpdate(const std::string& url, const std::string& version)
|
||||
void HomeView::onRecoverSprites()
|
||||
{
|
||||
#ifdef ENABLE_DATA_RECOVERY
|
||||
ASSERT(m_dataRecovery); // "Recover Files" button is hidden when
|
||||
// data recovery is disabled (m_dataRecovery == nullptr)
|
||||
if (!m_dataRecovery)
|
||||
return;
|
||||
|
||||
if (!m_dataRecoveryView) {
|
||||
m_dataRecoveryView = new DataRecoveryView(m_dataRecovery);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user