diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 7b357af..b59451d 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -646,37 +646,6 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): # suppress saving settings while initializing widgets settings_loaded = False - def change_template(self, template): - for info in self.get_selected_vms(): - info.vm.template = template - - def change_network(self, netvm_name): - try: - check_power = any(info.state['power'] == 'Running' for info - in self.get_selected_vms()) - netvm = self.qubes_cache.get_vm(name=netvm_name) - if check_power and netvm.state['power'] != 'Running': - reply = QMessageBox.question( - self, self.tr("Qube Start Confirmation"), - self.tr("
Can not change netvm to a halted Qube.
" - "Do you want to start the Qube '{0}'?").format( - netvm_name), - QMessageBox.Yes | QMessageBox.Cancel) - - if reply == QMessageBox.Yes: - with common_threads.busy_cursor(): - netvm.vm.start() - else: - return - - for info in self.get_selected_vms(): - info.vm.netvm = netvm_name - except exc.QubesValueError as ex: - QMessageBox.warning( - self, - self.tr("Change Network Error"), - self.tr((str(ex)))) - def __init__(self, qt_app, qubes_app, dispatcher, _parent=None): super().__init__() self.setupUi(self) @@ -831,6 +800,37 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow): self.check_updates() + def change_template(self, template): + for info in self.get_selected_vms(): + info.vm.template = template + + def change_network(self, netvm_name): + try: + check_power = any(info.state['power'] == 'Running' for info + in self.get_selected_vms()) + netvm = self.qubes_cache.get_vm(name=netvm_name) + if check_power and netvm.state['power'] != 'Running': + reply = QMessageBox.question( + self, self.tr("Qube Start Confirmation"), + self.tr("
Can not change netvm to a halted Qube.
" + "Do you want to start the Qube '{0}'?").format( + netvm_name), + QMessageBox.Yes | QMessageBox.Cancel) + + if reply == QMessageBox.Yes: + with common_threads.busy_cursor(): + netvm.vm.start() + else: + return + + for info in self.get_selected_vms(): + info.vm.netvm = netvm_name + except exc.QubesValueError as ex: + QMessageBox.warning( + self, + self.tr("Change Network Error"), + self.tr((str(ex)))) + def save_sorting(self): self.manager_settings.setValue('view/sort_column', self.proxy.sortColumn())