Added Timer for template updates

Since there is no template updates dbus events, we need to check it periodically
This commit is contained in:
donoban 2018-05-09 14:36:39 +02:00
parent bc07e37266
commit 806915f834
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -383,6 +383,17 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
manager.Starting.connect(self.OnStarting)
manager.Started.connect(self.OnStarted)
# Check Updates Timer
timer = QtCore.QTimer(self)
timer.timeout.connect(self.CheckUpdates)
timer.start(1000 * 60 * 5) # 5mins
def CheckUpdates(self):
print("Checking updates")
for vm in self.qubes_app.domains:
if vm.klass == 'TempateVM':
self.vms_in_table[vm.qid].update()
def OnDomainAdded(self, manager, domain):
#needs to clear cache
self.qubes_app.domains.clear_cache()