Display 'updates pending' icon for Dom0 correctly.
This commit is contained in:
parent
e4f7e2c4e9
commit
201783badd
@ -56,6 +56,7 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
from datetime import datetime,timedelta
|
from datetime import datetime,timedelta
|
||||||
from qubes.qubes import updates_stat_file
|
from qubes.qubes import updates_stat_file
|
||||||
|
qubes_dom0_updates_stat_file = '/var/lib/qubes/updates/dom0-updates-available'
|
||||||
|
|
||||||
qubes_guid_path = '/usr/bin/qubes_guid'
|
qubes_guid_path = '/usr/bin/qubes_guid'
|
||||||
|
|
||||||
@ -462,12 +463,17 @@ class VmUpdateInfoWidget(QWidget):
|
|||||||
|
|
||||||
self.previous_outdated = outdated
|
self.previous_outdated = outdated
|
||||||
|
|
||||||
|
if not vm.is_updateable():
|
||||||
|
return
|
||||||
|
|
||||||
if vm.qid == 0:
|
if vm.qid == 0:
|
||||||
update_recommended = self.previous_update_recommended
|
update_recommended = self.previous_update_recommended
|
||||||
#slot for dom0 special treatment
|
if os.path.exists(qubes_dom0_updates_stat_file):
|
||||||
#
|
update_recommended = True
|
||||||
#
|
else:
|
||||||
elif vm.is_updateable():
|
update_recommended = False
|
||||||
|
|
||||||
|
else:
|
||||||
update_recommended = self.previous_update_recommended
|
update_recommended = self.previous_update_recommended
|
||||||
stat_file_path = vm.dir_path + '/' + updates_stat_file
|
stat_file_path = vm.dir_path + '/' + updates_stat_file
|
||||||
if not os.path.exists(stat_file_path):
|
if not os.path.exists(stat_file_path):
|
||||||
@ -1304,10 +1310,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
progress.hide()
|
progress.hide()
|
||||||
|
|
||||||
if vm.qid != 0:
|
if vm.qid != 0:
|
||||||
if thread_monitor.success:
|
if not thread_monitor.success:
|
||||||
# gpk-update-viewer was started, don't know if user installs updates, but touch stat file anyway
|
|
||||||
open(vm.dir_path + '/' + updates_stat_file, 'w').close()
|
|
||||||
else:
|
|
||||||
QMessageBox.warning (None, "Error VM update!", "ERROR: {0}".format(thread_monitor.error_msg))
|
QMessageBox.warning (None, "Error VM update!", "ERROR: {0}".format(thread_monitor.error_msg))
|
||||||
|
|
||||||
def do_update_vm(self, vm, thread_monitor):
|
def do_update_vm(self, vm, thread_monitor):
|
||||||
|
Loading…
Reference in New Issue
Block a user