[ui] improvement -> checking if the internet connection is available before proceeding with the upgrade process

This commit is contained in:
Vinicius Moreira
2021-03-02 13:11:02 -03:00
parent 5f5b3182b1
commit 485f578913
2 changed files with 10 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.9.15] 2021
### Improvements
- UI
- checking if internet connection is available before trying to upgrade the selected packages
- checking if the internet connection is available before trying to upgrade the selected packages
### Fixes
- AppImage

View File

@@ -388,12 +388,14 @@ class UpgradeSelected(AsyncAction):
except:
traceback.print_exc()
def _handle_internet_off(self):
self.pkgs = None
self.print(self.i18n['internet.required'])
self.notify_finished({'success': False, 'updated': 0, 'types': set(), 'id': None})
def run(self):
if not self.internet_checker.is_available():
self.pkgs = None
self.print(self.i18n['internet.required'])
self.notify_finished({'success': False, 'updated': 0, 'types': set(), 'id': None})
return
return self._handle_internet_off()
root_user = user.is_root()
to_update, upgrade_requires_root, bkp_supported = [], False, False
@@ -472,6 +474,9 @@ class UpgradeSelected(AsyncAction):
self.pkgs = None
return
if not self.internet_checker.is_available():
return self._handle_internet_off()
self.change_substatus('')
app_config = CoreConfigManager().get_config()