diff options
Diffstat (limited to 'desktop/modules/vm/VmModule.qml')
| -rw-r--r-- | desktop/modules/vm/VmModule.qml | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/desktop/modules/vm/VmModule.qml b/desktop/modules/vm/VmModule.qml index bc6b190..fa88cef 100644 --- a/desktop/modules/vm/VmModule.qml +++ b/desktop/modules/vm/VmModule.qml @@ -29,7 +29,7 @@ Module { page: Component { Page { - title: "Virtual machines" + title: "VMs and containers" VmPage { width: parent.width } } } @@ -38,14 +38,21 @@ Module { // the notification is the only feedback, since virsh output goes nowhere. property Process notifyProc: Process {} + function notify(target, action, message) { + notifyProc.command = ["notify-send", "--app-name=vm-manager", + "--urgency=critical", "--icon=error", + `${action} failed: ${target}`, message]; + notifyProc.running = false; + notifyProc.running = true; + } + property Connections conn: Connections { target: Virsh - function onActionFailed(vm, action, message) { - mod.notifyProc.command = ["notify-send", "--app-name=vm-manager", - "--urgency=critical", "--icon=error", - `${action} failed: ${vm}`, message]; - mod.notifyProc.running = false; - mod.notifyProc.running = true; - } + function onActionFailed(vm, action, message) { mod.notify(vm, action, message); } + } + + property Connections dockerConn: Connections { + target: Docker + function onActionFailed(target, action, message) { mod.notify(target, "docker " + action, message); } } } |
