Follow API change: template_vm -> template

This commit is contained in:
Agnieszka Kostrzewa 2012-03-12 12:53:07 +01:00
parent 7d4c74b85e
commit e63813d519
3 changed files with 10 additions and 10 deletions

View File

@ -60,8 +60,8 @@ class AppmenuSelectManager:
self.app_list = apps_multiselect # this is a multiselect wiget
self.vm = vm
if self.vm.template_vm:
self.source_vm = self.vm.template_vm
if self.vm.template:
self.source_vm = self.vm.template
else:
self.source_vm = self.vm

View File

@ -146,15 +146,15 @@ class VmTemplateItem (QTableWidgetItem):
def __init__(self, vm):
super(VmTemplateItem, self).__init__()
if vm.template_vm is not None:
self.setText(vm.template_vm.name)
if vm.template is not None:
self.setText(vm.template.name)
else:
font = QFont()
font.setStyle(QFont.StyleItalic)
self.setFont(font)
self.setTextColor(QColor("gray"))
if vm.is_appvm(): # and vm.template_vm is None
if vm.is_appvm(): # and vm.template is None
self.setText("StandaloneVM")
elif vm.is_template():
self.setText("TemplateVM")

View File

@ -64,8 +64,8 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
self.app = app
self.qvm_collection = qvm_collection
self.vm = vm
if self.vm.template_vm:
self.source_vm = self.vm.template_vm
if self.vm.template:
self.source_vm = self.vm.template
else:
self.source_vm = self.vm
@ -179,14 +179,14 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
self.vmlabel.setItemIcon (i, QIcon(label.icon_path))
self.vmlabel.setCurrentIndex(self.label_idx)
if not self.vm.is_template() and self.vm.template_vm is not None:
if not self.vm.is_template() and self.vm.template is not None:
template_vm_list = [vm for vm in self.qvm_collection.values() if not vm.internal and vm.is_template()]
self.template_idx = 0
for (i, vm) in enumerate(template_vm_list):
text = vm.name
if vm is self.qvm_collection.get_default_template_vm():
text += " (default)"
if vm.qid == self.vm.template_vm.qid:
if vm.qid == self.vm.template.qid:
self.template_idx = i
text += " (current)"
self.template_name.insertItem(i, text)
@ -287,7 +287,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
assert template_vm.is_template()
self.qvm_collection.lock_db_for_writing()
self.vm.template_vm = template_vm
self.vm.template = template_vm
self.qvm_collection.save()
self.qvm_collection.unlock_db()