Allow to change f/w rules and appmenus of a running VM (ticket #452)
This commit is contained in:
parent
82001fe51f
commit
dc38fd72cd
@ -139,14 +139,15 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
self.done(0)
|
self.done(0)
|
||||||
|
|
||||||
def __save_changes__(self, thread_monitor):
|
def __save_changes__(self, thread_monitor):
|
||||||
|
|
||||||
|
self.fw_model.apply_rules()
|
||||||
|
self.AppListManager.save_appmenu_select_changes()
|
||||||
|
|
||||||
ret = self.__apply_basic_tab__()
|
ret = self.__apply_basic_tab__()
|
||||||
if len(ret) > 0 :
|
if len(ret) > 0 :
|
||||||
thread_monitor.set_error_msg('\n'.join(ret))
|
thread_monitor.set_error_msg('\n'.join(ret))
|
||||||
thread_monitor.set_finished()
|
thread_monitor.set_finished()
|
||||||
return
|
|
||||||
self.fw_model.apply_rules()
|
|
||||||
self.AppListManager.save_appmenu_select_changes()
|
|
||||||
thread_monitor.set_finished()
|
|
||||||
|
|
||||||
def current_tab_changed(self, idx):
|
def current_tab_changed(self, idx):
|
||||||
if idx == self.tabs_indices["firewall"]:
|
if idx == self.tabs_indices["firewall"]:
|
||||||
@ -211,15 +212,13 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
def __apply_basic_tab__(self):
|
def __apply_basic_tab__(self):
|
||||||
msg = []
|
msg = []
|
||||||
|
|
||||||
if self.vm.is_running():
|
|
||||||
msg.append("Can't change settings of a running VM.")
|
|
||||||
msg.append("telemele")
|
|
||||||
return msg
|
|
||||||
|
|
||||||
# vmname changed
|
# vmname changed
|
||||||
vmname = str(self.vmname.text())
|
vmname = str(self.vmname.text())
|
||||||
if self.vm.name != vmname:
|
if self.vm.name != vmname:
|
||||||
if self.qvm_collection.get_vm_by_name(vmname) is not None:
|
if self.vm.is_running():
|
||||||
|
msg.append("Can't change name of a running VM.")
|
||||||
|
|
||||||
|
elif self.qvm_collection.get_vm_by_name(vmname) is not None:
|
||||||
msg.append("A VM named <b>{0}</b> already exists in the system!".format(vmname))
|
msg.append("A VM named <b>{0}</b> already exists in the system!".format(vmname))
|
||||||
else:
|
else:
|
||||||
oldname = self.vm.name
|
oldname = self.vm.name
|
||||||
@ -236,6 +235,10 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
|
|
||||||
#vm label changed
|
#vm label changed
|
||||||
if self.vmlabel.currentIndex() != self.label_idx:
|
if self.vmlabel.currentIndex() != self.label_idx:
|
||||||
|
if self.vm.is_running():
|
||||||
|
msg.append("Can't change label of a running VM.")
|
||||||
|
|
||||||
|
else:
|
||||||
label = self.label_list[self.vmlabel.currentIndex()]
|
label = self.label_list[self.vmlabel.currentIndex()]
|
||||||
self.qvm_collection.lock_db_for_writing()
|
self.qvm_collection.lock_db_for_writing()
|
||||||
self.vm.label = label
|
self.vm.label = label
|
||||||
|
Loading…
Reference in New Issue
Block a user