Exemplo n.º 1
0
 def __init__(self, vm):
     self.vm = vm
     if vm.qid == 0:
         local_user = grp.getgrnam('qubes').gr_mem[0]
         home_dir = pwd.getpwnam(local_user).pw_dir
         self.size = qubesutils.get_disk_usage(home_dir)
     else:
         self.size = self.get_vm_size(vm)
     super(BackupVMsWindow.VmListItem, self).__init__(vm.name+ " (" + qubesutils.size_to_human(self.size) + ")")
Exemplo n.º 2
0
 def __init__(self, vm):
     self.vm = vm
     if vm.qid == 0:
         local_user = grp.getgrnam('qubes').gr_mem[0]
         home_dir = pwd.getpwnam(local_user).pw_dir
         self.size = qubesutils.get_disk_usage(home_dir)
     else:
         self.size = self.get_vm_size(vm)
     super(BackupVMsWindow.VmListItem,
           self).__init__(vm.name + " (" +
                          qubesutils.size_to_human(self.size) + ")")
Exemplo n.º 3
0
    def __fill_vms_list__(self):
        for vm in self.qvm_collection.values():
            if vm.internal:
                continue

            item = BackupVMsWindow.VmListItem(vm)
            if vm.include_in_backups == True:
                self.select_vms_widget.selected_list.addItem(item)
                self.total_size += item.size
            else:
                self.select_vms_widget.available_list.addItem(item)
        self.check_running()
        self.total_size_label.setText(qubesutils.size_to_human(self.total_size))
Exemplo n.º 4
0
    def __fill_vms_list__(self):
        for vm in self.qvm_collection.values():
            if vm.internal:
                continue

            item = BackupVMsWindow.VmListItem(vm)
            if vm.include_in_backups == True:
                self.select_vms_widget.selected_list.addItem(item)
                self.total_size += item.size
            else:
                self.select_vms_widget.available_list.addItem(item)
        self.check_running()
        self.total_size_label.setText(qubesutils.size_to_human(
            self.total_size))
Exemplo n.º 5
0
 def vms_removed(self, items):
     for i in items:
         self.total_size -= i.size
     self.total_size_label.setText(qubesutils.size_to_human(self.total_size))
Exemplo n.º 6
0
 def vms_removed(self, items):
     for i in items:
         self.total_size -= i.size
     self.total_size_label.setText(qubesutils.size_to_human(
         self.total_size))