try
{
TransferStatusPtr status = m_addon_manager.request_check_online();
- status->then([this]{
- MenuManager::instance().set_dialog({});
- refresh();
+ status->then(
+ [this](bool success)
+ {
+ if (success)
+ {
+ refresh();
+ }
});
std::unique_ptr<DownloadDialog> dialog(new DownloadDialog(status));
dialog->set_title("Downloading Add-On Repository Index");
auto addon_id = addon.get_id();
TransferStatusPtr status = m_addon_manager.request_install_addon(addon_id);
- status->then([this, addon_id]{
- try
+ status->then(
+ [this, addon_id](bool success)
+ {
+ if (success)
{
- m_addon_manager.enable_addon(addon_id);
+ try
+ {
+ m_addon_manager.enable_addon(addon_id);
+ }
+ catch(const std::exception& err)
+ {
+ log_warning << "Enabling addon failed: " << err.what() << std::endl;
+ }
+ refresh();
}
- catch(const std::exception& err)
- {
- log_warning << "Enabling addon failed: " << err.what() << std::endl;
- }
- MenuManager::instance().set_dialog({});
- refresh();
});
std::unique_ptr<DownloadDialog> dialog(new DownloadDialog(status));