[gnome-boxes] libvirt-machine-properties: Save machine's name on change
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] libvirt-machine-properties: Save machine's name on change
- Date: Sat, 16 Aug 2014 16:27:50 +0000 (UTC)
commit a8eeab046aefb309fb4cd13039b1a729bb20d042
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Aug 14 09:34:56 2014 +0200
libvirt-machine-properties: Save machine's name on change
This patch ensures that the machine's name is saved everytime it changes.
Also, together with following patches this allows editing name through
window's title.
https://bugzilla.gnome.org/show_bug.cgi?id=692383
src/libvirt-machine-properties.vala | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index f00d30e..54b2b15 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -9,9 +9,16 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
public LibvirtMachineProperties (LibvirtMachine machine) {
this.machine = machine;
+
+ machine.notify["name"].connect (() => {
+ try_change_name (machine.name);
+ });
}
private bool try_change_name (string name) {
+ if (machine.name == name)
+ return false;
+
try {
var config = machine.domain.get_config (GVir.DomainXMLFlags.INACTIVE);
// Te use libvirt "title" for free form user name
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]