diff --git a/core-modules/01QubesDisposableVm.py b/core-modules/01QubesDisposableVm.py index 1e78ffa7..94aa2f2b 100644 --- a/core-modules/01QubesDisposableVm.py +++ b/core-modules/01QubesDisposableVm.py @@ -23,17 +23,7 @@ import sys from qubes.qubes import QubesVm,QubesVmLabel,register_qubes_vm_class - -QubesDispVmLabels = { - "red" : QubesVmLabel ("red", 1, icon="dispvm-red"), - "orange" : QubesVmLabel ("orange", 2, icon="dispvm-orange"), - "yellow" : QubesVmLabel ("yellow", 3, icon="dispvm-yellow"), - "green" : QubesVmLabel ("green", 4, color="0x5fa05e", icon="dispvm-green"), - "gray" : QubesVmLabel ("gray", 5, icon="dispvm-gray"), - "blue" : QubesVmLabel ("blue", 6, icon="dispvm-blue"), - "purple" : QubesVmLabel ("purple", 7, color="0xb83374", icon="dispvm-purple"), - "black" : QubesVmLabel ("black", 8, icon="dispvm-black"), -} +from qubes.qubes import QubesDispVmLabels class QubesDisposableVm(QubesVm): """ @@ -93,5 +83,4 @@ class QubesDisposableVm(QubesVm): return True # register classes -sys.modules['qubes.qubes'].QubesDispVmLabels = QubesDispVmLabels register_qubes_vm_class(QubesDisposableVm) diff --git a/core/qubes.py b/core/qubes.py index 8c0d8e46..bef2a4ea 100755 --- a/core/qubes.py +++ b/core/qubes.py @@ -166,35 +166,35 @@ class QubesHost(object): return (current_time, current) class QubesVmLabel(object): - def __init__(self, name, index, color = None, icon = None): + def __init__(self, index, color, name, icon = None): self.name = name self.index = index - self.color = color if color is not None else name + self.color = color self.icon = icon if icon is not None else name self.icon_path = os.path.join( system_path['qubes_icon_dir'], self.icon) + ".png" # Globally defined lables QubesVmLabels = { - "red" : QubesVmLabel ("red", 1), - "orange" : QubesVmLabel ("orange", 2), - "yellow" : QubesVmLabel ("yellow", 3), - "green" : QubesVmLabel ("green", 4, color="0x5fa05e"), - "gray" : QubesVmLabel ("gray", 5), - "blue" : QubesVmLabel ("blue", 6), - "purple" : QubesVmLabel ("purple", 7, color="0xb83374"), - "black" : QubesVmLabel ("black", 8), + "red": QubesVmLabel(1, "0xcc0000", "red" ), + "orange": QubesVmLabel(2, "0xf57900", "orange" ), + "yellow": QubesVmLabel(3, "0xedd400", "yellow" ), + "green": QubesVmLabel(4, "0x73d216", "green" ), + "gray": QubesVmLabel(5, "0x555753", "gray" ), + "blue": QubesVmLabel(6, "0x3465a4", "blue" ), + "purple": QubesVmLabel(7, "0x75507b", "purple" ), + "black": QubesVmLabel(8, "0x000000", "black" ), } QubesDispVmLabels = { - "red" : QubesVmLabel ("red", 1, icon="dispvm-red"), - "orange" : QubesVmLabel ("orange", 2, icon="dispvm-orange"), - "yellow" : QubesVmLabel ("yellow", 3, icon="dispvm-yellow"), - "green" : QubesVmLabel ("green", 4, color="0x5fa05e", icon="dispvm-green"), - "gray" : QubesVmLabel ("gray", 5, icon="dispvm-gray"), - "blue" : QubesVmLabel ("blue", 6, icon="dispvm-blue"), - "purple" : QubesVmLabel ("purple", 7, color="0xb83374", icon="dispvm-purple"), - "black" : QubesVmLabel ("black", 8, icon="dispvm-black"), + "red": QubesVmLabel(1, "0xcc0000", "red", icon="dispvm-red" ), + "orange": QubesVmLabel(2, "0xf57900", "orange", icon="dispvm-orange"), + "yellow": QubesVmLabel(3, "0xedd400", "yellow", icon="dispvm-yellow"), + "green": QubesVmLabel(4, "0x73d216", "green", icon="dispvm-green" ), + "gray": QubesVmLabel(5, "0x555753", "gray", icon="dispvm-gray" ), + "blue": QubesVmLabel(6, "0x3465a4", "blue", icon="dispvm-blue" ), + "purple": QubesVmLabel(7, "0x75507b", "purple", icon="dispvm-purple"), + "black": QubesVmLabel(8, "0x000000", "black", icon="dispvm-black" ), } defaults["appvm_label"] = QubesVmLabels["red"] diff --git a/dispvm/qubes-restore.c b/dispvm/qubes-restore.c index 07db5ef1..2da9d3a2 100644 --- a/dispvm/qubes-restore.c +++ b/dispvm/qubes-restore.c @@ -378,10 +378,6 @@ int get_netvm_id_from_name(const char *name) close(fd); netvm_id[n] = 0; n = atoi(netvm_id); - if (n <= 0) { - fprintf(stderr, "bad netvm id\n"); - exit(1); - } return n; }